nextTableWeeks.vue 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <template>
  2. <div>
  3. <div class="cell clearfix" style="float: right">
  4. <el-button
  5. style="float: right"
  6. size="small"
  7. icon="el-icon-printer"
  8. @click="printAction()"
  9. type="primary"
  10. >打印
  11. </el-button>
  12. </div>
  13. <div class="cell clearfix">
  14. <label class="title"> <span class="name">时间</span> : </label>
  15. <div class="time">
  16. <ul class>
  17. <li
  18. :class="item.id == week_type ? 'active' : ''"
  19. @click="selectWeekType(item.id)"
  20. v-for="item in weekArr"
  21. :key="item.id"
  22. >
  23. {{ item.name }}
  24. </li>
  25. </ul>
  26. </div>
  27. </div>
  28. <div class="cell clearfix">
  29. <div class="title"><span class="name">班 次</span> :</div>
  30. <div class="time">
  31. <ul class>
  32. <li
  33. :class="item.id == week_time ? 'active' : ''"
  34. @click="selectWeekTime(item.id)"
  35. v-for="item in weekTimes"
  36. :key="item.id"
  37. >
  38. {{ item.name }}
  39. </li>
  40. </ul>
  41. </div>
  42. </div>
  43. <div class="cell clearfix">
  44. <div class="title"><span class="name">处方状态</span> :</div>
  45. <div class="time">
  46. <ul class>
  47. <li
  48. :class="item.id == pre_status ? 'active' : ''"
  49. @click="selectPreList(item.id)"
  50. v-for="item in preStatusList"
  51. :key="item.id"
  52. >
  53. {{ item.name }}
  54. </li>
  55. </ul>
  56. </div>
  57. </div>
  58. <div class="cell clearfix">
  59. <div class="title"><span class="name">分区</span> :</div>
  60. <div class="time">
  61. <ul class>
  62. <li
  63. :class="item.id == zone ? 'active' : ''"
  64. @click="selectZoneList(item.id)"
  65. v-for="item in zoneList"
  66. :key="item.id"
  67. >
  68. {{ item.name }}
  69. </li>
  70. </ul>
  71. </div>
  72. </div>
  73. <el-table
  74. :row-style="{ color: '#303133' }"
  75. :data="scheduleData"
  76. border
  77. :header-cell-style="{
  78. backgroundColor: 'rgb(245, 247, 250)',
  79. color: '#606266'
  80. }"
  81. style="width: 100%"
  82. >
  83. <el-table-column label="透析处方" min-width="100" align="center">
  84. <template slot-scope="scope">
  85. <span v-if="scope.row.prescription.id > 0">已确认</span>
  86. <span v-if="scope.row.prescription.id == 0">未确认</span>
  87. </template>
  88. </el-table-column>
  89. <el-table-column label="星期" min-width="100" align="center">
  90. <template slot-scope="scope">
  91. <span v-if="scope.row.schedule_week == 0">周日</span>
  92. <span v-if="scope.row.schedule_week == 1">周一</span>
  93. <span v-if="scope.row.schedule_week == 2">周二</span>
  94. <span v-if="scope.row.schedule_week == 3">周三</span>
  95. <span v-if="scope.row.schedule_week == 4">周四</span>
  96. <span v-if="scope.row.schedule_week == 5">周五</span>
  97. <span v-if="scope.row.schedule_week == 6">周六</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="姓名" min-width="100" align="center">
  101. <template slot-scope="scope">
  102. {{ scope.row.patient }}
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="分区" min-width="70" align="center">
  106. <template slot-scope="scope">
  107. {{ scope.row.zone.name }}
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="班次" min-width="70" align="center">
  111. <template slot-scope="scope">
  112. {{ getSchedulesType(scope.row.schedule_type) }}
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="机号" min-width="70" align="center">
  116. <template slot-scope="scope">
  117. {{ scope.row.number.number }}
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="透析模式" min-width="100" align="center">
  121. <template slot-scope="scope">
  122. {{
  123. scope.row.mode_id && modeOptions[scope.row.mode_id]
  124. ? modeOptions[scope.row.mode_id].name
  125. : ""
  126. }}
  127. </template>
  128. </el-table-column>
  129. <el-table-column label="透析器/灌流器" min-width="100" align="center">
  130. <template slot-scope="scope">
  131. <span v-if="org_id!=9987" >
  132. <span v-if="scope.row.prescription.dialyzer_perfusion_apparatus!=''">
  133. <span v-if="org_id!=10131">{{ scope.row.prescription.dialyzer_perfusion_apparatus }}</span>
  134. <span v-if="org_id ==10131">{{getDialysisDialyszerPerfusionOne(scope.row.patient_id)}}</span>
  135. </span>
  136. <span v-if="scope.row.prescription.dialyzer_perfusion_apparatus =='' && scope.row.dialysissolution.length>0 ">{{ getDialysisDialyszerPerfusion(scope.row.patient_id) }}</span>
  137. </span>
  138. {{scope.row.prescription.dialysis_dialyszers}}
  139. <span v-if="scope.row.prescription.dialysis_dialyszers!='' && scope.row.prescription.dialysis_irrigation!=''">/</span>
  140. <span v-if="scope.row.prescription.dialysis_irrigation!=''">{{scope.row.prescription.dialysis_irrigation}}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column label="抗凝剂(商品名称)" min-width="100" align="center">
  144. <template slot-scope="scope">
  145. <span v-if="scope.row.prescription.anticoagulant === 1">无肝素</span>
  146. <span v-if="scope.row.prescription.anticoagulant === 2">普通肝素</span>
  147. <span v-if="scope.row.prescription.anticoagulant === 3" >低分子肝素</span>
  148. <span v-if="scope.row.prescription.anticoagulant === 4">阿加曲班</span>
  149. <span v-if="scope.row.prescription.anticoagulant === 5">枸橼酸钠</span>
  150. <span v-if="scope.row.prescription.anticoagulant === 6">低分子肝素钙</span>
  151. <span v-if="scope.row.prescription.anticoagulant === 7">低分子肝素钠</span>
  152. <span v-if="scope.row.prescription.antioxidant_commodity_name!=''">
  153. (<span>{{scope.row.prescription.antioxidant_commodity_name}}</span>)
  154. </span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="总量" min-width="100" align="center">
  158. <template slot-scope="scope">
  159. <span v-if="scope.row.prescription.anticoagulant == 1">{{
  160. scope.row.prescription.anticoagulant_zongliang
  161. ? scope.row.prescription.anticoagulant_zongliang + "mg"
  162. : ""
  163. }}</span>
  164. <span v-if="scope.row.prescription.anticoagulant == 2">{{
  165. scope.row.prescription.anticoagulant_zongliang
  166. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  167. : ""
  168. }}</span>
  169. <span v-if="scope.row.prescription.anticoagulant == 3">{{
  170. scope.row.prescription.anticoagulant_zongliang
  171. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  172. : ""
  173. }}</span>
  174. <span v-if="scope.row.prescription.anticoagulant == 4">{{
  175. scope.row.prescription.anticoagulant_zongliang
  176. ? scope.row.prescription.anticoagulant_zongliang + "mg"
  177. : ""
  178. }}</span>
  179. <span v-if="scope.row.prescription.anticoagulant == 5">{{
  180. scope.row.prescription.anticoagulant_zongliang
  181. ? scope.row.prescription.anticoagulant_zongliang + "mg"
  182. : ""
  183. }}</span>
  184. <span v-if="scope.row.prescription.anticoagulant == 6">{{
  185. scope.row.prescription.anticoagulant_zongliang
  186. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  187. : ""
  188. }}</span>
  189. <span v-if="scope.row.prescription.anticoagulant == 7">{{
  190. scope.row.prescription.anticoagulant_zongliang
  191. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  192. : ""
  193. }}</span>
  194. </template>
  195. </el-table-column>
  196. <el-table-column label="长期医嘱" min-width="440" align="center">
  197. <template slot-scope="scope">
  198. <span style="white-space: pre" v-if="scope.row.doctoradvice.length>0">{{getAdvice(scope.row.doctoradvice)}}</span>
  199. <span style="white-space: pre" v-if="scope.row.hisdoctoradviceinfo.length>0">{{getAdviceOne(scope.row.hisdoctoradviceinfo)}}</span>
  200. </template>
  201. </el-table-column>
  202. </el-table>
  203. </div>
  204. </template>
  205. <script>
  206. import { getNextScheduleWeekDay,getAllZoneList } from "@/api/schedule";
  207. import WeekItem from "./WeekItem";
  208. const moment = require('moment')
  209. export default {
  210. name: "tableWeeks",
  211. props: {
  212. weekTime: {
  213. type: String,
  214. default: "thisWeek"
  215. }
  216. },
  217. data() {
  218. return {
  219. weekArr: [
  220. { id: 0, name: "全部" },
  221. { id: 1, name: "周一" },
  222. { id: 2, name: "周二" },
  223. { id: 3, name: "周三" },
  224. { id: 4, name: "周四" },
  225. { id: 5, name: "周五" },
  226. { id: 6, name: "周六" },
  227. { id: 7, name: "周日" }
  228. ],
  229. anticoagulants_confit: null,
  230. week_type: "1",
  231. week_time:0,
  232. weekTimes:[
  233. {id:0,name:"全部"},
  234. {id:1,name:"上午"},
  235. {id:2,name:"下午"},
  236. {id:3,name:"晚上"},
  237. ],
  238. weekTitle: ["", "", "", "", "", "", ""],
  239. weekData: {
  240. Monday: [],
  241. Tuesday: [],
  242. Wednesday: [],
  243. Thursday: [],
  244. Friday: [],
  245. Saturday: [],
  246. Sunday: []
  247. },
  248. scheduleData: [],
  249. modeOptions: null,
  250. org_id:0,
  251. pre_status:0,
  252. preStatusList:[
  253. {id:0,name:"全部"},
  254. {id:1,name:"已确认"},
  255. {id:2,name:"未确认"},
  256. ],
  257. zone:"",
  258. zoneList:[{id:0,name:"全部"}],
  259. };
  260. },
  261. watch: {
  262. weekTime: function() {
  263. var theType = this.weekType(this.weekTime);
  264. this.getSchedules(theType);
  265. }
  266. },
  267. methods: {
  268. printAction() {
  269. this.$router.push({
  270. path: "/schedule/remind/print/next?week_type=" + this.week_type+"&week_time="+this.week_time+"&zone="+this.zone+"&prestatus="+this.pre_status
  271. });
  272. },
  273. compare(property) {
  274. return function (a, b) {
  275. var value1 = a[property];
  276. var value2 = b[property];
  277. return value1 - value2;
  278. }
  279. },
  280. getNextScheduleWeekDay() {
  281. const start = moment().weekday(1).format('YYYY-MM-DD'); //本周一
  282. const end = moment().weekday(7).format('YYYY-MM-DD')
  283. // console.log("start",moment(start).unix())
  284. const params = {
  285. start_time:moment().week(moment().week() + 1).startOf('week').unix(),
  286. end_time:moment().week(moment().week() + 1).endOf('week').unix(),
  287. week_type:this.week_type,
  288. week_time:this.week_time,
  289. zone:this.zone,
  290. }
  291. // const params = {
  292. // start_time:1609603200,
  293. // end_time:1610208000,
  294. // week_type:this.week_type,
  295. // week_time:this.week_time,
  296. // }
  297. getNextScheduleWeekDay(params).then(response => {
  298. this.scheduleData = [];
  299. if (response.data.state == 1) {
  300. var scheduleData = response.data.data.schedule;
  301. if(this.pre_status == 0){
  302. for(let i=0;i<scheduleData.length;i++){
  303. scheduleData[i].sort = scheduleData[i].number.sort
  304. }
  305. var arr = scheduleData.sort(this.compare('sort'))
  306. console.log("元旦快乐",arr)
  307. this.scheduleData = arr
  308. }
  309. if(this.pre_status == 1){
  310. var newList = []
  311. for(let i=0;i<scheduleData.length;i++){
  312. if(scheduleData.prescription.id > 0){
  313. newList.push(scheduleData[i])
  314. }
  315. }
  316. var arr = newList.sort(this.compare('sort'))
  317. console.log("元旦快乐",arr)
  318. this.scheduleData = arr
  319. }
  320. if(this.pre_status == 2){
  321. var newList = []
  322. for(let i=0;i<scheduleData.length;i++){
  323. if(scheduleData.prescription.id == 0){
  324. newList.push(scheduleData[i])
  325. }
  326. }
  327. var arr = newList.sort(this.compare('sort'))
  328. console.log("元旦快乐",arr)
  329. this.scheduleData = arr
  330. }
  331. } else {
  332. this.$message.error("网络错误");
  333. return false;
  334. }
  335. });
  336. },
  337. weekType(weekTime) {
  338. var theType = 2;
  339. switch (weekTime) {
  340. case "lastWeek":
  341. theType = 1;
  342. break;
  343. case "thisWeek":
  344. theType = 2;
  345. break;
  346. case "nextWeek":
  347. theType = 3;
  348. break;
  349. case "nextTwoWeek":
  350. theType = 4;
  351. break;
  352. default:
  353. theType = 2;
  354. break;
  355. }
  356. return theType;
  357. },
  358. weekPath(week) {
  359. var weekArr = {
  360. 1: "Monday",
  361. 2: "Tuesday",
  362. 3: "Wednesday",
  363. 4: "Thursday",
  364. 5: "Friday",
  365. 6: "Saturday",
  366. 7: "Sunday"
  367. };
  368. if (typeof weekArr[week] == "undefined") {
  369. return "";
  370. }
  371. return weekArr[week];
  372. },
  373. selectWeekType(type) {
  374. this.week_type = type;
  375. this.getNextScheduleWeekDay();
  376. },
  377. selectWeekTime(type){
  378. this.week_time = type
  379. this.getNextScheduleWeekDay()
  380. },
  381. selectPreList(type){
  382. this.pre_status = type
  383. this.getNextScheduleWeekDay()
  384. },
  385. selectZoneList(type){
  386. this.zone = type
  387. this.getNextScheduleWeekDay()
  388. },
  389. getSchedulesType: function(type) {
  390. let type_name = "";
  391. switch (type) {
  392. case 1:
  393. type_name = "上午";
  394. break;
  395. case 2:
  396. type_name = "下午";
  397. break;
  398. case 3:
  399. type_name = "晚上";
  400. break;
  401. }
  402. return type_name;
  403. },
  404. getAdvice: function(doctor_advice) {
  405. if (doctor_advice != null) {
  406. let name = "";
  407. for (let i = 0; i < doctor_advice.length; i++) {
  408. let prescribing_number = "";
  409. let single_dose = "";
  410. let drug_spec = "";
  411. if (doctor_advice[i].prescribing_number > 0) {
  412. prescribing_number =
  413. doctor_advice[i].prescribing_number +
  414. doctor_advice[i].prescribing_number_unit;
  415. }
  416. if (doctor_advice[i].single_dose > 0) {
  417. single_dose =
  418. " 单次用量 " +
  419. doctor_advice[i].single_dose +
  420. doctor_advice[i].single_dose_unit;
  421. }
  422. if (doctor_advice[i].drug_spec > 0) {
  423. drug_spec =
  424. doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit;
  425. }
  426. name =
  427. name +
  428. doctor_advice[i].advice_name +
  429. " " +
  430. drug_spec +
  431. " " +
  432. prescribing_number +
  433. " " +
  434. single_dose +
  435. " " +
  436. doctor_advice[i].delivery_way +
  437. " " +
  438. doctor_advice[i].execution_frequency +
  439. " " +
  440. doctor_advice[i].remark +
  441. "\n";
  442. if (doctor_advice[i].child.length > 0) {
  443. for (let a = 0; a < doctor_advice[i].child.length; a++) {
  444. if (doctor_advice[i].child[a].prescribing_number > 0) {
  445. doctor_advice[i].child[a]["presc"] =
  446. doctor_advice[i].child[a].prescribing_number +
  447. doctor_advice[i].child[a].prescribing_number_unit;
  448. } else {
  449. doctor_advice[i].child[a]["presc"] = "";
  450. }
  451. if (doctor_advice[i].child[a].single_dose > 0) {
  452. doctor_advice[i].child[a]["single"] =
  453. " " +
  454. " 单次用量 " +
  455. " " +
  456. doctor_advice[i].child[a].single_dose +
  457. doctor_advice[i].child[a].single_dose_unit;
  458. } else {
  459. doctor_advice[i].child[a]["single"] = "";
  460. }
  461. name =
  462. name +
  463. "▲" +
  464. doctor_advice[i].child[a].advice_name +
  465. "" +
  466. doctor_advice[i].child[a].advice_desc +
  467. doctor_advice[i].child[a].drug_spec_unit +
  468. doctor_advice[i].child[a].presc +
  469. doctor_advice[i].child[a].single +
  470. "\n";
  471. }
  472. }
  473. }
  474. return name;
  475. }
  476. },
  477. getAdviceOne: function(doctor_advice) {
  478. if (doctor_advice != null) {
  479. let name = "";
  480. for (let i = 0; i < doctor_advice.length; i++) {
  481. let prescribing_number = "";
  482. let single_dose = "";
  483. let drug_spec = "";
  484. if (doctor_advice[i].prescribing_number > 0) {
  485. prescribing_number =
  486. doctor_advice[i].prescribing_number +
  487. doctor_advice[i].prescribing_number_unit;
  488. }
  489. if (doctor_advice[i].single_dose > 0) {
  490. single_dose =
  491. " 单次用量 " +
  492. doctor_advice[i].single_dose +
  493. doctor_advice[i].single_dose_unit;
  494. }
  495. if (doctor_advice[i].drug_spec > 0) {
  496. drug_spec =
  497. doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit;
  498. }
  499. name =
  500. name +
  501. doctor_advice[i].advice_name +
  502. " " +
  503. drug_spec +
  504. " " +
  505. prescribing_number +
  506. " " +
  507. single_dose +
  508. " " +
  509. doctor_advice[i].delivery_way +
  510. " " +
  511. doctor_advice[i].execution_frequency +
  512. " " +
  513. doctor_advice[i].remark +
  514. "\n";
  515. }
  516. return name;
  517. }
  518. },
  519. getAllZoneList(){
  520. getAllZoneList().then(response=>{
  521. if(response.data.state == 1){
  522. var zonelist = response.data.data.zoneList
  523. this.zoneList.push(...zonelist)
  524. }
  525. })
  526. },
  527. getDialysisDialyszerPerfusion(patient_id){
  528. var name = ""
  529. for(let i=0;i<this.scheduleData.length;i++){
  530. if(patient_id == this.scheduleData[i].patient_id){
  531. var arrLength = this.scheduleData[i].dialysissolution.length
  532. if(arrLength > 0){
  533. name = this.scheduleData[i].dialysissolution[arrLength - 1].dialysis_dialyszers
  534. }
  535. }
  536. }
  537. return name
  538. },
  539. getDialysisDialyszerPerfusionOne(patient_id){
  540. var name = ""
  541. for(let i=0;i<this.scheduleData.length;i++){
  542. if(patient_id == this.scheduleData[i].patient_id){
  543. var arrLength = this.scheduleData[i].dialysissolution.length
  544. if(arrLength > 0){
  545. name = this.scheduleData[i].dialysissolution[arrLength - 1].dialyzer_perfusion_apparatus
  546. }
  547. }
  548. }
  549. return name
  550. },
  551. },
  552. components: {
  553. WeekItem
  554. },
  555. created() {
  556. this.modeOptions = this.$store.getters.treatment_mode;
  557. this.anticoagulants_confit = this.$store.getters.anticoagulants_confit;
  558. this.week_type = new Date().getDay();
  559. if (this.week_type == 0) {
  560. this.week_type = 7;
  561. }
  562. this.getAllZoneList()
  563. this.getNextScheduleWeekDay();
  564. this.org_id = this.$store.getters.xt_user.org.id
  565. }
  566. };
  567. </script>
  568. <style rel="stylesheet/css" lang="scss">
  569. .el-table td,
  570. .el-table th.is-leaf,
  571. .el-table--border,
  572. .el-table--group {
  573. border-color: #d0d3da;
  574. }
  575. .el-table--border::after,
  576. .el-table--group::after,
  577. .el-table::before {
  578. background-color: #d0d3da;
  579. }
  580. </style>