statementPrint.vue 13KB

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