remind_print.vue 20KB

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