statementPrint.vue 37KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011
  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. <div
  16. v-if="
  17. org_id == 9990 ||
  18. org_id == 10138 ||
  19. org_id == 9504 ||
  20. org_id == 10028 ||
  21. org_id == 4 ||
  22. org_id == 10278
  23. "
  24. >
  25. <printTwo :info="info" v-if="org_id == 9990"></printTwo>
  26. <printThree
  27. :info="info"
  28. :paramsObj="paramsObj"
  29. :balanceAccounts="balanceAccounts"
  30. v-if="
  31. org_id == 10138 || org_id == 4 || org_id == 10278
  32. "
  33. ></printThree>
  34. <printFour
  35. v-if="org_id == 9504 || org_id == 10028 || org_id == 10088"
  36. :info="info"
  37. :paramsObj="paramsObj"
  38. :balanceAccounts="balanceAccounts"
  39. ></printFour>
  40. <!-- <privateChargePrint :info="info" v-if="org_id == 10215 && this.paramsObj.balance_accounts_type == 2"></privateChargePrint>-->
  41. </div>
  42. <!-- <print-other :info="info" v-if="org_id == 9919"></print-other>-->
  43. <!-- <printOne :info=" info" v-if="org_id == 10215 && this.paramsObj.balance_accounts_type == 2"></printOne>-->
  44. <printOne :info="info" v-else></printOne>
  45. <!-- 测试医保环境下表格样式放开以下这条 -->
  46. <!-- <testVue :info="info" v-else></testVue> -->
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import { parseTime } from "@/utils";
  52. import { getDialysisRecord } from "@/api/dialysis";
  53. import { getDataConfig } from "@/utils/data";
  54. import { jsGetAge, uParseTime } from "@/utils/tools";
  55. import axios from "axios";
  56. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  57. import print from "print-js";
  58. import printOne from "./statementTemplate/printOne";
  59. import privateChargePrint from "./statementTemplate/privateChargePrint";
  60. import printTwo from "./statementTemplate/printTwo";
  61. import printThree from "./statementTemplate/printThree";
  62. import printFour from "./statementTemplate/printFour";
  63. import testVue from "./statementTemplate/test";
  64. import {
  65. getAllDoctorList,
  66. getAllHisPatientList,
  67. getPrescriptionPrint,
  68. } from "@/api/project/project";
  69. import { getPrivateExpenses,getPrivateExpensesOrder } from "@/api/his/his";
  70. // import PrintOther from '../hospitalStation/statementTemplate/printOther'
  71. export default {
  72. name: "dialysisPrintOrder",
  73. components: {
  74. BreadCrumb,
  75. printOne,
  76. privateChargePrint,
  77. printTwo,
  78. printThree,
  79. printFour,
  80. testVue,
  81. },
  82. props: {
  83. paramsObj: Object,
  84. },
  85. data() {
  86. return {
  87. crumbs: [
  88. { path: false, name: "门诊医生站" },
  89. { path: false, name: "打印" },
  90. ],
  91. record_date: "",
  92. patientTableData: [],
  93. advicePrint: [],
  94. hisPatient: {},
  95. patient: {},
  96. search_input: "",
  97. loading: false,
  98. patient_id: 0,
  99. prescription_id: 0,
  100. ids: "",
  101. info: null,
  102. org_id: "",
  103. balanceAccounts: {},
  104. };
  105. },
  106. methods: {
  107. printThisPage() {
  108. var ptime = Math.round(new Date().getTime() / 1000);
  109. this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
  110. if (
  111. this.$store.getters.xt_user.org_id == 10138 ||
  112. // this.$store.getters.xt_user.org_id == 0 ||
  113. this.$store.getters.xt_user.org_id == 4 ||
  114. this.$store.getters.xt_user.org_id == 10278
  115. ) {
  116. setTimeout(() => {
  117. const style =
  118. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 47%;}}}";
  119. const style2 =
  120. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 50%;}}}";
  121. const style3 =
  122. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 55%;}}}";
  123. const style4 =
  124. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 58%;}}}";
  125. const style5 =
  126. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 61%;}}}";
  127. const style6 =
  128. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 66%;}}}";
  129. const style7 =
  130. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 71%;}}}";
  131. const style8 =
  132. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 75%;}}}";
  133. const style9 =
  134. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 80%;}}}";
  135. const style10 =
  136. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 85%;}}}";
  137. const style11 =
  138. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 87%;}}}";
  139. const style12 =
  140. "@media print {#prescription-print{font-size:14px;border:1px solid white}.printTitle{font-size: 22px;text-align: center;font-weight: bold;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 89%;}}}";
  141. if (this.num >= 13) {
  142. printJS({
  143. printable: "prescription-print",
  144. type: "html",
  145. style: style,
  146. scanStyles: false,
  147. });
  148. } else if (this.num == 12) {
  149. printJS({
  150. printable: "prescription-print",
  151. type: "html",
  152. style: style2,
  153. scanStyles: false,
  154. });
  155. } else if (this.num == 11) {
  156. printJS({
  157. printable: "prescription-print",
  158. type: "html",
  159. style: style3,
  160. scanStyles: false,
  161. });
  162. } else if (this.num == 10) {
  163. printJS({
  164. printable: "prescription-print",
  165. type: "html",
  166. style: style4,
  167. scanStyles: false,
  168. });
  169. } else if (this.num == 9) {
  170. printJS({
  171. printable: "prescription-print",
  172. type: "html",
  173. style: style5,
  174. scanStyles: false,
  175. });
  176. } else if (this.num == 8) {
  177. printJS({
  178. printable: "prescription-print",
  179. type: "html",
  180. style: style6,
  181. scanStyles: false,
  182. });
  183. } else if (this.num == 7) {
  184. printJS({
  185. printable: "prescription-print",
  186. type: "html",
  187. style: style7,
  188. scanStyles: false,
  189. });
  190. } else if (this.num == 6) {
  191. printJS({
  192. printable: "prescription-print",
  193. type: "html",
  194. style: style8,
  195. scanStyles: false,
  196. });
  197. } else if (this.num == 5) {
  198. printJS({
  199. printable: "prescription-print",
  200. type: "html",
  201. style: style9,
  202. scanStyles: false,
  203. });
  204. } else if (this.num == 4) {
  205. printJS({
  206. printable: "prescription-print",
  207. type: "html",
  208. style: style10,
  209. scanStyles: false,
  210. });
  211. } else if (this.num == 3) {
  212. printJS({
  213. printable: "prescription-print",
  214. type: "html",
  215. style: style11,
  216. scanStyles: false,
  217. });
  218. } else if (this.num <= 2) {
  219. printJS({
  220. printable: "prescription-print",
  221. type: "html",
  222. style: style12,
  223. scanStyles: false,
  224. });
  225. }
  226. }, 500);
  227. } else if (
  228. this.$store.getters.xt_user.org_id == 9504 ||
  229. this.$store.getters.xt_user.org_id == 10028
  230. ) {
  231. const style =
  232. "@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;}}";
  233. printJS({
  234. printable: "prescription-print",
  235. type: "html",
  236. style: style,
  237. scanStyles: false,
  238. });
  239. } else {
  240. // 医保环境打印格式
  241. if (
  242. this.$store.getters.xt_user.org_id == 9919 ||
  243. this.$store.getters.xt_user.org_id == 10106
  244. ) {
  245. const style =
  246. "@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;}}";
  247. printJS({
  248. printable: "statement-print",
  249. type: "html",
  250. style: style,
  251. scanStyles: false,
  252. });
  253. } else {
  254. const style =
  255. "@media print {#statement-print{font-size:14px;border:1px solid white}.statementTitle{font-size: 22px;text-align: center;font-weight: bold;}table{border-collapse: collapse;text-align: center;}table td {padding: 10px 5px;font-size:16px;}@media print {html {zoom: 57%;}}}";
  256. printJS({
  257. printable: "statement-print",
  258. type: "html",
  259. style: style,
  260. scanStyles: false,
  261. });
  262. }
  263. }
  264. // if (this.org_template_info.template_id == 1) {
  265. // printJS({
  266. // printable: "dialysis-print-box",
  267. // type: "html",
  268. // style: style,
  269. // scanStyles: false
  270. // });
  271. // }
  272. },
  273. getAllDoctorList() {
  274. getAllDoctorList().then((response) => {
  275. if (response.data.state == 1) {
  276. var doctor = response.data.data.doctor;
  277. this.doctorList = doctor;
  278. }
  279. });
  280. },
  281. getAllHisPatientList() {
  282. const params = {
  283. record_date: this.record_date,
  284. };
  285. getAllHisPatientList(params).then((response) => {
  286. if (response.data.state == 1) {
  287. this.patientTableData = response.data.data.list;
  288. this.patientTableDataTwo = response.data.data.list;
  289. console.log("222", this.patientTableData);
  290. let cal_one = 0;
  291. let cal_two = 0;
  292. for (let i = 0; i < response.data.data.list.length; i++) {
  293. if (
  294. response.data.data.list[i].prescription == null ||
  295. response.data.data.list[i].prescription.length == 0
  296. ) {
  297. cal_one = cal_one + 1;
  298. }
  299. if (
  300. response.data.data.list[i].prescription != null &&
  301. response.data.data.list[i].prescription.length > 0
  302. ) {
  303. cal_two = cal_two + 1;
  304. }
  305. }
  306. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  307. // console.log(this.patientTableData[0])
  308. // this.choosePatient(this.patientTableData[0])
  309. this.cal_one = cal_one;
  310. this.cal_two = cal_two;
  311. }
  312. });
  313. },
  314. changePatient(row) {
  315. console.log("row", row);
  316. this.patient_id = row.patient_id;
  317. this.record_date = this.record_date;
  318. this.prescription_id = this.prescription_id;
  319. // var params = {
  320. // patient_id:row.patient_id,
  321. // record_date:this.record_date,
  322. // prescription_id:this.prescription_id,
  323. // }
  324. // getPrescriptionPrint(params).then(response=>{
  325. // if(response.data.state == 1){
  326. // var advicePrint = response.data.data.advicePrint
  327. // console.log("adviceprint",advicePrint)
  328. // this.advicePrint = advicePrint
  329. // // var hisPatient = response.data.data.hisPatient
  330. // // console.log("hispatient",hisPatient)
  331. // // this.hisPatient = hisPatient
  332. // var patient = response.data.data.patient
  333. // console.log("patient",patient)
  334. // this.patient = patient
  335. // var doctorPorject = response.data.data.doctorPorject
  336. // console.log("doctorporject",doctorPorject)
  337. // }
  338. // })
  339. },
  340. getTimes(time) {
  341. return uParseTime(time, "{y}-{m}-{d}");
  342. },
  343. searchAction() {},
  344. getInfo(order_id, obj) {
  345. // 模拟数据
  346. // let datainfo =
  347. // '{"code":0,"data":{"info":{"setl_time":"2022-04-22 08:32:58","cvlserv_pay":0,"year":"2022","med_type":"11","psn_pay":51.82,"opter_id":"孙欣欣","begndate":"2022-04-22","flxempe_flag":"0","hifmi_pay":0,"psn_no":"32090000000000001004696424","act_pay_dedc":0,"medins_setl_id":null,"acct_mulaid_pay":0,"clr_way":"1","oth_pay":0,"gend":"1","mdtrt_id":"32090000000100784946","acct_pay":0,"inscp_scp_amt":575.8,"insutype":"390","invono":null,"enddate":"2022-04-22","cash_payamt":51.82,"psn_type":"1501","fixmedins_name":"盐城响水悦达血液透析中心有限公司","hifp_pay":403.06,"new_flag":null,"overlmt_selfpay":0,"preselfpay_amt":0,"pay_loc":"2","clr_type":"11","refd_setl_flag":"0","cvlserv_flag":"0","emp_name":"合兴村委会","brdy":"1975-08-29","naty":"01","certno":"320921197508296752","dise_code":"M07800","fixmedins_code":"H32092103007","dedc_hosp_lv":"1","opter_name":"孙欣欣","balc":0,"fixmedins_poolarea":"320921","psn_cert_type":"01","hifob_pay":0,"medfee_sumamt":575.8,"hifes_pay":0,"fund_pay_sumamt":523.98,"opt_time":"2022-04-22 08:32:58","fulamt_ownpay_amt":0,"setl_id":"320900000000000000000087224401","maf_pay":120.92,"psn_name":"陆树新","insu_optins":null,"pref_fund_pay":null,"clr_optins":"320921","pool_prop_selfpay":0.7,"dise_name":"慢性肾功能衰竭","lmtpric_hosp_lv":"1","age":46,"dtrt_cert_type":"03","hosp_lv":"8"}}}';
  348. // var json = JSON.parse(datainfo);
  349. // console.log(json, "json");
  350. // this.info = json.data.info
  351. //
  352. if (obj.balance_accounts_type == 2) {
  353. let params = {
  354. his_patient_id: obj.his_patient_id,
  355. id: obj.order_id,
  356. order_id:obj.order_id,
  357. admin_user_id:this.$store.getters.xt_user.user.id,
  358. };
  359. if (
  360. this.org_id == 10138 ||
  361. this.$store.getters.xt_user.org_id == 4 ||
  362. this.org_id == 10278
  363. ) {
  364. getPrivateExpenses(params).then((response) => {
  365. if (response.data.state == 0) {
  366. // this.$message.error(response.data.msg)
  367. return false;
  368. } else {
  369. this.balanceAccounts = response.data.data;
  370. let arr = [];
  371. let obj = {
  372. type: 1,
  373. details: [],
  374. total: 0,
  375. };
  376. let obj2 = {
  377. type: 2,
  378. details: [],
  379. total: 0,
  380. };
  381. let obj3 = {
  382. type: 3,
  383. details: [],
  384. total: 0,
  385. };
  386. let num = 0;
  387. let obj4 = {
  388. type: 4,
  389. details: [],
  390. total: 0,
  391. };
  392. this.balanceAccounts.order_info.map((item) => {
  393. if (item.advice_id > 0) {
  394. obj.details.push(item);
  395. obj.total += item.pric * item.advice.prescribing_number;
  396. num++;
  397. } else {
  398. if (item.project.type == 2) {
  399. obj2.details.push(item);
  400. obj2.total += item.pric * item.project.count;
  401. num++;
  402. } else {
  403. obj3.details.push(item);
  404. obj3.total += item.pric * item.project.count;
  405. num++;
  406. }
  407. }
  408. });
  409. if (this.balanceAccounts.new_order_info != null) {
  410. this.balanceAccounts.new_order_info.map((item) => {
  411. obj2.total = obj2.total + item.Total;
  412. var newObj = {
  413. pric: parseFloat(item.Total),
  414. project: {
  415. count: 1,
  416. project: {
  417. project_name: item.Name,
  418. unit: "",
  419. },
  420. },
  421. };
  422. obj2.details.push(newObj);
  423. num++;
  424. });
  425. }
  426. this.balanceAccounts.new_detail_list = [];
  427. this.balanceAccounts.new_detail_list.push(obj);
  428. this.balanceAccounts.new_detail_list.push(obj2);
  429. this.balanceAccounts.new_detail_list.push(obj3);
  430. // this.balanceAccounts.new_detail_list.push(obj4)
  431. console.log(111, this.balanceAccounts);
  432. this.num = num;
  433. console.log("this.num", this.num);
  434. }
  435. });
  436. } else if (this.org_id == 10028) {
  437. getPrivateExpenses(params).then((response) => {
  438. if (response.data.state == 0) {
  439. // this.$message.error(response.data.msg)
  440. return false;
  441. } else {
  442. this.balanceAccounts = response.data.data;
  443. let obj = {
  444. type: 1,
  445. details: [],
  446. total: 0,
  447. };
  448. let obj2 = {
  449. type: 2,
  450. details: [],
  451. total: 0,
  452. };
  453. let obj3 = {
  454. type: 3,
  455. details: [],
  456. total: 0,
  457. };
  458. this.balanceAccounts.order_info.map((item) => {
  459. if (item.advice_id > 0) {
  460. obj.details.push(item);
  461. obj.total += item.pric * item.advice.prescribing_number;
  462. } else {
  463. if (item.project.type == 2) {
  464. obj2.details.push(item);
  465. obj2.total += item.pric * item.project.count;
  466. } else {
  467. obj3.details.push(item);
  468. obj3.total += item.pric * item.project.count;
  469. }
  470. }
  471. });
  472. this.balanceAccounts.new_detail_list = [];
  473. this.balanceAccounts.new_detail_list.push(obj);
  474. this.balanceAccounts.new_detail_list.push(obj2);
  475. this.balanceAccounts.new_detail_list.push(obj3);
  476. console.log(111, this.balanceAccounts);
  477. }
  478. });
  479. }else
  480. if (this.org_id == 10215 || this.org_id == 0) {
  481. getPrivateExpensesOrder(params).then((response) => {
  482. if (response.data.state == 0) {
  483. // this.$message.error(response.data.msg)
  484. return false;
  485. } else {
  486. var that = this
  487. that.info = response.data.data.info;
  488. that.p_admin = response.data.data.printor_admin;
  489. that.charge_admin = response.data.data.charge_admin;
  490. that.info["p_admin"] = that.p_admin;
  491. that.info["charge_admin"] = that.charge_admin;
  492. that.info["order_number"] = response.data.data.order_number;
  493. that.info["patient"] = response.data.data.patient;
  494. that.info["date"] = response.data.data.date;
  495. that.info["number"] = response.data.data.number;
  496. that.info["order_infos"] = response.data.data.order_infos;
  497. that.info["diagnosis"] = response.data.data.diagnosis;
  498. that.info["fixmedins_name"] = response.data.data.org_name;
  499. that.info["fixmedins_code"] = response.data.data.org_code;
  500. // that.info["doctor_code"] = response.data.data.doctor_code;
  501. // that.info["department"] = response.data.data.department;
  502. // that.info["health_card_no"] = response.data.data.health_card_no;
  503. that.info["bed_cost_total"] = response.data.data.bedCostTotal;
  504. that.info["bed_cost_self_total"] =
  505. response.data.data.bedCostSelfTotal;
  506. that.info["bed_cost_part_self_total"] =
  507. response.data.data.bedCostPartSelfTotal;
  508. that.info["operation_cost_total"] =
  509. response.data.data.operationCostTotal;
  510. that.info["operation_cost_self_total"] =
  511. response.data.data.operationCostSelfTotal;
  512. that.info["operation_cost_part_self_total"] =
  513. response.data.data.operationCostPartSelfTotal;
  514. that.info["other_cost_total"] = response.data.data.otherCostTotal;
  515. that.info["other_cost_self_total"] =
  516. response.data.data.otherCostSelfTotal;
  517. that.info["other_cost_part_self_total"] =
  518. response.data.data.otherCostPartSelfTotal;
  519. that.info["material_cost_total"] =
  520. response.data.data.materialCostTotal;
  521. that.info["material_cost_self_total"] =
  522. response.data.data.materialCostSelfTotal;
  523. that.info["material_cost_part_self_total"] =
  524. response.data.data.materialCostPartSelfTotal;
  525. that.info["western_medicine_cost_total"] =
  526. response.data.data.westernMedicineCostTotal;
  527. that.info["western_medicine_cost_self_total"] =
  528. response.data.data.westernMedicineCostSelfTotal;
  529. that.info["western_medicine_cost_part_self_total"] =
  530. response.data.data.westernMedicineCostPartSelfTotal;
  531. that.info["chinese_traditional_medicine_cost_total"] =
  532. response.data.data.chineseTraditionalMedicineCostTotal;
  533. that.info["chinese_traditional_medicine_cost_self_total"] =
  534. response.data.data.chineseTraditionalMedicineCostSelfTotal;
  535. that.info["chinese_traditional_medicine_cost_part_self_total"] =
  536. response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  537. that.info["check_cost_total"] = response.data.data.checkCostTotal;
  538. that.info["check_cost_self_total"] =
  539. response.data.data.checkCostSelfTotal;
  540. that.info["check_cost_part_self_total"] =
  541. response.data.data.checkCostPartSelfTotal;
  542. that.info["laboratory_cost_total"] =
  543. response.data.data.laboratoryCostTotal;
  544. that.info["laboratory_cost_self_total"] =
  545. response.data.data.laboratoryCostSelfTotal;
  546. that.info["laboratory_cost_part_self_total"] =
  547. response.data.data.laboratoryCostPartSelfTotal;
  548. that.info["treat_cost_total"] = response.data.data.treatCostTotal;
  549. that.info["treat_cost_self_total"] =
  550. response.data.data.treatCostSelfTotal;
  551. that.info["treat_cost_part_self_total"] =
  552. response.data.data.treatCostPartSelfTotal;
  553. that.info["date"] = response.data.data.date;
  554. // that.info["number"] = response.data.data.number;
  555. that.info["order_infos"] = response.data.data.order_infos;
  556. that.info["diagnosis"] = response.data.data.diagnosis;
  557. let obj = {
  558. type: 1,
  559. details: [],
  560. total: 0,
  561. };
  562. let obj2 = {
  563. type: 2,
  564. details: [],
  565. total: 0,
  566. };
  567. let obj3 = {
  568. type: 3,
  569. details: [],
  570. total: 0,
  571. };
  572. let obj4 = {
  573. type: 4,
  574. details: [],
  575. total: 0,
  576. };
  577. let num = 0;
  578. that.info.order_infos.map((item) => {
  579. if (item.advice_id > 0) {
  580. obj.details.push(item);
  581. obj.total += item.pric * item.advice.prescribing_number;
  582. num++;
  583. } else {
  584. if (item.project.type == 2) {
  585. obj2.details.push(item);
  586. obj2.total += item.pric * item.project.count;
  587. num++;
  588. } else {
  589. obj3.details.push(item);
  590. obj3.total += item.pric * item.project.count;
  591. num++;
  592. }
  593. }
  594. });
  595. // this.info.order_infos.map(item => {
  596. // obj4.total = item.Total
  597. // obj4.details.push(item)
  598. // num++
  599. //
  600. // })
  601. that.info.new_detail_list = [];
  602. that.info.new_detail_list.push(obj);
  603. that.info.new_detail_list.push(obj2);
  604. that.info.new_detail_list.push(obj3);
  605. // that.info.new_detail_list.push(obj4)
  606. that.num = num;
  607. if (that.paramsObj.settle_type != 1) {
  608. that.info.begndate = that.getTimes(that.paramsObj.start_time);
  609. that.info.enddate = that.getTimes(that.paramsObj.end_time);
  610. }
  611. }
  612. });
  613. }
  614. } else {
  615. var that = this;
  616. axios
  617. .get("http://127.0.0.1:9532/api/settle/query", {
  618. params: {
  619. order_id: order_id,
  620. admin_user_id: this.$store.getters.xt_user.user.id,
  621. },
  622. })
  623. .then(function (response) {
  624. if (response.data.state == 0) {
  625. this.$message.error(response.data.msg);
  626. return false;
  627. } else {
  628. console.log(response.data.data.info);
  629. that.info = response.data.data.info;
  630. that.p_admin = response.data.data.printor_admin;
  631. that.charge_admin = response.data.data.charge_admin;
  632. that.info["p_admin"] = that.p_admin;
  633. that.info["charge_admin"] = that.charge_admin;
  634. that.info["order_number"] = response.data.data.order_number;
  635. that.info["patient"] = response.data.data.patient;
  636. that.info["date"] = response.data.data.date;
  637. that.info["number"] = response.data.data.number;
  638. that.info["order_infos"] = response.data.data.order_infos;
  639. that.info["diagnosis"] = response.data.data.diagnosis;
  640. that.info["org_code"] = response.data.data.org_code;
  641. that.info["org_name"] = response.data.data.org_name;
  642. that.info["doctor_code"] = response.data.data.doctor_code;
  643. that.info["department"] = response.data.data.department;
  644. that.info["health_card_no"] = response.data.data.health_card_no;
  645. that.info["bed_cost_total"] = response.data.data.bedCostTotal;
  646. that.info["bed_cost_self_total"] =
  647. response.data.data.bedCostSelfTotal;
  648. that.info["bed_cost_part_self_total"] =
  649. response.data.data.bedCostPartSelfTotal;
  650. that.info["operation_cost_total"] =
  651. response.data.data.operationCostTotal;
  652. that.info["operation_cost_self_total"] =
  653. response.data.data.operationCostSelfTotal;
  654. that.info["operation_cost_part_self_total"] =
  655. response.data.data.operationCostPartSelfTotal;
  656. that.info["other_cost_total"] = response.data.data.otherCostTotal;
  657. that.info["other_cost_self_total"] =
  658. response.data.data.otherCostSelfTotal;
  659. that.info["other_cost_part_self_total"] =
  660. response.data.data.otherCostPartSelfTotal;
  661. that.info["material_cost_total"] =
  662. response.data.data.materialCostTotal;
  663. that.info["material_cost_self_total"] =
  664. response.data.data.materialCostSelfTotal;
  665. that.info["material_cost_part_self_total"] =
  666. response.data.data.materialCostPartSelfTotal;
  667. that.info["western_medicine_cost_total"] =
  668. response.data.data.westernMedicineCostTotal;
  669. that.info["western_medicine_cost_self_total"] =
  670. response.data.data.westernMedicineCostSelfTotal;
  671. that.info["western_medicine_cost_part_self_total"] =
  672. response.data.data.westernMedicineCostPartSelfTotal;
  673. that.info["chinese_traditional_medicine_cost_total"] =
  674. response.data.data.chineseTraditionalMedicineCostTotal;
  675. that.info["chinese_traditional_medicine_cost_self_total"] =
  676. response.data.data.chineseTraditionalMedicineCostSelfTotal;
  677. that.info["chinese_traditional_medicine_cost_part_self_total"] =
  678. response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  679. that.info["check_cost_total"] = response.data.data.checkCostTotal;
  680. that.info["check_cost_self_total"] =
  681. response.data.data.checkCostSelfTotal;
  682. that.info["check_cost_part_self_total"] =
  683. response.data.data.checkCostPartSelfTotal;
  684. that.info["laboratory_cost_total"] =
  685. response.data.data.laboratoryCostTotal;
  686. that.info["laboratory_cost_self_total"] =
  687. response.data.data.laboratoryCostSelfTotal;
  688. that.info["laboratory_cost_part_self_total"] =
  689. response.data.data.laboratoryCostPartSelfTotal;
  690. that.info["treat_cost_total"] = response.data.data.treatCostTotal;
  691. that.info["treat_cost_self_total"] =
  692. response.data.data.treatCostSelfTotal;
  693. that.info["treat_cost_part_self_total"] =
  694. response.data.data.treatCostPartSelfTotal;
  695. that.info["date"] = response.data.data.date;
  696. that.info["number"] = response.data.data.number;
  697. that.info["order_infos"] = response.data.data.order_infos;
  698. that.info["diagnosis"] = response.data.data.diagnosis;
  699. let obj = {
  700. type: 1,
  701. details: [],
  702. total: 0,
  703. };
  704. let obj2 = {
  705. type: 2,
  706. details: [],
  707. total: 0,
  708. };
  709. let obj3 = {
  710. type: 3,
  711. details: [],
  712. total: 0,
  713. };
  714. let obj4 = {
  715. type: 4,
  716. details: [],
  717. total: 0,
  718. };
  719. let num = 0;
  720. that.info.order_infos.map((item) => {
  721. if (item.advice_id > 0) {
  722. obj.details.push(item);
  723. obj.total += item.pric * item.advice.prescribing_number;
  724. num++;
  725. } else {
  726. if (item.project.type == 2) {
  727. obj2.details.push(item);
  728. obj2.total += item.pric * item.project.count;
  729. num++;
  730. } else {
  731. obj3.details.push(item);
  732. obj3.total += item.pric * item.project.count;
  733. num++;
  734. }
  735. }
  736. });
  737. // this.info.order_infos.map(item => {
  738. // obj4.total = item.Total
  739. // obj4.details.push(item)
  740. // num++
  741. //
  742. // })
  743. that.info.new_detail_list = [];
  744. that.info.new_detail_list.push(obj);
  745. that.info.new_detail_list.push(obj2);
  746. that.info.new_detail_list.push(obj3);
  747. // that.info.new_detail_list.push(obj4)
  748. that.num = num;
  749. if (that.paramsObj.settle_type != 1) {
  750. that.info.begndate = that.getTimes(that.paramsObj.start_time);
  751. that.info.enddate = that.getTimes(that.paramsObj.end_time);
  752. }
  753. }
  754. })
  755. .catch(function (error) {});
  756. }
  757. },
  758. },
  759. created() {
  760. console.log(this.paramsObj);
  761. this.getInfo(this.paramsObj.order_id, this.paramsObj);
  762. this.org_id = this.$store.getters.xt_user.org_id;
  763. console.log("this.org_id", this.org_id);
  764. },
  765. watch: {
  766. paramsObj: {
  767. //深度监听,可监听到对象、数组的变化
  768. handler(val, oldVal) {
  769. this.paramsObj = val;
  770. console.log(this.paramsObj);
  771. this.getInfo(this.paramsObj.order_id, this.paramsObj);
  772. },
  773. deep: true,
  774. immediate: true,
  775. },
  776. },
  777. };
  778. </script>
  779. <style>
  780. .dialysis-print-order {
  781. width: 960px;
  782. margin: 0 auto;
  783. }
  784. .dialysis-print-order .order-yy-name {
  785. margin: auto;
  786. text-align: center;
  787. font-size: 20px;
  788. letter-spacing: 5px;
  789. }
  790. .dialysis-print-order .order-title {
  791. margin: auto;
  792. font-weight: 600;
  793. text-align: center;
  794. font-size: 22px;
  795. padding: 10px;
  796. }
  797. .dialysis-print-order .table-box {
  798. width: 100%;
  799. line-height: 23px;
  800. font-size: 14px;
  801. }
  802. .dialysis-print-order .print-table {
  803. width: 100%;
  804. text-align: center;
  805. border-collapse: collapse;
  806. line-height: 40px;
  807. font-size: 14px;
  808. border-color: #000;
  809. }
  810. .dialysis-print-order .print-table-no {
  811. width: 100%;
  812. text-align: center;
  813. border-collapse: collapse;
  814. font-size: 14px;
  815. }
  816. .dialysis-print-order .under-line {
  817. border-bottom: 1px solid #999;
  818. width: 95%;
  819. text-align: center;
  820. margin-left: 2px;
  821. }
  822. .dialysis-print-order .title-box {
  823. text-align: center;
  824. font-size: 16px;
  825. }
  826. .dialysis-print-order .radio-lebel-box {
  827. font-weight: 400;
  828. cursor: pointer;
  829. }
  830. .dialysis-print-order .radio-no {
  831. opacity: 0;
  832. outline: none;
  833. position: absolute;
  834. margin: 0;
  835. width: 0;
  836. height: 0;
  837. z-index: -1;
  838. }
  839. .dialysis-print-order .radio-inner {
  840. white-space: nowrap;
  841. cursor: pointer;
  842. outline: none;
  843. display: inline-block;
  844. line-height: 1;
  845. position: relative;
  846. vertical-align: middle;
  847. }
  848. .dialysis-print-order .radio-fang {
  849. display: inline-block;
  850. position: relative;
  851. border: 1px solid #000;
  852. box-sizing: border-box;
  853. width: 14px;
  854. height: 14px;
  855. background-color: #fff;
  856. z-index: 1;
  857. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  858. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  859. }
  860. .dialysis-print-order .is-checked-radio::after {
  861. content: "√";
  862. font-size: 15px;
  863. }
  864. .dialysis-print-order .print-table-no tr td {
  865. padding: 8px 5px;
  866. line-height: 25px;
  867. }
  868. .dialysis-print-order .print-table tr td {
  869. padding: 1px 1px;
  870. /*line-height: 25px;*/
  871. }
  872. .es-img {
  873. height: 30px;
  874. }
  875. .advice-name {
  876. text-align: left;
  877. }
  878. .advice-children {
  879. display: flex;
  880. }
  881. .title-box-pro {
  882. border: 0 #fff;
  883. line-height: 25px;
  884. height: 25px;
  885. text-align: left;
  886. padding-left: 10px !important;
  887. }
  888. .title-box-pro-tr {
  889. border: 0 #fff;
  890. }
  891. .text-align-left {
  892. text-align: left !important;
  893. padding-left: 10px !important;
  894. font-size: 14px !important;
  895. line-height: 25px;
  896. }
  897. .print-table-tr-new td {
  898. line-height: 20px !important;
  899. }
  900. .border-top-solid {
  901. border: solid 1px #000;
  902. }
  903. .print-template-two tr {
  904. line-height: 30px;
  905. }
  906. .table-box1 {
  907. border: 1px solid #000;
  908. width: 100%;
  909. line-height: 30px;
  910. font-size: 14px;
  911. border-collapse: collapse;
  912. }
  913. .table-box1 tr {
  914. border-bottom: 1px solid #000;
  915. }
  916. </style>
  917. <style lang="scss">
  918. .newContainer {
  919. .dialysisPage::-webkit-scrollbar {
  920. height: 15px;
  921. }
  922. .el-date-editor {
  923. .el-input__inner {
  924. padding-right: 0px;
  925. }
  926. }
  927. .el-table td,
  928. .el-table th {
  929. text-align: center;
  930. }
  931. }
  932. .newContainer::-webkit-scrollbar {
  933. height: 15px !important;
  934. }
  935. </style>