newStatementPrint.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. var that = this;
  147. axios.get('http://127.0.0.1:9532/api/settle/query', {
  148. params: {
  149. order_id: order_id,
  150. admin_user_id:that.$store.getters.xt_user.user.id
  151. }
  152. })
  153. .then(function (response) {
  154. if (response.data.state == 0) {
  155. this.$message.error(response.data.msg);
  156. return false
  157. } else {
  158. console.log("logloglog");
  159. console.log(response.data.data.info);
  160. that.info = response.data.data.info;
  161. that.p_admin = response.data.data.printor_admin;
  162. that.charge_admin = response.data.data.charge_admin;
  163. that.info['p_admin'] = that.p_admin;
  164. that.info['charge_admin'] = that.charge_admin;
  165. that.info['date'] = response.data.data.date;
  166. that.info['number'] = response.data.data.number;
  167. that.info['order_infos'] = response.data.data.order_infos;
  168. that.info['diagnosis'] = response.data.data.diagnosis;
  169. that.info['bed_cost_total'] = response.data.data.bedCostTotal;
  170. that.info['bed_cost_self_total'] = response.data.data.bedCostSelfTotal;
  171. that.info['bed_cost_part_self_total'] = response.data.data.bedCostPartSelfTotal;
  172. that.info['operation_cost_total'] = response.data.data.operationCostTotal;
  173. that.info['operation_cost_self_total'] = response.data.data.operationCostSelfTotal;
  174. that.info['operation_cost_part_self_total'] = response.data.data.operationCostPartSelfTotal;
  175. that.info['other_cost_total'] = response.data.data.otherCostTotal;
  176. that.info['other_cost_self_total'] = response.data.data.otherCostSelfTotal;
  177. that.info['other_cost_part_self_total'] = response.data.data.otherCostPartSelfTotal;
  178. that.info['material_cost_total'] = response.data.data.materialCostTotal;
  179. that.info['material_cost_self_total'] = response.data.data.materialCostSelfTotal;
  180. that.info['material_cost_part_self_total'] = response.data.data.materialCostPartSelfTotal;
  181. that.info['western_medicine_cost_total'] = response.data.data.westernMedicineCostTotal;
  182. that.info['western_medicine_cost_self_total'] = response.data.data.westernMedicineCostSelfTotal;
  183. that.info['western_medicine_cost_part_self_total'] = response.data.data.westernMedicineCostPartSelfTotal;
  184. that.info['chinese_traditional_medicine_cost_total'] = response.data.data.chineseTraditionalMedicineCostTotal;
  185. that.info['chinese_traditional_medicine_cost_self_total'] = response.data.data.chineseTraditionalMedicineCostSelfTotal;
  186. that.info['chinese_traditional_medicine_cost_part_self_total'] = response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  187. that.info['check_cost_total'] = response.data.data.checkCostTotal;
  188. that.info['check_cost_self_total'] = response.data.data.checkCostSelfTotal;
  189. that.info['check_cost_part_self_total'] = response.data.data.checkCostPartSelfTotal;
  190. that.info['laboratory_cost_total'] = response.data.data.laboratoryCostTotal;
  191. that.info['laboratory_cost_self_total'] = response.data.data.laboratoryCostSelfTotal;
  192. that.info['laboratory_cost_part_self_total'] = response.data.data.laboratoryCostPartSelfTotal;
  193. that.info['treat_cost_total'] = response.data.data.treatCostTotal;
  194. that.info['treat_cost_self_total'] = response.data.data.treatCostSelfTotal;
  195. that.info['treat_cost_part_self_total'] = response.data.data.treatCostPartSelfTotal;
  196. if(that.paramsObj.settle_type != 1){
  197. that.info.begndate = that.getTimes(that.paramsObj.start_time)
  198. that.info.enddate = that.getTimes(that.paramsObj.end_time)
  199. }
  200. }
  201. })
  202. .catch(function (error) {
  203. });
  204. }
  205. },
  206. created() {
  207. this.getInfo(this.paramsObj.order_id)
  208. },
  209. watch:{
  210. paramsObj:{//深度监听,可监听到对象、数组的变化
  211. handler(val, oldVal){
  212. this.paramsObj = val;
  213. this.getInfo(this.paramsObj.order_id)
  214. },
  215. deep:true
  216. }
  217. }
  218. };
  219. </script>
  220. <style>
  221. .dialysis-print-order {
  222. width: 960px;
  223. margin: 0 auto;
  224. }
  225. .dialysis-print-order .order-yy-name {
  226. margin: auto;
  227. text-align: center;
  228. font-size: 20px;
  229. letter-spacing: 5px;
  230. }
  231. .dialysis-print-order .order-title {
  232. margin: auto;
  233. font-weight: 600;
  234. text-align: center;
  235. font-size: 22px;
  236. padding: 10px;
  237. }
  238. .dialysis-print-order .table-box {
  239. width: 100%;
  240. line-height: 23px;
  241. font-size: 14px;
  242. }
  243. .dialysis-print-order .print-table {
  244. width: 100%;
  245. text-align: center;
  246. border-collapse: collapse;
  247. line-height: 40px;
  248. font-size: 14px;
  249. border-color: #000;
  250. }
  251. .dialysis-print-order .print-table-no {
  252. width: 100%;
  253. text-align: center;
  254. border-collapse: collapse;
  255. font-size: 14px;
  256. }
  257. .dialysis-print-order .under-line {
  258. border-bottom: 1px solid #999;
  259. width: 95%;
  260. text-align: center;
  261. margin-left: 2px;
  262. }
  263. .dialysis-print-order .title-box {
  264. text-align: center;
  265. font-size: 16px;
  266. }
  267. .dialysis-print-order .radio-lebel-box {
  268. font-weight: 400;
  269. cursor: pointer;
  270. }
  271. .dialysis-print-order .radio-no {
  272. opacity: 0;
  273. outline: none;
  274. position: absolute;
  275. margin: 0;
  276. width: 0;
  277. height: 0;
  278. z-index: -1;
  279. }
  280. .dialysis-print-order .radio-inner {
  281. white-space: nowrap;
  282. cursor: pointer;
  283. outline: none;
  284. display: inline-block;
  285. line-height: 1;
  286. position: relative;
  287. vertical-align: middle;
  288. }
  289. .dialysis-print-order .radio-fang {
  290. display: inline-block;
  291. position: relative;
  292. border: 1px solid #000;
  293. box-sizing: border-box;
  294. width: 14px;
  295. height: 14px;
  296. background-color: #fff;
  297. z-index: 1;
  298. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  299. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  300. }
  301. .dialysis-print-order .is-checked-radio::after {
  302. content: "√";
  303. font-size: 15px;
  304. }
  305. .dialysis-print-order .print-table-no tr td {
  306. padding: 8px 5px;
  307. line-height: 25px;
  308. }
  309. .dialysis-print-order .print-table tr td {
  310. padding: 1px 1px;
  311. /*line-height: 25px;*/
  312. }
  313. .es-img {
  314. height: 30px;
  315. }
  316. .advice-name {
  317. text-align: left;
  318. }
  319. .advice-children {
  320. display: flex;
  321. }
  322. .title-box-pro {
  323. border: 0 #fff;
  324. line-height: 25px;
  325. height: 25px;
  326. text-align: left;
  327. padding-left: 10px !important;
  328. }
  329. .title-box-pro-tr {
  330. border: 0 #fff;
  331. }
  332. .text-align-left {
  333. text-align: left !important;
  334. padding-left: 10px !important;
  335. font-size: 14px !important;
  336. line-height: 25px;
  337. }
  338. .print-table-tr-new td {
  339. line-height: 20px !important;
  340. }
  341. .border-top-solid {
  342. border: solid 1px #000;
  343. }
  344. .print-template-two tr {
  345. line-height: 30px;
  346. }
  347. .table-box1 {
  348. border: 1px solid #000;
  349. width: 100%;
  350. line-height: 30px;
  351. font-size: 14px;
  352. border-collapse: collapse;
  353. }
  354. .table-box1 tr {
  355. border-bottom: 1px solid #000;
  356. }
  357. </style>
  358. <style lang="scss">
  359. .newContainer{
  360. .dialysisPage::-webkit-scrollbar {
  361. height: 15px;
  362. }
  363. .el-date-editor{
  364. .el-input__inner{
  365. padding-right:0px;
  366. }
  367. }
  368. .el-table td, .el-table th{
  369. text-align: center;
  370. }
  371. }
  372. .newContainer::-webkit-scrollbar{
  373. height: 15px !important;
  374. }
  375. </style>