treatPrint.vue 12KB

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