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

tableWeeks.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  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. <el-table
  29. :row-style="{ color: '#303133' }"
  30. :data="scheduleData"
  31. border
  32. :header-cell-style="{
  33. backgroundColor: 'rgb(245, 247, 250)',
  34. color: '#606266'
  35. }"
  36. style="width: 100%"
  37. >
  38. <el-table-column label="姓名" min-width="100" align="center">
  39. <template slot-scope="scope">
  40. {{ scope.row.patient}}
  41. </template>
  42. </el-table-column>
  43. <el-table-column label="分区" min-width="70" align="center">
  44. <template slot-scope="scope">
  45. {{ scope.row.zone.name }}
  46. </template>
  47. </el-table-column>
  48. <el-table-column label="班次" min-width="70" align="center">
  49. <template slot-scope="scope">
  50. {{ getSchedulesType(scope.row.schedule_type) }}
  51. </template>
  52. </el-table-column>
  53. <el-table-column label="机号" min-width="70" align="center">
  54. <template slot-scope="scope">
  55. {{ scope.row.number.number }}
  56. </template>
  57. </el-table-column>
  58. <el-table-column label="透析模式" min-width="100" align="center">
  59. <template slot-scope="scope">
  60. {{ modeOptions[scope.row.mode_id].name }}
  61. </template>
  62. </el-table-column>
  63. <el-table-column label="透析器" min-width="100" align="center">
  64. <template slot-scope="scope">
  65. {{ scope.row.prescription.dialyzer_perfusion_apparatus }}
  66. </template>
  67. </el-table-column>
  68. <el-table-column label="抗凝剂" min-width="100" align="center">
  69. <template slot-scope="scope">
  70. {{
  71. scope.row.prescription.anticoagulant
  72. ? anticoagulants_confit[scope.row.prescription.anticoagulant].name
  73. : ""
  74. }}
  75. </template>
  76. </el-table-column>
  77. <el-table-column label="总量" min-width="100" align="center">
  78. <template slot-scope="scope">
  79. <span v-if="scope.row.prescription.anticoagulant == 1">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'mg':''}}</span>
  80. <span v-if="scope.row.prescription.anticoagulant == 2">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'iu':''}}</span>
  81. <span v-if="scope.row.prescription.anticoagulant == 3">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'iu':''}}</span>
  82. <span v-if="scope.row.prescription.anticoagulant == 4">{{scope.row.prescription.anticoagulant_zongliang?scope.row.prescription.anticoagulant_zongliang+'mg':''}}</span>
  83. </template>
  84. </el-table-column>
  85. <el-table-column label="长期医嘱" min-width="440" align="center">
  86. <template slot-scope="scope">
  87. <span style="white-space: pre">{{getAdvice(scope.row.doctor_advice)}}</span>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. </div>
  92. </template>
  93. <script>
  94. import { getSchedules, getScheduleWeekDay } from '@/api/schedule'
  95. import WeekItem from './WeekItem'
  96. export default {
  97. name: 'tableWeeks',
  98. props: {
  99. weekTime: {
  100. type: String,
  101. default: 'thisWeek'
  102. }
  103. },
  104. data() {
  105. return {
  106. weekArr: [
  107. { id: 1, name: '周一' },
  108. { id: 2, name: '周二' },
  109. { id: 3, name: '周三' },
  110. { id: 4, name: '周四' },
  111. { id: 5, name: '周五' },
  112. { id: 6, name: '周六' },
  113. { id: 7, name: '周日' }
  114. ],
  115. anticoagulants_confit: null,
  116. week_type: '1',
  117. weekTitle: ['', '', '', '', '', '', ''],
  118. weekData: {
  119. Monday: [],
  120. Tuesday: [],
  121. Wednesday: [],
  122. Thursday: [],
  123. Friday: [],
  124. Saturday: [],
  125. Sunday: []
  126. },
  127. scheduleData: [],
  128. modeOptions: null
  129. }
  130. },
  131. watch: {
  132. weekTime: function() {
  133. var theType = this.weekType(this.weekTime)
  134. this.getSchedules(theType)
  135. }
  136. },
  137. methods: {
  138. printAction(){
  139. console.log("111111")
  140. this.$router.push({ path: '/schedule/remind/print?week_type=' + this.week_type })
  141. },
  142. getScheduleWeekDay(weekType) {
  143. getScheduleWeekDay(weekType).then(response => {
  144. this.scheduleData = []
  145. if (response.data.state == 1) {
  146. this.scheduleData = response.data.data.schdules
  147. console.log(this.scheduleData)
  148. } else {
  149. this.$message.error('网络错误')
  150. return false
  151. }
  152. })
  153. },
  154. // getSchedules(weekType) {
  155. // getSchedules(weekType).then(response => {
  156. // this.scheduleData = []
  157. // if (response.data.state == 1) {
  158. // this.weekTitle = response.data.data.weekTitle
  159. // var theSchedules = response.data.data.schdules
  160. // var that = this
  161. // theSchedules.forEach(function(schedule) {
  162. // schedule['mode_name'] = typeof (that.modeOptions[schedule.mode_id]) == 'undefined' ? '' : that.modeOptions[schedule.mode_id].name
  163. // var weekPath = that.weekPath(schedule.schedule_week)
  164. // if (weekPath.length > 0) {
  165. // that.weekData[weekPath].push(schedule)
  166. // }
  167. // })
  168. // var rowNum = 0
  169. // console.log(that.weekData)
  170. // for (var index in that.weekData) {
  171. // var thisLen = that.weekData[index].length
  172. // rowNum = rowNum >= thisLen ? rowNum : thisLen
  173. // }
  174. // console.log(rowNum)
  175. // for (let index = 0; index < rowNum; index++) {
  176. // var dataItem = {}
  177. // for (var weekIndex in that.weekData) {
  178. // var weekItem = that.weekData[weekIndex].shift()
  179. // console.log('weekItem', weekItem)
  180. // if (typeof (weekItem) != 'undefined') {
  181. // dataItem[weekIndex] = weekItem
  182. // }
  183. // }
  184. // that.scheduleData.push(dataItem)
  185. // }
  186. //
  187. // console.log(that.scheduleData)
  188. //
  189. // } else {
  190. // this.$message.error('网络错误')
  191. // return false
  192. // }
  193. // })
  194. // },
  195. weekType(weekTime) {
  196. var theType = 2
  197. switch (weekTime) {
  198. case 'lastWeek':
  199. theType = 1
  200. break
  201. case 'thisWeek':
  202. theType = 2
  203. break
  204. case 'nextWeek':
  205. theType = 3
  206. break
  207. case 'nextTwoWeek':
  208. theType = 4
  209. break
  210. default:
  211. theType = 2
  212. break
  213. }
  214. return theType
  215. },
  216. weekPath(week) {
  217. var weekArr = {
  218. 1: 'Monday',
  219. 2: 'Tuesday',
  220. 3: 'Wednesday',
  221. 4: 'Thursday',
  222. 5: 'Friday',
  223. 6: 'Saturday',
  224. 7: 'Sunday'
  225. }
  226. if (typeof (weekArr[week]) == 'undefined') {
  227. return ''
  228. }
  229. return weekArr[week]
  230. }, selectWeekType(type) {
  231. this.week_type = type
  232. let params = {
  233. week_type: this.week_type
  234. }
  235. this.getScheduleWeekDay(params)
  236. }, getSchedulesType: function(type) {
  237. let type_name = ''
  238. switch (type) {
  239. case 1:
  240. type_name = '上午'
  241. break
  242. case 2:
  243. type_name = '下午'
  244. break
  245. case 3:
  246. type_name = '晚上'
  247. break
  248. }
  249. return type_name
  250. },
  251. getAdvice:function(doctor_advice) {
  252. let name = ""
  253. for (let i = 0; i< doctor_advice.length; i++){
  254. let prescribing_number = ''
  255. let single_dose = ''
  256. let drug_spec = ''
  257. if (doctor_advice[i].prescribing_number > 0) {
  258. prescribing_number = doctor_advice[i].prescribing_number + doctor_advice[i].prescribing_number_unit
  259. }
  260. if (doctor_advice[i].single_dose > 0) {
  261. single_dose = ' 单次用量 ' + doctor_advice[i].single_dose + doctor_advice[i].single_dose_unit
  262. }
  263. if (doctor_advice[i].drug_spec > 0) {
  264. drug_spec = doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit
  265. }
  266. name = name + doctor_advice[i].advice_name +" "+ drug_spec+" "+ prescribing_number + " "+single_dose+" " + doctor_advice[i].delivery_way+" "+ doctor_advice[i].execution_frequency +" " + doctor_advice[i].remark +"\n"
  267. if (doctor_advice[i].child.length > 0){
  268. for (let a = 0 ; a < doctor_advice[i].child.length; a++){
  269. if(doctor_advice[i].child[a].prescribing_number > 0){
  270. doctor_advice[i].child[a]['presc'] = doctor_advice[i].child[a].prescribing_number + doctor_advice[i].child[a].prescribing_number_unit
  271. }else{
  272. doctor_advice[i].child[a]['presc'] = ''
  273. }
  274. if(doctor_advice[i].child[a].single_dose > 0){
  275. doctor_advice[i].child[a]['single'] = " "+' 单次用量 '+" "+doctor_advice[i].child[a].single_dose + doctor_advice[i].child[a].single_dose_unit
  276. }else{
  277. doctor_advice[i].child[a]['single'] = ''
  278. }
  279. name = name+"▲"+doctor_advice[i].child[a].advice_name+""
  280. + doctor_advice[i].child[a].advice_desc
  281. + doctor_advice[i].child[a].drug_spec_unit
  282. + doctor_advice[i].child[a].presc
  283. + doctor_advice[i].child[a].single+"\n"
  284. }
  285. }
  286. }
  287. return name
  288. }
  289. },
  290. components: {
  291. WeekItem
  292. },
  293. created() {
  294. this.modeOptions = this.$store.getters.treatment_mode
  295. this.anticoagulants_confit = this.$store.getters.anticoagulants_confit
  296. this.week_type = new Date().getDay()
  297. if(this.week_type == 0){
  298. this.week_type = 7
  299. }
  300. let params = {
  301. week_type: this.week_type
  302. }
  303. this.getScheduleWeekDay(params)
  304. }
  305. }
  306. </script>
  307. <style rel="stylesheet/css" lang="scss">
  308. .el-table td,
  309. .el-table th.is-leaf,
  310. .el-table--border,
  311. .el-table--group {
  312. border-color: #d0d3da;
  313. }
  314. .el-table--border::after,
  315. .el-table--group::after,
  316. .el-table::before {
  317. background-color: #d0d3da;
  318. }
  319. </style>