statementPrint.vue 13KB

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