statementPrint.vue 11KB

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