123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <el-row style="float:right;">
- <el-col :span="24">
- <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
- </el-col>
- </el-row>
- </div>
- <div class="app-container" style="background-color: white;" v-show="show">
- <div id="dialysisTable">
- <div class="order_title_panl">
- <span class="main_title">透析医嘱</span>
- </div>
- <p style="width: 960px;text-align: right;margin: 0 auto 10px;">日期:{{ time }}</p>
- <table class="table dialysisTable" border="1" cellspacing="0" cellpadding="0">
- <tr>
- <th width="40px">姓名</th>
- <th width="40px">透析器</th>
- <!-- <th width="50px">类型</th> -->
- <th width="50px">开始时间</th>
- <th width="100px">医嘱内容</th>
- <th width="50px">执行时间</th>
- <th width="50px">执行护士</th>
- <th width="50px">校对护士</th>
- <th width="50px">校对时间</th>
- <th width="50px">开嘱医生</th>
- <th width="50px">开嘱时间</th>
- </tr>
- <template v-for="(schedules, zone_name, index) in scheduleMap">
- <tr ><!--:key="index"-->
- <td>{{ zone_name }}</td>
- <!-- <td></td> -->
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <template v-for="schedule in schedules">
- <template v-for="(group, group_index) in schedule.new_advice">
- <tr v-for="(advice, advice_index) in group.advices" :key="advice_index">
- <td
- v-if="advice_index == 0"
- :rowspan="group.advices.length"
- >{{ advice.parent_id == 0 ? schedule.patient.name : "" }}
- <br>
- ({{ advice.parent_id == 0 ? schedule.dialysis_no : ""}})
- <br>
- <span v-if="schedule.mode_id == 1">(HD)</span>
- <span v-if="schedule.mode_id == 2">(HDF)</span>
- <span v-if="schedule.mode_id == 3">(HD+HP)</span>
- <span v-if="schedule.mode_id == 4">(HP)</span>
- <span v-if="schedule.mode_id == 5">(HF)</span>
- <span v-if="schedule.mode_id == 6">(SCUF)</span>
- <span v-if="schedule.mode_id == 7">(IUF)</span>
- <span v-if="schedule.mode_id == 8">(HFHD)</span>
- <span v-if="schedule.mode_id == 9">(HFHD+HP)</span>
- <span v-if="schedule.mode_id == 10">(PHF)</span>
- <span v-if="schedule.mode_id == 11">(HFR)</span>
- <span v-if="schedule.mode_id == 12">(HDF+HP)</span>
- <span v-if="schedule.mode_id == 13">(CRRT)</span>
- <span v-if="schedule.mode_id == 14">(腹水回输)</span>
- <span v-if="schedule.mode_id == 24">I-HDF</span>
- </td>
- <td v-if="advice_index == 0" :rowspan="group.advices.length">
- {{advice.parent_id == 0 && schedule.prescription!=null ? schedule.prescription.dialyzer_perfusion_apparatus : ""}}
- </td>
- <!-- <td
- v-if="advice_index == 0"
- :rowspan="group.advices.length"
- >{{ getAdaviceType(advice.advice_type, advice.parent_id) }}</td>-->
- <td v-if="advice_index == 0" :rowspan="group.advices.length">
- {{
- advice.parent_id == 0
- ? parseTime(advice.start_time, "{m}-{d} {h}:{i}")
- : ""
- }}
- </td>
- <td
- :class="
- advice.parent_id == 0
- ? 'advice_content'
- : 'subadvice_content'
- "
- >
- <span>{{ advice.advice_name }}</span>
- <span>{{ advice.advice_desc }}{{ advice.drug_spec_unit }}</span>
- <span v-if="advice.prescribing_number">
- {{ advice.prescribing_number
- }}{{ advice.prescribing_number_unit }}
- </span>
- <span v-if="advice.single_dose">
- 单次用量 {{ advice.single_dose
- }}{{ advice.single_dose_unit }}
- </span>
- <span>{{ advice.delivery_way }}</span>
- <span>{{ advice.execution_frequency }}</span>
- <span
- v-if="advice.parent_id == 0 && advice.remark.length > 0"
- >({{ advice.remark }})</span>
- </td>
- <td>{{ parseTime(advice.execution_time, "{m}-{d} {h}:{i}") }}</td>
- <td>{{ getName(advice.execution_staff) }}</td>
- <td>{{ getName(advice.checker) }}</td>
- <td>{{ parseTime(advice.check_time, "{m}-{d} {h}:{i}") }}</td>
- <td>{{ getName(advice.advice_doctor) }}</td>
- <td>{{ parseTime(advice.start_time, "{m}-{d} {h}:{i}") }}</td>
- </tr>
- </template>
- </template>
- </template>
- </table>
- </div>
- </div>
-
- <div class="app-container" style="background-color: white;" v-show="showOne">
- <div id="dialysisTable">
- <div class="order_title_panl">
- <span class="main_title">透析医嘱</span>
- </div>
- <p style="width: 960px;text-align: right;margin: 0 auto 10px;">日期:{{ time }}</p>
- <table class="table dialysisTable" border="1" cellspacing="0" cellpadding="0">
- <tr>
- <th width="40px">姓名</th>
- <th width="40px">透析器</th>
- <!-- <th width="50px">类型</th> -->
- <th width="50px">开始时间</th>
- <th width="100px">医嘱内容</th>
- <th width="50px">执行时间</th>
- <th width="50px">执行护士</th>
- <th width="50px">校对护士</th>
- <th width="50px">校对时间</th>
- <th width="50px">开嘱医生</th>
- <th width="50px">开嘱时间</th>
- </tr>
- <template v-for="(schedules, zone_name, index) in scheduleMap">
- <tr ><!--:key="index"-->
- <td>{{ zone_name }}</td>
- <!-- <td></td> -->
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- </tr>
- <template v-for="schedule in schedules">
- <template v-for="(group, group_index) in schedule.new_advice">
- <tr v-for="(advice, advice_index) in group.advices" :key="advice_index">
- <td
- v-if="advice_index == 0"
- :rowspan="group.advices.length"
- >{{ advice.parent_id == 0 ? schedule.patient.name : "" }}
- <br>
- ({{ advice.parent_id == 0 ? schedule.dialysis_no : ""}})
- <br>
- <span v-if="schedule.mode_id == 1">(HD)</span>
- <span v-if="schedule.mode_id == 2">(HDF)</span>
- <span v-if="schedule.mode_id == 3">(HD+HP)</span>
- <span v-if="schedule.mode_id == 4">(HP)</span>
- <span v-if="schedule.mode_id == 5">(HF)</span>
- <span v-if="schedule.mode_id == 6">(SCUF)</span>
- <span v-if="schedule.mode_id == 7">(IUF)</span>
- <span v-if="schedule.mode_id == 8">(HFHD)</span>
- <span v-if="schedule.mode_id == 9">(HFHD+HP)</span>
- <span v-if="schedule.mode_id == 10">(PHF)</span>
- <span v-if="schedule.mode_id == 11">(HFR)</span>
- <span v-if="schedule.mode_id == 12">(HDF+HP)</span>
- <span v-if="schedule.mode_id == 13">(CRRT)</span>
- <span v-if="schedule.mode_id == 14">(腹水回输)</span>
- <span v-if="schedule.mode_id == 24">I-HDF</span>
- </td>
- <td v-if="advice_index == 0" :rowspan="group.advices.length">
- {{advice.parent_id == 0 && schedule.prescription!=null ? schedule.prescription.dialyzer_perfusion_apparatus : ""}}
- </td>
- <!-- <td
- v-if="advice_index == 0"
- :rowspan="group.advices.length"
- >{{ getAdaviceType(advice.advice_type, advice.parent_id) }}</td>-->
- <td v-if="advice_index == 0" :rowspan="group.advices.length">
- {{
- advice.parent_id == 0
- ? parseTime(advice.start_time, "{m}-{d} {h}:{i}")
- : ""
- }}
- </td>
- <td
- :class="
- advice.parent_id == 0
- ? 'advice_content'
- : 'subadvice_content'
- "
- >
- <span>{{ advice.advice_name }}</span>
- <span>{{ advice.advice_desc }}{{ advice.drug_spec_unit }}</span>
- <span v-if="advice.prescribing_number">
- {{ advice.prescribing_number
- }}{{ advice.prescribing_number_unit }}
- </span>
- <span v-if="advice.single_dose">
- 单次用量 {{ advice.single_dose
- }}{{ advice.single_dose_unit }}
- </span>
- <span>{{ advice.delivery_way }}</span>
- <span>{{ advice.execution_frequency }}</span>
- <span
- v-if="advice.parent_id == 0 && advice.remark.length > 0"
- >({{ advice.remark }})</span>
- </td>
- <td>{{ parseTime(advice.execution_time, "{m}-{d} {h}:{i}") }}</td>
- <td>{{ getName(advice.execution_staff) }}</td>
- <td>{{ getName(advice.checker) }}</td>
- <td>{{ parseTime(advice.check_time, "{m}-{d} {h}:{i}") }}</td>
- <td>{{ getName(advice.advice_doctor) }}</td>
- <td>{{ parseTime(advice.created_time, "{m}-{d} {h}:{i}") }}</td>
- </tr>
- </template>
- </template>
- </template>
- </table>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import { getSchedualDoctors } from '@/api/advice'
- import { parseTime } from '@/utils'
- import print from 'print-js'
- const moment = require('moment')
- export default {
- components:{
- BreadCrumb
- },
- data(){
- return{
- crumbs: [
- { path: false, name: '耗材药品' },
- { path: false, name: '打印' }
- ],
- tableData:[],
- start_time:"",
- end_time:"",
- print_time:moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
-
- zone_selected: 0,
- scheduleMap:[],
- time:'',
- show:true,
- showOne:false,
- delivery_way:"",
- org_id:0,
- }
- },
- methods:{
- printAction: function() {
- const style = '@media print { .dialysisTable{width:960px;margin: 0 auto;text-align: center;border-collapse: collapse;}.order_title_panl {text-align: center;.main_title {font-size: 18px;line-height: 40px;font-weight: 500;}}.dialysisTable tr{padding: 10px 0;}.dialysisTable th {color: #000;padding: 0;margin: 0;height: 30px;}.dialysisTable tr td {padding: 12px 0;}.subadvice_content {text-align: left;padding-left: 25px !important;padding-right: 5px !important;}.advice_content {text-align: left;padding-left: 5px !important;padding-right: 5px !important;padding: 15px 5px !important;} }'
-
- printJS({
- printable: 'dialysisTable',
- type: 'html',
- documentTitle: ' ',
- style: style,
- scanStyles: false
- })
- },
- requestSchedualDoctors (time) {
- let newTime = moment(time).format('YYYY-MM-DD')
- getSchedualDoctors({
- date: newTime,
- patient_type: 0,
- advice_type: 2,
- delivery_way:this.delivery_way,
- }).then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- this.admin_user = resp.data.adminUser
- var config = resp.data.config
- let project_config = resp.data.project_config
- // console.log('project_config',resp.data.project_config)
- if(project_config.is_open == 1){
- this.project = resp.data.project
- resp.data.hisAdvices.map((item,index) => {
- item.new_advice = item.new_advice ? item.new_advice : []
- if(this.org_id!=9671 && this.org_id!= 10318 && this.org_id!=0){
- if(this.project[index].project.length > 0){
- this.project[index].project.map(it => {
- let obj = {
- advice_doctor: it.doctor,
- start_time:it.start_time,
- advice_name: it.type == 2 ? it.project.project_name : it.good_info.good_name,
- execution_time:it.execution_time,
- execution_state:it.execution_state,
- execution_staff:it.execution_staff,
- check_time:it.check_time,
- check_state:it.check_state,
- checker:it.checker,
- created_time:it.ctime,
- remark:'',
- id:it.id,
- parent_id:0,
- groupno:0
- }
-
- item.doctor_advice.push(obj)
- })
- }
- }
- })
- }
- if(config.is_open == 0 || config.is_open == 2){
-
- var schedulesArr = resp.data.scheduals
- let schedules = []
- var ids = this.$store.getters.temp_params.advice_ids
- console.log('ids',ids)
- schedulesArr.map(item => {
- if(ids.indexOf(item.patient_id) > -1){
- schedules.push(item)
- }
-
- })
-
- for (let i = 0; i < schedules.length; i++) {
- schedules[i].dialysis_no = schedules[i].patient.dialysis_no
- }
-
-
- var arr = []
- for (let j = 0; j < schedules.length; j++) {
- arr.push(schedules[j].dialysis_no)
- }
- arr.sort(function (a, b) {
- return a - b
- })
-
-
- var arrTwo = []
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < schedules.length; j++) {
- if (arr[i] == schedules[j].dialysis_no) {
- arrTwo.push(schedules[j])
- }
- }
- }
-
- arrTwo.map((item, index) => {
-
- item.doctor_advice.sort(this.compare('start_time'))
- })
-
-
- const res = new Map()
- let a = arrTwo.filter(
- a => !res.has(a.dialysis_no) && res.set(a.dialysis_no, 1)
- )
-
-
-
- schedules = a
- var zoneMap = {}
- var scheduleMap = {}
- for (let index = 0; index < schedules.length; index++) {
- const schedule = schedules[index]
- if (schedule.doctor_advice.length == 0) {
- continue
- }
- if (scheduleMap[schedule.device_number.zone.name] == null) {
- scheduleMap[schedule.device_number.zone.name] = []
- }
- scheduleMap[schedule.device_number.zone.name].push(schedule)
- if (zoneMap[schedule.device_number.zone.name] == null) {
- zoneMap[schedule.device_number.zone.name] =
- schedule.device_number.zone
- }
- }
-
- var zones = []
- zones.push({ value: 0, text: '全部分区' })
- for (var zoneName in zoneMap) {
- zones.push({ value: zoneMap[zoneName].id, text: zoneName })
- }
-
- zones = zones.sort(function (a, b) {
- return a.value > b.value
- })
- this.zones = zones
- for (var key in scheduleMap) {
- let mapArr = scheduleMap[key]
- for (let i = 0; i < mapArr.length; i++) {
- mapArr[i]['new_advice'] = []
- }
- }
-
- for (var key in scheduleMap) {
- let mapArr = scheduleMap[key]
- for (let i = 0; i < mapArr.length; i++) {
- var maps = mapArr[i]
- var resp_advices = maps.doctor_advice
- if (resp_advices.length > 0) {
- var newGroupObject = function () {
- return Object.assign(
- {},
- {
- group_no: 0,
- advices: []
- }
- )
- }
- var initGroupBlock = function (group, advice) {
- group.group_no = advice.groupno
- }
-
- var advice_groups = []
- var group = newGroupObject()
- for (let index = 0; index < resp_advices.length; index++) {
- const advice = resp_advices[index]
- if (advice.groupno == 0) {
- // 老版本的医嘱
- if (advice.parent_id > 0) {
- if (advice_groups.length > 0) {
- var parent_group = advice_groups[advice_groups.length - 1]
- if (parent_group.advices.length > 0) {
- if (parent_group.advices[0].id == advice.parent_id) {
- parent_group.advices.push(advice)
- }
- }
- }
- continue
- } else {
- if (group.group_no > 0) {
- advice_groups.push(group)
- group = newGroupObject()
- }
-
- initGroupBlock(group, advice)
- group.advices.push(advice)
- advice_groups.push(group)
- group = newGroupObject()
- continue
- }
- } else {
- if (group.group_no > 0 && group.group_no != advice.groupno) {
- advice_groups.push(group)
- group = newGroupObject()
- }
- if (group.group_no == 0) {
- initGroupBlock(group, advice)
- }
- if (group.group_no == advice.groupno) {
- group.advices.push(advice)
- }
- }
- }
- if (group.group_no > 0) {
- // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
- advice_groups.push(group)
- }
- advice_groups = advice_groups
- } else {
- advice_groups = []
- }
- maps.new_advice = advice_groups
- }
- }
-
-
- this.scheduleMap = scheduleMap
- }
-
- if(config.is_open == 1){
- var schedulesArr = resp.data.hisAdvices
- let schedules = []
- var ids = this.$store.getters.temp_params.advice_ids
- console.log('ids',ids)
- schedulesArr.map(item => {
- if(ids.indexOf(item.patient_id) > -1){
- schedules.push(item)
- }
-
- })
-
- for (let i = 0; i < schedules.length; i++) {
- schedules[i].dialysis_no = schedules[i].patient.dialysis_no
- }
-
-
- var arr = []
- for (let j = 0; j < schedules.length; j++) {
- arr.push(schedules[j].dialysis_no)
- }
- arr.sort(function (a, b) {
- return a - b
- })
-
-
- var arrTwo = []
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < schedules.length; j++) {
- if (arr[i] == schedules[j].dialysis_no) {
- arrTwo.push(schedules[j])
- }
- }
- }
-
- arrTwo.map((item, index) => {
-
- item.doctor_advice.sort(this.compare('start_time'))
- })
-
-
- const res = new Map()
- let a = arrTwo.filter(
- a => !res.has(a.dialysis_no) && res.set(a.dialysis_no, 1)
- )
-
-
-
- schedules = a
- var zoneMap = {}
- var scheduleMap = {}
- for (let index = 0; index < schedules.length; index++) {
- const schedule = schedules[index]
- if (schedule.doctor_advice.length == 0) {
- continue
- }
- if (scheduleMap[schedule.device_number.zone.name] == null) {
- scheduleMap[schedule.device_number.zone.name] = []
- }
- scheduleMap[schedule.device_number.zone.name].push(schedule)
- if (zoneMap[schedule.device_number.zone.name] == null) {
- zoneMap[schedule.device_number.zone.name] =
- schedule.device_number.zone
- }
- }
-
- var zones = []
- zones.push({ value: 0, text: '全部分区' })
- for (var zoneName in zoneMap) {
- zones.push({ value: zoneMap[zoneName].id, text: zoneName })
- }
-
- zones = zones.sort(function (a, b) {
- return a.value > b.value
- })
- this.zones = zones
- for (var key in scheduleMap) {
- let mapArr = scheduleMap[key]
- for (let i = 0; i < mapArr.length; i++) {
- mapArr[i]['new_advice'] = []
- }
- }
-
- for (var key in scheduleMap) {
- let mapArr = scheduleMap[key]
- for (let i = 0; i < mapArr.length; i++) {
- var maps = mapArr[i]
- var resp_advices = maps.doctor_advice
- if (resp_advices.length > 0) {
- var newGroupObject = function () {
- return Object.assign(
- {},
- {
- group_no: 0,
- advices: []
- }
- )
- }
- var initGroupBlock = function (group, advice) {
- group.group_no = advice.groupno
- }
-
- var advice_groups = []
- var group = newGroupObject()
- for (let index = 0; index < resp_advices.length; index++) {
- const advice = resp_advices[index]
- if (advice.groupno == 0) {
- // 老版本的医嘱
- if (advice.parent_id > 0) {
- if (advice_groups.length > 0) {
- var parent_group = advice_groups[advice_groups.length - 1]
- if (parent_group.advices.length > 0) {
- if (parent_group.advices[0].id == advice.parent_id) {
- parent_group.advices.push(advice)
- }
- }
- }
- continue
- } else {
- if (group.group_no > 0) {
- advice_groups.push(group)
- group = newGroupObject()
- }
-
- initGroupBlock(group, advice)
- group.advices.push(advice)
- advice_groups.push(group)
- group = newGroupObject()
- continue
- }
- } else {
- if (group.group_no > 0 && group.group_no != advice.groupno) {
- advice_groups.push(group)
- group = newGroupObject()
- }
- if (group.group_no == 0) {
- initGroupBlock(group, advice)
- }
- if (group.group_no == advice.groupno) {
- group.advices.push(advice)
- }
- }
- }
- if (group.group_no > 0) {
- // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
- advice_groups.push(group)
- }
- advice_groups = advice_groups
- } else {
- advice_groups = []
- }
- maps.new_advice = advice_groups
- }
- }
-
-
- this.scheduleMap = scheduleMap
- }
-
-
- }
- })
- },
- compare (property) {
- return function (a, b) {
- var value1 = a[property]
- var value2 = b[property]
- return value1 - value2
- }
- },
- parseTime: function (time, layout) {
- if (time == 0) {
- return ''
- }
- return parseTime(time, layout)
- },
- getName (val) {
- for (let i = 0; i < this.admin_user.length; i++) {
- if (this.admin_user[i].id == val) {
- return this.admin_user[i].name
- }
- }
- },
- },
- computed: {
- filtedScheduals: function () {
- var scheduleMap = new Object()
- if (this.zone_selected == 0) {
- for (const key in this.scheduleMap) {
- scheduleMap[key] = this.scheduleMap[key]
- }
- } else {
- var zone_name = this.zones[this.zone_selected].text
- scheduleMap[zone_name] = this.scheduleMap[zone_name]
- }
-
- if (this.schedule_type_selected != 0) {
- var _scheduleMap = {}
- for (const key in scheduleMap) {
- var origin_schedules = scheduleMap[key]
- var schedules = []
- for (let index = 0; index < origin_schedules.length; index++) {
- const schedule = origin_schedules[index]
- if (schedule.schedule_type == this.schedule_type_selected) {
- schedules.push(schedule)
- }
- }
- if (schedules.length > 0) {
- _scheduleMap[key] = schedules
- }
- }
-
- scheduleMap = _scheduleMap
- }
- for (var key in scheduleMap) {
- let mapArr = scheduleMap[key]
- for (let i = 0; i < mapArr.length; i++) {
- mapArr[i]['new_advice'] = []
- }
- }
-
- for (var key in scheduleMap) {
- let mapArr = scheduleMap[key]
- for (let i = 0; i < mapArr.length; i++) {
- var maps = mapArr[i]
- var resp_advices = maps.doctor_advice
- if (resp_advices.length > 0) {
- var newGroupObject = function () {
- return Object.assign(
- {},
- {
- group_no: 0,
- advices: []
- }
- )
- }
- var initGroupBlock = function (group, advice) {
- group.group_no = advice.groupno
- }
-
- var advice_groups = []
- var group = newGroupObject()
- for (let index = 0; index < resp_advices.length; index++) {
- const advice = resp_advices[index]
- if (advice.groupno == 0) {
- // 老版本的医嘱
- if (advice.parent_id > 0) {
- if (advice_groups.length > 0) {
- var parent_group = advice_groups[advice_groups.length - 1]
- if (parent_group.advices.length > 0) {
- if (parent_group.advices[0].id == advice.parent_id) {
- parent_group.advices.push(advice)
- }
- }
- }
- continue
- } else {
- if (group.group_no > 0) {
- advice_groups.push(group)
- group = newGroupObject()
- }
-
- initGroupBlock(group, advice)
- group.advices.push(advice)
- advice_groups.push(group)
- group = newGroupObject()
- continue
- }
- } else {
- if (group.group_no > 0 && group.group_no != advice.groupno) {
- advice_groups.push(group)
- group = newGroupObject()
- }
- if (group.group_no == 0) {
- initGroupBlock(group, advice)
- }
- if (group.group_no == advice.groupno) {
- group.advices.push(advice)
- }
- }
- }
- if (group.group_no > 0) {
- // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
- advice_groups.push(group)
- }
- advice_groups = advice_groups
- } else {
- advice_groups = []
- }
- maps.new_advice = advice_groups
- }
- }
- console.log("222222",scheduleMap)
- return scheduleMap
- }
- },
- created(){
- var time = this.$route.query.time
- var delivery_way = this.$route.query.delivery_way
- this.delivery_way = delivery_way
- this.time = moment(time).format('YYYY-MM-DD')
- console.log(11,this.$route.query)
- this.requestSchedualDoctors(time)
- this.org_id = this.$store.getters.xt_user.template_info.org_id;
- }
- }
- </script>
-
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .dialysisTable{
- width:960px;
- margin: 0 auto;
- text-align: center;
- border-collapse: collapse;
- }
- .order_title_panl {
- text-align: center;
-
- .main_title {
- font-size: 18px;
- line-height: 40px;
- font-weight: 500;
- }
- }
- .dialysisTable tr{
- padding: 10px 0;
- }
- .dialysisTable th {
- color: #000;
- padding: 0;
- margin: 0;
- height: 30px;
- }
- .dialysisTable tr td {
- padding: 12px 0;
- }
- .subadvice_content {
- text-align: left;
- padding-left: 25px !important;
- padding-right: 5px !important;
- }
- .advice_content {
- text-align: left;
- padding-left: 5px !important;
- padding-right: 5px !important;
- padding: 15px 5px !important;
- }
- </style>
|