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

doctorAdvicePrint.vue 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  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.start_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. org_id:0,
  260. }
  261. },
  262. methods:{
  263. printAction: function() {
  264. 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;} }'
  265. printJS({
  266. printable: 'dialysisTable',
  267. type: 'html',
  268. documentTitle: ' ',
  269. style: style,
  270. scanStyles: false
  271. })
  272. },
  273. requestSchedualDoctors (time) {
  274. let newTime = moment(time).format('YYYY-MM-DD')
  275. getSchedualDoctors({
  276. date: newTime,
  277. patient_type: 0,
  278. advice_type: 2,
  279. delivery_way:this.delivery_way,
  280. }).then(rs => {
  281. var resp = rs.data
  282. if (resp.state == 1) {
  283. this.admin_user = resp.data.adminUser
  284. var config = resp.data.config
  285. let project_config = resp.data.project_config
  286. // console.log('project_config',resp.data.project_config)
  287. if(project_config.is_open == 1){
  288. this.project = resp.data.project
  289. resp.data.hisAdvices.map((item,index) => {
  290. item.new_advice = item.new_advice ? item.new_advice : []
  291. if(this.org_id!=9671 && this.org_id!= 10318 && this.org_id!=0){
  292. if(this.project[index].project.length > 0){
  293. this.project[index].project.map(it => {
  294. let obj = {
  295. advice_doctor: it.doctor,
  296. start_time:it.start_time,
  297. advice_name: it.type == 2 ? it.project.project_name : it.good_info.good_name,
  298. execution_time:it.execution_time,
  299. execution_state:it.execution_state,
  300. execution_staff:it.execution_staff,
  301. check_time:it.check_time,
  302. check_state:it.check_state,
  303. checker:it.checker,
  304. created_time:it.ctime,
  305. remark:'',
  306. id:it.id,
  307. parent_id:0,
  308. groupno:0
  309. }
  310. item.doctor_advice.push(obj)
  311. })
  312. }
  313. }
  314. })
  315. }
  316. if(config.is_open == 0 || config.is_open == 2){
  317. var schedulesArr = resp.data.scheduals
  318. let schedules = []
  319. var ids = this.$store.getters.temp_params.advice_ids
  320. console.log('ids',ids)
  321. schedulesArr.map(item => {
  322. if(ids.indexOf(item.patient_id) > -1){
  323. schedules.push(item)
  324. }
  325. })
  326. for (let i = 0; i < schedules.length; i++) {
  327. schedules[i].dialysis_no = schedules[i].patient.dialysis_no
  328. }
  329. var arr = []
  330. for (let j = 0; j < schedules.length; j++) {
  331. arr.push(schedules[j].dialysis_no)
  332. }
  333. arr.sort(function (a, b) {
  334. return a - b
  335. })
  336. var arrTwo = []
  337. for (let i = 0; i < arr.length; i++) {
  338. for (let j = 0; j < schedules.length; j++) {
  339. if (arr[i] == schedules[j].dialysis_no) {
  340. arrTwo.push(schedules[j])
  341. }
  342. }
  343. }
  344. arrTwo.map((item, index) => {
  345. item.doctor_advice.sort(this.compare('start_time'))
  346. })
  347. const res = new Map()
  348. let a = arrTwo.filter(
  349. a => !res.has(a.dialysis_no) && res.set(a.dialysis_no, 1)
  350. )
  351. schedules = a
  352. var zoneMap = {}
  353. var scheduleMap = {}
  354. for (let index = 0; index < schedules.length; index++) {
  355. const schedule = schedules[index]
  356. if (schedule.doctor_advice.length == 0) {
  357. continue
  358. }
  359. if (scheduleMap[schedule.device_number.zone.name] == null) {
  360. scheduleMap[schedule.device_number.zone.name] = []
  361. }
  362. scheduleMap[schedule.device_number.zone.name].push(schedule)
  363. if (zoneMap[schedule.device_number.zone.name] == null) {
  364. zoneMap[schedule.device_number.zone.name] =
  365. schedule.device_number.zone
  366. }
  367. }
  368. var zones = []
  369. zones.push({ value: 0, text: '全部分区' })
  370. for (var zoneName in zoneMap) {
  371. zones.push({ value: zoneMap[zoneName].id, text: zoneName })
  372. }
  373. zones = zones.sort(function (a, b) {
  374. return a.value > b.value
  375. })
  376. this.zones = zones
  377. for (var key in scheduleMap) {
  378. let mapArr = scheduleMap[key]
  379. for (let i = 0; i < mapArr.length; i++) {
  380. mapArr[i]['new_advice'] = []
  381. }
  382. }
  383. for (var key in scheduleMap) {
  384. let mapArr = scheduleMap[key]
  385. for (let i = 0; i < mapArr.length; i++) {
  386. var maps = mapArr[i]
  387. var resp_advices = maps.doctor_advice
  388. if (resp_advices.length > 0) {
  389. var newGroupObject = function () {
  390. return Object.assign(
  391. {},
  392. {
  393. group_no: 0,
  394. advices: []
  395. }
  396. )
  397. }
  398. var initGroupBlock = function (group, advice) {
  399. group.group_no = advice.groupno
  400. }
  401. var advice_groups = []
  402. var group = newGroupObject()
  403. for (let index = 0; index < resp_advices.length; index++) {
  404. const advice = resp_advices[index]
  405. if (advice.groupno == 0) {
  406. // 老版本的医嘱
  407. if (advice.parent_id > 0) {
  408. if (advice_groups.length > 0) {
  409. var parent_group = advice_groups[advice_groups.length - 1]
  410. if (parent_group.advices.length > 0) {
  411. if (parent_group.advices[0].id == advice.parent_id) {
  412. parent_group.advices.push(advice)
  413. }
  414. }
  415. }
  416. continue
  417. } else {
  418. if (group.group_no > 0) {
  419. advice_groups.push(group)
  420. group = newGroupObject()
  421. }
  422. initGroupBlock(group, advice)
  423. group.advices.push(advice)
  424. advice_groups.push(group)
  425. group = newGroupObject()
  426. continue
  427. }
  428. } else {
  429. if (group.group_no > 0 && group.group_no != advice.groupno) {
  430. advice_groups.push(group)
  431. group = newGroupObject()
  432. }
  433. if (group.group_no == 0) {
  434. initGroupBlock(group, advice)
  435. }
  436. if (group.group_no == advice.groupno) {
  437. group.advices.push(advice)
  438. }
  439. }
  440. }
  441. if (group.group_no > 0) {
  442. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
  443. advice_groups.push(group)
  444. }
  445. advice_groups = advice_groups
  446. } else {
  447. advice_groups = []
  448. }
  449. maps.new_advice = advice_groups
  450. }
  451. }
  452. this.scheduleMap = scheduleMap
  453. }
  454. if(config.is_open == 1){
  455. var schedulesArr = resp.data.hisAdvices
  456. let schedules = []
  457. var ids = this.$store.getters.temp_params.advice_ids
  458. console.log('ids',ids)
  459. schedulesArr.map(item => {
  460. if(ids.indexOf(item.patient_id) > -1){
  461. schedules.push(item)
  462. }
  463. })
  464. for (let i = 0; i < schedules.length; i++) {
  465. schedules[i].dialysis_no = schedules[i].patient.dialysis_no
  466. }
  467. var arr = []
  468. for (let j = 0; j < schedules.length; j++) {
  469. arr.push(schedules[j].dialysis_no)
  470. }
  471. arr.sort(function (a, b) {
  472. return a - b
  473. })
  474. var arrTwo = []
  475. for (let i = 0; i < arr.length; i++) {
  476. for (let j = 0; j < schedules.length; j++) {
  477. if (arr[i] == schedules[j].dialysis_no) {
  478. arrTwo.push(schedules[j])
  479. }
  480. }
  481. }
  482. arrTwo.map((item, index) => {
  483. item.doctor_advice.sort(this.compare('start_time'))
  484. })
  485. const res = new Map()
  486. let a = arrTwo.filter(
  487. a => !res.has(a.dialysis_no) && res.set(a.dialysis_no, 1)
  488. )
  489. schedules = a
  490. var zoneMap = {}
  491. var scheduleMap = {}
  492. for (let index = 0; index < schedules.length; index++) {
  493. const schedule = schedules[index]
  494. if (schedule.doctor_advice.length == 0) {
  495. continue
  496. }
  497. if (scheduleMap[schedule.device_number.zone.name] == null) {
  498. scheduleMap[schedule.device_number.zone.name] = []
  499. }
  500. scheduleMap[schedule.device_number.zone.name].push(schedule)
  501. if (zoneMap[schedule.device_number.zone.name] == null) {
  502. zoneMap[schedule.device_number.zone.name] =
  503. schedule.device_number.zone
  504. }
  505. }
  506. var zones = []
  507. zones.push({ value: 0, text: '全部分区' })
  508. for (var zoneName in zoneMap) {
  509. zones.push({ value: zoneMap[zoneName].id, text: zoneName })
  510. }
  511. zones = zones.sort(function (a, b) {
  512. return a.value > b.value
  513. })
  514. this.zones = zones
  515. for (var key in scheduleMap) {
  516. let mapArr = scheduleMap[key]
  517. for (let i = 0; i < mapArr.length; i++) {
  518. mapArr[i]['new_advice'] = []
  519. }
  520. }
  521. for (var key in scheduleMap) {
  522. let mapArr = scheduleMap[key]
  523. for (let i = 0; i < mapArr.length; i++) {
  524. var maps = mapArr[i]
  525. var resp_advices = maps.doctor_advice
  526. if (resp_advices.length > 0) {
  527. var newGroupObject = function () {
  528. return Object.assign(
  529. {},
  530. {
  531. group_no: 0,
  532. advices: []
  533. }
  534. )
  535. }
  536. var initGroupBlock = function (group, advice) {
  537. group.group_no = advice.groupno
  538. }
  539. var advice_groups = []
  540. var group = newGroupObject()
  541. for (let index = 0; index < resp_advices.length; index++) {
  542. const advice = resp_advices[index]
  543. if (advice.groupno == 0) {
  544. // 老版本的医嘱
  545. if (advice.parent_id > 0) {
  546. if (advice_groups.length > 0) {
  547. var parent_group = advice_groups[advice_groups.length - 1]
  548. if (parent_group.advices.length > 0) {
  549. if (parent_group.advices[0].id == advice.parent_id) {
  550. parent_group.advices.push(advice)
  551. }
  552. }
  553. }
  554. continue
  555. } else {
  556. if (group.group_no > 0) {
  557. advice_groups.push(group)
  558. group = newGroupObject()
  559. }
  560. initGroupBlock(group, advice)
  561. group.advices.push(advice)
  562. advice_groups.push(group)
  563. group = newGroupObject()
  564. continue
  565. }
  566. } else {
  567. if (group.group_no > 0 && group.group_no != advice.groupno) {
  568. advice_groups.push(group)
  569. group = newGroupObject()
  570. }
  571. if (group.group_no == 0) {
  572. initGroupBlock(group, advice)
  573. }
  574. if (group.group_no == advice.groupno) {
  575. group.advices.push(advice)
  576. }
  577. }
  578. }
  579. if (group.group_no > 0) {
  580. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
  581. advice_groups.push(group)
  582. }
  583. advice_groups = advice_groups
  584. } else {
  585. advice_groups = []
  586. }
  587. maps.new_advice = advice_groups
  588. }
  589. }
  590. this.scheduleMap = scheduleMap
  591. }
  592. }
  593. })
  594. },
  595. compare (property) {
  596. return function (a, b) {
  597. var value1 = a[property]
  598. var value2 = b[property]
  599. return value1 - value2
  600. }
  601. },
  602. parseTime: function (time, layout) {
  603. if (time == 0) {
  604. return ''
  605. }
  606. return parseTime(time, layout)
  607. },
  608. getName (val) {
  609. for (let i = 0; i < this.admin_user.length; i++) {
  610. if (this.admin_user[i].id == val) {
  611. return this.admin_user[i].name
  612. }
  613. }
  614. },
  615. },
  616. computed: {
  617. filtedScheduals: function () {
  618. var scheduleMap = new Object()
  619. if (this.zone_selected == 0) {
  620. for (const key in this.scheduleMap) {
  621. scheduleMap[key] = this.scheduleMap[key]
  622. }
  623. } else {
  624. var zone_name = this.zones[this.zone_selected].text
  625. scheduleMap[zone_name] = this.scheduleMap[zone_name]
  626. }
  627. if (this.schedule_type_selected != 0) {
  628. var _scheduleMap = {}
  629. for (const key in scheduleMap) {
  630. var origin_schedules = scheduleMap[key]
  631. var schedules = []
  632. for (let index = 0; index < origin_schedules.length; index++) {
  633. const schedule = origin_schedules[index]
  634. if (schedule.schedule_type == this.schedule_type_selected) {
  635. schedules.push(schedule)
  636. }
  637. }
  638. if (schedules.length > 0) {
  639. _scheduleMap[key] = schedules
  640. }
  641. }
  642. scheduleMap = _scheduleMap
  643. }
  644. for (var key in scheduleMap) {
  645. let mapArr = scheduleMap[key]
  646. for (let i = 0; i < mapArr.length; i++) {
  647. mapArr[i]['new_advice'] = []
  648. }
  649. }
  650. for (var key in scheduleMap) {
  651. let mapArr = scheduleMap[key]
  652. for (let i = 0; i < mapArr.length; i++) {
  653. var maps = mapArr[i]
  654. var resp_advices = maps.doctor_advice
  655. if (resp_advices.length > 0) {
  656. var newGroupObject = function () {
  657. return Object.assign(
  658. {},
  659. {
  660. group_no: 0,
  661. advices: []
  662. }
  663. )
  664. }
  665. var initGroupBlock = function (group, advice) {
  666. group.group_no = advice.groupno
  667. }
  668. var advice_groups = []
  669. var group = newGroupObject()
  670. for (let index = 0; index < resp_advices.length; index++) {
  671. const advice = resp_advices[index]
  672. if (advice.groupno == 0) {
  673. // 老版本的医嘱
  674. if (advice.parent_id > 0) {
  675. if (advice_groups.length > 0) {
  676. var parent_group = advice_groups[advice_groups.length - 1]
  677. if (parent_group.advices.length > 0) {
  678. if (parent_group.advices[0].id == advice.parent_id) {
  679. parent_group.advices.push(advice)
  680. }
  681. }
  682. }
  683. continue
  684. } else {
  685. if (group.group_no > 0) {
  686. advice_groups.push(group)
  687. group = newGroupObject()
  688. }
  689. initGroupBlock(group, advice)
  690. group.advices.push(advice)
  691. advice_groups.push(group)
  692. group = newGroupObject()
  693. continue
  694. }
  695. } else {
  696. if (group.group_no > 0 && group.group_no != advice.groupno) {
  697. advice_groups.push(group)
  698. group = newGroupObject()
  699. }
  700. if (group.group_no == 0) {
  701. initGroupBlock(group, advice)
  702. }
  703. if (group.group_no == advice.groupno) {
  704. group.advices.push(advice)
  705. }
  706. }
  707. }
  708. if (group.group_no > 0) {
  709. // 上述的算法会导致最后一组没有加到advice_groups,这里要手动加
  710. advice_groups.push(group)
  711. }
  712. advice_groups = advice_groups
  713. } else {
  714. advice_groups = []
  715. }
  716. maps.new_advice = advice_groups
  717. }
  718. }
  719. console.log("222222",scheduleMap)
  720. return scheduleMap
  721. }
  722. },
  723. created(){
  724. var time = this.$route.query.time
  725. var delivery_way = this.$route.query.delivery_way
  726. this.delivery_way = delivery_way
  727. this.time = moment(time).format('YYYY-MM-DD')
  728. console.log(11,this.$route.query)
  729. this.requestSchedualDoctors(time)
  730. this.org_id = this.$store.getters.xt_user.template_info.org_id;
  731. }
  732. }
  733. </script>
  734. <style rel="stylesheet/scss" lang="scss" scoped>
  735. .dialysisTable{
  736. width:960px;
  737. margin: 0 auto;
  738. text-align: center;
  739. border-collapse: collapse;
  740. }
  741. .order_title_panl {
  742. text-align: center;
  743. .main_title {
  744. font-size: 18px;
  745. line-height: 40px;
  746. font-weight: 500;
  747. }
  748. }
  749. .dialysisTable tr{
  750. padding: 10px 0;
  751. }
  752. .dialysisTable th {
  753. color: #000;
  754. padding: 0;
  755. margin: 0;
  756. height: 30px;
  757. }
  758. .dialysisTable tr td {
  759. padding: 12px 0;
  760. }
  761. .subadvice_content {
  762. text-align: left;
  763. padding-left: 25px !important;
  764. padding-right: 5px !important;
  765. }
  766. .advice_content {
  767. text-align: left;
  768. padding-left: 5px !important;
  769. padding-right: 5px !important;
  770. padding: 15px 5px !important;
  771. }
  772. </style>