123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850 |
- <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 v-for="(item, index) in list" :key="index">
- <div class="signPrint" v-for="it in item.parent_advice" style="page-break-after: always;">
-
- <div>分区/床位号:{{item.device_number.zone.name}}/{{item.device_number.number}}</div>
- <div>姓名:{{item.patient.name}}</div>
- <div v-if="org_id == 0 || org_id==10340">身份证:{{item.patient.id_card_no}}</div>
- <div>
- <div>药名:{{ it.advice_name }}
- <span v-if="it.prescribing_number>0 && org_id !=0 && org_id!=10440">
- {{it.prescribing_number}}{{ it.prescribing_number_unit }}
-
-
- </span>
- </div>
- <div v-if="org_id == 10138 || org_id == 10278">
- 规格:{{getSpecialName(it.drug_id)}}
-
- </div>
- <div v-if="org_id ==0 || org_id ==10223">
- 规格:{{it.advice_desc }} {{ it.drug_spec_unit }}
- </div>
- <div v-if="(org_id ==0 || org_id==10440 || org_id == 10478 || org_id ==10571 || org_id ==10223 || org_id ==10617 || org_id ==10598) && org_id!=10278">单次用量:{{it.single_dose}}{{it.single_dose_unit }}</div>
- <div v-if="org_id!=0 && org_id!=10278 && org_id!=10138 && org_id!=10223">执行频率:{{it.execution_frequency}}</div>
- <div v-if="org_id!=10278">给药途径:{{it.delivery_way}}</div>
- <div v-if="org_id == 0 || org_id==10223">
- <span>执行者:</span>
- <span>核对者:</span>
- </div>
-
- </div>
-
- <span v-if="it.childAdvice.length >0"> </span>
- <div v-for="its in it.childAdvice">
- <div>药名:{{ its.advice_name }}
- <span v-if="its.prescribing_number>0 && org_id !=0 && org_id!=10440">
- {{its.prescribing_number}}{{ its.prescribing_number_unit }}
- </span>
- </div>
- <div v-if="org_id ==0 || org_id == 10138 || org_id == 10278">
- 规格:{{getSpecialName(its.drug_id)}}
-
- </div>
- <div v-if=" org_id ==0 || org_id==10440 || org_id == 10478 || org_id ==10571 || org_id ==10223 || org_id ==10617 || org_id ==10598">单次用量:{{its.single_dose}}{{its.single_dose_unit }}</div>
- <div v-if="org_id!=0 && org_id!=10278 && org_id!=10138 && org_id!=10223">执行频率:{{its.execution_frequency}}</div>
- <div>给药途径:{{its.delivery_way}}</div>
- <div v-if="org_id == 0 || org_id==10223">
- <span>执行者:</span>
- <span>核对者:</span>
- </div>
- </div>
- <div v-if="org_id!=10223 && org_id!=0">打印时间:{{time}}</div>
- <div v-if="org_id==10223 || org_id == 0">配药时间:</div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- <div class="app-container" style="background-color: white;" v-show="showOne">
- <div id="dialysisTable">
- <div v-for="(item, index) in list" :key="index">
- <div class="signPrint" v-for="it in item.doctor_advice" style="page-break-after: always;">
- <div>分区/床位号:{{item.device_number.zone.name}}/{{item.device_number.number}}</div>
- <div>姓名:{{item.patient.name}}</div>
- <div>医嘱内容:{{getAdvice(item.doctor_advice)}}
- <span v-if="it.prescribing_number >0&& org_id !=0 && org_id!=10440"> {{it.prescribing_number}}{{ it.prescribing_number_unit }}</span>
- </div>
- <div v-if="org_id ==0 || org_id == 10138 || org_id == 10278">
- 规格:{{getSpecialName(it.drug_id)}}
-
- </div>
- <div v-if=" org_id ==0 || org_id==10440">单次用量:{{it.single_dose}} {{it.single_dose_unit }}</div>
- <div>给药途径:{{item.doctor_advice[0].execution_frequency}}</div>
- <div v-if="org_id!=0 && org_id!=10278 && org_id!=10138">执行频率:{{item.doctor_advice[0].delivery_way}}</div>
- <div>打印时间:{{time}}</div>
- </div>
-
- </div>
- </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:"",
- list:[],
- execution_frequency:"",
- org_id:0,
- drugList:[],
- }
- },
- 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,
- execution_frequency:this.execution_frequency,
- patient_id:this.$route.query.patient_id,
- keyword:this.$route.query.keyword,
- excution_way:this.excution_way
- }).then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- this.admin_user = resp.data.adminUser
- var config = resp.data.config
- 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
- }
- }
-
- for(let i=0;i<schedules.length;i++){
- schedules[i].parent_advice = []
- for(let j=0;j<schedules[i].doctor_advice.length;j++){
- if(schedules[i].doctor_advice[j].parent_id== 0){
- schedules[i].parent_advice.push(schedules[i].doctor_advice[j])
- }
- }
- }
- for(let i=0;i<schedules.length;i++){
- schedules[i].sort = 0
- schedules[i].sort = schedules[i].device_number.sort
- for(let j=0;j<schedules[i].parent_advice.length;j++){
- schedules[i].parent_advice[j].childAdvice = []
- for(let z=0;z<schedules[i].doctor_advice.length;z++){
- if(schedules[i].parent_advice[j].id == schedules[i].doctor_advice[z].parent_id){
- schedules[i].parent_advice[j].childAdvice.push(schedules[i].doctor_advice[z])
- }
- }
- }
- }
- console.log("scheduleMap999999999999",schedules)
- this.list = schedules.sort(this.compare('sort'))
- }
-
- if(config.is_open == 1){
- var schedulesArr = resp.data.hisAdvices
- this.drugList = resp.data.drug
- 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
- }
- }
-
- for(let i=0;i<schedules.length;i++){
- schedules[i].parent_advice = []
- for(let j=0;j<schedules[i].doctor_advice.length;j++){
- if(schedules[i].doctor_advice[j].parent_id== 0){
- schedules[i].parent_advice.push(schedules[i].doctor_advice[j])
- }
- }
- }
-
- for(let i=0;i<schedules.length;i++){
- schedules[i].sort = 0
- schedules[i].sort = schedules[i].device_number.sort
- for(let j=0;j<schedules[i].parent_advice.length;j++){
- schedules[i].parent_advice[j].childAdvice = []
- for(let z=0;z<schedules[i].doctor_advice.length;z++){
- if(schedules[i].parent_advice[j].id == schedules[i].doctor_advice[z].parent_id){
- schedules[i].parent_advice[j].childAdvice.push(schedules[i].doctor_advice[z])
- }
- }
- }
- }
- console.log("哈哈哈",schedules)
- this.list = schedules.sort(this.compare('sort'))
-
- //未执行
- if(this.$route.query.excution_way == 2){
- if(this.list!=null){
- for(let i=0;i<this.list.length;i++){
- this.list[i].doctor_advice_map = []
- for(let j=0;j<this.list[i].parent_advice.length;j++){
- if(this.list[i].parent_advice[j].execution_state!=1){
- this.list[i].doctor_advice_map.push(this.list[i].parent_advice[j])
- }
-
- }
- this.list[i].parent_advice= []
- if(this.list[i].doctor_advice_map!=null){
- this.list[i].parent_advice.push(...this.list[i].doctor_advice_map)
- }
-
- }
- }
- }
-
- if(this.$route.query.excution_way == 1){
- for(let i=0;i<this.list.length;i++){
- this.list[i].doctor_advice_map = []
- for(let j=0;j<this.list[i].parent_advice.length;j++){
- if(this.list[i].parent_advice[j].execution_state==1){
- this.list[i].doctor_advice_map.push(this.list[i].parent_advice[j])
- }
-
- }
- this.list[i].parent_advice= []
- if(this.list[i].doctor_advice_map!=null){
- this.list[i].parent_advice.push(...this.list[i].doctor_advice_map)
- }
-
- }
- }
-
-
- this.scheduleMap = scheduleMap
- }
-
-
- console.log("this.list",this.list)
-
- }
- })
- },
- 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
- }
- }
- },
- getAdvice: function(doctor_advice) {
- if (doctor_advice.length > 0) {
- let name = "";
- for (let i = 0; i < doctor_advice.length; i++) {
- let prescribing_number = "";
- let single_dose = "";
- let drug_spec = "";
-
- if (doctor_advice[i].prescribing_number > 0) {
- prescribing_number =
- doctor_advice[i].prescribing_number +
- doctor_advice[i].prescribing_number_unit;
- }
- if (doctor_advice[i].single_dose > 0) {
- single_dose =
- " 单次用量 " +
- doctor_advice[i].single_dose +
- doctor_advice[i].single_dose_unit;
- }
-
- if (doctor_advice[i].drug_spec > 0) {
- drug_spec =
- doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit;
- }
-
- name =
- name +
- doctor_advice[i].advice_name +
- " " +
- drug_spec +
- " " +
- prescribing_number +
- " " +
- single_dose +
- " " +
- doctor_advice[i].delivery_way +
- " " +
- doctor_advice[i].execution_frequency +
- " " +
- doctor_advice[i].remark +
- "\n";
-
- // if (doctor_advice[i].child.length > 0) {
- // for (let a = 0; a < doctor_advice[i].child.length; a++) {
- // if (doctor_advice[i].child[a].prescribing_number > 0) {
- // doctor_advice[i].child[a]["presc"] =
- // doctor_advice[i].child[a].prescribing_number +
- // doctor_advice[i].child[a].prescribing_number_unit;
- // } else {
- // doctor_advice[i].child[a]["presc"] = "";
- // }
-
- // if (doctor_advice[i].child[a].single_dose > 0) {
- // doctor_advice[i].child[a]["single"] =
- // " " +
- // " 单次用量 " +
- // " " +
- // doctor_advice[i].child[a].single_dose +
- // doctor_advice[i].child[a].single_dose_unit;
- // } else {
- // doctor_advice[i].child[a]["single"] = "";
- // }
-
- // name =
- // name +
- // "▲" +
- // doctor_advice[i].child[a].advice_name +
- // "" +
- // doctor_advice[i].child[a].advice_desc +
- // doctor_advice[i].child[a].drug_spec_unit +
- // doctor_advice[i].child[a].presc +
- // doctor_advice[i].child[a].single +
- // "\n";
- // }
- // }
- }
- return name;
- }else{
- return ""
- }
- },
- getSpecialName(drug_id){
- var name = ""
- for(let i=0;i<this.drugList.length;i++){
- if(drug_id == this.drugList[i].id){
- name = this.drugList[i].dose + this.drugList[i].dose_unit + "*" + this.drugList[i].min_number + this.drugList[i].min_unit +"/"+this.drugList[i].max_unit
- }
- }
- return 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.org_id = this.$store.getters.xt_user.org.id
- console.log("delivery_Way",delivery_way)
- this.delivery_way = delivery_way
- var execution_frequency = this.$route.query.execution_frequency
- this.execution_frequency = execution_frequency
- this.time = moment(time).format('YYYY-MM-DD')
- console.log(11,this.$route.query)
- this.requestSchedualDoctors(time)
- }
- }
- </script>
-
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .signPrint{
- -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
- -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
- margin-bottom: 20px;
- padding: 20px 10px;
- }
- .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>
|