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

remind_print.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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
  8. size="small"
  9. icon="el-icon-printer"
  10. type="primary"
  11. @click="printAction"
  12. >打印</el-button
  13. >
  14. </el-col>
  15. </el-row>
  16. </div>
  17. <div class="app-container" style="background-color: white;">
  18. <div id="print_content">
  19. <div class="print_main_content">
  20. <div class="order_title_panl">
  21. <span class="main_title">{{day}}排班提醒({{ currentDate }})</span>
  22. </div>
  23. <div class="table_panel">
  24. <table class="table">
  25. <thead>
  26. <tr>
  27. <!-- <td :width="td_1_width">姓名</td>
  28. <td :width="td_1_width">分区</td>
  29. <td :width="td_1_width">班次</td>
  30. <td :width="td_1_width">机号</td>
  31. <td :width="td_1_width">透析模式</td>
  32. <td :width="td_2_width">透析器</td>
  33. <td :width="td_2_width">抗凝剂</td>
  34. <td :width="td_2_width">低分子肝素</td>
  35. <td :width="td_4_width">长期医嘱</td> -->
  36. <td width="100">姓名</td>
  37. <td width="70">分区</td>
  38. <td width="70">班次</td>
  39. <td width="70">机号</td>
  40. <td width="120">透析模式</td>
  41. <td width="100">透析器/灌流器</td>
  42. <td width="120">抗凝剂</td>
  43. <td width="100">总量</td>
  44. <td width="300">长期医嘱</td>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. <tr v-for="(main_collection, index) in scheduleData" :key="index">
  49. <td :width="td_1_width">{{ main_collection.patient}}</td>
  50. <td :width="td_1_width">{{ main_collection.zone.name }}</td>
  51. <td :width="td_1_width">
  52. {{getSchedulesType(main_collection.schedule_type)}}
  53. </td>
  54. <td :width="td_1_width">
  55. {{main_collection.number.number}}
  56. </td>
  57. <td :width="td_1_width">
  58. {{modeOptions[main_collection.mode_id].name}}
  59. </td>
  60. <td :width="td_1_width">
  61. <span v-if="org_id!=9987">{{main_collection.prescription.dialyzer_perfusion_apparatus}}</span>
  62. {{main_collection.prescription.dialysis_dialyszers}}
  63. <span v-if="main_collection.prescription.dialysis_dialyszers!=''&& main_collection.prescription.dialysis_irrigation!='' ">/</span>
  64. <span v-if="main_collection.prescription.dialysis_irrigation!=''">{{main_collection.prescription.dialysis_irrigation}}</span>
  65. </td>
  66. <td :width="td_1_width">
  67. {{ main_collection.prescription.anticoagulant ? anticoagulants_confit[main_collection.prescription.anticoagulant].name : ''}}
  68. </td>
  69. <td :width="td_1_width">
  70. <span v-if="main_collection.prescription.anticoagulant == 1">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'mg':''}}</span>
  71. <span v-if="main_collection.prescription.anticoagulant == 2">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'iu':''}}</span>
  72. <span v-if="main_collection.prescription.anticoagulant == 3">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'iu':''}}</span>
  73. <span v-if="main_collection.prescription.anticoagulant == 4">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'mg':''}}</span>
  74. <span v-if="main_collection.prescription.anticoagulant == 5">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'mg':''}}</span>
  75. <span v-if="main_collection.prescription.anticoagulant == 6">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'iu':''}}</span>
  76. <span v-if="main_collection.prescription.anticoagulant == 7">{{main_collection.prescription.anticoagulant_zongliang?main_collection.prescription.anticoagulant_zongliang+'iu':''}}</span>
  77. </td>
  78. <td :width="td_4_width" style="text-align:left" >
  79. <span style="white-space: pre">{{getAdvice(main_collection.doctor_advice)}}</span>
  80. </td>
  81. </tr>
  82. </tbody>
  83. </table>
  84. </div>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </template>
  90. <script>
  91. import { getScheduleWeekDay } from '@/api/schedule'
  92. import { parseTime } from '@/utils'
  93. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  94. import print from 'print-js'
  95. export default {
  96. name: 'SchedulePrint',
  97. data() {
  98. return {
  99. crumbs: [
  100. { path: false, name: '排班提醒' },
  101. { path: false, name: '排班提醒打印' }
  102. ],
  103. scheduleData:[],
  104. week_type: 0,
  105. day:'',
  106. td_1_width: '10%',
  107. td_2_width: '10%',
  108. td_3_width: '25%',
  109. td_4_width: '45%',
  110. modeOptions: null,
  111. anticoagulants_confit:null,
  112. currentDate:'',
  113. org_id:0
  114. }
  115. },
  116. components: {
  117. BreadCrumb
  118. },
  119. created() {
  120. this.org_id = this.$store.getters.xt_user.org.id
  121. // this.currentDate = this.getCurrentDate()
  122. this.modeOptions = this.$store.getters.treatment_mode
  123. this.anticoagulants_confit = this.$store.getters.anticoagulants_confit
  124. this.week_type = this.$route.query.week_type
  125. this.week_time = this.$route.query.week_time
  126. const params = {
  127. week_type:this.week_type,
  128. week_time:this.week_time,
  129. }
  130. console.log("params",params)
  131. getScheduleWeekDay(params).then(rs => {
  132. var resp = rs.data
  133. console.log(resp)
  134. if (resp.state == 1) {
  135. var scheduleData = resp.data.schdules
  136. let a = resp.data.day
  137. console.log("a",a)
  138. var myDate = new Date(a);
  139. var year = myDate.getFullYear(); //年
  140. var month = myDate.getMonth() + 1; //月
  141. var day = myDate.getDate(); //日
  142. var days = myDate.getDay();
  143. switch(days) {
  144. case 1:
  145. days = '星期一';
  146. break;
  147. case 2:
  148. days = '星期二';
  149. break;
  150. case 3:
  151. days = '星期三';
  152. break;
  153. case 4:
  154. days = '星期四';
  155. break;
  156. case 5:
  157. days = '星期五';
  158. break;
  159. case 6:
  160. days = '星期六';
  161. break;
  162. case 0:
  163. days = '星期日';
  164. break;
  165. }
  166. var str = year + "年" + month + "月" + day + "日 " + days;
  167. this.currentDate = str
  168. console.log("树",scheduleData)
  169. for(let i=0;i<scheduleData.length;i++){
  170. scheduleData[i].sort = scheduleData[i].number.sort
  171. }
  172. var arr = scheduleData.sort(this.compare('sort'))
  173. console.log("打印数据",arr)
  174. this.scheduleData = arr
  175. } else {
  176. this.$message.error(resp.msg)
  177. }
  178. }).catch(err => {
  179. this.$message.error(err)
  180. })
  181. },
  182. methods: {
  183. getAdvice:function(doctor_advice) {
  184. if (doctor_advice != null) {
  185. let name = ""
  186. for (let i = 0; i< doctor_advice.length; i++) {
  187. let prescribing_number = ''
  188. let single_dose = ''
  189. let drug_spec = ''
  190. if (doctor_advice[i].prescribing_number > 0) {
  191. prescribing_number = doctor_advice[i].prescribing_number + doctor_advice[i].prescribing_number_unit
  192. }
  193. if (doctor_advice[i].single_dose > 0) {
  194. single_dose = ' 单次用量 ' + doctor_advice[i].single_dose + doctor_advice[i].single_dose_unit
  195. }
  196. if (doctor_advice[i].drug_spec > 0) {
  197. drug_spec = doctor_advice[i].drug_spec + doctor_advice[i].drug_spec_unit
  198. }
  199. 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"
  200. if (doctor_advice[i].child.length > 0) {
  201. for (let a = 0; a < doctor_advice[i].child.length; a++) {
  202. if (doctor_advice[i].child[a].prescribing_number > 0) {
  203. doctor_advice[i].child[a]['presc'] = doctor_advice[i].child[a].prescribing_number + doctor_advice[i].child[a].prescribing_number_unit
  204. } else {
  205. doctor_advice[i].child[a]['presc'] = ''
  206. }
  207. if (doctor_advice[i].child[a].single_dose > 0) {
  208. doctor_advice[i].child[a]['single'] = " " + ' 单次用量 ' + " " + doctor_advice[i].child[a].single_dose + doctor_advice[i].child[a].single_dose_unit
  209. } else {
  210. doctor_advice[i].child[a]['single'] = ''
  211. }
  212. name = name + "▲" + doctor_advice[i].child[a].advice_name + ""
  213. + doctor_advice[i].child[a].advice_desc
  214. + doctor_advice[i].child[a].drug_spec_unit
  215. + doctor_advice[i].child[a].presc
  216. + doctor_advice[i].child[a].single + "\n"
  217. }
  218. }
  219. }
  220. return name
  221. }
  222. },
  223. printAction: function() {
  224. const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 20px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 18px; padding: 10px 5px; } .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
  225. printJS({
  226. printable: 'print_content',
  227. type: 'html',
  228. documentTitle: ' ',
  229. style: style,
  230. scanStyles: false
  231. })
  232. }, getSchedulesType: function(type) {
  233. let type_name = ''
  234. switch (type) {
  235. case 1:
  236. type_name = '上午'
  237. break
  238. case 2:
  239. type_name = '下午'
  240. break
  241. case 3:
  242. type_name = '晚上'
  243. break
  244. }
  245. return type_name
  246. },
  247. getCurrentDate: function () {
  248. console.log(this.$route.query.week_type)
  249. var myDate = new Date();
  250. var year = myDate.getFullYear(); //年
  251. var month = myDate.getMonth() + 1; //月
  252. var day = myDate.getDate(); //日
  253. var newday = myDate.getDay();
  254. var days = parseInt(this.$route.query.week_type);
  255. var dayNum = parseInt(this.$route.query.week_type);
  256. switch(days) {
  257. case 1:
  258. days = '星期一';
  259. break;
  260. case 2:
  261. days = '星期二';
  262. break;
  263. case 3:
  264. days = '星期三';
  265. break;
  266. case 4:
  267. days = '星期四';
  268. break;
  269. case 5:
  270. days = '星期五';
  271. break;
  272. case 6:
  273. days = '星期六';
  274. break;
  275. case 7:
  276. days = '星期日';
  277. break;
  278. }
  279. if(newday > dayNum){
  280. let lastDay = day - (newday - dayNum)
  281. console.log("lastDay1",lastDay)
  282. var str = year + "年" + month + "月" + lastDay + "日 " + days;
  283. return str;
  284. }else if(newday < dayNum){
  285. let lastDay = day + (dayNum - newday)
  286. console.log("lastDay2",lastDay)
  287. var str = year + "年" + month + "月" + lastDay + "日 " + days;
  288. return str;
  289. }else{
  290. var str = year + "年" + month + "月" + day + "日 " + days;
  291. return str;
  292. }
  293. },
  294. compare(property) {
  295. return function (a, b) {
  296. var value1 = a[property];
  297. var value2 = b[property];
  298. return value1 - value2;
  299. }
  300. },
  301. }
  302. }
  303. </script>
  304. <style rel="stylesheet/scss" lang="scss" scoped>
  305. .print_main_content {
  306. background-color: white;
  307. max-width: 1500px;
  308. margin: 0 auto;
  309. padding: 0 0 20px 0;
  310. .order_title_panl {
  311. text-align: center;
  312. .main_title {
  313. font-size: 18px;
  314. line-height: 40px;
  315. font-weight: 500;
  316. }
  317. }
  318. .table_panel {
  319. .table {
  320. width: 100%;
  321. border: 1px solid;
  322. border-collapse: collapse;
  323. padding: 2px;
  324. thead {
  325. tr {
  326. td {
  327. border: 1px solid;
  328. text-align: center;
  329. font-size: 20px;
  330. padding: 15px 5px;
  331. }
  332. }
  333. }
  334. tbody {
  335. tr {
  336. td {
  337. border: 1px solid;
  338. text-align: center;
  339. font-size: 18px;
  340. padding: 10px 5px;
  341. .proj {
  342. padding: 5px 0;
  343. text-align: left;
  344. .proj_title {
  345. font-size: 16px;
  346. font-weight: 500;
  347. line-height: 25px;
  348. }
  349. .proj_item {
  350. font-size: 15px;
  351. line-height: 20px;
  352. .zone_name {
  353. font-weight: 500;
  354. }
  355. }
  356. }
  357. }
  358. }
  359. }
  360. }
  361. }
  362. }
  363. </style>