treatPrint.vue 9.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <!-- <bread-crumb :crumbs="crumbs"></bread-crumb> -->
  5. <template>
  6. <el-button
  7. :loading="loading"
  8. size="small"
  9. icon="el-icon-printer"
  10. @click="printThisPage"
  11. type="primary"
  12. >打印</el-button
  13. >
  14. </template>
  15. </div>
  16. <div class="app-container" style="min-height:0;">
  17. <el-container class="newContainer">
  18. <div style="width:270px;margin-right:20px;">
  19. <div class="cell clearfix" style="margin-bottom:10px;">
  20. <el-input size="small" v-model.trim="search_input" class="filter-item"/>
  21. <el-button size="small" class="filter-item" type="primary" @click="searchAction">搜索</el-button>
  22. </div>
  23. <el-table ref="tab" @current-change="changePatient" highlight-current-row :data="patientTableData"
  24. height="480" border style="width: 100%">
  25. <el-table-column prop="date" label="患者">
  26. <template slot-scope="scope">{{scope.row.patients?scope.row.patients.name:''}}</template>
  27. </el-table-column>
  28. <el-table-column prop="name" label="就诊号">
  29. <template slot-scope="scope">{{ scope.row.his_patient ?scope.row.his_patient.number:''}}</template>
  30. </el-table-column>
  31. </el-table>
  32. </div>
  33. <div class='dialysisPage' style="flex: 1;height: calc(100vh - 178px);overflow-x:auto;::-webkit-scrollbar:height:15px">
  34. <printOne v-bind:childResponse="childResponse" :advicePrint="advicePrint" :patient="patient" :hisPatient="hisPatient" :patient_id="patient_id" :record_date="record_date" :prescription_id="prescription_id"></printOne>
  35. </div>
  36. </el-container>
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. import { parseTime } from "@/utils";
  42. import { getDialysisRecord } from "@/api/dialysis";
  43. import { getDataConfig } from "@/utils/data";
  44. import { jsGetAge, uParseTime } from "@/utils/tools";
  45. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  46. import print from "print-js";
  47. import printOne from "./treatTemplate/printOne"
  48. import { getAllDoctorList,getAllHisPatientList,getPrescriptionPrint } from "@/api/project/project"
  49. export default {
  50. name: "dialysisPrintOrder",
  51. components: {
  52. BreadCrumb,
  53. printOne
  54. },
  55. data() {
  56. return {
  57. record_date:"",
  58. patientTableData:[],
  59. advicePrint:[],
  60. hisPatient:{},
  61. patient:{},
  62. search_input:"",
  63. loading:false,
  64. patient_id:0,
  65. prescription_id:0
  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. const style =
  73. '@media print {.printTitle{font-size: 22px;text-align: center;font-weight: bold;}.infoTitle{display: flex;border-bottom: 2px solid #000;margin-top:10px;line-height: 1px; padding:0 10px;}.infoTitle p{width: 300px;}.infoMain{display: flex;flex-wrap: wrap;border-bottom: 2px solid #000;padding:0 10px;}.infoMain p{width: 50%;line-height: 1px;}.prescriptionBox{padding:0 10px;height:600px;}.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; line-height: 1px; border-bottom: 2px solid #000;} .actionBar{display: flex; justify-content: space-between; line-height: 1px; padding:0 10px;} .actionBar p{width:150px;}}';
  74. printJS({
  75. printable: "prescription-print",
  76. type: "html",
  77. style: style,
  78. scanStyles: false
  79. });
  80. // if (this.org_template_info.template_id == 1) {
  81. // printJS({
  82. // printable: "dialysis-print-box",
  83. // type: "html",
  84. // style: style,
  85. // scanStyles: false
  86. // });
  87. // }
  88. },
  89. getAllDoctorList(){
  90. getAllDoctorList().then(response=>{
  91. if(response.data.state == 1){
  92. var doctor = response.data.data.doctor
  93. this.doctorList = doctor
  94. }
  95. })
  96. },
  97. getAllHisPatientList(){
  98. const params = {
  99. record_date:this.record_date
  100. }
  101. getAllHisPatientList(params).then(response=>{
  102. if(response.data.state == 1){
  103. this.patientTableData = response.data.data.list
  104. this.patientTableDataTwo = response.data.data.list
  105. console.log('222', this.patientTableData)
  106. let cal_one = 0
  107. let cal_two = 0
  108. for (let i = 0; i < response.data.data.list.length; i++) {
  109. if (response.data.data.list[i].prescription == null || response.data.data.list[i].prescription.length == 0) {
  110. cal_one = cal_one + 1
  111. }
  112. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  113. cal_two = cal_two + 1
  114. }
  115. }
  116. this.$refs.tab.setCurrentRow(this.patientTableData[0])
  117. console.log(this.patientTableData[0])
  118. this.choosePatient(this.patientTableData[0])
  119. this.cal_one = cal_one
  120. this.cal_two = cal_two
  121. }
  122. })
  123. },
  124. changePatient(row){
  125. console.log("row",row)
  126. this.patient_id = row.patient_id
  127. this.record_date = this.record_date
  128. this.prescription_id = this.prescription_id
  129. // var params = {
  130. // patient_id:row.patient_id,
  131. // record_date:this.record_date,
  132. // prescription_id:this.prescription_id,
  133. // }
  134. // getPrescriptionPrint(params).then(response=>{
  135. // if(response.data.state == 1){
  136. // var advicePrint = response.data.data.advicePrint
  137. // console.log("adviceprint",advicePrint)
  138. // this.advicePrint = advicePrint
  139. // // var hisPatient = response.data.data.hisPatient
  140. // // console.log("hispatient",hisPatient)
  141. // // this.hisPatient = hisPatient
  142. // var patient = response.data.data.patient
  143. // console.log("patient",patient)
  144. // this.patient = patient
  145. // var doctorPorject = response.data.data.doctorPorject
  146. // console.log("doctorporject",doctorPorject)
  147. // }
  148. // })
  149. },
  150. searchAction(){
  151. }
  152. },
  153. created() {
  154. this.getAllDoctorList()
  155. var record_date = this.$route.query.record
  156. this.record_date = record_date
  157. console.log("record_date",record_date)
  158. this.prescription_id = this.$route.query.prescription_id
  159. this.getAllHisPatientList(record_date)
  160. },
  161. };
  162. </script>
  163. <style>
  164. .dialysis-print-order {
  165. width: 960px;
  166. margin: 0 auto;
  167. }
  168. .dialysis-print-order .order-yy-name {
  169. margin: auto;
  170. text-align: center;
  171. font-size: 20px;
  172. letter-spacing: 5px;
  173. }
  174. .dialysis-print-order .order-title {
  175. margin: auto;
  176. font-weight: 600;
  177. text-align: center;
  178. font-size: 22px;
  179. padding: 10px;
  180. }
  181. .dialysis-print-order .table-box {
  182. width: 100%;
  183. line-height: 23px;
  184. font-size: 14px;
  185. }
  186. .dialysis-print-order .print-table {
  187. width: 100%;
  188. text-align: center;
  189. border-collapse: collapse;
  190. line-height: 40px;
  191. font-size: 14px;
  192. border-color: #000;
  193. }
  194. .dialysis-print-order .print-table-no {
  195. width: 100%;
  196. text-align: center;
  197. border-collapse: collapse;
  198. font-size: 14px;
  199. }
  200. .dialysis-print-order .under-line {
  201. border-bottom: 1px solid #999;
  202. width: 95%;
  203. text-align: center;
  204. margin-left: 2px;
  205. }
  206. .dialysis-print-order .title-box {
  207. text-align: center;
  208. font-size: 16px;
  209. }
  210. .dialysis-print-order .radio-lebel-box {
  211. font-weight: 400;
  212. cursor: pointer;
  213. }
  214. .dialysis-print-order .radio-no {
  215. opacity: 0;
  216. outline: none;
  217. position: absolute;
  218. margin: 0;
  219. width: 0;
  220. height: 0;
  221. z-index: -1;
  222. }
  223. .dialysis-print-order .radio-inner {
  224. white-space: nowrap;
  225. cursor: pointer;
  226. outline: none;
  227. display: inline-block;
  228. line-height: 1;
  229. position: relative;
  230. vertical-align: middle;
  231. }
  232. .dialysis-print-order .radio-fang {
  233. display: inline-block;
  234. position: relative;
  235. border: 1px solid #000;
  236. box-sizing: border-box;
  237. width: 14px;
  238. height: 14px;
  239. background-color: #fff;
  240. z-index: 1;
  241. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  242. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  243. }
  244. .dialysis-print-order .is-checked-radio::after {
  245. content: "√";
  246. font-size: 15px;
  247. }
  248. .dialysis-print-order .print-table-no tr td {
  249. padding: 8px 5px;
  250. line-height: 25px;
  251. }
  252. .dialysis-print-order .print-table tr td {
  253. padding: 1px 1px;
  254. /*line-height: 25px;*/
  255. }
  256. .es-img {
  257. height: 30px;
  258. }
  259. .advice-name {
  260. text-align: left;
  261. }
  262. .advice-children {
  263. display: flex;
  264. }
  265. .title-box-pro {
  266. border: 0 #fff;
  267. line-height: 25px;
  268. height: 25px;
  269. text-align: left;
  270. padding-left: 10px !important;
  271. }
  272. .title-box-pro-tr {
  273. border: 0 #fff;
  274. }
  275. .text-align-left {
  276. text-align: left !important;
  277. padding-left: 10px !important;
  278. font-size: 14px !important;
  279. line-height: 25px;
  280. }
  281. .print-table-tr-new td {
  282. line-height: 20px !important;
  283. }
  284. .border-top-solid {
  285. border: solid 1px #000;
  286. }
  287. .print-template-two tr {
  288. line-height: 30px;
  289. }
  290. .table-box1 {
  291. border: 1px solid #000;
  292. width: 100%;
  293. line-height: 30px;
  294. font-size: 14px;
  295. border-collapse: collapse;
  296. }
  297. .table-box1 tr {
  298. border-bottom: 1px solid #000;
  299. }
  300. </style>
  301. <style lang="scss">
  302. .newContainer{
  303. .dialysisPage::-webkit-scrollbar {
  304. height: 15px;
  305. }
  306. .el-date-editor{
  307. .el-input__inner{
  308. padding-right:0px;
  309. }
  310. }
  311. .el-table td, .el-table th{
  312. text-align: center;
  313. }
  314. }
  315. .newContainer::-webkit-scrollbar{
  316. height: 15px !important;
  317. }
  318. </style>