statementPrint.vue 60KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. <template>
  2. <!-- 打印 -->
  3. <div>
  4. <template>
  5. <el-button
  6. style="position: fixed; right: 25px; z-index: 999"
  7. :loading="loading"
  8. size="small"
  9. icon="el-icon-printer"
  10. @click="printThisPage"
  11. type="primary"
  12. >打印
  13. </el-button
  14. >
  15. </template>
  16. <div class="dialysisPage" style="padding-top: 40px">
  17. <div
  18. v-if="
  19. org_id == 9990 ||
  20. org_id == 10138 ||
  21. org_id == 9504 ||
  22. org_id == 10028 ||
  23. org_id == 4 ||
  24. org_id == 10278
  25. "
  26. >
  27. <printTwo :info="info" v-if="org_id == 9990"></printTwo>
  28. <printThree
  29. :info="info"
  30. :paramsObj="paramsObj"
  31. :balanceAccounts="balanceAccounts"
  32. v-if="org_id == 10138 || org_id == 4 || org_id == 10278"
  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. <!-- <printFive-->
  45. <!-- v-if="org_id == 10191"-->
  46. <!-- :info="info"-->
  47. <!-- :paramsObj="paramsObj"-->
  48. <!-- :balanceAccounts="balanceAccounts"-->
  49. <!-- ></printFive>-->
  50. <printSeven
  51. v-if="org_id == 10387"
  52. :info="info"
  53. :paramsObj="paramsObj"
  54. :balanceAccounts="balanceAccounts"
  55. >
  56. </printSeven>
  57. <print10191 :info="info" v-if="org_id == 10191"></print10191>
  58. <printTen :info="info" v-if="org_id == 10210"></printTen>
  59. <printOne :info="info" v-if=" org_id != 9990 &&
  60. org_id != 10138 &&
  61. org_id != 9504 &&
  62. org_id != 10028 &&
  63. org_id != 4 &&
  64. org_id != 10278 && org_id != 10387 && org_id != 0 && org_id != 10191 &&org_id != 10210"></printOne>
  65. </div>
  66. </div>
  67. </template>
  68. <script>
  69. import {uParseTime} from "@/utils/tools";
  70. import axios from "axios";
  71. import print from "print-js";
  72. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  73. import printOne from "./statementTemplate/printOne";
  74. import privateChargePrint from "./statementTemplate/privateChargePrint";
  75. import printTwo from "./statementTemplate/printTwo";
  76. import printThree from "./statementTemplate/printThree";
  77. import printFour from "./statementTemplate/printFour";
  78. import printFive from "./statementTemplate/printFive";
  79. import testVue from "./statementTemplate/test";
  80. import {getAllDoctorList, getAllHisPatientList,} from "@/api/project/project";
  81. import {getPrivateExpenses, getPrivateExpensesOrder,getPrivateExpensesTwo} from "@/api/his/his";
  82. import printSeven from "./statementTemplate/printSeven";
  83. import Print10191 from "./statementTemplate/print10191";
  84. import printTen from "./statementTemplate/printTen";
  85. // import PrintOther from '../hospitalStation/statementTemplate/printOther'
  86. export default {
  87. name: "dialysisPrintOrder",
  88. components: {
  89. Print10191,
  90. printSeven,
  91. BreadCrumb,
  92. printOne,
  93. privateChargePrint,
  94. printTwo,
  95. printThree,
  96. printFour,
  97. testVue,
  98. printFive,
  99. printTen
  100. },
  101. props: {
  102. paramsObj: Object,
  103. },
  104. data() {
  105. return {
  106. crumbs: [
  107. {path: false, name: "门诊医生站"},
  108. {path: false, name: "打印"},
  109. ],
  110. record_date: "",
  111. patientTableData: [],
  112. advicePrint: [],
  113. hisPatient: {},
  114. patient: {},
  115. search_input: "",
  116. loading: false,
  117. patient_id: 0,
  118. prescription_id: 0,
  119. ids: "",
  120. info: null,
  121. org_id: "",
  122. balanceAccounts: {},
  123. };
  124. },
  125. methods: {
  126. printThisPage() {
  127. var ptime = Math.round(new Date().getTime() / 1000);
  128. this.print_time = uParseTime(ptime, "{y}-{m}-{d} {h}:{i}");
  129. if (
  130. this.$store.getters.xt_user.org_id == 10138 ||
  131. this.$store.getters.xt_user.org_id == 4 ||
  132. this.$store.getters.xt_user.org_id == 10278
  133. ) {
  134. setTimeout(() => {
  135. const style =
  136. "@media print {#statement-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%;}}}";
  137. const style2 =
  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: 50%;}}}";
  139. const style3 =
  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: 55%;}}}";
  141. const style4 =
  142. "@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%;}}}";
  143. const style5 =
  144. "@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%;}}}";
  145. const style6 =
  146. "@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%;}}}";
  147. const style7 =
  148. "@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%;}}}";
  149. const style8 =
  150. "@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%;}}}";
  151. const style9 =
  152. "@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%;}}}";
  153. const style10 =
  154. "@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%;}}}";
  155. const style11 =
  156. "@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%;}}}";
  157. const style12 =
  158. "@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%;}}}";
  159. if (this.num >= 13) {
  160. printJS({
  161. printable: "prescription-print",
  162. type: "html",
  163. style: style,
  164. scanStyles: false,
  165. });
  166. } else if (this.num == 12) {
  167. printJS({
  168. printable: "prescription-print",
  169. type: "html",
  170. style: style2,
  171. scanStyles: false,
  172. });
  173. } else if (this.num == 11) {
  174. printJS({
  175. printable: "prescription-print",
  176. type: "html",
  177. style: style3,
  178. scanStyles: false,
  179. });
  180. } else if (this.num == 10) {
  181. printJS({
  182. printable: "prescription-print",
  183. type: "html",
  184. style: style4,
  185. scanStyles: false,
  186. });
  187. } else if (this.num == 9) {
  188. printJS({
  189. printable: "prescription-print",
  190. type: "html",
  191. style: style5,
  192. scanStyles: false,
  193. });
  194. } else if (this.num == 8) {
  195. printJS({
  196. printable: "prescription-print",
  197. type: "html",
  198. style: style6,
  199. scanStyles: false,
  200. });
  201. } else if (this.num == 7) {
  202. printJS({
  203. printable: "prescription-print",
  204. type: "html",
  205. style: style7,
  206. scanStyles: false,
  207. });
  208. } else if (this.num == 6) {
  209. printJS({
  210. printable: "prescription-print",
  211. type: "html",
  212. style: style8,
  213. scanStyles: false,
  214. });
  215. } else if (this.num == 5) {
  216. printJS({
  217. printable: "prescription-print",
  218. type: "html",
  219. style: style9,
  220. scanStyles: false,
  221. });
  222. } else if (this.num == 4) {
  223. printJS({
  224. printable: "prescription-print",
  225. type: "html",
  226. style: style10,
  227. scanStyles: false,
  228. });
  229. } else if (this.num == 3) {
  230. printJS({
  231. printable: "prescription-print",
  232. type: "html",
  233. style: style11,
  234. scanStyles: false,
  235. });
  236. } else if (this.num <= 2) {
  237. printJS({
  238. printable: "prescription-print",
  239. type: "html",
  240. style: style12,
  241. scanStyles: false,
  242. });
  243. }
  244. }, 500);
  245. } else if (
  246. this.$store.getters.xt_user.org_id == 9504 ||
  247. this.$store.getters.xt_user.org_id == 10028
  248. ) {
  249. const style =
  250. "@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;}}";
  251. printJS({
  252. printable: "prescription-print",
  253. type: "html",
  254. style: style,
  255. scanStyles: false,
  256. });
  257. } else {
  258. // 医保环境打印格式
  259. if (
  260. this.$store.getters.xt_user.org_id == 9919 ||
  261. this.$store.getters.xt_user.org_id == 10106
  262. ) {
  263. const style =
  264. "@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;}}";
  265. printJS({
  266. printable: "statement-print",
  267. type: "html",
  268. style: style,
  269. scanStyles: false,
  270. });
  271. } else if (
  272. this.$store.getters.xt_user.org_id == 0 ||
  273. this.$store.getters.xt_user.org_id == 10191
  274. ) {
  275. const style =
  276. "@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%;}}}";
  277. printJS({
  278. printable: "statement-print",
  279. type: "html",
  280. style: style,
  281. scanStyles: false,
  282. });
  283. // const style =
  284. // "@media print {.statementTable{width: 100%;text-align: center;border-collapse: collapse;line-height: 40px;font-size: 14px;border-color: #000;} .statementTable thead{font-size: 28px;text-align: center;font-weight: bold;margin-bottom: 10px;} .statementTable tbody{text-align:left;} .statementTable tbody .view_tr{text-align:center;border: 1px solid;} tbody .dashed_tr{border: 1px dashed;text-align:center} .list_table{width: 100%;margin-bottom: 100px;} tbody tr td div{height:25px;}}";
  285. // printJS({
  286. // printable: "statement-print",
  287. // type: "html",
  288. // style: style,
  289. // scanStyles: false,
  290. // });
  291. } else {
  292. const style =
  293. "@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%;}}}";
  294. printJS({
  295. printable: "statement-print",
  296. type: "html",
  297. style: style,
  298. scanStyles: false,
  299. });
  300. }
  301. }
  302. // if (this.org_template_info.template_id == 1) {
  303. // printJS({
  304. // printable: "dialysis-print-box",
  305. // type: "html",
  306. // style: style,
  307. // scanStyles: false
  308. // });
  309. // }
  310. },
  311. getAllDoctorList() {
  312. getAllDoctorList().then((response) => {
  313. if (response.data.state == 1) {
  314. var doctor = response.data.data.doctor;
  315. this.doctorList = doctor;
  316. }
  317. });
  318. },
  319. getAllHisPatientList() {
  320. const params = {
  321. record_date: this.record_date,
  322. };
  323. getAllHisPatientList(params).then((response) => {
  324. if (response.data.state == 1) {
  325. this.patientTableData = response.data.data.list;
  326. this.patientTableDataTwo = response.data.data.list;
  327. console.log("222", this.patientTableData);
  328. let cal_one = 0;
  329. let cal_two = 0;
  330. for (let i = 0; i < response.data.data.list.length; i++) {
  331. if (
  332. response.data.data.list[i].prescription == null ||
  333. response.data.data.list[i].prescription.length == 0
  334. ) {
  335. cal_one = cal_one + 1;
  336. }
  337. if (
  338. response.data.data.list[i].prescription != null &&
  339. response.data.data.list[i].prescription.length > 0
  340. ) {
  341. cal_two = cal_two + 1;
  342. }
  343. }
  344. // this.$refs.tab.setCurrentRow(this.patientTableData[0])
  345. // console.log(this.patientTableData[0])
  346. // this.choosePatient(this.patientTableData[0])
  347. this.cal_one = cal_one;
  348. this.cal_two = cal_two;
  349. }
  350. });
  351. },
  352. changePatient(row) {
  353. console.log("row", row);
  354. this.patient_id = row.patient_id;
  355. this.record_date = this.record_date;
  356. this.prescription_id = this.prescription_id;
  357. // var params = {
  358. // patient_id:row.patient_id,
  359. // record_date:this.record_date,
  360. // prescription_id:this.prescription_id,
  361. // }
  362. // getPrescriptionPrint(params).then(response=>{
  363. // if(response.data.state == 1){
  364. // var advicePrint = response.data.data.advicePrint
  365. // console.log("adviceprint",advicePrint)
  366. // this.advicePrint = advicePrint
  367. // // var hisPatient = response.data.data.hisPatient
  368. // // console.log("hispatient",hisPatient)
  369. // // this.hisPatient = hisPatient
  370. // var patient = response.data.data.patient
  371. // console.log("patient",patient)
  372. // this.patient = patient
  373. // var doctorPorject = response.data.data.doctorPorject
  374. // console.log("doctorporject",doctorPorject)
  375. // }
  376. // })
  377. },
  378. getTimes(time) {
  379. return uParseTime(time, "{y}-{m}-{d}");
  380. },
  381. searchAction() {
  382. },
  383. getInfo(order_id, obj) {
  384. if (obj.balance_accounts_type == 2 ) {
  385. let params = {
  386. his_patient_id: obj.his_patient_id,
  387. id: obj.order_id,
  388. order_id: obj.order_id,
  389. admin_user_id: this.$store.getters.xt_user.user.id,
  390. };
  391. if (
  392. this.org_id == 10138 ||
  393. this.$store.getters.xt_user.org_id == 4 ||
  394. this.org_id == 10278
  395. ) {
  396. getPrivateExpenses(params).then((response) => {
  397. if (response.data.state == 0) {
  398. // this.$message.error(response.data.msg)
  399. return false;
  400. } else {
  401. this.balanceAccounts = response.data.data;
  402. let arr = [];
  403. let obj = {
  404. type: 1,
  405. details: [],
  406. total: 0,
  407. };
  408. let obj2 = {
  409. type: 2,
  410. details: [],
  411. total: 0,
  412. };
  413. let obj3 = {
  414. type: 3,
  415. details: [],
  416. total: 0,
  417. };
  418. let num = 0;
  419. let obj4 = {
  420. type: 4,
  421. details: [],
  422. total: 0,
  423. };
  424. this.balanceAccounts.order_info.map((item) => {
  425. if (item.advice_id > 0) {
  426. obj.details.push(item);
  427. obj.total += item.pric.toFixed(2) * item.advice.prescribing_number
  428. num++;
  429. } else {
  430. if (item.project.type == 2) {
  431. obj2.details.push(item);
  432. obj2.total += item.pric * item.project.count;
  433. num++;
  434. } else {
  435. obj3.details.push(item);
  436. obj3.total += item.pric * item.project.count;
  437. num++;
  438. }
  439. }
  440. });
  441. if (this.balanceAccounts.new_order_info != null) {
  442. this.balanceAccounts.new_order_info.map((item) => {
  443. obj2.total = obj2.total + item.Total;
  444. var newObj = {
  445. pric: parseFloat(item.Total),
  446. project: {
  447. count: 1,
  448. project: {
  449. project_name: item.Name,
  450. unit: "",
  451. },
  452. },
  453. };
  454. obj2.details.push(newObj);
  455. num++;
  456. });
  457. }
  458. this.balanceAccounts.new_detail_list = [];
  459. this.balanceAccounts.new_detail_list.push(obj);
  460. this.balanceAccounts.new_detail_list.push(obj2);
  461. this.balanceAccounts.new_detail_list.push(obj3);
  462. // this.balanceAccounts.new_detail_list.push(obj4)
  463. console.log(111, this.balanceAccounts);
  464. this.num = num;
  465. console.log("this.num", this.num);
  466. }
  467. });
  468. } else if (this.org_id == 10028) {
  469. getPrivateExpenses(params).then((response) => {
  470. if (response.data.state == 0) {
  471. // this.$message.error(response.data.msg)
  472. return false;
  473. } else {
  474. this.balanceAccounts = response.data.data;
  475. let obj = {
  476. type: 1,
  477. details: [],
  478. total: 0,
  479. };
  480. let obj2 = {
  481. type: 2,
  482. details: [],
  483. total: 0,
  484. };
  485. let obj3 = {
  486. type: 3,
  487. details: [],
  488. total: 0,
  489. };
  490. this.balanceAccounts.order_info.map((item) => {
  491. if (item.advice_id > 0) {
  492. obj.details.push(item);
  493. obj.total += item.pric * item.advice.prescribing_number;
  494. } else {
  495. if (item.project.type == 2) {
  496. obj2.details.push(item);
  497. obj2.total += item.pric * item.project.count;
  498. } else {
  499. obj3.details.push(item);
  500. obj3.total += item.pric * item.project.count;
  501. }
  502. }
  503. });
  504. this.balanceAccounts.new_detail_list = [];
  505. this.balanceAccounts.new_detail_list.push(obj);
  506. this.balanceAccounts.new_detail_list.push(obj2);
  507. this.balanceAccounts.new_detail_list.push(obj3);
  508. console.log(111, this.balanceAccounts);
  509. }
  510. });
  511. } else if (this.org_id == 10215 ) {
  512. getPrivateExpensesOrder(params).then((response) => {
  513. if (response.data.state == 0) {
  514. // this.$message.error(response.data.msg)
  515. return false;
  516. } else {
  517. var that = this;
  518. that.info = response.data.data.info;
  519. that.p_admin = response.data.data.printor_admin;
  520. that.charge_admin = response.data.data.charge_admin;
  521. that.info["p_admin"] = that.p_admin;
  522. that.info["charge_admin"] = that.charge_admin;
  523. that.info["order_number"] = response.data.data.order_number;
  524. that.info["patient"] = response.data.data.patient;
  525. that.info["date"] = response.data.data.date;
  526. that.info["number"] = response.data.data.number;
  527. that.info["order_infos"] = response.data.data.order_infos;
  528. that.info["diagnosis"] = response.data.data.diagnosis;
  529. that.info["fixmedins_name"] = response.data.data.org_name;
  530. that.info["fixmedins_code"] = response.data.data.org_code;
  531. // that.info["doctor_code"] = response.data.data.doctor_code;
  532. // that.info["department"] = response.data.data.department;
  533. // that.info["health_card_no"] = response.data.data.health_card_no;
  534. that.info["bed_cost_total"] = response.data.data.bedCostTotal;
  535. that.info["bed_cost_self_total"] =
  536. response.data.data.bedCostSelfTotal;
  537. that.info["bed_cost_part_self_total"] =
  538. response.data.data.bedCostPartSelfTotal;
  539. that.info["operation_cost_total"] =
  540. response.data.data.operationCostTotal;
  541. that.info["operation_cost_self_total"] =
  542. response.data.data.operationCostSelfTotal;
  543. that.info["operation_cost_part_self_total"] =
  544. response.data.data.operationCostPartSelfTotal;
  545. that.info["other_cost_total"] = response.data.data.otherCostTotal;
  546. that.info["other_cost_self_total"] =
  547. response.data.data.otherCostSelfTotal;
  548. that.info["other_cost_part_self_total"] =
  549. response.data.data.otherCostPartSelfTotal;
  550. that.info["material_cost_total"] =
  551. response.data.data.materialCostTotal;
  552. that.info["material_cost_self_total"] =
  553. response.data.data.materialCostSelfTotal;
  554. that.info["material_cost_part_self_total"] =
  555. response.data.data.materialCostPartSelfTotal;
  556. that.info["western_medicine_cost_total"] =
  557. response.data.data.westernMedicineCostTotal;
  558. that.info["western_medicine_cost_self_total"] =
  559. response.data.data.westernMedicineCostSelfTotal;
  560. that.info["western_medicine_cost_part_self_total"] =
  561. response.data.data.westernMedicineCostPartSelfTotal;
  562. that.info["chinese_traditional_medicine_cost_total"] =
  563. response.data.data.chineseTraditionalMedicineCostTotal;
  564. that.info["chinese_traditional_medicine_cost_self_total"] =
  565. response.data.data.chineseTraditionalMedicineCostSelfTotal;
  566. that.info["chinese_traditional_medicine_cost_part_self_total"] =
  567. response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  568. that.info["check_cost_total"] = response.data.data.checkCostTotal;
  569. that.info["check_cost_self_total"] =
  570. response.data.data.checkCostSelfTotal;
  571. that.info["check_cost_part_self_total"] =
  572. response.data.data.checkCostPartSelfTotal;
  573. that.info["laboratory_cost_total"] =
  574. response.data.data.laboratoryCostTotal;
  575. that.info["laboratory_cost_self_total"] =
  576. response.data.data.laboratoryCostSelfTotal;
  577. that.info["laboratory_cost_part_self_total"] =
  578. response.data.data.laboratoryCostPartSelfTotal;
  579. that.info["treat_cost_total"] = response.data.data.treatCostTotal;
  580. that.info["treat_cost_self_total"] =
  581. response.data.data.treatCostSelfTotal;
  582. that.info["treat_cost_part_self_total"] =
  583. response.data.data.treatCostPartSelfTotal;
  584. that.info["date"] = response.data.data.date;
  585. // that.info["number"] = response.data.data.number;
  586. that.info["order_infos"] = response.data.data.order_infos;
  587. that.info["diagnosis"] = response.data.data.diagnosis;
  588. let obj = {
  589. type: 1,
  590. details: [],
  591. total: 0,
  592. };
  593. let obj2 = {
  594. type: 2,
  595. details: [],
  596. total: 0,
  597. };
  598. let obj3 = {
  599. type: 3,
  600. details: [],
  601. total: 0,
  602. };
  603. let obj4 = {
  604. type: 4,
  605. details: [],
  606. total: 0,
  607. };
  608. let num = 0;
  609. that.info.order_infos.map((item) => {
  610. if (item.advice_id > 0) {
  611. obj.details.push(item);
  612. obj.total += item.pric * item.advice.prescribing_number;
  613. num++;
  614. } else {
  615. if (item.project.type == 2) {
  616. obj2.details.push(item);
  617. obj2.total += item.pric * item.project.count;
  618. num++;
  619. } else {
  620. obj3.details.push(item);
  621. obj3.total += item.pric * item.project.count;
  622. num++;
  623. }
  624. }
  625. });
  626. // this.info.order_infos.map(item => {
  627. // obj4.total = item.Total
  628. // obj4.details.push(item)
  629. // num++
  630. //
  631. // })
  632. that.info.new_detail_list = [];
  633. that.info.new_detail_list.push(obj);
  634. that.info.new_detail_list.push(obj2);
  635. that.info.new_detail_list.push(obj3);
  636. // that.info.new_detail_list.push(obj4)
  637. that.num = num;
  638. if (that.paramsObj.settle_type != 1) {
  639. that.info.begndate = that.getTimes(that.paramsObj.start_time);
  640. that.info.enddate = that.getTimes(that.paramsObj.end_time);
  641. }
  642. that.info.order_infos.map((item) => {
  643. });
  644. }
  645. });
  646. }
  647. // else if (this.org_id == 0) {
  648. //
  649. // getPrivateExpensesOrder(params).then((response) => {
  650. // if (response.data.state == 0) {
  651. // // this.$message.error(response.data.msg)
  652. //
  653. // return false;
  654. // } else {
  655. // var that = this;
  656. // that.info = response.data.data.info;
  657. // that.p_admin = response.data.data.printor_admin;
  658. // that.charge_admin = response.data.data.charge_admin;
  659. //
  660. // that.info["p_admin"] = that.p_admin;
  661. // that.info["charge_admin"] = that.charge_admin;
  662. // that.info["order_number"] = response.data.data.order_number;
  663. // that.info["patient"] = response.data.data.patient;
  664. // that.info["date"] = response.data.data.date;
  665. // that.info["number"] = response.data.data.number;
  666. // that.info["order_infos"] = response.data.data.order_infos;
  667. // that.info["diagnosis"] = response.data.data.diagnosis;
  668. // that.info["fixmedins_name"] = response.data.data.org_name;
  669. // that.info["fixmedins_code"] = response.data.data.org_code;
  670. // // that.info["doctor_code"] = response.data.data.doctor_code;
  671. // // that.info["department"] = response.data.data.department;
  672. // // that.info["health_card_no"] = response.data.data.health_card_no;
  673. //
  674. // that.info["bed_cost_total"] = response.data.data.bedCostTotal;
  675. // that.info["bed_cost_self_total"] =
  676. // response.data.data.bedCostSelfTotal;
  677. // that.info["bed_cost_part_self_total"] =
  678. // response.data.data.bedCostPartSelfTotal;
  679. //
  680. // that.info["operation_cost_total"] =
  681. // response.data.data.operationCostTotal;
  682. // that.info["operation_cost_self_total"] =
  683. // response.data.data.operationCostSelfTotal;
  684. // that.info["operation_cost_part_self_total"] =
  685. // response.data.data.operationCostPartSelfTotal;
  686. //
  687. // that.info["other_cost_total"] = response.data.data.otherCostTotal;
  688. // that.info["other_cost_self_total"] =
  689. // response.data.data.otherCostSelfTotal;
  690. // that.info["other_cost_part_self_total"] =
  691. // response.data.data.otherCostPartSelfTotal;
  692. //
  693. // that.info["material_cost_total"] =
  694. // response.data.data.materialCostTotal;
  695. // that.info["material_cost_self_total"] =
  696. // response.data.data.materialCostSelfTotal;
  697. // that.info["material_cost_part_self_total"] =
  698. // response.data.data.materialCostPartSelfTotal;
  699. //
  700. // that.info["western_medicine_cost_total"] =
  701. // response.data.data.westernMedicineCostTotal;
  702. // that.info["western_medicine_cost_self_total"] =
  703. // response.data.data.westernMedicineCostSelfTotal;
  704. // that.info["western_medicine_cost_part_self_total"] =
  705. // response.data.data.westernMedicineCostPartSelfTotal;
  706. //
  707. // that.info["chinese_traditional_medicine_cost_total"] =
  708. // response.data.data.chineseTraditionalMedicineCostTotal;
  709. // that.info["chinese_traditional_medicine_cost_self_total"] =
  710. // response.data.data.chineseTraditionalMedicineCostSelfTotal;
  711. // that.info["chinese_traditional_medicine_cost_part_self_total"] =
  712. // response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  713. //
  714. // that.info["check_cost_total"] = response.data.data.checkCostTotal;
  715. // that.info["check_cost_self_total"] =
  716. // response.data.data.checkCostSelfTotal;
  717. // that.info["check_cost_part_self_total"] =
  718. // response.data.data.checkCostPartSelfTotal;
  719. //
  720. // that.info["laboratory_cost_total"] =
  721. // response.data.data.laboratoryCostTotal;
  722. // that.info["laboratory_cost_self_total"] =
  723. // response.data.data.laboratoryCostSelfTotal;
  724. // that.info["laboratory_cost_part_self_total"] =
  725. // response.data.data.laboratoryCostPartSelfTotal;
  726. //
  727. // that.info["treat_cost_total"] = response.data.data.treatCostTotal;
  728. // that.info["treat_cost_self_total"] =
  729. // response.data.data.treatCostSelfTotal;
  730. // that.info["treat_cost_part_self_total"] =
  731. // response.data.data.treatCostPartSelfTotal;
  732. // that.info["date"] = response.data.data.date;
  733. // // that.info["number"] = response.data.data.number;
  734. // that.info["order_infos"] = response.data.data.order_infos;
  735. // that.info["diagnosis"] = response.data.data.diagnosis;
  736. //
  737. //
  738. // let list = []
  739. // for (let i = 0; i < response.data.data.order_infos.length; i++) {
  740. // let order = response.data.data.order_infos[i]
  741. // let obj = {
  742. // code:"",
  743. // name: "",
  744. // spec: "",
  745. // cnt: "",
  746. // det_item_fee_sumamt: "",
  747. // }
  748. //
  749. // if (order.advice_id > 0 && order.project_id == 0) {
  750. // obj.name = order.advice.advice_name
  751. // let spec = order.advice.drug.dose + order.advice.drug.dose_unit + '*' + order.advice.drug.min_number + order.advice.drug.min_unit + '/' + order.advice.drug.max_unit
  752. // obj.spec = spec
  753. // obj.cnt = order.cnt
  754. // obj.det_item_fee_sumamt =order.det_item_fee_sumamt
  755. // obj.code = order.advice.drug.medical_insurance_number
  756. // list.push(obj)
  757. // }else if (order.advice_id == 0 && order.project_id > 0) {
  758. // if(order.project.type == 2){
  759. // obj.name = order.project.project.project_name
  760. // obj.spec = ""
  761. // obj.cnt = order.cnt
  762. // obj.det_item_fee_sumamt =order.det_item_fee_sumamt
  763. // obj.code = order.project.project.medical_code
  764. // }else{
  765. // obj.name = order.project.good_info.good_name
  766. // obj.spec = order.project.good_info.specification_name
  767. // obj.cnt = order.cnt
  768. // obj.det_item_fee_sumamt =order.det_item_fee_sumamt
  769. // obj.code = order.project.good_info.medical_insurance_number
  770. // }
  771. // list.push(obj)
  772. // }
  773. //
  774. // }
  775. // console.log(list)
  776. // let len = list.length / 2
  777. // let L_list = []
  778. // let R_list = []
  779. // len = Math.trunc(len)
  780. // for(let i = 0; i < len; i++){
  781. // L_list.push(list[i])
  782. // }
  783. // console.log(len)
  784. // for(let i = len; i < list.length; i++){
  785. // console.log(list[i])
  786. // R_list.push(list[i])
  787. // }
  788. // console.log(L_list)
  789. // console.log(R_list)
  790. //
  791. // that.info["L_list"] = L_list
  792. // that.info["R_list"] = R_list
  793. //
  794. //
  795. //
  796. //
  797. //
  798. //
  799. // }
  800. // });
  801. // }
  802. } else {
  803. console.log(this.org_id)
  804. if (this.org_id == 0) {
  805. let params = {
  806. order_id: obj.order_id,
  807. admin_user_id: this.$store.getters.xt_user.user.id,
  808. };
  809. getPrivateExpensesTwo(params).then((response) => {
  810. if (response.data.state == 0) {
  811. // this.$message.error(response.data.msg)
  812. return false;
  813. } else {
  814. var that = this;
  815. that.info = response.data.data.info;
  816. that.p_admin = response.data.data.printor_admin;
  817. that.charge_admin = response.data.data.charge_admin;
  818. that.info["p_admin"] = that.p_admin;
  819. that.info["charge_admin"] = that.charge_admin;
  820. that.info["order_number"] = response.data.data.order_number;
  821. that.info["patient"] = response.data.data.patient;
  822. that.info["date"] = response.data.data.date;
  823. that.info["number"] = response.data.data.number;
  824. that.info["order_infos"] = response.data.data.order_infos;
  825. that.info["diagnosis"] = response.data.data.diagnosis;
  826. that.info["fixmedins_name"] = response.data.data.org_name;
  827. that.info["fixmedins_code"] = response.data.data.org_code;
  828. // that.info["doctor_code"] = response.data.data.doctor_code;
  829. // that.info["department"] = response.data.data.department;
  830. // that.info["health_card_no"] = response.data.data.health_card_no;
  831. that.info["bed_cost_total"] = response.data.data.bedCostTotal;
  832. that.info["bed_cost_self_total"] =
  833. response.data.data.bedCostSelfTotal;
  834. that.info["bed_cost_part_self_total"] =
  835. response.data.data.bedCostPartSelfTotal;
  836. that.info["operation_cost_total"] =
  837. response.data.data.operationCostTotal;
  838. that.info["operation_cost_self_total"] =
  839. response.data.data.operationCostSelfTotal;
  840. that.info["operation_cost_part_self_total"] =
  841. response.data.data.operationCostPartSelfTotal;
  842. that.info["other_cost_total"] = response.data.data.otherCostTotal;
  843. that.info["other_cost_self_total"] =
  844. response.data.data.otherCostSelfTotal;
  845. that.info["other_cost_part_self_total"] =
  846. response.data.data.otherCostPartSelfTotal;
  847. that.info["material_cost_total"] =
  848. response.data.data.materialCostTotal;
  849. that.info["material_cost_self_total"] =
  850. response.data.data.materialCostSelfTotal;
  851. that.info["material_cost_part_self_total"] =
  852. response.data.data.materialCostPartSelfTotal;
  853. that.info["western_medicine_cost_total"] =
  854. response.data.data.westernMedicineCostTotal;
  855. that.info["western_medicine_cost_self_total"] =
  856. response.data.data.westernMedicineCostSelfTotal;
  857. that.info["western_medicine_cost_part_self_total"] =
  858. response.data.data.westernMedicineCostPartSelfTotal;
  859. that.info["chinese_traditional_medicine_cost_total"] =
  860. response.data.data.chineseTraditionalMedicineCostTotal;
  861. that.info["chinese_traditional_medicine_cost_self_total"] =
  862. response.data.data.chineseTraditionalMedicineCostSelfTotal;
  863. that.info["chinese_traditional_medicine_cost_part_self_total"] =
  864. response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  865. that.info["check_cost_total"] = response.data.data.checkCostTotal;
  866. that.info["check_cost_self_total"] =
  867. response.data.data.checkCostSelfTotal;
  868. that.info["check_cost_part_self_total"] =
  869. response.data.data.checkCostPartSelfTotal;
  870. that.info["laboratory_cost_total"] =
  871. response.data.data.laboratoryCostTotal;
  872. that.info["laboratory_cost_self_total"] =
  873. response.data.data.laboratoryCostSelfTotal;
  874. that.info["laboratory_cost_part_self_total"] =
  875. response.data.data.laboratoryCostPartSelfTotal;
  876. that.info["treat_cost_total"] = response.data.data.treatCostTotal;
  877. that.info["treat_cost_self_total"] =
  878. response.data.data.treatCostSelfTotal;
  879. that.info["treat_cost_part_self_total"] =
  880. response.data.data.treatCostPartSelfTotal;
  881. that.info["date"] = response.data.data.date;
  882. // that.info["number"] = response.data.data.number;
  883. that.info["order_infos"] = response.data.data.order_infos;
  884. that.info["diagnosis"] = response.data.data.diagnosis;
  885. let list = []
  886. for (let i = 0; i < response.data.data.order_infos.length; i++) {
  887. let order = response.data.data.order_infos[i]
  888. let obj = {
  889. name: "",
  890. spec: "",
  891. cnt: "",
  892. det_item_fee_sumamt: "",
  893. }
  894. if (order.advice_id > 0 && order.project_id == 0) {
  895. obj.name = order.advice.advice_name
  896. let spec = order.advice.drug.dose + order.advice.drug.dose_unit + '*' + order.advice.drug.min_number + order.advice.drug.min_unit + '/' + order.advice.drug.max_unit
  897. obj.spec = spec
  898. obj.cnt = order.cnt
  899. obj.det_item_fee_sumamt = order.det_item_fee_sumamt
  900. list.push(obj)
  901. } else if (order.advice_id == 0 && order.project_id > 0) {
  902. if (order.project.type == 2) {
  903. obj.name = order.project.project.project_name
  904. obj.spec = ""
  905. obj.cnt = order.cnt
  906. obj.det_item_fee_sumamt = order.det_item_fee_sumamt
  907. } else {
  908. obj.name = order.project.good_info.good_name
  909. obj.spec = order.project.good_info.specification_name
  910. obj.cnt = order.cnt
  911. obj.det_item_fee_sumamt = order.det_item_fee_sumamt
  912. }
  913. list.push(obj)
  914. }
  915. }
  916. console.log(list)
  917. let len = list.length / 2
  918. let L_list = []
  919. let R_list = []
  920. len = Math.trunc(len)
  921. for (let i = 0; i < len; i++) {
  922. L_list.push(list[i])
  923. }
  924. console.log(len)
  925. for (let i = len; i < list.length; i++) {
  926. console.log(list[i])
  927. R_list.push(list[i])
  928. }
  929. console.log(L_list)
  930. console.log(R_list)
  931. that.info["L_list"] = L_list
  932. that.info["R_list"] = R_list
  933. }
  934. });
  935. } else {
  936. var that = this;
  937. axios
  938. .get("http://127.0.0.1:9532/api/settle/query", {
  939. params: {
  940. order_id: order_id,
  941. admin_user_id: this.$store.getters.xt_user.user.id,
  942. },
  943. })
  944. .then(function (response) {
  945. if (response.data.state == 0) {
  946. this.$message.error(response.data.msg);
  947. return false;
  948. } else {
  949. console.log(response.data.data.info);
  950. that.info = response.data.data.info;
  951. that.p_admin = response.data.data.printor_admin;
  952. that.charge_admin = response.data.data.charge_admin;
  953. that.info["p_admin"] = that.p_admin;
  954. that.info["charge_admin"] = that.charge_admin;
  955. that.info["order_number"] = response.data.data.order_number;
  956. that.info["patient"] = response.data.data.patient;
  957. that.info["date"] = response.data.data.date;
  958. that.info["number"] = response.data.data.number;
  959. that.info["order_infos"] = response.data.data.order_infos;
  960. that.info["diagnosis"] = response.data.data.diagnosis;
  961. that.info["org_code"] = response.data.data.org_code;
  962. that.info["org_name"] = response.data.data.org_name;
  963. that.info["doctor_code"] = response.data.data.doctor_code;
  964. that.info["department"] = response.data.data.department;
  965. that.info["health_card_no"] = response.data.data.health_card_no;
  966. that.info["bed_cost_total"] = response.data.data.bedCostTotal;
  967. that.info["bed_cost_self_total"] =
  968. response.data.data.bedCostSelfTotal;
  969. that.info["bed_cost_part_self_total"] =
  970. response.data.data.bedCostPartSelfTotal;
  971. that.info["operation_cost_total"] =
  972. response.data.data.operationCostTotal;
  973. that.info["operation_cost_self_total"] =
  974. response.data.data.operationCostSelfTotal;
  975. that.info["operation_cost_part_self_total"] =
  976. response.data.data.operationCostPartSelfTotal;
  977. that.info["other_cost_total"] = response.data.data.otherCostTotal;
  978. that.info["other_cost_self_total"] =
  979. response.data.data.otherCostSelfTotal;
  980. that.info["other_cost_part_self_total"] =
  981. response.data.data.otherCostPartSelfTotal;
  982. that.info["material_cost_total"] =
  983. response.data.data.materialCostTotal;
  984. that.info["material_cost_self_total"] =
  985. response.data.data.materialCostSelfTotal;
  986. that.info["material_cost_part_self_total"] =
  987. response.data.data.materialCostPartSelfTotal;
  988. that.info["western_medicine_cost_total"] =
  989. response.data.data.westernMedicineCostTotal;
  990. that.info["western_medicine_cost_self_total"] =
  991. response.data.data.westernMedicineCostSelfTotal;
  992. that.info["western_medicine_cost_part_self_total"] =
  993. response.data.data.westernMedicineCostPartSelfTotal;
  994. that.info["chinese_traditional_medicine_cost_total"] =
  995. response.data.data.chineseTraditionalMedicineCostTotal;
  996. that.info["chinese_traditional_medicine_cost_self_total"] =
  997. response.data.data.chineseTraditionalMedicineCostSelfTotal;
  998. that.info["chinese_traditional_medicine_cost_part_self_total"] =
  999. response.data.data.chineseTraditionalMedicineCostPartSelfTotal;
  1000. that.info["check_cost_total"] = response.data.data.checkCostTotal;
  1001. that.info["check_cost_self_total"] =
  1002. response.data.data.checkCostSelfTotal;
  1003. that.info["check_cost_part_self_total"] =
  1004. response.data.data.checkCostPartSelfTotal;
  1005. that.info["laboratory_cost_total"] =
  1006. response.data.data.laboratoryCostTotal;
  1007. that.info["laboratory_cost_self_total"] =
  1008. response.data.data.laboratoryCostSelfTotal;
  1009. that.info["laboratory_cost_part_self_total"] =
  1010. response.data.data.laboratoryCostPartSelfTotal;
  1011. that.info["treat_cost_total"] = response.data.data.treatCostTotal;
  1012. that.info["treat_cost_self_total"] =
  1013. response.data.data.treatCostSelfTotal;
  1014. that.info["treat_cost_part_self_total"] =
  1015. response.data.data.treatCostPartSelfTotal;
  1016. that.info["date"] = response.data.data.date;
  1017. that.info["number"] = response.data.data.number;
  1018. that.info["order_infos"] = response.data.data.order_infos;
  1019. that.info["diagnosis"] = response.data.data.diagnosis;
  1020. that.info["bedInscpTotal"] =
  1021. response.data.data.bedInscpTotal;
  1022. that.info["bedSelfTotal"] =
  1023. response.data.data.bedSelfTotal;
  1024. that.info["operationInscpTotal"] =
  1025. response.data.data.operationInscpTotal;
  1026. that.info["operationSelfTotal"] =
  1027. response.data.data.operationSelfTotal;
  1028. that.info["checkInscpTotal"] =
  1029. response.data.data.checkInscpTotal;
  1030. that.info["checkSelfTotal"] =
  1031. response.data.data.checkSelfTotal;
  1032. that.info["treatInscpTotal"] =
  1033. response.data.data.treatInscpTotal;
  1034. that.info["treatSelfTotal"] =
  1035. response.data.data.treatSelfTotal;
  1036. that.info["laboratoryInscpTotal"] =
  1037. response.data.data.laboratoryInscpTotal;
  1038. that.info["laboratorySelfTotal"] =
  1039. response.data.data.laboratorySelfTotal;
  1040. that.info["westernMedicineInscpTotal"] =
  1041. response.data.data.westernMedicineInscpTotal;
  1042. that.info["westernMedicineSelfTotal"] =
  1043. response.data.data.westernMedicineSelfTotal;
  1044. that.info["materialInscpTotal"] =
  1045. response.data.data.materialInscpTotal;
  1046. that.info["materialSelfTotal"] =
  1047. response.data.data.materialSelfTotal;
  1048. that.info["chineseTraditionalInscpTotal"] =
  1049. response.data.data.chineseTraditionalInscpTotal;
  1050. that.info["chineseTraditionalSelfTotal"] =
  1051. response.data.data.chineseTraditionalSelfTotal;
  1052. that.info["otherInscpTotal"] =
  1053. response.data.data.otherInscpTotal;
  1054. that.info["otherSelfTotal"] =
  1055. response.data.data.otherSelfTotal;
  1056. let obj = {
  1057. type: 1,
  1058. details: [],
  1059. total: 0,
  1060. };
  1061. let obj2 = {
  1062. type: 2,
  1063. details: [],
  1064. total: 0,
  1065. };
  1066. let obj3 = {
  1067. type: 3,
  1068. details: [],
  1069. total: 0,
  1070. };
  1071. let obj4 = {
  1072. type: 4,
  1073. details: [],
  1074. total: 0,
  1075. };
  1076. let num = 0;
  1077. that.info.order_infos.map((item) => {
  1078. if (item.advice_id > 0) {
  1079. obj.details.push(item);
  1080. obj.total += item.pric * item.advice.prescribing_number;
  1081. num++;
  1082. } else {
  1083. if (item.project.type == 2) {
  1084. obj2.details.push(item);
  1085. obj2.total += item.pric * item.project.count;
  1086. num++;
  1087. } else {
  1088. obj3.details.push(item);
  1089. obj3.total += item.pric * item.project.count;
  1090. num++;
  1091. }
  1092. }
  1093. });
  1094. // this.info.order_infos.map(item => {
  1095. // obj4.total = item.Total
  1096. // obj4.details.push(item)
  1097. // num++
  1098. //
  1099. // })
  1100. that.info.new_detail_list = [];
  1101. that.info.new_detail_list.push(obj);
  1102. that.info.new_detail_list.push(obj2);
  1103. that.info.new_detail_list.push(obj3);
  1104. // that.info.new_detail_list.push(obj4)
  1105. that.num = num;
  1106. if (that.paramsObj.settle_type != 1) {
  1107. that.info.begndate = that.getTimes(that.paramsObj.start_time);
  1108. that.info.enddate = that.getTimes(that.paramsObj.end_time);
  1109. }
  1110. let list = []
  1111. for (let i = 0; i < response.data.data.order_infos.length; i++) {
  1112. let order = response.data.data.order_infos[i]
  1113. let obj = {
  1114. name: "",
  1115. spec: "",
  1116. cnt: "",
  1117. det_item_fee_sumamt: "",
  1118. }
  1119. if (order.advice_id > 0 && order.project_id == 0) {
  1120. obj.name = order.advice.advice_name
  1121. let spec = order.advice.drug.dose + order.advice.drug.dose_unit + '*' + order.advice.drug.min_number + order.advice.drug.min_unit + '/' + order.advice.drug.max_unit
  1122. obj.spec = spec
  1123. obj.cnt = order.cnt
  1124. obj.det_item_fee_sumamt = order.det_item_fee_sumamt
  1125. list.push(obj)
  1126. } else if (order.advice_id == 0 && order.project_id > 0) {
  1127. if (order.project.type == 2) {
  1128. obj.name = order.project.project.project_name
  1129. obj.spec = ""
  1130. obj.cnt = order.cnt
  1131. obj.det_item_fee_sumamt = order.det_item_fee_sumamt
  1132. list.push(obj)
  1133. } else {
  1134. obj.name = order.project.good_info.good_name
  1135. obj.spec = order.project.good_info.specification_name
  1136. obj.cnt = order.cnt
  1137. obj.det_item_fee_sumamt = order.det_item_fee_sumamt
  1138. list.push(obj)
  1139. }
  1140. }
  1141. }
  1142. let len = list.length / 2
  1143. let L_list = []
  1144. let R_list = []
  1145. len = Math.trunc(len)
  1146. for (let i = 0; i < len; i++) {
  1147. L_list.push(list[i])
  1148. }
  1149. for (let i = len; i < list.length; i++) {
  1150. R_list.push(list[i])
  1151. }
  1152. that.info["L_list"] = L_list
  1153. that.info["R_list"] = R_list
  1154. }
  1155. })
  1156. .catch(function (error) {
  1157. });
  1158. }
  1159. }
  1160. },
  1161. },
  1162. created() {
  1163. console.log(this.paramsObj);
  1164. this.getInfo(this.paramsObj.order_id, this.paramsObj);
  1165. this.org_id = this.$store.getters.xt_user.org_id;
  1166. console.log("this.org_id", this.org_id);
  1167. },
  1168. watch: {
  1169. paramsObj: {
  1170. //深度监听,可监听到对象、数组的变化
  1171. handler(val, oldVal) {
  1172. this.paramsObj = val;
  1173. console.log(this.paramsObj);
  1174. this.getInfo(this.paramsObj.order_id, this.paramsObj);
  1175. },
  1176. deep: true,
  1177. immediate: true,
  1178. },
  1179. },
  1180. };
  1181. </script>
  1182. <style>
  1183. .dialysis-print-order {
  1184. width: 960px;
  1185. margin: 0 auto;
  1186. }
  1187. .dialysis-print-order .order-yy-name {
  1188. margin: auto;
  1189. text-align: center;
  1190. font-size: 20px;
  1191. letter-spacing: 5px;
  1192. }
  1193. .dialysis-print-order .order-title {
  1194. margin: auto;
  1195. font-weight: 600;
  1196. text-align: center;
  1197. font-size: 22px;
  1198. padding: 10px;
  1199. }
  1200. .dialysis-print-order .table-box {
  1201. width: 100%;
  1202. line-height: 23px;
  1203. font-size: 14px;
  1204. }
  1205. .dialysis-print-order .print-table {
  1206. width: 100%;
  1207. text-align: center;
  1208. border-collapse: collapse;
  1209. line-height: 40px;
  1210. font-size: 14px;
  1211. border-color: #000;
  1212. }
  1213. .dialysis-print-order .print-table-no {
  1214. width: 100%;
  1215. text-align: center;
  1216. border-collapse: collapse;
  1217. font-size: 14px;
  1218. }
  1219. .dialysis-print-order .under-line {
  1220. border-bottom: 1px solid #999;
  1221. width: 95%;
  1222. text-align: center;
  1223. margin-left: 2px;
  1224. }
  1225. .dialysis-print-order .title-box {
  1226. text-align: center;
  1227. font-size: 16px;
  1228. }
  1229. .dialysis-print-order .radio-lebel-box {
  1230. font-weight: 400;
  1231. cursor: pointer;
  1232. }
  1233. .dialysis-print-order .radio-no {
  1234. opacity: 0;
  1235. outline: none;
  1236. position: absolute;
  1237. margin: 0;
  1238. width: 0;
  1239. height: 0;
  1240. z-index: -1;
  1241. }
  1242. .dialysis-print-order .radio-inner {
  1243. white-space: nowrap;
  1244. cursor: pointer;
  1245. outline: none;
  1246. display: inline-block;
  1247. line-height: 1;
  1248. position: relative;
  1249. vertical-align: middle;
  1250. }
  1251. .dialysis-print-order .radio-fang {
  1252. display: inline-block;
  1253. position: relative;
  1254. border: 1px solid #000;
  1255. box-sizing: border-box;
  1256. width: 14px;
  1257. height: 14px;
  1258. background-color: #fff;
  1259. z-index: 1;
  1260. transition: border-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46),
  1261. background-color 0.25s cubic-bezier(0.71, -0.46, 0.29, 1.46);
  1262. }
  1263. .dialysis-print-order .is-checked-radio::after {
  1264. content: "√";
  1265. font-size: 15px;
  1266. }
  1267. .dialysis-print-order .print-table-no tr td {
  1268. padding: 8px 5px;
  1269. line-height: 25px;
  1270. }
  1271. .dialysis-print-order .print-table tr td {
  1272. padding: 1px 1px;
  1273. /*line-height: 25px;*/
  1274. }
  1275. .es-img {
  1276. height: 30px;
  1277. }
  1278. .advice-name {
  1279. text-align: left;
  1280. }
  1281. .advice-children {
  1282. display: flex;
  1283. }
  1284. .title-box-pro {
  1285. border: 0 #fff;
  1286. line-height: 25px;
  1287. height: 25px;
  1288. text-align: left;
  1289. padding-left: 10px !important;
  1290. }
  1291. .title-box-pro-tr {
  1292. border: 0 #fff;
  1293. }
  1294. .text-align-left {
  1295. text-align: left !important;
  1296. padding-left: 10px !important;
  1297. font-size: 14px !important;
  1298. line-height: 25px;
  1299. }
  1300. .print-table-tr-new td {
  1301. line-height: 20px !important;
  1302. }
  1303. .border-top-solid {
  1304. border: solid 1px #000;
  1305. }
  1306. .print-template-two tr {
  1307. line-height: 30px;
  1308. }
  1309. .table-box1 {
  1310. border: 1px solid #000;
  1311. width: 100%;
  1312. line-height: 30px;
  1313. font-size: 14px;
  1314. border-collapse: collapse;
  1315. }
  1316. .table-box1 tr {
  1317. border-bottom: 1px solid #000;
  1318. }
  1319. </style>
  1320. <style lang="scss">
  1321. .newContainer {
  1322. .dialysisPage::-webkit-scrollbar {
  1323. height: 15px;
  1324. }
  1325. .el-date-editor {
  1326. .el-input__inner {
  1327. padding-right: 0px;
  1328. }
  1329. }
  1330. .el-table td,
  1331. .el-table th {
  1332. text-align: center;
  1333. }
  1334. }
  1335. .newContainer::-webkit-scrollbar {
  1336. height: 15px !important;
  1337. }
  1338. </style>