Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

doctorAdvicePrint.vue 35KB

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