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