newStatementPrint.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436
  1. <template>
  2. <div>
  3. <template>
  4. <el-button
  5. style="position:fixed;right:25px;z-index:999"
  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. <printOne :info="info" :p_admin="p_admin" :charge_admin="charge_admin"></printOne>
  16. </div>
  17. </div>
  18. </template>
  19. <script>
  20. import { parseTime } from "@/utils";
  21. import { getDialysisRecord } from "@/api/dialysis";
  22. import { getDataConfig } from "@/utils/data";
  23. import { jsGetAge, uParseTime } from "@/utils/tools";
  24. import axios from 'axios'
  25. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  26. import print from "print-js";
  27. import printOne from "./statementTemplate/printOne"
  28. import { getAllDoctorList,getAllHisPatientList,getPrescriptionPrint } from "@/api/project/project"
  29. export default {
  30. name: "newStatementPrint",
  31. components: {
  32. BreadCrumb,
  33. printOne
  34. },
  35. props:{
  36. paramsObj:Object
  37. },
  38. data() {
  39. return {
  40. crumbs: [
  41. { path: false, name: '门诊医生站' },
  42. { path: false, name: '打印' }
  43. ],
  44. record_date:"",
  45. patientTableData:[],
  46. advicePrint:[],
  47. hisPatient:{},
  48. patient:{},
  49. search_input:"",
  50. loading:false,
  51. patient_id:0,
  52. prescription_id:0,
  53. ids:'',
  54. info:null,
  55. p_admin:{},
  56. charge_admin:{},
  57. };
  58. },
  59. methods:{
  60. printThisPage() {
  61. var ptime = Math.round(new Date().getTime() / 1000);
  62. this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
  63. const style =
  64. '@media print {.statementTitle{font-size: 28px;text-align: center;font-weight: bold;margin-bottom: 10px;}.statementTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 40px;font-size: 16px;border-color: #000;}}';
  65. printJS({
  66. printable: "statement-print",
  67. type: "html",
  68. style: style,
  69. scanStyles: false
  70. });
  71. // if (this.org_template_info.template_id == 1) {
  72. // printJS({
  73. // printable: "dialysis-print-box",
  74. // type: "html",
  75. // style: style,
  76. // scanStyles: false
  77. // });
  78. // }
  79. },
  80. getAllDoctorList(){
  81. getAllDoctorList().then(response=>{
  82. if(response.data.state == 1){
  83. var doctor = response.data.data.doctor;
  84. this.doctorList = doctor
  85. }
  86. })
  87. },
  88. getAllHisPatientList(){
  89. const params = {
  90. record_date:this.record_date
  91. };
  92. getAllHisPatientList(params).then(response=>{
  93. if(response.data.state == 1){
  94. this.patientTableData = response.data.data.list;
  95. this.patientTableDataTwo = response.data.data.list;
  96. console.log('222', this.patientTableData);
  97. let cal_one = 0;
  98. let cal_two = 0;
  99. for (let i = 0; i < response.data.data.list.length; i++) {
  100. if (response.data.data.list[i].prescription == null || response.data.data.list[i].prescription.length == 0) {
  101. cal_one = cal_one + 1
  102. }
  103. if (response.data.data.list[i].prescription != null && response.data.data.list[i].prescription.length > 0) {
  104. cal_two = cal_two + 1
  105. }
  106. }
  107. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  108. // console.log(this.patientTableData[0])
  109. // this.choosePatient(this.patientTableData[0])
  110. this.cal_one = cal_one;
  111. this.cal_two = cal_two
  112. }
  113. })
  114. },
  115. changePatient(row){
  116. console.log("row",row);
  117. this.patient_id = row.patient_id;
  118. this.record_date = this.record_date;
  119. this.prescription_id = this.prescription_id
  120. // var params = {
  121. // patient_id:row.patient_id,
  122. // record_date:this.record_date,
  123. // prescription_id:this.prescription_id,
  124. // }
  125. // getPrescriptionPrint(params).then(response=>{
  126. // if(response.data.state == 1){
  127. // var advicePrint = response.data.data.advicePrint
  128. // console.log("adviceprint",advicePrint)
  129. // this.advicePrint = advicePrint
  130. // // var hisPatient = response.data.data.hisPatient
  131. // // console.log("hispatient",hisPatient)
  132. // // this.hisPatient = hisPatient
  133. // var patient = response.data.data.patient
  134. // console.log("patient",patient)
  135. // this.patient = patient
  136. // var doctorPorject = response.data.data.doctorPorject
  137. // console.log("doctorporject",doctorPorject)
  138. // }
  139. // })
  140. }, getTimes(time) {
  141. return uParseTime(time, '{y}-{m}-{d}')
  142. },
  143. searchAction(){
  144. },
  145. getInfo(order_id) {
  146. if (this.$store.getters.xt_user.org_id == 3877 || this.$store.getters.xt_user.org_id == 9919 || this.$store.getters.xt_user.org_id == 4 || this.$store.getters.xt_user.org_id == 9538 || this.$store.getters.xt_user.org_id == 9671 || this.$store.getters.xt_user.org_id == 9674 || this.$store.getters.xt_user.org_id == 10106 || this.$store.getters.xt_user.org_id == 9990 ) {
  147. var that = this;
  148. axios.get('http://127.0.0.1:9532/api/settle/query', {
  149. params: {
  150. order_id: order_id,
  151. admin_user_id:that.$store.getters.xt_user.user.id
  152. }
  153. })
  154. .then(function (response) {
  155. if (response.data.state == 0) {
  156. this.$message.error(response.data.msg);
  157. return false
  158. } else {
  159. console.log("logloglog");
  160. console.log(response.data.data.info);
  161. that.info = response.data.data.info;
  162. that.p_admin = response.data.data.printor_admin;
  163. that.charge_admin = response.data.data.charge_admin;
  164. that.info['p_admin'] = that.p_admin;
  165. that.info['charge_admin'] = that.charge_admin;
  166. that.info['date'] = response.data.data.date;
  167. that.info['number'] = response.data.data.number;
  168. that.info['order_infos'] = response.data.data.order_infos;
  169. that.info['diagnosis'] = response.data.data.diagnosis;
  170. that.info['bed_cost_total'] = response.data.data.bedCostTotal;
  171. that.info['bed_cost_self_total'] = response.data.data.bedCostSelfTotal;
  172. that.info['bed_cost_part_self_total'] = response.data.data.bedCostPartSelfTotal;
  173. that.info['operation_cost_total'] = response.data.data.operationCostTotal;
  174. that.info['operation_cost_self_total'] = response.data.data.operationCostSelfTotal;
  175. that.info['operation_cost_part_self_total'] = response.data.data.operationCostPartSelfTotal;
  176. that.info['other_cost_total'] = response.data.data.otherCostTotal;
  177. that.info['other_cost_self_total'] = response.data.data.otherCostSelfTotal;
  178. that.info['other_cost_part_self_total'] = response.data.data.otherCostPartSelfTotal;
  179. that.info['material_cost_total'] = response.data.data.materialCostTotal;
  180. that.info['material_cost_self_total'] = response.data.data.materialCostSelfTotal;
  181. that.info['material_cost_part_self_total'] = response.data.data.materialCostPartSelfTotal;
  182. that.info['western_medicine_cost_total'] = response.data.data.westernMedicineCostTotal;
  183. that.info['western_medicine_cost_self_total'] = response.data.data.westernMedicineCostSelfTotal;
  184. that.info['western_medicine_cost_part_self_total'] = response.data.data.westernMedicineCostPartSelfTotal;
  185. that.info['chinese_traditional_medicine_cost_total'] = response.data.data.chineseTraditionalMedicineCostTotal;
  186. that.info['chinese_traditional_medicine_cost_self_total'] = response.data.data.chineseTraditionalMedicineCostSelfTotal;
  187. that.info['chinese_traditional_medicine_cost_part_self_total'] = response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  188. that.info['check_cost_total'] = response.data.data.checkCostTotal;
  189. that.info['check_cost_self_total'] = response.data.data.checkCostSelfTotal;
  190. that.info['check_cost_part_self_total'] = response.data.data.checkCostPartSelfTotal;
  191. that.info['laboratory_cost_total'] = response.data.data.laboratoryCostTotal;
  192. that.info['laboratory_cost_self_total'] = response.data.data.laboratoryCostSelfTotal;
  193. that.info['laboratory_cost_part_self_total'] = response.data.data.laboratoryCostPartSelfTotal;
  194. that.info['treat_cost_total'] = response.data.data.treatCostTotal;
  195. that.info['treat_cost_self_total'] = response.data.data.treatCostSelfTotal;
  196. that.info['treat_cost_part_self_total'] = response.data.data.treatCostPartSelfTotal;
  197. if(that.paramsObj.settle_type != 1){
  198. that.info.begndate = that.getTimes(that.paramsObj.start_time)
  199. that.info.enddate = that.getTimes(that.paramsObj.end_time)
  200. }
  201. }
  202. })
  203. .catch(function (error) {
  204. });
  205. }
  206. }
  207. },
  208. created() {
  209. this.getInfo(this.paramsObj.order_id)
  210. },
  211. watch:{
  212. paramsObj:{//深度监听,可监听到对象、数组的变化
  213. handler(val, oldVal){
  214. this.paramsObj = val;
  215. this.getInfo(this.paramsObj.order_id)
  216. },
  217. deep:true
  218. }
  219. }
  220. };
  221. </script>
  222. <style>
  223. .dialysis-print-order {
  224. width: 960px;
  225. margin: 0 auto;
  226. }
  227. .dialysis-print-order .order-yy-name {
  228. margin: auto;
  229. text-align: center;
  230. font-size: 20px;
  231. letter-spacing: 5px;
  232. }
  233. .dialysis-print-order .order-title {
  234. margin: auto;
  235. font-weight: 600;
  236. text-align: center;
  237. font-size: 22px;
  238. padding: 10px;
  239. }
  240. .dialysis-print-order .table-box {
  241. width: 100%;
  242. line-height: 23px;
  243. font-size: 14px;
  244. }
  245. .dialysis-print-order .print-table {
  246. width: 100%;
  247. text-align: center;
  248. border-collapse: collapse;
  249. line-height: 40px;
  250. font-size: 14px;
  251. border-color: #000;
  252. }
  253. .dialysis-print-order .print-table-no {
  254. width: 100%;
  255. text-align: center;
  256. border-collapse: collapse;
  257. font-size: 14px;
  258. }
  259. .dialysis-print-order .under-line {
  260. border-bottom: 1px solid #999;
  261. width: 95%;
  262. text-align: center;
  263. margin-left: 2px;
  264. }
  265. .dialysis-print-order .title-box {
  266. text-align: center;
  267. font-size: 16px;
  268. }
  269. .dialysis-print-order .radio-lebel-box {
  270. font-weight: 400;
  271. cursor: pointer;
  272. }
  273. .dialysis-print-order .radio-no {
  274. opacity: 0;
  275. outline: none;
  276. position: absolute;
  277. margin: 0;
  278. width: 0;
  279. height: 0;
  280. z-index: -1;
  281. }
  282. .dialysis-print-order .radio-inner {
  283. white-space: nowrap;
  284. cursor: pointer;
  285. outline: none;
  286. display: inline-block;
  287. line-height: 1;
  288. position: relative;
  289. vertical-align: middle;
  290. }
  291. .dialysis-print-order .radio-fang {
  292. display: inline-block;
  293. position: relative;
  294. border: 1px solid #000;
  295. box-sizing: border-box;
  296. width: 14px;
  297. height: 14px;
  298. background-color: #fff;
  299. z-index: 1;
  300. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  301. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  302. }
  303. .dialysis-print-order .is-checked-radio::after {
  304. content: "√";
  305. font-size: 15px;
  306. }
  307. .dialysis-print-order .print-table-no tr td {
  308. padding: 8px 5px;
  309. line-height: 25px;
  310. }
  311. .dialysis-print-order .print-table tr td {
  312. padding: 1px 1px;
  313. /*line-height: 25px;*/
  314. }
  315. .es-img {
  316. height: 30px;
  317. }
  318. .advice-name {
  319. text-align: left;
  320. }
  321. .advice-children {
  322. display: flex;
  323. }
  324. .title-box-pro {
  325. border: 0 #fff;
  326. line-height: 25px;
  327. height: 25px;
  328. text-align: left;
  329. padding-left: 10px !important;
  330. }
  331. .title-box-pro-tr {
  332. border: 0 #fff;
  333. }
  334. .text-align-left {
  335. text-align: left !important;
  336. padding-left: 10px !important;
  337. font-size: 14px !important;
  338. line-height: 25px;
  339. }
  340. .print-table-tr-new td {
  341. line-height: 20px !important;
  342. }
  343. .border-top-solid {
  344. border: solid 1px #000;
  345. }
  346. .print-template-two tr {
  347. line-height: 30px;
  348. }
  349. .table-box1 {
  350. border: 1px solid #000;
  351. width: 100%;
  352. line-height: 30px;
  353. font-size: 14px;
  354. border-collapse: collapse;
  355. }
  356. .table-box1 tr {
  357. border-bottom: 1px solid #000;
  358. }
  359. </style>
  360. <style lang="scss">
  361. .newContainer{
  362. .dialysisPage::-webkit-scrollbar {
  363. height: 15px;
  364. }
  365. .el-date-editor{
  366. .el-input__inner{
  367. padding-right:0px;
  368. }
  369. }
  370. .el-table td, .el-table th{
  371. text-align: center;
  372. }
  373. }
  374. .newContainer::-webkit-scrollbar{
  375. height: 15px !important;
  376. }
  377. </style>