remind_print.vue 19KB

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