print.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. <template>
  2. <div>
  3. <div class="dialysisPage" style="padding-top: 40px">
  4. <div v-if="org_id != 10138 && org_id != 10278 && org_id != 10243 && org_id != 10537 && org_id != 10610 ">
  5. <printOne v-if="org_id != 10088 && org_id != 10215 && org_id != 10375 && org_id != 10188 && org_id != 10217 && org_id != 10598 && org_id != 10644" v-bind:childResponse="childResponse"
  6. :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient"
  7. :doctorPorject="doctorPorject" :patient_id="patient_id" :record_date="record_date"
  8. :prescription_id="prescription_id"></printOne>
  9. <print-ten-one
  10. v-if="org_id == 10188 || org_id == 10217 " v-bind:childResponse="childResponse"
  11. :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient"
  12. :doctorPorject="doctorPorject" :patient_id="patient_id" :record_date="record_date"
  13. :prescription_id="prescription_id"
  14. ></print-ten-one>
  15. <prinSeven v-if="org_id == 10375 "
  16. v-bind:childResponse="childResponse"
  17. :advicePrint="advicePrint"
  18. :ids="ids"
  19. :patient="patient"
  20. :hisPatient="hisPatient"
  21. :doctorPorject="doctorPorject"
  22. :patient_id="patient_id"
  23. :record_date="record_date"
  24. :prescription_id="prescription_id">
  25. </prinSeven>
  26. <prineight v-if="org_id == 10644 "
  27. v-bind:childResponse="childResponse"
  28. :advicePrint="advicePrint"
  29. :ids="ids"
  30. :patient="patient"
  31. :hisPatient="hisPatient"
  32. :doctorPorject="doctorPorject"
  33. :patient_id="patient_id"
  34. :record_date="record_date"
  35. :prescription_id="prescription_id">
  36. </prineight>
  37. <printFour
  38. v-if="org_id == 10088 || org_id == 10510 || org_id == 10598"
  39. v-bind:childResponse="childResponse"
  40. :advicePrint="advicePrint"
  41. :ids="ids"
  42. :patient="patient"
  43. :hisPatient="hisPatient"
  44. :doctorPorject="doctorPorject"
  45. :patient_id="patient_id"
  46. :record_date="record_date"
  47. :prescription_id="prescription_id"
  48. ></printFour>
  49. <printFive
  50. v-if="org_id == 10215"
  51. v-bind:childResponse="childResponse"
  52. :advicePrint="advicePrint"
  53. :ids="ids"
  54. :patient="patient"
  55. :hisPatient="hisPatient"
  56. :doctorPorject="doctorPorject"
  57. :patient_id="patient_id"
  58. :record_date="record_date"
  59. :prescription_id="prescription_id"
  60. :his_patient_id ="his_patient_id"
  61. ></printFive>
  62. <!-- <printSix v-if="org_id != 10088 && org_id != 10215" v-bind:childResponse="childResponse" :advicePrint="advicePrint" :ids="ids" :patient="patient" :hisPatient="hisPatient" :doctorPorject="doctorPorject" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printSix> -->
  63. </div>
  64. <div v-else-if="org_id == 10243 || org_id == 9675">
  65. <printSix
  66. v-bind:childResponse="childResponse"
  67. :advicePrint="advicePrint"
  68. :ids="ids"
  69. :patient="patient"
  70. :hisPatient="hisPatient"
  71. :doctorPorject="doctorPorject"
  72. :patient_id="patient_id"
  73. :record_date="record_date"
  74. :prescription_id="prescription_id"
  75. ></printSix>
  76. </div>
  77. <div v-else>
  78. <printThree
  79. :advicePrint="advicePrint"
  80. :ids="ids"
  81. :patient="patient"
  82. :newHisPatient="newHisPatient"
  83. :doctorPorject="doctorPorject"
  84. :patient_id="patient_id"
  85. :record_date="record_date"
  86. :prescription_id="prescription_id"
  87. ></printThree>
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. <script>
  93. import { uParseTime } from "@/utils/tools";
  94. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  95. import print from "print-js";
  96. import printOne from "./template/printOne";
  97. import printThree from "./template/printThree";
  98. import printFour from "./template/printFour";
  99. import printFive from "./template/printFive";
  100. import printSix from "./template/printSix";
  101. import prinSeven from './template/prinSeven.vue'
  102. import prineight from './template/prineight'
  103. import {
  104. getAllDoctorList,
  105. getAllHisPatientList,
  106. } from "@/api/project/project";
  107. import PrintTen from '../outpatientCharges/invoiceTemplate/printTen'
  108. import PrintTenOne from './template/printTenOne.vue'
  109. export default {
  110. name: "dialysisPrintOrder",
  111. components: {
  112. PrintTenOne,
  113. PrintTen,
  114. BreadCrumb,
  115. printOne,
  116. printThree,
  117. printFour,
  118. printFive,
  119. printSix,
  120. prinSeven,
  121. prineight
  122. },
  123. props: {
  124. paramsObj: Object,
  125. newHisPatient:Object,
  126. },
  127. data() {
  128. return {
  129. crumbs: [
  130. { path: false, name: "门诊医生站" },
  131. { path: false, name: "打印" },
  132. ],
  133. record_date: "",
  134. patientTableData: [],
  135. advicePrint: [],
  136. hisPatient: {},
  137. patient: {},
  138. doctorPorject: {},
  139. search_input: "",
  140. loading: false,
  141. patient_id: "",
  142. his_patient_id:"",
  143. prescription_id: "",
  144. ids: "",
  145. paramsObj: {},
  146. org_id: "",
  147. };
  148. },
  149. methods: {
  150. printThisPage() {
  151. var ptime = Math.round(new Date().getTime() / 1000);
  152. this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
  153. if (this.org_id == 10138 || this.org_id == 10278) {
  154. setTimeout(() => {
  155. const style =
  156. "@media print {#prescription-print{font-size:14px;border:1px solid white}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;margin-bottom: 10px;}.infoTitle{display: flex;margin-top:10px;}.infoTitle div{width: 200px;}.infoMain{display: flex;flex-wrap: wrap;margin-top:10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{min-height:350px;}.Rp{font-size: 18px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;}.drugsBox div{line-height: 20px;}.drugsOne{line-height: 24px;}.drugsOne span{margin-right: 20px;}.doctorBox{display: flex;justify-content: space-between;padding:0 10px;line-height: 24px;border-bottom: 2px solid #000;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;}.actionBar p{width:150px;}.under_line{display: inline-block;border-bottom: 1px solid #000;flex: 1;}@media print {html {zoom: 90%;}}}";
  157. printJS({
  158. printable: "prescriptionPrint1",
  159. type: "html",
  160. style: style,
  161. scanStyles: false,
  162. });
  163. }, 500);
  164. }
  165. else {
  166. const style =
  167. "@media print {#prescription-print{font-size:14px;}.prescription-print:last-child {page-break-after: auto;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;margin-top:10px; padding:0 10px;}.infoTitle p{width: 200px;font-size:14px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain div{width: 50%;line-height: 24px;}.prescriptionBox{padding:0 10px;min-height:100px;}.Rp{font-size: 22px;font-weight: bold;}.drugsBox{padding-left: 40px;margin-bottom: 10px;position: relative;}.drugsBox div{line-height: 20px;width:80%} .drugsOne{line-height: 1px;} .drugsOne span{margin-right: 20px;} .doctorBoxxxx{display: flex; justify-content: space-between; padding:0 10px; line-height: 1px; border-bottom: 2px solid #000;} .actionBar{display: flex; justify-content: space-between; line-height: 1px; padding:0 10px;} .doctorBoxxxx p {margin-left: auto} .actionBar p{width:150px;}}";
  168. printJS({
  169. printable: "prescriptionPrint",
  170. type: "html",
  171. style: style,
  172. scanStyles: false,
  173. });
  174. }
  175. // if (this.org_template_info.template_id == 1) {
  176. // printJS({
  177. // printable: "dialysis-print-box",
  178. // type: "html",
  179. // style: style,
  180. // scanStyles: false
  181. // });
  182. // }
  183. },
  184. getAllDoctorList() {
  185. getAllDoctorList().then((response) => {
  186. if (response.data.state == 1) {
  187. var doctor = response.data.data.doctor;
  188. this.doctorList = doctor;
  189. }
  190. });
  191. },
  192. getAllHisPatientList() {
  193. const params = {
  194. record_date: this.record_date,
  195. };
  196. getAllHisPatientList(params).then((response) => {
  197. if (response.data.state == 1) {
  198. this.patientTableData = response.data.data.list;
  199. this.patientTableDataTwo = response.data.data.list;
  200. let cal_one = 0;
  201. let cal_two = 0;
  202. for (let i = 0; i < response.data.data.list.length; i++) {
  203. if (
  204. response.data.data.list[i].prescription == null ||
  205. response.data.data.list[i].prescription.length == 0
  206. ) {
  207. cal_one = cal_one + 1;
  208. }
  209. if (
  210. response.data.data.list[i].prescription != null &&
  211. response.data.data.list[i].prescription.length > 0
  212. ) {
  213. cal_two = cal_two + 1;
  214. }
  215. }
  216. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  217. // console.log(this.patientTableData[0])
  218. // this.choosePatient(this.patientTableData[0])
  219. this.cal_one = cal_one;
  220. this.cal_two = cal_two;
  221. }
  222. });
  223. },
  224. changePatient(row) {
  225. this.patient_id = row.patient_id;
  226. this.record_date = this.record_date;
  227. this.prescription_id = this.prescription_id;
  228. this.his_patient_id = row.his_patient_id
  229. },
  230. searchAction() {},
  231. },
  232. created() {
  233. this.record_date = this.paramsObj.record;
  234. this.prescription_id = this.paramsObj.prescription_id;
  235. this.patient_id = this.paramsObj.patient_id;
  236. this.ids = this.paramsObj.ids;
  237. this.org_id = this.$store.getters.xt_user.org_id;
  238. this.his_patient_id = this.paramsObj.his_patient_id;
  239. this.getAllDoctorList();
  240. this.getAllHisPatientList(this.record_date);
  241. },
  242. watch: {
  243. paramsObj: {
  244. //深度监听,可监听到对象、数组的变化
  245. handler(val, oldVal) {
  246. this.paramsObj = val;
  247. this.patient_id = this.paramsObj.patient_id;
  248. this.his_patient_id = this.paramsObj.his_patient_id;
  249. var record_date = this.paramsObj.record;
  250. this.record_date = record_date;
  251. var prescription_id = this.paramsObj.prescription_id;
  252. this.prescription_id = prescription_id;
  253. this.ids = this.paramsObj.ids;
  254. },
  255. deep: true,
  256. },
  257. },
  258. };
  259. </script>
  260. <style>
  261. .dialysis-print-order {
  262. width: 960px;
  263. margin: 0 auto;
  264. }
  265. .dialysis-print-order .order-yy-name {
  266. margin: auto;
  267. text-align: center;
  268. font-size: 20px;
  269. letter-spacing: 5px;
  270. }
  271. .dialysis-print-order .order-title {
  272. margin: auto;
  273. font-weight: 600;
  274. text-align: center;
  275. font-size: 22px;
  276. padding: 10px;
  277. }
  278. .dialysis-print-order .table-box {
  279. width: 100%;
  280. line-height: 23px;
  281. font-size: 14px;
  282. }
  283. .dialysis-print-order .print-table {
  284. width: 100%;
  285. text-align: center;
  286. border-collapse: collapse;
  287. line-height: 40px;
  288. font-size: 14px;
  289. border-color: #000;
  290. }
  291. .dialysis-print-order .print-table-no {
  292. width: 100%;
  293. text-align: center;
  294. border-collapse: collapse;
  295. font-size: 14px;
  296. }
  297. .dialysis-print-order .under-line {
  298. border-bottom: 1px solid #999;
  299. width: 95%;
  300. text-align: center;
  301. margin-left: 2px;
  302. }
  303. .dialysis-print-order .title-box {
  304. text-align: center;
  305. font-size: 16px;
  306. }
  307. .dialysis-print-order .radio-lebel-box {
  308. font-weight: 400;
  309. cursor: pointer;
  310. }
  311. .dialysis-print-order .radio-no {
  312. opacity: 0;
  313. outline: none;
  314. position: absolute;
  315. margin: 0;
  316. width: 0;
  317. height: 0;
  318. z-index: -1;
  319. }
  320. .dialysis-print-order .radio-inner {
  321. white-space: nowrap;
  322. cursor: pointer;
  323. outline: none;
  324. display: inline-block;
  325. line-height: 1;
  326. position: relative;
  327. vertical-align: middle;
  328. }
  329. .dialysis-print-order .radio-fang {
  330. display: inline-block;
  331. position: relative;
  332. border: 1px solid #000;
  333. box-sizing: border-box;
  334. width: 14px;
  335. height: 14px;
  336. background-color: #fff;
  337. z-index: 1;
  338. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  339. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  340. }
  341. .dialysis-print-order .is-checked-radio::after {
  342. content: "√";
  343. font-size: 15px;
  344. }
  345. .dialysis-print-order .print-table-no tr td {
  346. padding: 8px 5px;
  347. line-height: 25px;
  348. }
  349. .dialysis-print-order .print-table tr td {
  350. padding: 1px 1px;
  351. /*line-height: 25px;*/
  352. }
  353. .es-img {
  354. height: 30px;
  355. }
  356. .advice-name {
  357. text-align: left;
  358. }
  359. .advice-children {
  360. display: flex;
  361. }
  362. .title-box-pro {
  363. border: 0 #fff;
  364. line-height: 25px;
  365. height: 25px;
  366. text-align: left;
  367. padding-left: 10px !important;
  368. }
  369. .title-box-pro-tr {
  370. border: 0 #fff;
  371. }
  372. .text-align-left {
  373. text-align: left !important;
  374. padding-left: 10px !important;
  375. font-size: 14px !important;
  376. line-height: 25px;
  377. }
  378. .print-table-tr-new td {
  379. line-height: 20px !important;
  380. }
  381. .border-top-solid {
  382. border: solid 1px #000;
  383. }
  384. .print-template-two tr {
  385. line-height: 30px;
  386. }
  387. .table-box1 {
  388. border: 1px solid #000;
  389. width: 100%;
  390. line-height: 30px;
  391. font-size: 14px;
  392. border-collapse: collapse;
  393. }
  394. .table-box1 tr {
  395. border-bottom: 1px solid #000;
  396. }
  397. </style>
  398. <style lang="scss">
  399. .newContainer {
  400. .dialysisPage::-webkit-scrollbar {
  401. height: 15px;
  402. }
  403. .el-date-editor {
  404. .el-input__inner {
  405. padding-right: 0px;
  406. }
  407. }
  408. .el-table td,
  409. .el-table th {
  410. text-align: center;
  411. }
  412. }
  413. .newContainer::-webkit-scrollbar {
  414. height: 15px !important;
  415. }
  416. </style>