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

tableWeeks.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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 class="title"><span class="name">班 次</span> :</div>
  28. <div class="time">
  29. <ul class>
  30. <li
  31. :class="item.id == week_time ? 'active' : ''"
  32. @click="selectWeekTime(item.id)"
  33. v-for="item in weekTimes"
  34. :key="item.id"
  35. >
  36. {{ item.name }}
  37. </li>
  38. </ul>
  39. </div>
  40. </div>
  41. <el-table
  42. :row-style="{ color: '#303133' }"
  43. :data="scheduleData"
  44. border
  45. :header-cell-style="{
  46. backgroundColor: 'rgb(245, 247, 250)',
  47. color: '#606266'
  48. }"
  49. style="width: 100%"
  50. >
  51. <el-table-column label="姓名" min-width="100" align="center">
  52. <template slot-scope="scope">
  53. {{ scope.row.patient }}
  54. </template>
  55. </el-table-column>
  56. <el-table-column label="分区" min-width="70" align="center">
  57. <template slot-scope="scope">
  58. {{ scope.row.zone.name }}
  59. </template>
  60. </el-table-column>
  61. <el-table-column label="班次" min-width="70" align="center">
  62. <template slot-scope="scope">
  63. {{ getSchedulesType(scope.row.schedule_type) }}
  64. </template>
  65. </el-table-column>
  66. <el-table-column label="机号" min-width="70" align="center">
  67. <template slot-scope="scope">
  68. {{ scope.row.number.number }}
  69. </template>
  70. </el-table-column>
  71. <el-table-column label="透析模式" min-width="100" align="center">
  72. <template slot-scope="scope">
  73. {{
  74. scope.row.mode_id && modeOptions[scope.row.mode_id]
  75. ? modeOptions[scope.row.mode_id].name
  76. : ""
  77. }}
  78. </template>
  79. </el-table-column>
  80. <el-table-column label="透析器" min-width="100" align="center">
  81. <template slot-scope="scope">
  82. {{ scope.row.prescription.dialyzer_perfusion_apparatus }}
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="抗凝剂" min-width="100" align="center">
  86. <template slot-scope="scope">
  87. <span v-if="scope.row.prescription.anticoagulant === 1">无肝素</span>
  88. <span v-if="scope.row.prescription.anticoagulant === 2"
  89. >普通肝素</span
  90. >
  91. <span v-if="scope.row.prescription.anticoagulant === 3"
  92. >低分子肝素</span
  93. >
  94. <span v-if="scope.row.prescription.anticoagulant === 4"
  95. >阿加曲班</span
  96. >
  97. <span v-if="scope.row.prescription.anticoagulant === 5"
  98. >枸橼酸钠</span
  99. >
  100. <span v-if="scope.row.prescription.anticoagulant === 6"
  101. >低分子肝素钙</span
  102. >
  103. <span v-if="scope.row.prescription.anticoagulant === 7"
  104. >低分子肝素钠</span
  105. >
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="总量" min-width="100" align="center">
  109. <template slot-scope="scope">
  110. <span v-if="scope.row.prescription.anticoagulant == 1">{{
  111. scope.row.prescription.anticoagulant_zongliang
  112. ? scope.row.prescription.anticoagulant_zongliang + "mg"
  113. : ""
  114. }}</span>
  115. <span v-if="scope.row.prescription.anticoagulant == 2">{{
  116. scope.row.prescription.anticoagulant_zongliang
  117. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  118. : ""
  119. }}</span>
  120. <span v-if="scope.row.prescription.anticoagulant == 3">{{
  121. scope.row.prescription.anticoagulant_zongliang
  122. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  123. : ""
  124. }}</span>
  125. <span v-if="scope.row.prescription.anticoagulant == 4">{{
  126. scope.row.prescription.anticoagulant_zongliang
  127. ? scope.row.prescription.anticoagulant_zongliang + "mg"
  128. : ""
  129. }}</span>
  130. <span v-if="scope.row.prescription.anticoagulant == 5">{{
  131. scope.row.prescription.anticoagulant_zongliang
  132. ? scope.row.prescription.anticoagulant_zongliang + "mg"
  133. : ""
  134. }}</span>
  135. <span v-if="scope.row.prescription.anticoagulant == 6">{{
  136. scope.row.prescription.anticoagulant_zongliang
  137. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  138. : ""
  139. }}</span>
  140. <span v-if="scope.row.prescription.anticoagulant == 7">{{
  141. scope.row.prescription.anticoagulant_zongliang
  142. ? scope.row.prescription.anticoagulant_zongliang + "iu"
  143. : ""
  144. }}</span>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="长期医嘱" min-width="440" align="center">
  148. <template slot-scope="scope">
  149. <span style="white-space: pre">{{
  150. getAdvice(scope.row.doctor_advice)
  151. }}</span>
  152. </template>
  153. </el-table-column>
  154. </el-table>
  155. </div>
  156. </template>
  157. <script>
  158. import { getSchedules, getScheduleWeekDay } from "@/api/schedule";
  159. import WeekItem from "./WeekItem";
  160. export default {
  161. name: "tableWeeks",
  162. props: {
  163. weekTime: {
  164. type: String,
  165. default: "thisWeek"
  166. }
  167. },
  168. data() {
  169. return {
  170. weekArr: [
  171. { id: 1, name: "周一" },
  172. { id: 2, name: "周二" },
  173. { id: 3, name: "周三" },
  174. { id: 4, name: "周四" },
  175. { id: 5, name: "周五" },
  176. { id: 6, name: "周六" },
  177. { id: 7, name: "周日" }
  178. ],
  179. anticoagulants_confit: null,
  180. week_type: "1",
  181. week_time:0,
  182. weekTimes:[
  183. {id:0,name:"全部"},
  184. {id:1,name:"上午"},
  185. {id:2,name:"下午"},
  186. {id:3,name:"晚上"},
  187. ],
  188. weekTitle: ["", "", "", "", "", "", ""],
  189. weekData: {
  190. Monday: [],
  191. Tuesday: [],
  192. Wednesday: [],
  193. Thursday: [],
  194. Friday: [],
  195. Saturday: [],
  196. Sunday: []
  197. },
  198. scheduleData: [],
  199. modeOptions: null
  200. };
  201. },
  202. watch: {
  203. weekTime: function() {
  204. var theType = this.weekType(this.weekTime);
  205. this.getSchedules(theType);
  206. }
  207. },
  208. methods: {
  209. printAction() {
  210. this.$router.push({
  211. path: "/schedule/remind/print?week_type=" + this.week_type+"&week_time="+this.week_time
  212. });
  213. },
  214. compare(property) {
  215. return function (a, b) {
  216. var value1 = a[property];
  217. var value2 = b[property];
  218. return value1 - value2;
  219. }
  220. },
  221. getScheduleWeekDay() {
  222. const params = {
  223. week_type:this.week_type,
  224. week_time:this.week_time,
  225. }
  226. getScheduleWeekDay(params).then(response => {
  227. this.scheduleData = [];
  228. if (response.data.state == 1) {
  229. var scheduleData = response.data.data.schdules;
  230. for(let i=0;i<scheduleData.length;i++){
  231. scheduleData[i].sort = scheduleData[i].number.sort
  232. }
  233. var arr = scheduleData.sort(this.compare('sort'))
  234. // console.log("元旦快乐",arr)
  235. this.scheduleData = arr
  236. } else {
  237. this.$message.error("网络错误");
  238. return false;
  239. }
  240. });
  241. },
  242. // getSchedules(weekType) {
  243. // getSchedules(weekType).then(response => {
  244. // this.scheduleData = []
  245. // if (response.data.state == 1) {
  246. // this.weekTitle = response.data.data.weekTitle
  247. // var theSchedules = response.data.data.schdules
  248. // var that = this
  249. // theSchedules.forEach(function(schedule) {
  250. // schedule['mode_name'] = typeof (that.modeOptions[schedule.mode_id]) == 'undefined' ? '' : that.modeOptions[schedule.mode_id].name
  251. // var weekPath = that.weekPath(schedule.schedule_week)
  252. // if (weekPath.length > 0) {
  253. // that.weekData[weekPath].push(schedule)
  254. // }
  255. // })
  256. // var rowNum = 0
  257. // console.log(that.weekData)
  258. // for (var index in that.weekData) {
  259. // var thisLen = that.weekData[index].length
  260. // rowNum = rowNum >= thisLen ? rowNum : thisLen
  261. // }
  262. // console.log(rowNum)
  263. // for (let index = 0; index < rowNum; index++) {
  264. // var dataItem = {}
  265. // for (var weekIndex in that.weekData) {
  266. // var weekItem = that.weekData[weekIndex].shift()
  267. // console.log('weekItem', weekItem)
  268. // if (typeof (weekItem) != 'undefined') {
  269. // dataItem[weekIndex] = weekItem
  270. // }
  271. // }
  272. // that.scheduleData.push(dataItem)
  273. // }
  274. //
  275. // console.log(that.scheduleData)
  276. //
  277. // } else {
  278. // this.$message.error('网络错误')
  279. // return false
  280. // }
  281. // })
  282. // },
  283. weekType(weekTime) {
  284. var theType = 2;
  285. switch (weekTime) {
  286. case "lastWeek":
  287. theType = 1;
  288. break;
  289. case "thisWeek":
  290. theType = 2;
  291. break;
  292. case "nextWeek":
  293. theType = 3;
  294. break;
  295. case "nextTwoWeek":
  296. theType = 4;
  297. break;
  298. default:
  299. theType = 2;
  300. break;
  301. }
  302. return theType;
  303. },
  304. weekPath(week) {
  305. var weekArr = {
  306. 1: "Monday",
  307. 2: "Tuesday",
  308. 3: "Wednesday",
  309. 4: "Thursday",
  310. 5: "Friday",
  311. 6: "Saturday",
  312. 7: "Sunday"
  313. };
  314. if (typeof weekArr[week] == "undefined") {
  315. return "";
  316. }
  317. return weekArr[week];
  318. },
  319. selectWeekType(type) {
  320. this.week_type = type;
  321. // let params = {
  322. // week_type: this.week_type
  323. // };
  324. this.getScheduleWeekDay();
  325. },
  326. selectWeekTime(type){
  327. this.week_time = type
  328. this.getScheduleWeekDay()
  329. },
  330. getSchedulesType: function(type) {
  331. let type_name = "";
  332. switch (type) {
  333. case 1:
  334. type_name = "上午";
  335. break;
  336. case 2:
  337. type_name = "下午";
  338. break;
  339. case 3:
  340. type_name = "晚上";
  341. break;
  342. }
  343. return type_name;
  344. },
  345. getAdvice: function(doctor_advice) {
  346. if (doctor_advice != null) {
  347. let name = "";
  348. for (let i = 0; i < doctor_advice.length; i++) {
  349. let prescribing_number = "";
  350. let single_dose = "";
  351. let drug_spec = "";
  352. if (doctor_advice[i].prescribing_number > 0) {
  353. prescribing_number =
  354. doctor_advice[i].prescribing_number +
  355. doctor_advice[i].prescribing_number_unit;
  356. }
  357. if (doctor_advice[i].single_dose > 0) {
  358. single_dose =
  359. " 单次用量 " +
  360. doctor_advice[i].single_dose +
  361. doctor_advice[i].single_dose_unit;
  362. }
  363. if (doctor_advice[i].drug_spec > 0) {
  364. drug_spec =
  365. doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit;
  366. }
  367. name =
  368. name +
  369. doctor_advice[i].advice_name +
  370. " " +
  371. drug_spec +
  372. " " +
  373. prescribing_number +
  374. " " +
  375. single_dose +
  376. " " +
  377. doctor_advice[i].delivery_way +
  378. " " +
  379. doctor_advice[i].execution_frequency +
  380. " " +
  381. doctor_advice[i].remark +
  382. "\n";
  383. if (doctor_advice[i].child.length > 0) {
  384. for (let a = 0; a < doctor_advice[i].child.length; a++) {
  385. if (doctor_advice[i].child[a].prescribing_number > 0) {
  386. doctor_advice[i].child[a]["presc"] =
  387. doctor_advice[i].child[a].prescribing_number +
  388. doctor_advice[i].child[a].prescribing_number_unit;
  389. } else {
  390. doctor_advice[i].child[a]["presc"] = "";
  391. }
  392. if (doctor_advice[i].child[a].single_dose > 0) {
  393. doctor_advice[i].child[a]["single"] =
  394. " " +
  395. " 单次用量 " +
  396. " " +
  397. doctor_advice[i].child[a].single_dose +
  398. doctor_advice[i].child[a].single_dose_unit;
  399. } else {
  400. doctor_advice[i].child[a]["single"] = "";
  401. }
  402. name =
  403. name +
  404. "▲" +
  405. doctor_advice[i].child[a].advice_name +
  406. "" +
  407. doctor_advice[i].child[a].advice_desc +
  408. doctor_advice[i].child[a].drug_spec_unit +
  409. doctor_advice[i].child[a].presc +
  410. doctor_advice[i].child[a].single +
  411. "\n";
  412. }
  413. }
  414. }
  415. return name;
  416. }
  417. }
  418. },
  419. components: {
  420. WeekItem
  421. },
  422. created() {
  423. this.modeOptions = this.$store.getters.treatment_mode;
  424. this.anticoagulants_confit = this.$store.getters.anticoagulants_confit;
  425. console.log("抗凝机", this.anticoagulants_confit);
  426. this.week_type = new Date().getDay();
  427. if (this.week_type == 0) {
  428. this.week_type = 7;
  429. }
  430. // let params = {
  431. // week_type: this.week_type
  432. // };
  433. this.getScheduleWeekDay();
  434. }
  435. };
  436. </script>
  437. <style rel="stylesheet/css" lang="scss">
  438. .el-table td,
  439. .el-table th.is-leaf,
  440. .el-table--border,
  441. .el-table--group {
  442. border-color: #d0d3da;
  443. }
  444. .el-table--border::after,
  445. .el-table--group::after,
  446. .el-table::before {
  447. background-color: #d0d3da;
  448. }
  449. </style>