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

next_remind_print.vue 18KB

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