newStatementPrintTwo.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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. <print-one v-if="org_id != 10138" :info="info"></print-one>
  17. <print-two v-else :info="info" :paramsObj="paramsObj" :balanceAccounts="balanceAccounts"></print-two>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { parseTime } from '@/utils'
  23. import { getDialysisRecord } from '@/api/dialysis'
  24. import { getDataConfig } from '@/utils/data'
  25. import { jsGetAge, uParseTime } from '@/utils/tools'
  26. import { getPrivateExpenses } from '@/api/his/his'
  27. import axios from 'axios'
  28. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  29. import printOne from './newTreatTemplate/printOne'
  30. import printTwo from './newTreatTemplate/printTwo'
  31. export default {
  32. name: "newStatementPrintTwo",
  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. balanceAccounts:{},
  60. num:0
  61. };
  62. },
  63. methods:{
  64. printThisPage() {
  65. var ptime = Math.round(new Date().getTime() / 1000);
  66. this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
  67. // const style =
  68. // '@media print {.printTitle{font-size: 20px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;font-size:12px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;font-size:12px;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none;font-size:12px;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;font-size:12px;}.actionBar div{width:150px;}}';
  69. // printJS({
  70. // printable: "prescription-print",
  71. // type: "html",
  72. // style: style,
  73. // scanStyles: false
  74. // });
  75. if(this.org_id == 10138){
  76. setTimeout(() => {
  77. const style =
  78. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 49%;}}}';
  79. const style2 =
  80. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 52%;}}}';
  81. const style3 =
  82. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 55%;}}}';
  83. const style4 =
  84. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 58%;}}}';
  85. const style5 =
  86. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 61%;}}}';
  87. const style6 =
  88. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 66%;}}}';
  89. const style7 =
  90. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 71%;}}}';
  91. const style8 =
  92. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 75%;}}}';
  93. const style9 =
  94. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 80%;}}}';
  95. const style10 =
  96. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 90%;}}}';
  97. const style11 =
  98. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 91%;}}}';
  99. const style12 =
  100. '@media print {#prescription-print{font-size:14px;}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;}@media print {html {zoom: 91%;}}}';
  101. if(this.num >= 13){
  102. printJS({
  103. printable: "prescription-print",
  104. type: "html",
  105. style: style,
  106. scanStyles: false
  107. });
  108. }else if(this.num == 12){
  109. printJS({
  110. printable: "prescription-print",
  111. type: "html",
  112. style: style2,
  113. scanStyles: false
  114. });
  115. }else if(this.num == 11){
  116. printJS({
  117. printable: "prescription-print",
  118. type: "html",
  119. style: style3,
  120. scanStyles: false
  121. });
  122. }else if(this.num == 10){
  123. printJS({
  124. printable: "prescription-print",
  125. type: "html",
  126. style: style4,
  127. scanStyles: false
  128. });
  129. }else if(this.num == 9){
  130. printJS({
  131. printable: "prescription-print",
  132. type: "html",
  133. style: style5,
  134. scanStyles: false
  135. });
  136. }else if(this.num == 8){
  137. printJS({
  138. printable: "prescription-print",
  139. type: "html",
  140. style: style6,
  141. scanStyles: false
  142. });
  143. }else if(this.num == 7){
  144. printJS({
  145. printable: "prescription-print",
  146. type: "html",
  147. style: style7,
  148. scanStyles: false
  149. });
  150. }else if(this.num == 6){
  151. printJS({
  152. printable: "prescription-print",
  153. type: "html",
  154. style: style8,
  155. scanStyles: false
  156. });
  157. }else if(this.num == 5){
  158. printJS({
  159. printable: "prescription-print",
  160. type: "html",
  161. style: style9,
  162. scanStyles: false
  163. });
  164. }else if(this.num == 4){
  165. printJS({
  166. printable: "prescription-print",
  167. type: "html",
  168. style: style10,
  169. scanStyles: false
  170. });
  171. }else if(this.num == 3){
  172. printJS({
  173. printable: "prescription-print",
  174. type: "html",
  175. style: style11,
  176. scanStyles: false
  177. });
  178. }else if(this.num <= 2){
  179. printJS({
  180. printable: "prescription-print",
  181. type: "html",
  182. style: style12,
  183. scanStyles: false
  184. });
  185. }
  186. },500)
  187. }else{
  188. const style =
  189. '@media print {.printTitle{font-size: 20px;text-align: center;font-weight: bold;}.infoMain{display: flex;flex-wrap: wrap;padding:0 10px;margin-top:10px;font-size:12px;}.infoMain .infoP{width: 33%;}.chargeBox{border: 1px solid #000;font-size:12px;}.chargeUl{display:flex;justify-content: space-between;text-align: center;}.chargeUl p{line-height: 1px;}.chargeP{line-height: 1px;padding-bottom:16px;}.moneyBox{display: flex;justify-content: space-between;padding: 0 10px;background: #eeeeee;-webkit-print-color-adjust:exact;-moz-print-color-adjust:exact;-ms-print-color-adjust:exact;print-color-adjust:exact;height: 40px;align-items: center;border:1px solid #000; border-top:none;font-size:12px;}.actionBar{display: flex;justify-content: space-between; line-height: 24px;padding:0 10px;font-size:12px;}.actionBar div{width:150px;}}';
  190. printJS({
  191. printable: "prescription-print",
  192. type: "html",
  193. style: style,
  194. scanStyles: false
  195. });
  196. }
  197. // if (this.org_template_info.template_id == 1) {
  198. // printJS({
  199. // printable: "dialysis-print-box",
  200. // type: "html",
  201. // style: style,
  202. // scanStyles: false
  203. // });
  204. // }
  205. },
  206. searchAction(){
  207. },
  208. getInfo(obj) {
  209. if (obj.balance_accounts_type == 2){
  210. let params = {
  211. his_patient_id: obj.his_patient_id,
  212. id: obj.order_id,
  213. }
  214. getPrivateExpenses(params).then(response => {
  215. if (response.data.state == 0) {
  216. this.$message.error(response.data.msg)
  217. return false
  218. } else {
  219. this.balanceAccounts = response.data.data
  220. let arr = []
  221. let obj = {
  222. type:1,
  223. details: [],
  224. total: 0
  225. }
  226. let obj2 = {
  227. type:2,
  228. details: [],
  229. total: 0
  230. }
  231. let obj3 = {
  232. type:3,
  233. details: [],
  234. total: 0
  235. }
  236. let num = 0
  237. this.balanceAccounts.order_info.map(item => {
  238. if(item.advice_id > 0){
  239. obj.details.push(item)
  240. obj.total += (item.pric * item.advice.prescribing_number)
  241. num++
  242. }else{
  243. if(item.project.type == 2){
  244. obj2.details.push(item)
  245. obj2.total += (item.pric * item.project.count)
  246. num++
  247. }else{
  248. obj3.details.push(item)
  249. obj3.total += (item.pric * item.project.count)
  250. num++
  251. }
  252. }
  253. })
  254. this.balanceAccounts.new_detail_list = []
  255. this.balanceAccounts.new_detail_list.push(obj)
  256. this.balanceAccounts.new_detail_list.push(obj2)
  257. this.balanceAccounts.new_detail_list.push(obj3)
  258. console.log(111,this.balanceAccounts)
  259. this.num = num
  260. console.log('this.num',this.num)
  261. }
  262. })
  263. }else {
  264. if (this.$store.getters.xt_user.org_id == 9504 || this.$store.getters.xt_user.org_id == 10028 || this.$store.getters.xt_user.org_id == 10138) {
  265. var that = this;
  266. axios.get('http://127.0.0.1:9532/sz/api/settle/query', {
  267. params: obj
  268. })
  269. .then(function(response) {
  270. if (response.data.state == 0) {
  271. // this.$message.error(response.data.msg);
  272. return false
  273. } else {
  274. if (response.data.data.failed_code == -10) {
  275. // that.$message.error(response.data.data.msg)
  276. that.$confirm(response.data.data.msg, '医保错误信息', {
  277. confirmButtonText: '确 定',
  278. type: 'warning'
  279. }).then(() => {
  280. }).catch(() => {
  281. })
  282. } else {
  283. console.log("~~~~");
  284. that.info = response.data.data.result;
  285. console.log(that.info);
  286. that.info['patient_info'] = response.data.data.patient_info
  287. that.info['dialysis_no'] = response.data.data.dialysis_no
  288. that.info['org_code'] = response.data.data.org_code;
  289. that.info['patient_name'] = response.data.data.patient_name;
  290. that.info['doctor_code'] = response.data.data.doctor_code;
  291. that.info['doctor_name'] = response.data.data.doctor_name;
  292. if (response.data.data.health_card_no_two.length == 0) {
  293. that.info['health_card_no'] = response.data.data.health_card_no
  294. } else {
  295. that.info['health_card_no'] = response.data.data.health_card_no_two
  296. }
  297. that.info['order_number'] = response.data.data.order_number;
  298. that.info['department'] = response.data.data.department;
  299. that.info['yiliao_leibie'] = response.data.data.yiliao_leibie;
  300. that.info['before_money'] = response.data.data.before_money;
  301. that.info['after_money'] = response.data.data.after_money;
  302. that.info['org_name'] = that.$store.getters.xt_user.org.org_name;
  303. console.log("~~~~" + that.info);
  304. var name_arr = [];
  305. var spec_arr = [];
  306. var count_arr = [];
  307. var price_arr = [];
  308. var total_arr = [];
  309. for (let i = 0; i < that.info.transBody.outputlist1.length; i++) {
  310. name_arr.push(that.info.transBody.outputlist1[i].ake006);
  311. spec_arr.push(that.info.transBody.outputlist1[i].aka074);
  312. count_arr.push(that.info.transBody.outputlist1[i].akc226);
  313. price_arr.push(that.info.transBody.outputlist1[i].akc225);
  314. total_arr.push(that.info.transBody.outputlist1[i].akc264)
  315. }
  316. console.log("~~~" + that.info);
  317. that.info['name_arr'] = name_arr;
  318. that.info['spec_arr'] = spec_arr;
  319. that.info['count_arr'] = count_arr;
  320. that.info['price_arr'] = price_arr;
  321. that.info['total_arr'] = total_arr;
  322. that.info['record_date'] = obj.record_time;
  323. console.log("~~" + that.info)
  324. let type_arr = []
  325. for (let i = 0; i < that.info.transBody.outputlist1.length; i++) {
  326. type_arr.push(that.info.transBody.outputlist1[i].aka111)
  327. }
  328. let typeArr = that.unique(type_arr)
  329. that.info['new_detail_list'] = []
  330. for (let i = 0; i < typeArr.length; i++) {
  331. let obj = {
  332. aka111: typeArr[i],
  333. details: [],
  334. total: 0
  335. }
  336. for (let b = 0; b < that.info.transBody.outputlist1.length; b++) {
  337. if (typeArr[i] == that.info.transBody.outputlist1[b].aka111) {
  338. obj.details.push(that.info.transBody.outputlist1[b])
  339. obj.total += that.info.transBody.outputlist1[b].akc264
  340. }
  341. }
  342. that.info.new_detail_list.push(obj)
  343. }
  344. }
  345. }
  346. })
  347. .catch(function(error) {
  348. });
  349. }
  350. }
  351. }, unique(array) {
  352. // res用来存储结果
  353. var res = []
  354. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  355. for (var j = 0, resLen = res.length; j < resLen; j++) {
  356. if (array[i] === res[j] ) {
  357. break
  358. }
  359. }
  360. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  361. if (j === resLen) {
  362. res.push(array[i])
  363. }
  364. }
  365. return res
  366. },
  367. },
  368. created() {
  369. this.org_id = this.$store.getters.xt_user.org_id
  370. this.getInfo(this.paramsObj)
  371. },
  372. watch:{
  373. paramsObj:{//深度监听,可监听到对象、数组的变化
  374. handler(val, oldVal){
  375. this.paramsObj = val;
  376. this.getInfo(this.paramsObj)
  377. },
  378. deep:true
  379. }
  380. }
  381. };
  382. </script>
  383. <style>
  384. .dialysis-print-order {
  385. width: 960px;
  386. margin: 0 auto;
  387. }
  388. .dialysis-print-order .order-yy-name {
  389. margin: auto;
  390. text-align: center;
  391. font-size: 20px;
  392. letter-spacing: 5px;
  393. }
  394. .dialysis-print-order .order-title {
  395. margin: auto;
  396. font-weight: 600;
  397. text-align: center;
  398. font-size: 22px;
  399. padding: 10px;
  400. }
  401. .dialysis-print-order .table-box {
  402. width: 100%;
  403. line-height: 23px;
  404. font-size: 14px;
  405. }
  406. .dialysis-print-order .print-table {
  407. width: 100%;
  408. text-align: center;
  409. border-collapse: collapse;
  410. line-height: 40px;
  411. font-size: 14px;
  412. border-color: #000;
  413. }
  414. .dialysis-print-order .print-table-no {
  415. width: 100%;
  416. text-align: center;
  417. border-collapse: collapse;
  418. font-size: 14px;
  419. }
  420. .dialysis-print-order .under-line {
  421. border-bottom: 1px solid #999;
  422. width: 95%;
  423. text-align: center;
  424. margin-left: 2px;
  425. }
  426. .dialysis-print-order .title-box {
  427. text-align: center;
  428. font-size: 16px;
  429. }
  430. .dialysis-print-order .radio-lebel-box {
  431. font-weight: 400;
  432. cursor: pointer;
  433. }
  434. .dialysis-print-order .radio-no {
  435. opacity: 0;
  436. outline: none;
  437. position: absolute;
  438. margin: 0;
  439. width: 0;
  440. height: 0;
  441. z-index: -1;
  442. }
  443. .dialysis-print-order .radio-inner {
  444. white-space: nowrap;
  445. cursor: pointer;
  446. outline: none;
  447. display: inline-block;
  448. line-height: 1;
  449. position: relative;
  450. vertical-align: middle;
  451. }
  452. .dialysis-print-order .radio-fang {
  453. display: inline-block;
  454. position: relative;
  455. border: 1px solid #000;
  456. box-sizing: border-box;
  457. width: 14px;
  458. height: 14px;
  459. background-color: #fff;
  460. z-index: 1;
  461. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  462. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  463. }
  464. .dialysis-print-order .is-checked-radio::after {
  465. content: "√";
  466. font-size: 15px;
  467. }
  468. .dialysis-print-order .print-table-no tr td {
  469. padding: 8px 5px;
  470. line-height: 25px;
  471. }
  472. .dialysis-print-order .print-table tr td {
  473. padding: 1px 1px;
  474. /*line-height: 25px;*/
  475. }
  476. .es-img {
  477. height: 30px;
  478. }
  479. .advice-name {
  480. text-align: left;
  481. }
  482. .advice-children {
  483. display: flex;
  484. }
  485. .title-box-pro {
  486. border: 0 #fff;
  487. line-height: 25px;
  488. height: 25px;
  489. text-align: left;
  490. padding-left: 10px !important;
  491. }
  492. .title-box-pro-tr {
  493. border: 0 #fff;
  494. }
  495. .text-align-left {
  496. text-align: left !important;
  497. padding-left: 10px !important;
  498. font-size: 14px !important;
  499. line-height: 25px;
  500. }
  501. .print-table-tr-new td {
  502. line-height: 20px !important;
  503. }
  504. .border-top-solid {
  505. border: solid 1px #000;
  506. }
  507. .print-template-two tr {
  508. line-height: 30px;
  509. }
  510. .table-box1 {
  511. border: 1px solid #000;
  512. width: 100%;
  513. line-height: 30px;
  514. font-size: 14px;
  515. border-collapse: collapse;
  516. }
  517. .table-box1 tr {
  518. border-bottom: 1px solid #000;
  519. }
  520. </style>
  521. <style lang="scss">
  522. .newContainer{
  523. .dialysisPage::-webkit-scrollbar {
  524. height: 15px;
  525. }
  526. .el-date-editor{
  527. .el-input__inner{
  528. padding-right:0px;
  529. }
  530. }
  531. .el-table td, .el-table th{
  532. text-align: center;
  533. }
  534. }
  535. .newContainer::-webkit-scrollbar{
  536. height: 15px !important;
  537. }
  538. </style>