signPrint.vue 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;" v-show="show">
  12. <div id="dialysisTable">
  13. <div v-for="(item, index) in list" :key="index">
  14. <div class="signPrint" v-for="it in item.parent_advice" style="page-break-after: always;">
  15. <div>分区/床位号:{{item.device_number.zone.name}}/{{item.device_number.number}}</div>
  16. <div>姓名:{{item.patient.name}}</div>
  17. <div v-if="org_id == 0 || org_id==10340">身份证:{{item.patient.id_card_no}}</div>
  18. <div>
  19. <div>药名:{{ it.advice_name }}
  20. <span v-if="it.prescribing_number>0 && org_id !=0 && org_id!=10440">
  21. {{it.prescribing_number}}{{ it.prescribing_number_unit }}
  22. </span>
  23. </div>
  24. <div v-if="org_id == 10138 || org_id == 10278">
  25. 规格:{{getSpecialName(it.drug_id)}}
  26. </div>
  27. <div v-if="org_id ==0 || org_id ==10223">
  28. 规格:{{it.advice_desc }} {{ it.drug_spec_unit }}
  29. </div>
  30. <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>
  31. <div v-if="org_id!=0 && org_id!=10278 && org_id!=10138 && org_id!=10223">执行频率:{{it.execution_frequency}}</div>
  32. <div v-if="org_id!=10278">给药途径:{{it.delivery_way}}</div>
  33. <div v-if="org_id == 0 || org_id==10223">
  34. <span>执行者:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  35. <span>核对者:</span>
  36. </div>
  37. </div>
  38. <span v-if="it.childAdvice.length >0">&nbsp;</span>
  39. <div v-for="its in it.childAdvice">
  40. <div>药名:{{ its.advice_name }}
  41. <span v-if="its.prescribing_number>0 && org_id !=0 && org_id!=10440">
  42. {{its.prescribing_number}}{{ its.prescribing_number_unit }}
  43. </span>
  44. </div>
  45. <div v-if="org_id ==0 || org_id == 10138 || org_id == 10278">
  46. 规格:{{getSpecialName(its.drug_id)}}
  47. </div>
  48. <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>
  49. <div v-if="org_id!=0 && org_id!=10278 && org_id!=10138 && org_id!=10223">执行频率:{{its.execution_frequency}}</div>
  50. <div>给药途径:{{its.delivery_way}}</div>
  51. <div v-if="org_id == 0 || org_id==10223">
  52. <span>执行者:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  53. <span>核对者:</span>
  54. </div>
  55. </div>
  56. <div v-if="org_id!=10223 && org_id!=0">打印时间:{{time}}</div>
  57. <div v-if="org_id==10223 || org_id == 0">配药时间:</div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <!-- <div class="app-container" style="background-color: white;" v-show="showOne">
  63. <div id="dialysisTable">
  64. <div v-for="(item, index) in list" :key="index">
  65. <div class="signPrint" v-for="it in item.doctor_advice" style="page-break-after: always;">
  66. <div>分区/床位号:{{item.device_number.zone.name}}/{{item.device_number.number}}</div>
  67. <div>姓名:{{item.patient.name}}</div>
  68. <div>医嘱内容:{{getAdvice(item.doctor_advice)}}
  69. <span v-if="it.prescribing_number >0&& org_id !=0 && org_id!=10440"> {{it.prescribing_number}}{{ it.prescribing_number_unit }}</span>
  70. </div>
  71. <div v-if="org_id ==0 || org_id == 10138 || org_id == 10278">
  72. 规格:{{getSpecialName(it.drug_id)}}
  73. </div>
  74. <div v-if=" org_id ==0 || org_id==10440">单次用量:{{it.single_dose}}&nbsp;{{it.single_dose_unit }}</div>
  75. <div>给药途径:{{item.doctor_advice[0].execution_frequency}}</div>
  76. <div v-if="org_id!=0 && org_id!=10278 && org_id!=10138">执行频率:{{item.doctor_advice[0].delivery_way}}</div>
  77. <div>打印时间:{{time}}</div>
  78. </div>
  79. </div>
  80. </div>
  81. </div> -->
  82. </div>
  83. </template>
  84. <script>
  85. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  86. import { getSchedualDoctors } from '@/api/advice'
  87. import { parseTime } from '@/utils'
  88. import print from 'print-js'
  89. const moment = require('moment')
  90. export default {
  91. components:{
  92. BreadCrumb
  93. },
  94. data(){
  95. return{
  96. crumbs: [
  97. { path: false, name: '耗材药品' },
  98. { path: false, name: '打印' }
  99. ],
  100. tableData:[],
  101. start_time:"",
  102. end_time:"",
  103. print_time:moment(new Date()).add('year', 0).format('YYYY-MM-DD'),
  104. zone_selected: 0,
  105. scheduleMap:[],
  106. time:'',
  107. show:true,
  108. showOne:false,
  109. delivery_way:"",
  110. list:[],
  111. execution_frequency:"",
  112. org_id:0,
  113. drugList:[],
  114. }
  115. },
  116. methods:{
  117. printAction: function() {
  118. 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;} }'
  119. printJS({
  120. printable: 'dialysisTable',
  121. type: 'html',
  122. documentTitle: ' ',
  123. style: style,
  124. scanStyles: false
  125. })
  126. },
  127. requestSchedualDoctors (time) {
  128. let newTime = moment(time).format('YYYY-MM-DD')
  129. getSchedualDoctors({
  130. date: newTime,
  131. patient_type: 0,
  132. advice_type: 2,
  133. delivery_way:this.delivery_way,
  134. execution_frequency:this.execution_frequency,
  135. patient_id:this.$route.query.patient_id,
  136. keyword:this.$route.query.keyword,
  137. excution_way:this.excution_way
  138. }).then(rs => {
  139. var resp = rs.data
  140. if (resp.state == 1) {
  141. this.admin_user = resp.data.adminUser
  142. var config = resp.data.config
  143. if(config.is_open == 0 || config.is_open == 2){
  144. var schedulesArr = resp.data.scheduals
  145. let schedules = []
  146. var ids = this.$store.getters.temp_params.advice_ids
  147. console.log('ids',ids)
  148. schedulesArr.map(item => {
  149. if(ids.indexOf(item.patient_id) > -1){
  150. schedules.push(item)
  151. }
  152. })
  153. for (let i = 0; i < schedules.length; i++) {
  154. schedules[i].dialysis_no = schedules[i].patient.dialysis_no
  155. }
  156. var arr = []
  157. for (let j = 0; j < schedules.length; j++) {
  158. arr.push(schedules[j].dialysis_no)
  159. }
  160. arr.sort(function (a, b) {
  161. return a - b
  162. })
  163. var arrTwo = []
  164. for (let i = 0; i < arr.length; i++) {
  165. for (let j = 0; j < schedules.length; j++) {
  166. if (arr[i] == schedules[j].dialysis_no) {
  167. arrTwo.push(schedules[j])
  168. }
  169. }
  170. }
  171. arrTwo.map((item, index) => {
  172. item.doctor_advice.sort(this.compare('start_time'))
  173. })
  174. const res = new Map()
  175. let a = arrTwo.filter(
  176. a => !res.has(a.dialysis_no) && res.set(a.dialysis_no, 1)
  177. )
  178. schedules = a
  179. var zoneMap = {}
  180. var scheduleMap = {}
  181. for (let index = 0; index < schedules.length; index++) {
  182. const schedule = schedules[index]
  183. if (schedule.doctor_advice.length == 0) {
  184. continue
  185. }
  186. if (scheduleMap[schedule.device_number.zone.name] == null) {
  187. scheduleMap[schedule.device_number.zone.name] = []
  188. }
  189. scheduleMap[schedule.device_number.zone.name].push(schedule)
  190. if (zoneMap[schedule.device_number.zone.name] == null) {
  191. zoneMap[schedule.device_number.zone.name] =schedule.device_number.zone}
  192. }
  193. var zones = []
  194. zones.push({ value: 0, text: '全部分区' })
  195. for (var zoneName in zoneMap) {
  196. zones.push({ value: zoneMap[zoneName].id, text: zoneName })
  197. }
  198. zones = zones.sort(function (a, b) {
  199. return a.value > b.value
  200. })
  201. this.zones = zones
  202. for (var key in scheduleMap) {
  203. let mapArr = scheduleMap[key]
  204. for (let i = 0; i < mapArr.length; i++) {
  205. mapArr[i]['new_advice'] = []
  206. }
  207. }
  208. for (var key in scheduleMap) {
  209. let mapArr = scheduleMap[key]
  210. for (let i = 0; i < mapArr.length; i++) {
  211. var maps = mapArr[i]
  212. var resp_advices = maps.doctor_advice
  213. if (resp_advices.length > 0) {
  214. var newGroupObject = function () {
  215. return Object.assign(
  216. {},
  217. {
  218. group_no: 0,
  219. advices: []
  220. }
  221. )
  222. }
  223. var initGroupBlock = function (group, advice) {
  224. group.group_no = advice.groupno
  225. }
  226. var advice_groups = []
  227. var group = newGroupObject()
  228. for (let index = 0; index < resp_advices.length; index++) {
  229. const advice = resp_advices[index]
  230. if (advice.groupno == 0) {
  231. // 老版本的医嘱
  232. if (advice.parent_id > 0) {
  233. if (advice_groups.length > 0) {
  234. var parent_group = advice_groups[advice_groups.length - 1]
  235. if (parent_group.advices.length > 0) {
  236. if (parent_group.advices[0].id == advice.parent_id) {
  237. parent_group.advices.push(advice)
  238. }
  239. }
  240. }
  241. continue
  242. } else {
  243. if (group.group_no > 0) {
  244. advice_groups.push(group)
  245. group = newGroupObject()
  246. }
  247. initGroupBlock(group, advice)
  248. group.advices.push(advice)
  249. advice_groups.push(group)
  250. group = newGroupObject()
  251. continue
  252. }
  253. } else {
  254. if (group.group_no > 0 && group.group_no != advice.groupno) {
  255. advice_groups.push(group)
  256. group = newGroupObject()
  257. }
  258. if (group.group_no == 0) {
  259. initGroupBlock(group, advice)
  260. }
  261. if (group.group_no == advice.groupno) {
  262. group.advices.push(advice)
  263. }
  264. }
  265. }
  266. if (group.group_no > 0) {
  267. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
  268. advice_groups.push(group)
  269. }
  270. advice_groups = advice_groups
  271. } else {
  272. advice_groups = []
  273. }
  274. maps.new_advice = advice_groups
  275. }
  276. }
  277. for(let i=0;i<schedules.length;i++){
  278. schedules[i].parent_advice = []
  279. for(let j=0;j<schedules[i].doctor_advice.length;j++){
  280. if(schedules[i].doctor_advice[j].parent_id== 0){
  281. schedules[i].parent_advice.push(schedules[i].doctor_advice[j])
  282. }
  283. }
  284. }
  285. for(let i=0;i<schedules.length;i++){
  286. schedules[i].sort = 0
  287. schedules[i].sort = schedules[i].device_number.sort
  288. for(let j=0;j<schedules[i].parent_advice.length;j++){
  289. schedules[i].parent_advice[j].childAdvice = []
  290. for(let z=0;z<schedules[i].doctor_advice.length;z++){
  291. if(schedules[i].parent_advice[j].id == schedules[i].doctor_advice[z].parent_id){
  292. schedules[i].parent_advice[j].childAdvice.push(schedules[i].doctor_advice[z])
  293. }
  294. }
  295. }
  296. }
  297. console.log("scheduleMap999999999999",schedules)
  298. this.list = schedules.sort(this.compare('sort'))
  299. }
  300. if(config.is_open == 1){
  301. var schedulesArr = resp.data.hisAdvices
  302. this.drugList = resp.data.drug
  303. let schedules = []
  304. var ids = this.$store.getters.temp_params.advice_ids
  305. console.log('ids',ids)
  306. schedulesArr.map(item => {
  307. if(ids.indexOf(item.patient_id) > -1){
  308. schedules.push(item)
  309. }
  310. })
  311. for (let i = 0; i < schedules.length; i++) {
  312. schedules[i].dialysis_no = schedules[i].patient.dialysis_no
  313. }
  314. var arr = []
  315. for (let j = 0; j < schedules.length; j++) {
  316. arr.push(schedules[j].dialysis_no)
  317. }
  318. arr.sort(function (a, b) {
  319. return a - b
  320. })
  321. var arrTwo = []
  322. for (let i = 0; i < arr.length; i++) {
  323. for (let j = 0; j < schedules.length; j++) {
  324. if (arr[i] == schedules[j].dialysis_no) {
  325. arrTwo.push(schedules[j])
  326. }
  327. }
  328. }
  329. arrTwo.map((item, index) => {
  330. item.doctor_advice.sort(this.compare('start_time'))
  331. })
  332. const res = new Map()
  333. let a = arrTwo.filter(
  334. a => !res.has(a.dialysis_no) && res.set(a.dialysis_no, 1)
  335. )
  336. schedules = a
  337. var zoneMap = {}
  338. var scheduleMap = {}
  339. for (let index = 0; index < schedules.length; index++) {
  340. const schedule = schedules[index]
  341. if (schedule.doctor_advice.length == 0) {
  342. continue
  343. }
  344. if (scheduleMap[schedule.device_number.zone.name] == null) {
  345. scheduleMap[schedule.device_number.zone.name] = []
  346. }
  347. scheduleMap[schedule.device_number.zone.name].push(schedule)
  348. if (zoneMap[schedule.device_number.zone.name] == null) {
  349. zoneMap[schedule.device_number.zone.name] =
  350. schedule.device_number.zone
  351. }
  352. }
  353. var zones = []
  354. zones.push({ value: 0, text: '全部分区' })
  355. for (var zoneName in zoneMap) {
  356. zones.push({ value: zoneMap[zoneName].id, text: zoneName })
  357. }
  358. zones = zones.sort(function (a, b) {
  359. return a.value > b.value
  360. })
  361. this.zones = zones
  362. for (var key in scheduleMap) {
  363. let mapArr = scheduleMap[key]
  364. for (let i = 0; i < mapArr.length; i++) {
  365. mapArr[i]['new_advice'] = []
  366. }
  367. }
  368. for (var key in scheduleMap) {
  369. let mapArr = scheduleMap[key]
  370. for (let i = 0; i < mapArr.length; i++) {
  371. var maps = mapArr[i]
  372. var resp_advices = maps.doctor_advice
  373. if (resp_advices.length > 0) {
  374. var newGroupObject = function () {
  375. return Object.assign(
  376. {},
  377. {
  378. group_no: 0,
  379. advices: []
  380. }
  381. )
  382. }
  383. var initGroupBlock = function (group, advice) {
  384. group.group_no = advice.groupno
  385. }
  386. var advice_groups = []
  387. var group = newGroupObject()
  388. for (let index = 0; index < resp_advices.length; index++) {
  389. const advice = resp_advices[index]
  390. if (advice.groupno == 0) {
  391. // 老版本的医嘱
  392. if (advice.parent_id > 0) {
  393. if (advice_groups.length > 0) {
  394. var parent_group = advice_groups[advice_groups.length - 1]
  395. if (parent_group.advices.length > 0) {
  396. if (parent_group.advices[0].id == advice.parent_id) {
  397. parent_group.advices.push(advice)
  398. }
  399. }
  400. }
  401. continue
  402. } else {
  403. if (group.group_no > 0) {
  404. advice_groups.push(group)
  405. group = newGroupObject()
  406. }
  407. initGroupBlock(group, advice)
  408. group.advices.push(advice)
  409. advice_groups.push(group)
  410. group = newGroupObject()
  411. continue
  412. }
  413. } else {
  414. if (group.group_no > 0 && group.group_no != advice.groupno) {
  415. advice_groups.push(group)
  416. group = newGroupObject()
  417. }
  418. if (group.group_no == 0) {
  419. initGroupBlock(group, advice)
  420. }
  421. if (group.group_no == advice.groupno) {
  422. group.advices.push(advice)
  423. }
  424. }
  425. }
  426. if (group.group_no > 0) {
  427. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
  428. advice_groups.push(group)
  429. }
  430. advice_groups = advice_groups
  431. } else {
  432. advice_groups = []
  433. }
  434. maps.new_advice = advice_groups
  435. }
  436. }
  437. for(let i=0;i<schedules.length;i++){
  438. schedules[i].parent_advice = []
  439. for(let j=0;j<schedules[i].doctor_advice.length;j++){
  440. if(schedules[i].doctor_advice[j].parent_id== 0){
  441. schedules[i].parent_advice.push(schedules[i].doctor_advice[j])
  442. }
  443. }
  444. }
  445. for(let i=0;i<schedules.length;i++){
  446. schedules[i].sort = 0
  447. schedules[i].sort = schedules[i].device_number.sort
  448. for(let j=0;j<schedules[i].parent_advice.length;j++){
  449. schedules[i].parent_advice[j].childAdvice = []
  450. for(let z=0;z<schedules[i].doctor_advice.length;z++){
  451. if(schedules[i].parent_advice[j].id == schedules[i].doctor_advice[z].parent_id){
  452. schedules[i].parent_advice[j].childAdvice.push(schedules[i].doctor_advice[z])
  453. }
  454. }
  455. }
  456. }
  457. console.log("哈哈哈",schedules)
  458. this.list = schedules.sort(this.compare('sort'))
  459. //未执行
  460. if(this.$route.query.excution_way == 2){
  461. if(this.list!=null){
  462. for(let i=0;i<this.list.length;i++){
  463. this.list[i].doctor_advice_map = []
  464. for(let j=0;j<this.list[i].parent_advice.length;j++){
  465. if(this.list[i].parent_advice[j].execution_state!=1){
  466. this.list[i].doctor_advice_map.push(this.list[i].parent_advice[j])
  467. }
  468. }
  469. this.list[i].parent_advice= []
  470. if(this.list[i].doctor_advice_map!=null){
  471. this.list[i].parent_advice.push(...this.list[i].doctor_advice_map)
  472. }
  473. }
  474. }
  475. }
  476. if(this.$route.query.excution_way == 1){
  477. for(let i=0;i<this.list.length;i++){
  478. this.list[i].doctor_advice_map = []
  479. for(let j=0;j<this.list[i].parent_advice.length;j++){
  480. if(this.list[i].parent_advice[j].execution_state==1){
  481. this.list[i].doctor_advice_map.push(this.list[i].parent_advice[j])
  482. }
  483. }
  484. this.list[i].parent_advice= []
  485. if(this.list[i].doctor_advice_map!=null){
  486. this.list[i].parent_advice.push(...this.list[i].doctor_advice_map)
  487. }
  488. }
  489. }
  490. this.scheduleMap = scheduleMap
  491. }
  492. console.log("this.list",this.list)
  493. }
  494. })
  495. },
  496. compare (property) {
  497. return function (a, b) {
  498. var value1 = a[property]
  499. var value2 = b[property]
  500. return value1 - value2
  501. }
  502. },
  503. parseTime: function (time, layout) {
  504. if (time == 0) {
  505. return ''
  506. }
  507. return parseTime(time, layout)
  508. },
  509. getName (val) {
  510. for (let i = 0; i < this.admin_user.length; i++) {
  511. if (this.admin_user[i].id == val) {
  512. return this.admin_user[i].name
  513. }
  514. }
  515. },
  516. getAdvice: function(doctor_advice) {
  517. if (doctor_advice.length > 0) {
  518. let name = "";
  519. for (let i = 0; i < doctor_advice.length; i++) {
  520. let prescribing_number = "";
  521. let single_dose = "";
  522. let drug_spec = "";
  523. if (doctor_advice[i].prescribing_number > 0) {
  524. prescribing_number =
  525. doctor_advice[i].prescribing_number +
  526. doctor_advice[i].prescribing_number_unit;
  527. }
  528. if (doctor_advice[i].single_dose > 0) {
  529. single_dose =
  530. " 单次用量 " +
  531. doctor_advice[i].single_dose +
  532. doctor_advice[i].single_dose_unit;
  533. }
  534. if (doctor_advice[i].drug_spec > 0) {
  535. drug_spec =
  536. doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit;
  537. }
  538. name =
  539. name +
  540. doctor_advice[i].advice_name +
  541. " " +
  542. drug_spec +
  543. " " +
  544. prescribing_number +
  545. " " +
  546. single_dose +
  547. " " +
  548. doctor_advice[i].delivery_way +
  549. " " +
  550. doctor_advice[i].execution_frequency +
  551. " " +
  552. doctor_advice[i].remark +
  553. "\n";
  554. // if (doctor_advice[i].child.length > 0) {
  555. // for (let a = 0; a < doctor_advice[i].child.length; a++) {
  556. // if (doctor_advice[i].child[a].prescribing_number > 0) {
  557. // doctor_advice[i].child[a]["presc"] =
  558. // doctor_advice[i].child[a].prescribing_number +
  559. // doctor_advice[i].child[a].prescribing_number_unit;
  560. // } else {
  561. // doctor_advice[i].child[a]["presc"] = "";
  562. // }
  563. // if (doctor_advice[i].child[a].single_dose > 0) {
  564. // doctor_advice[i].child[a]["single"] =
  565. // " " +
  566. // " 单次用量 " +
  567. // " " +
  568. // doctor_advice[i].child[a].single_dose +
  569. // doctor_advice[i].child[a].single_dose_unit;
  570. // } else {
  571. // doctor_advice[i].child[a]["single"] = "";
  572. // }
  573. // name =
  574. // name +
  575. // "▲" +
  576. // doctor_advice[i].child[a].advice_name +
  577. // "" +
  578. // doctor_advice[i].child[a].advice_desc +
  579. // doctor_advice[i].child[a].drug_spec_unit +
  580. // doctor_advice[i].child[a].presc +
  581. // doctor_advice[i].child[a].single +
  582. // "\n";
  583. // }
  584. // }
  585. }
  586. return name;
  587. }else{
  588. return ""
  589. }
  590. },
  591. getSpecialName(drug_id){
  592. var name = ""
  593. for(let i=0;i<this.drugList.length;i++){
  594. if(drug_id == this.drugList[i].id){
  595. 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
  596. }
  597. }
  598. return name
  599. }
  600. },
  601. computed: {
  602. filtedScheduals: function () {
  603. var scheduleMap = new Object()
  604. if (this.zone_selected == 0) {
  605. for (const key in this.scheduleMap) {
  606. scheduleMap[key] = this.scheduleMap[key]
  607. }
  608. } else {
  609. var zone_name = this.zones[this.zone_selected].text
  610. scheduleMap[zone_name] = this.scheduleMap[zone_name]
  611. }
  612. if (this.schedule_type_selected != 0) {
  613. var _scheduleMap = {}
  614. for (const key in scheduleMap) {
  615. var origin_schedules = scheduleMap[key]
  616. var schedules = []
  617. for (let index = 0; index < origin_schedules.length; index++) {
  618. const schedule = origin_schedules[index]
  619. if (schedule.schedule_type == this.schedule_type_selected) {
  620. schedules.push(schedule)
  621. }
  622. }
  623. if (schedules.length > 0) {
  624. _scheduleMap[key] = schedules
  625. }
  626. }
  627. scheduleMap = _scheduleMap
  628. }
  629. for (var key in scheduleMap) {
  630. let mapArr = scheduleMap[key]
  631. for (let i = 0; i < mapArr.length; i++) {
  632. mapArr[i]['new_advice'] = []
  633. }
  634. }
  635. for (var key in scheduleMap) {
  636. let mapArr = scheduleMap[key]
  637. for (let i = 0; i < mapArr.length; i++) {
  638. var maps = mapArr[i]
  639. var resp_advices = maps.doctor_advice
  640. if (resp_advices.length > 0) {
  641. var newGroupObject = function () {
  642. return Object.assign(
  643. {},
  644. {
  645. group_no: 0,
  646. advices: []
  647. }
  648. )
  649. }
  650. var initGroupBlock = function (group, advice) {
  651. group.group_no = advice.groupno
  652. }
  653. var advice_groups = []
  654. var group = newGroupObject()
  655. for (let index = 0; index < resp_advices.length; index++) {
  656. const advice = resp_advices[index]
  657. if (advice.groupno == 0) {
  658. // 老版本的医嘱
  659. if (advice.parent_id > 0) {
  660. if (advice_groups.length > 0) {
  661. var parent_group = advice_groups[advice_groups.length - 1]
  662. if (parent_group.advices.length > 0) {
  663. if (parent_group.advices[0].id == advice.parent_id) {
  664. parent_group.advices.push(advice)
  665. }
  666. }
  667. }
  668. continue
  669. } else {
  670. if (group.group_no > 0) {
  671. advice_groups.push(group)
  672. group = newGroupObject()
  673. }
  674. initGroupBlock(group, advice)
  675. group.advices.push(advice)
  676. advice_groups.push(group)
  677. group = newGroupObject()
  678. continue
  679. }
  680. } else {
  681. if (group.group_no > 0 && group.group_no != advice.groupno) {
  682. advice_groups.push(group)
  683. group = newGroupObject()
  684. }
  685. if (group.group_no == 0) {
  686. initGroupBlock(group, advice)
  687. }
  688. if (group.group_no == advice.groupno) {
  689. group.advices.push(advice)
  690. }
  691. }
  692. }
  693. if (group.group_no > 0) {
  694. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
  695. advice_groups.push(group)
  696. }
  697. advice_groups = advice_groups
  698. } else {
  699. advice_groups = []
  700. }
  701. maps.new_advice = advice_groups
  702. }
  703. }
  704. console.log("222222",scheduleMap)
  705. return scheduleMap
  706. },
  707. },
  708. created(){
  709. var time = this.$route.query.time
  710. var delivery_way = this.$route.query.delivery_way
  711. this.org_id = this.$store.getters.xt_user.org.id
  712. console.log("delivery_Way",delivery_way)
  713. this.delivery_way = delivery_way
  714. var execution_frequency = this.$route.query.execution_frequency
  715. this.execution_frequency = execution_frequency
  716. this.time = moment(time).format('YYYY-MM-DD')
  717. console.log(11,this.$route.query)
  718. this.requestSchedualDoctors(time)
  719. }
  720. }
  721. </script>
  722. <style rel="stylesheet/scss" lang="scss" scoped>
  723. .signPrint{
  724. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 60px rgba(0, 0, 0, 0.06) inset;
  725. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  726. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  727. margin-bottom: 20px;
  728. padding: 20px 10px;
  729. }
  730. .dialysisTable{
  731. width:960px;
  732. margin: 0 auto;
  733. text-align: center;
  734. border-collapse: collapse;
  735. }
  736. .order_title_panl {
  737. text-align: center;
  738. .main_title {
  739. font-size: 18px;
  740. line-height: 40px;
  741. font-weight: 500;
  742. }
  743. }
  744. .dialysisTable tr{
  745. padding: 10px 0;
  746. }
  747. .dialysisTable th {
  748. color: #000;
  749. padding: 0;
  750. margin: 0;
  751. height: 30px;
  752. }
  753. .dialysisTable tr td {
  754. padding: 12px 0;
  755. }
  756. .subadvice_content {
  757. text-align: left;
  758. padding-left: 25px !important;
  759. padding-right: 5px !important;
  760. }
  761. .advice_content {
  762. text-align: left;
  763. padding-left: 5px !important;
  764. padding-right: 5px !important;
  765. padding: 15px 5px !important;
  766. }
  767. </style>