signPrint.vue 34KB

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