remind_print.vue 21KB

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