gatherStatistics.vue 50KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479
  1. <template>
  2. <div>
  3. <div
  4. style="display: flex; justify-content: space-between; margin-bottom: 10px"
  5. >
  6. <div>
  7. <el-select
  8. size="small"
  9. v-model="item_type"
  10. placeholder="请选择"
  11. style="width: 150px; margin-left: 10px"
  12. @change="changeItem"
  13. >
  14. <el-option label="全部" value="0"> </el-option>
  15. <el-option
  16. v-for="(item, index) in items"
  17. :key="index"
  18. :label="item.name"
  19. :value="item.id"
  20. >
  21. </el-option>
  22. </el-select>
  23. <el-input
  24. size="small"
  25. style="width: 150px"
  26. v-model="keywords"
  27. class="filter-item"
  28. placeholder="请输入项目名称"
  29. />
  30. <el-button
  31. size="small"
  32. style="margin: 0 10px"
  33. class="filter-item"
  34. type="primary"
  35. @click="searchAction"
  36. >搜索
  37. </el-button>
  38. <el-date-picker
  39. v-model="chargeDate"
  40. type="daterange"
  41. value-format="yyyy-MM-dd"
  42. range-separator="至"
  43. start-placeholder="开始日期"
  44. @change="changeDate"
  45. end-placeholder="结束日期"
  46. >
  47. </el-date-picker>
  48. <el-button type="primary" size="small" @click="toPrint">打印</el-button>
  49. <el-button type="primary" size="small" @click="toPrintInvoice"
  50. >发票打印</el-button>
  51. <el-button type="primary" size="small" @click="toJumpSettle"
  52. >汇总结算单</el-button>
  53. </div>
  54. <div></div>
  55. </div>
  56. <el-table
  57. :data="tableList"
  58. border
  59. :row-style="{ color: '#303133' }"
  60. ref="table"
  61. :header-cell-style="{
  62. backgroundColor: 'rgb(245, 247, 250)',
  63. color: '#606266',
  64. }"
  65. max-height="600"
  66. show-summary
  67. v-loading="detail_loading"
  68. highlight-current-row
  69. >
  70. <el-table-column type="index" label="序号" width="60px" align="center">
  71. <template slot-scope="scope">
  72. {{ scope.$index + 1 }}
  73. </template>
  74. </el-table-column>
  75. <el-table-column align="center" label="处方日期">
  76. <template slot-scope="scope">
  77. <span v-if="scope.row.record_date > 0"
  78. >{{ getTimes(scope.row.record_date) }}
  79. </span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column align="center" label="费用分类">
  83. <template slot-scope="scope">
  84. <span v-if="scope.row.type == 1">
  85. {{ scope.row.cost_type }}
  86. </span>
  87. <span v-if="scope.row.type == 2">
  88. {{ scope.row.cost_type }}
  89. </span>
  90. <span v-if="scope.row.type == 3"> 材料费 </span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column align="center" label="项目名称">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.name }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column align="center" label="规格型号">
  99. <template slot-scope="scope">
  100. {{ scope.row.spec }}
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="center" label="数量">
  104. <template slot-scope="scope">
  105. {{ scope.row.count_number }}
  106. {{ scope.row.unit }}
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="center" label="单价">
  110. <template slot-scope="scope">
  111. {{ scope.row.pric }}
  112. </template>
  113. </el-table-column>
  114. <el-table-column align="center" label="金额" prop="total_all">
  115. <template slot-scope="scope">
  116. <!-- <span v-if="scope.row.is_total == 1">{{ scope.row.total }}</span>
  117. <span v-if="scope.row.is_total == 2">{{ (scope.row.price * scope.row.count).toFixed(2) }}</span> -->
  118. <span>{{
  119. (scope.row.count_number * scope.row.pric).toFixed(2)
  120. }}</span>
  121. </template>
  122. </el-table-column>
  123. <el-table-column align="center" label="医保类别">
  124. <template slot-scope="scope">
  125. {{ getChrgitmLv(scope.row.medical_insurance_level) }}
  126. <!-- <span v-if="balanceAccountsType == 2">{{getChrgitmLv(scope.row.chrgitm_lv)}}</span>
  127. <span v-if="balanceAccountsType != 2">
  128. <span v-if="scope.row.type == 1">
  129. {{getAdviceMedChrgintmLv(scope.row.advice_id)}}
  130. </span>
  131. <span v-if="scope.row.type == 2">
  132. {{getProjectMedChrgintmLv(scope.row.project_id)}}
  133. </span>
  134. <span v-if="scope.row.type == 3">
  135. {{getProjectMedChrgintmLv(scope.row.project_id)}}
  136. </span>
  137. </span> -->
  138. </template>
  139. </el-table-column>
  140. </el-table>
  141. <div style="margin-top: 25px">
  142. <div class="listInfo">
  143. <div>西药:{{ getWesternMedicineCostTotal() }}</div>
  144. <div>中成药:{{ getChineseTraditionalMedicineCostTotal() }}</div>
  145. <div>中草药:{{ getChineseTotal() }}</div>
  146. </div>
  147. <div class="listInfo">
  148. <div>检查费:{{ getCheckCostTotal() }}</div>
  149. <div>输氧费:{{ getOxygen() }}</div>
  150. <div>手术费:{{ getOperation() }}</div>
  151. </div>
  152. <div class="listInfo">
  153. <div>化验费:{{ getLaboratoryCostTotal() }}</div>
  154. <div>输血费:{{ getBlood() }}</div>
  155. <div>诊断费:{{ getZhenChaCostTotal() }}</div>
  156. </div>
  157. <div class="listInfo">
  158. <div>治疗费:{{ getTreatement() }}</div>
  159. <div>护理费:{{ getNursing() }}</div>
  160. <div>床位费:{{ getBedCostTotal() }}</div>
  161. </div>
  162. <div class="listInfo" style="margin-bottom: 20px">
  163. <div>麻醉费:{{ getAnesthesia() }}</div>
  164. <div>材料费:{{ getMaterialCostTotal() }}</div>
  165. <div>其他:{{ getOtherCostTotal() }}</div>
  166. </div>
  167. </div>
  168. <el-dialog
  169. class="centerDialog"
  170. width="1200px"
  171. title="打印"
  172. :visible.sync="settlementVisible"
  173. >
  174. <newSettlePrint
  175. :info="info"
  176. >
  177. </newSettlePrint>
  178. </el-dialog>
  179. </div>
  180. </template>
  181. <script>
  182. import BreadCrumb from "@/xt_pages/components/bread-crumb";
  183. import { getGatherDetailList,getBatchPrivateExpenses } from "@/api/his/his_tools";
  184. import { uParseTime } from "@/utils/tools";
  185. import Print9919 from './print9919.vue'
  186. import newSettlePrint from './newSettlePrint.vue'
  187. const moment = require("moment");
  188. export default {
  189. components: {
  190. Print9919,
  191. newSettlePrint,
  192. BreadCrumb,
  193. },
  194. props: {
  195. patient_id: {
  196. type: Number,
  197. default: 0,
  198. },
  199. },
  200. data() {
  201. return {
  202. settlementVisible:false,
  203. detail_loading: false,
  204. info:{},
  205. tempArr: [],
  206. pos: 0,
  207. search_input: "",
  208. sameRowArr: [],
  209. keywords: "",
  210. tableData: [],
  211. chargeDate: [
  212. moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
  213. moment(new Date()).add("year", 0).format("YYYY-MM-DD"),
  214. ],
  215. item_type: "0",
  216. items: [
  217. { id: 1, name: "药品" },
  218. { id: 2, name: "项目" },
  219. { id: 3, name: "耗材" },
  220. ],
  221. list: [],
  222. patient: {},
  223. his_patient: {},
  224. hisDepatment: [],
  225. westernMedicineCostTotal: 0,
  226. chineseTraditionalMedicineCostTotal: 0,
  227. checkCostTotal: 0,
  228. laboratoryCostTotal: 0,
  229. zhenChaCostTotal: 0,
  230. bedCostTotal: 0,
  231. materialCostTotal: 0,
  232. otherCostTotal: 0,
  233. tableList: [],
  234. order_info_list: [],
  235. balanceAccountsType: 0,
  236. medicalInsuranceLevelList: [],
  237. drugTypeList: [],
  238. costClassifyList: [],
  239. id: 0,
  240. start_time: "",
  241. end_time: "",
  242. his_record_patient: {},
  243. orderList: [],
  244. org_id:'',
  245. };
  246. },
  247. methods: {
  248. searchAction() {
  249. let table_id = this.$store.getters.pagedata.list.table_id;
  250. if (table_id == undefined) {
  251. this.$store.commit("SET_PAGEDATA", {
  252. table_id: 0,
  253. type_id: this.id,
  254. keywords: this.keywords,
  255. start_time: this.chargeDate[0],
  256. end_time: this.chargeDate[1],
  257. patient_id: this.patient_id,
  258. });
  259. } else {
  260. this.$store.commit("SET_PAGEDATA", {
  261. table_id: table_id,
  262. type_id: this.id,
  263. keywords: this.keywords,
  264. start_time: this.chargeDate[0],
  265. end_time: this.chargeDate[1],
  266. patient_id: this.patient_id,
  267. });
  268. }
  269. this.tableList = [];
  270. this.getGatherDetailList();
  271. // console.log(this.tableList, "查看条约");
  272. },
  273. getPrice(val) {
  274. var total_price = 0;
  275. for (let i = 0; i < val.length; i++) {
  276. total_price += val[i].count * val[i].price;
  277. }
  278. return total_price.toFixed(2);
  279. },
  280. changeDate() {
  281. this.start_time = this.chargeDate[0];
  282. this.end_time = this.chargeDate[1];
  283. this.getGatherDetailList();
  284. },
  285. changeItem(id) {
  286. this.id = id;
  287. let table_id = this.$store.getters.pagedata.list.table_id;
  288. if (table_id == undefined) {
  289. this.$store.commit("SET_PAGEDATA", {
  290. table_id: 0,
  291. type_id: this.id,
  292. keywords: this.keywords,
  293. start_time: this.chargeDate[0],
  294. end_time: this.chargeDate[1],
  295. patient_id: this.patient_id,
  296. });
  297. } else {
  298. this.$store.commit("SET_PAGEDATA", {
  299. table_id: table_id,
  300. type_id: this.id,
  301. keywords: this.keywords,
  302. start_time: this.chargeDate[0],
  303. end_time: this.chargeDate[1],
  304. patient_id: this.patient_id,
  305. });
  306. }
  307. this.tableList = [];
  308. this.getGatherDetailList();
  309. },
  310. getGatherDetailList() {
  311. let start_time = this.chargeDate[0];
  312. let end_time = this.chargeDate[1];
  313. let params = {
  314. patient_id: this.patient_id,
  315. start_time: start_time,
  316. end_time: end_time,
  317. type: this.item_type,
  318. keyword: this.keywords,
  319. };
  320. getGatherDetailList(params).then((response) => {
  321. if (response.data.state == 0) {
  322. this.$message.error(response.data.msg);
  323. return false;
  324. } else {
  325. this.drugTypeList = response.data.data.drugTypeList;
  326. this.costClassifyList = response.data.data.costClassifyList;
  327. var list = response.data.data.list;
  328. var new_arr = [];
  329. for (let i = 0; i < list.length; i++) {
  330. for (let j = 0; j < list[i].orders.length; j++) {
  331. new_arr.push(list[i].orders[j]);
  332. }
  333. }
  334. var order_info = [];
  335. for (let i = 0; i < new_arr.length; i++) {
  336. for (let j = 0; j < new_arr[i].order_info.length; j++) {
  337. order_info.push(new_arr[i].order_info[j]);
  338. }
  339. }
  340. for (let i = 0; i < order_info.length; i++) {
  341. if (order_info[i].advice_id > 0) {
  342. order_info[i].item_id =
  343. order_info[i].advice.drug.id + "_" + order_info[i].pric;
  344. }
  345. if (order_info[i].project_id > 0) {
  346. if (order_info[i].project.type == 2) {
  347. order_info[i].item_id =
  348. order_info[i].project.project.id + "_" + order_info[i].pric;
  349. }
  350. if (order_info[i].project.type == 3) {
  351. order_info[i].item_id =
  352. order_info[i].project.good_info.id + "_" + order_info[i].pric;
  353. }
  354. }
  355. }
  356. //合并,相同的合并在一起
  357. let dataInfo = {};
  358. order_info.forEach((item, index) => {
  359. let { item_id } = item;
  360. if (!dataInfo[item_id]) {
  361. dataInfo[item_id] = {
  362. item_id,
  363. child: [],
  364. count_number: 0,
  365. record_date: "",
  366. cost_type: "",
  367. name: "",
  368. pric: item.pric,
  369. chrgitm_lv: "",
  370. advice_id: item.advice_id,
  371. project_id: item.project_id,
  372. type: 0,
  373. spec: "",
  374. unit: "",
  375. medical_insurance_level: "",
  376. cost_type: "",
  377. total_all: 0,
  378. };
  379. }
  380. dataInfo[item_id].child.push(item);
  381. });
  382. let arr = Object.values(dataInfo);
  383. for (let i = 0; i < arr.length; i++) {
  384. for (let j = 0; j < arr[i].child.length; j++) {
  385. if (arr[i].advice_id > 0) {
  386. arr[i].record_date = arr[i].child[0].advice.advice_date;
  387. arr[i].type = 1;
  388. arr[i].name = arr[i].child[0].advice.advice_name;
  389. arr[i].spec =
  390. arr[i].child[0].advice.drug.dose +
  391. arr[i].child[0].advice.drug.dose_unit +
  392. "*" +
  393. arr[i].child[0].advice.drug.min_number +
  394. arr[i].child[0].advice.drug.min_unit +
  395. "/" +
  396. arr[i].child[0].advice.drug.max_unit;
  397. arr[i].unit = arr[i].child[0].advice.prescribing_number_unit;
  398. arr[i].cost_type = arr[i].child[0].advice.drug.drug_type;
  399. arr[i].medical_insurance_level =
  400. arr[i].child[0].advice.drug.medical_insurance_level;
  401. }
  402. if (arr[i].project_id > 0) {
  403. arr[i].record_date = arr[i].child[0].project.record_date;
  404. arr[i].type = arr[i].child[0].project.type;
  405. if (arr[i].child[0].project.type == 2) {
  406. arr[i].name = arr[i].child[0].project.project.project_name;
  407. arr[i].spec = arr[i].child[0].project.project.project_name;
  408. arr[i].unit = arr[i].child[0].project.project.unit;
  409. arr[i].medical_insurance_level =
  410. arr[i].child[0].project.project.medical_coverage;
  411. arr[i].cost_type =
  412. arr[i].child[0].project.project.cost_classify;
  413. }
  414. if (arr[i].child[0].project.type == 3) {
  415. arr[i].name = arr[i].child[0].project.good_info.good_name;
  416. arr[i].spec =
  417. arr[i].child[0].project.good_info.specification_name;
  418. arr[i].unit = arr[i].child[0].project.good_info.packing_unit;
  419. arr[i].medical_insurance_level =
  420. arr[i].child[0].project.good_info.medical_insurance_level;
  421. arr[i].cost_type = "材料费";
  422. }
  423. }
  424. arr[i].count_number += arr[i].child[j].cnt;
  425. }
  426. }
  427. for (let i = 0; i < arr.length; i++) {
  428. if (arr[i].advice_id > 0) {
  429. arr[i].cost_type = this.getDrugType(arr[i].cost_type);
  430. }
  431. if (arr[i].type == 2) {
  432. arr[i].cost_type = this.getCostType(arr[i].cost_type);
  433. }
  434. arr[i].total_all = (arr[i].count_number * arr[i].pric).toFixed(2);
  435. }
  436. this.tableList = arr;
  437. this.patient = response.data.data.patient;
  438. this.his_patient = response.data.data.his_patient;
  439. this.hisDepatment = response.data.data.hisDepatment;
  440. this.order = response.data.data.order;
  441. this.his_record_patient = response.data.data.his_record_patient;
  442. this.medicalInsuranceLevelList =
  443. response.data.data.medicalInsuranceLevelList;
  444. let list_1 = this.$store.getters.pagedata.list;
  445. if (list_1.keywords == undefined) {
  446. this.keywords = "";
  447. } else {
  448. this.keywords = list_1.keywords;
  449. }
  450. this.id = list_1.type_id;
  451. this.item_type = this.id;
  452. if(this.item_type == undefined){
  453. this.item_type = "0"
  454. }else{
  455. this.item_type = this.id;
  456. }
  457. console.log(this.item_type,'this.item_type')
  458. if (this.keywords != "") {
  459. for (let i = 0; i < this.tableList.length; i++) {
  460. if (this.tableList[i].name.indexOf(this.keywords) > -1) {
  461. new_arr.push(this.tableList[i]);
  462. }
  463. }
  464. var obj = { index: "合计", is_total: 1, total: 0 };
  465. obj.total = this.getPrice(new_arr);
  466. this.tableList = [];
  467. this.tableList = new_arr;
  468. }
  469. if (this.id == 1) {
  470. var new_arr = [];
  471. for (let i = 0; i < this.tableList.length; i++) {
  472. if (this.tableList[i].type == 1) {
  473. new_arr.push(this.tableList[i]);
  474. }
  475. }
  476. this.tableList = [];
  477. this.tableList = new_arr;
  478. }
  479. if (this.id == 2) {
  480. var new_arr = [];
  481. for (let i = 0; i < this.tableList.length; i++) {
  482. if (this.tableList[i].type == 2) {
  483. new_arr.push(this.tableList[i]);
  484. }
  485. }
  486. this.tableList = [];
  487. this.tableList = new_arr;
  488. }
  489. if (this.id == 3) {
  490. var new_arr = [];
  491. for (let i = 0; i < this.tableList.length; i++) {
  492. if (this.tableList[i].type == 3) {
  493. new_arr.push(this.tableList[i]);
  494. }
  495. }
  496. this.tableList = [];
  497. this.tableList = new_arr;
  498. }
  499. }
  500. });
  501. },
  502. getAdviceName(id) {
  503. var drug_name = "";
  504. for (let i = 0; i < this.tableData.length; i++) {
  505. if (id == this.tableData[i].advice_id) {
  506. drug_name = this.tableData[i].advice.advice_name;
  507. }
  508. }
  509. return drug_name;
  510. },
  511. getProjectName(id) {
  512. var project_name = "";
  513. for (let i = 0; i < this.tableData.length; i++) {
  514. if (id == this.tableData[i].project_id) {
  515. project_name = this.tableData[i].project.project.project_name;
  516. }
  517. }
  518. return project_name;
  519. },
  520. setNewData(details) {
  521. let drug_ids = [];
  522. let project_ids = [];
  523. for (let i = 0; i < details.length; i++) {
  524. if (
  525. details[i].advice &&
  526. details[i].advice.id > 0 &&
  527. details[i].advice.prescription &&
  528. details[i].advice.prescription.type == 1
  529. ) {
  530. //药品
  531. let obj = {
  532. id: details[i].advice.drug_id,
  533. price: details[i].advice.price,
  534. record_date: details[i].advice.advice_date,
  535. };
  536. drug_ids.push(obj);
  537. } else if (
  538. details[i].project &&
  539. details[i].project.id > 0 &&
  540. details[i].project.prescription &&
  541. details[i].project.prescription.type == 2
  542. ) {
  543. //项目
  544. let obj = {
  545. id: details[i].project.project_id,
  546. price: details[i].project.price,
  547. record_date: details[i].project.record_date,
  548. };
  549. project_ids.push(obj);
  550. }
  551. }
  552. let new_drug_ids = this.unique(drug_ids);
  553. let new_project_ids = this.unique(project_ids);
  554. let list = [];
  555. if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
  556. for (let i = 0; i < new_drug_ids.length; i++) {
  557. let obj = {};
  558. let count = 0;
  559. for (let a = 0; a < details.length; a++) {
  560. if (
  561. new_drug_ids[i].id == details[a].advice.drug_id &&
  562. new_drug_ids[i].price == details[a].advice.price
  563. ) {
  564. obj["name"] = details[a].advice.advice_name;
  565. obj["spec"] =
  566. details[a].advice.drug.dose +
  567. details[a].advice.drug.dose_unit +
  568. "*" +
  569. details[a].advice.drug.min_number +
  570. details[a].advice.drug.min_unit +
  571. "/" +
  572. details[a].advice.drug.max_unit;
  573. obj["unit"] = details[a].advice.drug.min_unit;
  574. obj["medicine_insurance_kind"] = this.getMedicineInsuranceType(
  575. details[a].chrgitm_lv
  576. );
  577. obj["med_chrgitm_type"] = this.getType(
  578. details[a].med_chrgitm_type
  579. );
  580. obj["price"] = parseFloat(details[a].pric);
  581. obj["is_total"] = 2;
  582. obj["record_date"] = details[a].advice.record_date;
  583. obj["chrgitm_lv"] = details[a].chrgitm_lv;
  584. count = count + details[a].cnt;
  585. }
  586. }
  587. obj["count"] = count;
  588. list.push(obj);
  589. }
  590. }
  591. if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
  592. for (let i = 0; i < new_project_ids.length; i++) {
  593. let obj = {};
  594. let count = 0;
  595. for (let a = 0; a < details.length; a++) {
  596. if (
  597. new_project_ids[i].id == details[a].project.project_id &&
  598. new_project_ids[i].price == details[a].project.price
  599. ) {
  600. if (details[a].project.type == 2) {
  601. obj["name"] = details[a].project.project.project_name;
  602. obj["spec"] = details[a].project.project.project_name;
  603. obj["unit"] = details[a].project.project.unit;
  604. obj["record_date"] = details[a].project.record_date;
  605. } else if (details[a].project.type == 3) {
  606. obj["name"] = details[a].project.good_info.good_name;
  607. obj["spec"] = details[a].project.good_info.specification_name;
  608. obj["unit"] = details[a].project.good_info.packing_unit;
  609. obj["record_date"] = details[a].project.record_date;
  610. }
  611. obj["medicine_insurance_kind"] = this.getMedicineInsuranceType(
  612. details[a].chrgitm_lv
  613. );
  614. obj["med_chrgitm_type"] = this.getType(
  615. details[a].med_chrgitm_type
  616. );
  617. obj["price"] = parseFloat(details[a].pric);
  618. obj["chrgitm_lv"] = details[a].chrgitm_lv;
  619. obj["is_total"] = 2;
  620. count = count + details[a].cnt;
  621. }
  622. }
  623. obj["count"] = count;
  624. list.push(obj);
  625. }
  626. }
  627. if (new_drug_ids.length > 0 && new_project_ids.length > 0) {
  628. for (let i = 0; i < new_drug_ids.length; i++) {
  629. let obj = {};
  630. let count = 0;
  631. for (let a = 0; a < details.length; a++) {
  632. if (
  633. new_drug_ids[i].id == details[a].advice.drug_id &&
  634. new_drug_ids[i].price == details[a].advice.price
  635. ) {
  636. obj["name"] = details[a].advice.advice_name;
  637. obj["spec"] =
  638. details[a].advice.drug.dose +
  639. details[a].advice.drug.dose_unit +
  640. "*" +
  641. details[a].advice.drug.min_number +
  642. details[a].advice.drug.min_unit +
  643. "/" +
  644. details[a].advice.drug.max_unit;
  645. obj["unit"] = details[a].advice.drug.min_unit;
  646. obj["medicine_insurance_kind"] = this.getMedicineInsuranceType(
  647. details[a].chrgitm_lv
  648. );
  649. obj["med_chrgitm_type"] = this.getType(
  650. details[a].med_chrgitm_type
  651. );
  652. obj["price"] = parseFloat(details[a].pric);
  653. obj["is_total"] = 2;
  654. obj["record_date"] = details[a].advice.record_date;
  655. obj["chrgitm_lv"] = details[a].chrgitm_lv;
  656. count = count + details[a].cnt;
  657. }
  658. }
  659. obj["count"] = count;
  660. list.push(obj);
  661. }
  662. for (let i = 0; i < new_project_ids.length; i++) {
  663. let obj = {};
  664. let count = 0;
  665. for (let a = 0; a < details.length; a++) {
  666. if (
  667. new_project_ids[i].id == details[a].project.project_id &&
  668. new_project_ids[i].price == details[a].project.price
  669. ) {
  670. if (details[a].project.type == 2) {
  671. obj["name"] = details[a].project.project.project_name;
  672. obj["spec"] = "";
  673. obj["unit"] = details[a].project.project.unit;
  674. } else if (details[a].project.type == 3) {
  675. obj["name"] = details[a].project.good_info.good_name;
  676. obj["spec"] = "";
  677. obj["unit"] = details[a].project.good_info.packing_unit;
  678. }
  679. obj["medicine_insurance_kind"] = this.getMedicineInsuranceType(
  680. details[a].chrgitm_lv
  681. );
  682. obj["med_chrgitm_type"] = this.getType(
  683. details[a].med_chrgitm_type
  684. );
  685. obj["price"] = parseFloat(details[a].pric);
  686. obj["is_total"] = 2;
  687. obj["record_date"] = details[a].project.record_date;
  688. obj["chrgitm_lv"] = details[a].chrgitm_lv;
  689. count = count + details[a].cnt;
  690. }
  691. }
  692. obj["count"] = count;
  693. list.push(obj);
  694. }
  695. }
  696. return list;
  697. },
  698. getMedicineInsuranceType(type) {
  699. switch (type) {
  700. case "01":
  701. return "甲类";
  702. break;
  703. case "02":
  704. return "乙类";
  705. break;
  706. case "03":
  707. return "自费";
  708. break;
  709. }
  710. },
  711. getType(med_chrgitm_type) {
  712. switch (med_chrgitm_type) {
  713. case "01":
  714. return "床位费";
  715. break;
  716. case "02":
  717. return "诊察费";
  718. break;
  719. case "03":
  720. return "检查费";
  721. break;
  722. case "04":
  723. return "化验费";
  724. break;
  725. case "05":
  726. return "治疗费";
  727. break;
  728. case "06":
  729. return "手术费";
  730. break;
  731. case "07":
  732. return "护理费";
  733. break;
  734. case "08":
  735. return "材料费";
  736. break;
  737. case "09":
  738. return "西药费";
  739. break;
  740. case "10":
  741. return "中药饮片费";
  742. break;
  743. case "11":
  744. return "中成药费";
  745. break;
  746. case "12":
  747. return "一般诊疗费";
  748. break;
  749. case "13":
  750. return "挂号费";
  751. break;
  752. case "14":
  753. return "其他费";
  754. break;
  755. }
  756. },
  757. unique(array) {
  758. // res用来存储结果
  759. var res = [];
  760. for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
  761. for (var j = 0, resLen = res.length; j < resLen; j++) {
  762. if (array[i].id === res[j].id && array[i].price === res[j].price) {
  763. break;
  764. }
  765. }
  766. // 如果array[i]是唯一的,那么执行完循环,j等于resLen
  767. if (j === resLen) {
  768. res.push(array[i]);
  769. }
  770. }
  771. return res;
  772. },
  773. getTotal: function (items) {
  774. let total = 0;
  775. for (let i = 0; i < items.length; i++) {
  776. total =
  777. Number(total) +
  778. Number(
  779. (parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2)
  780. );
  781. }
  782. return total.toFixed(2);
  783. },
  784. getTimes(time) {
  785. if (time < 0) {
  786. return "";
  787. } else {
  788. return uParseTime(time, "{y}-{m}-{d}");
  789. }
  790. },toJumpSettle(){
  791. let params = {
  792. start_time:this.start_time,
  793. end_time:this.end_time,
  794. patient_id:this.patient_id,
  795. admin_user_id:this.$store.getters.xt_user.user.id,
  796. }
  797. getBatchPrivateExpenses(params).then((response) => {
  798. if (response.data.state == 0) {
  799. // this.$message.error(response.data.msg)
  800. return false
  801. } else {
  802. var that = this
  803. that.info = response.data.data.info
  804. that.p_admin = response.data.data.printor_admin
  805. that.charge_admin = response.data.data.charge_admin
  806. that.info['p_admin'] = that.p_admin
  807. that.info['charge_admin'] = that.charge_admin
  808. that.info['patient'] = response.data.data.patient
  809. that.info['date'] = response.data.data.date
  810. that.info['number'] = response.data.data.number
  811. that.info['order_infos'] = response.data.data.order_infos
  812. that.info['diagnosis'] = response.data.data.diagnosis
  813. if(that.org_id == 10191){
  814. that.info['org_code'] = "H36030201006"
  815. that.info['org_name'] = "萍乡欣瑞怡康血液透析中心"
  816. }else{
  817. that.info['org_code'] =response.data.data.org_code
  818. that.info['org_name'] = response.data.data.org_name
  819. }
  820. that.info['bed_cost_total'] = response.data.data.bedCostTotal
  821. that.info['bed_cost_self_total'] =
  822. response.data.data.bedCostSelfTotal
  823. that.info['bed_cost_part_self_total'] =
  824. response.data.data.bedCostPartSelfTotal
  825. that.info['operation_cost_total'] =
  826. response.data.data.operationCostTotal
  827. that.info['operation_cost_self_total'] =
  828. response.data.data.operationCostSelfTotal
  829. that.info['operation_cost_part_self_total'] =
  830. response.data.data.operationCostPartSelfTotal
  831. that.info['other_cost_total'] = response.data.data.otherCostTotal
  832. that.info['other_cost_self_total'] =
  833. response.data.data.otherCostSelfTotal
  834. that.info['other_cost_part_self_total'] =
  835. response.data.data.otherCostPartSelfTotal
  836. that.info['material_cost_total'] =
  837. response.data.data.materialCostTotal
  838. that.info['material_cost_self_total'] =
  839. response.data.data.materialCostSelfTotal
  840. that.info['material_cost_part_self_total'] =
  841. response.data.data.materialCostPartSelfTotal
  842. that.info['western_medicine_cost_total'] =
  843. response.data.data.westernMedicineCostTotal
  844. that.info['western_medicine_cost_self_total'] =
  845. response.data.data.westernMedicineCostSelfTotal
  846. that.info['western_medicine_cost_part_self_total'] =
  847. response.data.data.westernMedicineCostPartSelfTotal
  848. that.info['chinese_traditional_medicine_cost_total'] =
  849. response.data.data.chineseTraditionalMedicineCostTotal
  850. that.info['chinese_traditional_medicine_cost_self_total'] =
  851. response.data.data.chineseTraditionalMedicineCostSelfTotal
  852. that.info['chinese_traditional_medicine_cost_part_self_total'] =
  853. response.data.data.chineseTraditionalMedicineCostPartSelfTotal
  854. that.info['check_cost_total'] = response.data.data.checkCostTotal
  855. that.info['check_cost_self_total'] =
  856. response.data.data.checkCostSelfTotal
  857. that.info['check_cost_part_self_total'] =
  858. response.data.data.checkCostPartSelfTotal
  859. that.info['laboratory_cost_total'] =
  860. response.data.data.laboratoryCostTotal
  861. that.info['laboratory_cost_self_total'] =
  862. response.data.data.laboratoryCostSelfTotal
  863. that.info['laboratory_cost_part_self_total'] =
  864. response.data.data.laboratoryCostPartSelfTotal
  865. that.info['treat_cost_total'] = response.data.data.treatCostTotal
  866. that.info['treat_cost_self_total'] =
  867. response.data.data.treatCostSelfTotal
  868. that.info['treat_cost_part_self_total'] =
  869. response.data.data.treatCostPartSelfTotal
  870. that.info['huli_cost_total'] = response.data.data.hiliCostTotal
  871. that.info['huli_cost_self_total'] =
  872. response.data.data.hiliCostSelfTotal
  873. that.info['huli_cost_part_self_total'] =
  874. response.data.data.hiliCostPartSelfTotal
  875. that.info['date'] = response.data.data.date
  876. that.info['number'] = response.data.data.number
  877. that.info['order_infos'] = response.data.data.order_infos
  878. that.info['bedInscpTotal'] =
  879. response.data.data.bedInscpTotal
  880. that.info['bedSelfTotal'] =
  881. response.data.data.bedSelfTotal
  882. that.info['operationInscpTotal'] =
  883. response.data.data.operationInscpTotal
  884. that.info['operationSelfTotal'] =
  885. response.data.data.operationSelfTotal
  886. that.info['checkInscpTotal'] =
  887. response.data.data.checkInscpTotal
  888. that.info['checkSelfTotal'] =
  889. response.data.data.checkSelfTotal
  890. that.info['treatInscpTotal'] =
  891. response.data.data.treatInscpTotal
  892. that.info['treatSelfTotal'] =
  893. response.data.data.treatSelfTotal
  894. that.info['laboratoryInscpTotal'] =
  895. response.data.data.laboratoryInscpTotal
  896. that.info['laboratorySelfTotal'] =
  897. response.data.data.laboratorySelfTotal
  898. that.info['westernMedicineInscpTotal'] =
  899. response.data.data.westernMedicineInscpTotal
  900. that.info['westernMedicineSelfTotal'] =
  901. response.data.data.westernMedicineSelfTotal
  902. that.info['materialInscpTotal'] =
  903. response.data.data.materialInscpTotal
  904. that.info['materialSelfTotal'] =
  905. response.data.data.materialSelfTotal
  906. that.info['chineseTraditionalInscpTotal'] =
  907. response.data.data.chineseTraditionalInscpTotal
  908. that.info['chineseTraditionalSelfTotal'] =
  909. response.data.data.chineseTraditionalSelfTotal
  910. that.info['otherInscpTotal'] =
  911. response.data.data.otherInscpTotal
  912. that.info['otherSelfTotal'] =
  913. response.data.data.otherSelfTotal
  914. that.info['num'] =
  915. response.data.data.num
  916. that.info['f_time'] =
  917. response.data.data.f_time
  918. that.info['l_time'] =
  919. response.data.data.l_time
  920. that.settlementVisible = true
  921. }
  922. })
  923. },
  924. toPrint() {
  925. this.$router.push({
  926. path:
  927. "/hisTool/gatherPrint?patient_id=" +
  928. this.patient_id +
  929. "&start_time=" +
  930. this.start_time +
  931. "&end_time=" +
  932. this.end_time +
  933. "&type=" +
  934. this.item_type +
  935. "&keyword=" +
  936. this.keywords +
  937. "&id=" +
  938. this.id,
  939. });
  940. let table_id = this.$store.getters.pagedata.list.table_id;
  941. if (table_id == undefined) {
  942. this.$store.commit("SET_PAGEDATA", {
  943. table_id: 0,
  944. type_id: this.id,
  945. keywords: this.keywords,
  946. start_time: this.chargeDate[0],
  947. end_time: this.chargeDate[1],
  948. patient_id: this.patient_id,
  949. });
  950. } else {
  951. this.$store.commit("SET_PAGEDATA", {
  952. table_id: table_id,
  953. type_id: this.id,
  954. keywords: this.keywords,
  955. start_time: this.chargeDate[0],
  956. end_time: this.chargeDate[1],
  957. patient_id: this.patient_id,
  958. });
  959. }
  960. },
  961. toPrintInvoice() {
  962. if(this.org_id != 10375 ){
  963. this.$router.push({
  964. path:
  965. "/hisTool/gatherPrintInvoice?patient_id=" +
  966. this.patient_id +
  967. "&start_time=" +
  968. this.start_time +
  969. "&end_time=" +
  970. this.end_time +
  971. "&type=" +
  972. this.item_type +
  973. "&keyword=" +
  974. this.keywords,
  975. });
  976. }
  977. if(this.org_id == 10375 || this.org_id == 0){
  978. this.$router.push({
  979. path:
  980. "/hisTool/garherinvoice_lingshang?patient_id=" +
  981. this.patient_id +
  982. "&start_time=" +
  983. this.start_time +
  984. "&end_time=" +
  985. this.end_time +
  986. "&type=" +
  987. this.item_type +
  988. "&keyword=" +
  989. this.keywords,
  990. });
  991. }
  992. },
  993. setMonthPrescription(month_prescriptions) {
  994. let drug_month_prescriptions = {
  995. advices: [],
  996. };
  997. let drug_ids = [];
  998. let project_month_prescriptions = {
  999. project: [],
  1000. };
  1001. let project_ids = [];
  1002. for (let i = 0; i < month_prescriptions.length; i++) {
  1003. if (month_prescriptions[i].type == 1) {
  1004. //药品
  1005. for (let a = 0; a < month_prescriptions[i].advices.length; a++) {
  1006. let obj = {
  1007. id: month_prescriptions[i].advices[a].drug_id,
  1008. price: month_prescriptions[i].advices[a].price,
  1009. };
  1010. drug_ids.push(obj);
  1011. drug_month_prescriptions.advices.push(
  1012. month_prescriptions[i].advices[a]
  1013. );
  1014. }
  1015. } else if (month_prescriptions[i].type == 2) {
  1016. //项目
  1017. for (let a = 0; a < month_prescriptions[i].project.length; a++) {
  1018. let obj = {
  1019. id: month_prescriptions[i].project[a].project_id,
  1020. price: month_prescriptions[i].project[a].price,
  1021. };
  1022. project_ids.push(obj);
  1023. project_month_prescriptions.project.push(
  1024. month_prescriptions[i].project[a]
  1025. );
  1026. }
  1027. }
  1028. }
  1029. drug_ids = this.unique(drug_ids);
  1030. project_ids = this.unique(project_ids);
  1031. for (let i = 0; i < drug_ids.length; i++) {
  1032. let obj = {};
  1033. let count = 0;
  1034. for (let a = 0; a < drug_month_prescriptions.advices.length; a++) {
  1035. if (
  1036. drug_ids[i].price == drug_month_prescriptions.advices[a].price &&
  1037. drug_ids[i].id == drug_month_prescriptions.advices[a].drug_id
  1038. ) {
  1039. obj["advice_id"] = drug_month_prescriptions.advices[a].id;
  1040. obj["name"] = drug_month_prescriptions.advices[a].advice_name;
  1041. obj["statistical_classification"] = "";
  1042. obj["type"] = 1;
  1043. obj["single_dose"] =
  1044. drug_month_prescriptions.advices[a].single_dose;
  1045. obj["delivery_way"] =
  1046. drug_month_prescriptions.advices[a].delivery_way;
  1047. obj["execution_frequency"] =
  1048. drug_month_prescriptions.advices[a].execution_frequency;
  1049. obj["day"] = drug_month_prescriptions.advices[a].day;
  1050. obj["prescribing_number_unit"] =
  1051. drug_month_prescriptions.advices[a].prescribing_number_unit;
  1052. obj["remark"] = drug_month_prescriptions.advices[a].remark;
  1053. obj["price"] = parseFloat(
  1054. drug_month_prescriptions.advices[a].price
  1055. );
  1056. obj["record_date"] =
  1057. drug_month_prescriptions.advices[a].advice_date;
  1058. obj["spec"] =
  1059. drug_month_prescriptions.advices[a].drug.dose +
  1060. drug_month_prescriptions.advices[a].drug.dose_unit +
  1061. "*" +
  1062. drug_month_prescriptions.advices[a].drug.min_number +
  1063. drug_month_prescriptions.advices[a].drug.min_unit +
  1064. "/" +
  1065. drug_month_prescriptions.advices[a].drug.max_unit;
  1066. obj["is_total"] = 2;
  1067. obj["chrgitm_lv"] =
  1068. drug_month_prescriptions.advices[a].drug.medical_insurance_level;
  1069. obj["unit"] =
  1070. drug_month_prescriptions.advices[a].prescribing_number_unit;
  1071. obj["item_id"] = drug_ids[i].id + "/" + drug_ids[i].price;
  1072. count =
  1073. count + drug_month_prescriptions.advices[a].prescribing_number;
  1074. }
  1075. }
  1076. obj["count"] = count;
  1077. this.tableList.push(obj);
  1078. }
  1079. for (let i = 0; i < project_ids.length; i++) {
  1080. let obj = {};
  1081. let count = 0;
  1082. for (let a = 0; a < project_month_prescriptions.project.length; a++) {
  1083. if (
  1084. project_ids[i].price ==
  1085. project_month_prescriptions.project[a].price &&
  1086. project_ids[i].id ==
  1087. project_month_prescriptions.project[a].project_id
  1088. ) {
  1089. if (project_month_prescriptions.project[a].type == 2) {
  1090. obj["project_id"] = project_month_prescriptions.project[a].id;
  1091. obj["name"] =
  1092. project_month_prescriptions.project[a].project.project_name;
  1093. obj["statistical_classification"] = "";
  1094. obj["project_type"] = 2;
  1095. obj["spec"] =
  1096. project_month_prescriptions.project[a].project.project_name;
  1097. obj["unit"] = project_month_prescriptions.project[a].unit;
  1098. obj["chrgitm_lv"] =
  1099. project_month_prescriptions.project[a].project.medical_coverage;
  1100. obj["item_id"] = project_ids[i].id + "/" + project_ids[i].price;
  1101. } else if (project_month_prescriptions.project[a].type == 3) {
  1102. obj["project_id"] = project_month_prescriptions.project[a].id;
  1103. obj["name"] =
  1104. project_month_prescriptions.project[a].good_info.good_name;
  1105. obj["statistical_classification"] = "";
  1106. obj["project_type"] = 3;
  1107. obj["spec"] =
  1108. project_month_prescriptions.project[
  1109. a
  1110. ].good_info.specification_name;
  1111. obj["unit"] =
  1112. project_month_prescriptions.project[a].good_info.packing_unit;
  1113. obj["chrgitm_lv"] =
  1114. project_month_prescriptions.project[
  1115. a
  1116. ].good_info.medical_insurance_level;
  1117. obj["item_id"] = project_ids[i].id + "/" + project_ids[i].price;
  1118. }
  1119. obj["single_dose"] =
  1120. project_month_prescriptions.project[a].single_dose;
  1121. obj["delivery_way"] =
  1122. project_month_prescriptions.project[a].delivery_way;
  1123. obj["execution_frequency"] =
  1124. project_month_prescriptions.project[a].execution_frequency;
  1125. obj["day"] = project_month_prescriptions.project[a].day;
  1126. obj["single_dose_unit"] =
  1127. project_month_prescriptions.project[a].unit;
  1128. obj["prescribing_number_unit"] =
  1129. project_month_prescriptions.project[a].unit;
  1130. count =
  1131. count + parseFloat(project_month_prescriptions.project[a].count);
  1132. obj["price"] = parseFloat(
  1133. project_month_prescriptions.project[a].price
  1134. );
  1135. obj["remark"] = project_month_prescriptions.project[a].remark;
  1136. obj["type"] = 3;
  1137. obj["record_date"] =
  1138. project_month_prescriptions.project[a].record_date;
  1139. obj["is_total"] = 2;
  1140. }
  1141. }
  1142. obj["count"] = count;
  1143. this.tableList.push(obj);
  1144. }
  1145. var objOne = { index: "合计", is_total: 1, total: 0 };
  1146. objOne.total = this.getTotalPrice(this.tableList);
  1147. for (let i = 0; i < this.tableList.length; i++) {
  1148. this.tableList[i].index = i + 1;
  1149. this.tableList[i].total_all = (
  1150. this.tableList[i].count * this.tableList[i].price
  1151. ).toFixed(2);
  1152. }
  1153. },
  1154. getTotalPrice(val) {
  1155. var total_price = 0;
  1156. for (let i = 0; i < val.length; i++) {
  1157. total_price += val[i].count * val[i].price;
  1158. }
  1159. return total_price.toFixed(2);
  1160. },
  1161. getAdviceMedChrgintmType(name) {
  1162. var med_chrgitm_type = "";
  1163. for (let i = 0; i < this.order_info_list.length; i++) {
  1164. if (name == this.order_info_list[i].advice.advice_name) {
  1165. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type;
  1166. }
  1167. }
  1168. return med_chrgitm_type;
  1169. },
  1170. getProjectMedChrgintmType(project_id) {
  1171. var med_chrgitm_type = "";
  1172. for (let i = 0; i < this.order_info_list.length; i++) {
  1173. if (project_id == this.order_info_list[i].project_id) {
  1174. med_chrgitm_type = this.order_info_list[i].med_chrgitm_type;
  1175. }
  1176. }
  1177. return med_chrgitm_type;
  1178. },
  1179. getChrgitmLv(value) {
  1180. var name = "";
  1181. for (let i = 0; i < this.medicalInsuranceLevelList.length; i++) {
  1182. if (value == this.medicalInsuranceLevelList[i].value) {
  1183. name = this.medicalInsuranceLevelList[i].name;
  1184. }
  1185. }
  1186. return name;
  1187. },
  1188. getAdviceMedChrgintmLv(advice_id) {
  1189. var chrgitm_lv = "";
  1190. for (let i = 0; i < this.order_info_list.length; i++) {
  1191. if (advice_id == this.order_info_list[i].advice_id) {
  1192. chrgitm_lv = this.order_info_list[i].chrgitm_lv;
  1193. }
  1194. }
  1195. return chrgitm_lv;
  1196. },
  1197. getProjectMedChrgintmLv(advice_id) {
  1198. var chrgitm_lv = "";
  1199. for (let i = 0; i < this.order_info_list.length; i++) {
  1200. if (advice_id == this.order_info_list[i].advice_id) {
  1201. chrgitm_lv = this.order_info_list[i].chrgitm_lv;
  1202. }
  1203. }
  1204. return chrgitm_lv;
  1205. },
  1206. getWesternMedicineCostTotal() {
  1207. var total_price = 0;
  1208. for (let i = 0; i < this.tableList.length; i++) {
  1209. if (this.tableList[i].cost_type == "西药") {
  1210. total_price +=
  1211. this.tableList[i].count_number * this.tableList[i].pric;
  1212. }
  1213. }
  1214. return total_price.toFixed(2);
  1215. },
  1216. getChineseTraditionalMedicineCostTotal() {
  1217. var total_price = 0;
  1218. for (let i = 0; i < this.tableList.length; i++) {
  1219. if (this.tableList[i].cost_type == "中成药") {
  1220. total_price +=
  1221. this.tableList[i].count_number * this.tableList[i].pric;
  1222. }
  1223. }
  1224. return total_price.toFixed(2);
  1225. },
  1226. getChineseTotal() {
  1227. var total_price = 0;
  1228. for (let i = 0; i < this.tableList.length; i++) {
  1229. if (this.tableList[i].cost_type == "中草药") {
  1230. total_price +=
  1231. this.tableList[i].count_number * this.tableList[i].pric;
  1232. }
  1233. }
  1234. return total_price.toFixed(2);
  1235. },
  1236. getCheckCostTotal() {
  1237. var total_price = 0;
  1238. for (let i = 0; i < this.tableList.length; i++) {
  1239. if (this.tableList[i].cost_type == "检验费") {
  1240. total_price +=
  1241. this.tableList[i].count_number * this.tableList[i].pric;
  1242. }
  1243. }
  1244. return total_price.toFixed(2);
  1245. },
  1246. getOxygen() {
  1247. var total_price = 0;
  1248. for (let i = 0; i < this.tableList.length; i++) {
  1249. if (this.tableList[i].cost_type == "输氧费") {
  1250. total_price +=
  1251. this.tableList[i].count_number * this.tableList[i].pric;
  1252. }
  1253. }
  1254. return total_price.toFixed(2);
  1255. },
  1256. getOperation() {
  1257. var total_price = 0;
  1258. for (let i = 0; i < this.tableList.length; i++) {
  1259. if (this.tableList[i].cost_type == "手术费") {
  1260. total_price +=
  1261. this.tableList[i].count_number * this.tableList[i].pric;
  1262. }
  1263. }
  1264. return total_price.toFixed(2);
  1265. },
  1266. getLaboratoryCostTotal() {
  1267. var total_price = 0;
  1268. for (let i = 0; i < this.tableList.length; i++) {
  1269. if (this.tableList[i].cost_type == "化验费" || this.tableList[i].cost_type == "化验") {
  1270. total_price +=
  1271. this.tableList[i].count_number * this.tableList[i].pric;
  1272. }
  1273. }
  1274. return total_price.toFixed(2);
  1275. },
  1276. getBlood() {
  1277. var total_price = 0;
  1278. for (let i = 0; i < this.tableList.length; i++) {
  1279. if (this.tableList[i].cost_type == "输血费") {
  1280. total_price +=
  1281. this.tableList[i].count_number * this.tableList[i].pric;
  1282. }
  1283. }
  1284. return total_price.toFixed(2);
  1285. },
  1286. getZhenChaCostTotal() {
  1287. var total_price = 0;
  1288. for (let i = 0; i < this.tableList.length; i++) {
  1289. if (this.tableList[i].cost_type == "诊断费") {
  1290. total_price +=
  1291. this.tableList[i].count_number * this.tableList[i].pric;
  1292. }
  1293. }
  1294. return total_price.toFixed(2);
  1295. },
  1296. getTreatement() {
  1297. var total_price = 0;
  1298. for (let i = 0; i < this.tableList.length; i++) {
  1299. if (this.tableList[i].cost_type == "治疗费") {
  1300. total_price +=
  1301. this.tableList[i].count_number * this.tableList[i].pric;
  1302. }
  1303. }
  1304. return total_price.toFixed(2);
  1305. },
  1306. getNursing() {
  1307. var total_price = 0;
  1308. for (let i = 0; i < this.tableList.length; i++) {
  1309. if (this.tableList[i].cost_type == "护理费") {
  1310. total_price +=
  1311. this.tableList[i].count_number * this.tableList[i].pric;
  1312. }
  1313. }
  1314. return total_price.toFixed(2);
  1315. },
  1316. getBedCostTotal() {
  1317. var total_price = 0;
  1318. for (let i = 0; i < this.tableList.length; i++) {
  1319. if (this.tableList[i].cost_type == "床位费") {
  1320. total_price +=
  1321. this.tableList[i].count_number * this.tableList[i].pric;
  1322. }
  1323. }
  1324. return total_price.toFixed(2);
  1325. },
  1326. getAnesthesia() {
  1327. var total_price = 0;
  1328. for (let i = 0; i < this.tableList.length; i++) {
  1329. if (this.tableList[i].cost_type == "麻醉费") {
  1330. total_price +=
  1331. this.tableList[i].count_number * this.tableList[i].pric;
  1332. }
  1333. }
  1334. return total_price.toFixed(2);
  1335. },
  1336. getMaterialCostTotal() {
  1337. var total_price = 0;
  1338. for (let i = 0; i < this.tableList.length; i++) {
  1339. if (this.tableList[i].cost_type == "材料费") {
  1340. total_price +=
  1341. this.tableList[i].count_number * this.tableList[i].pric;
  1342. }
  1343. }
  1344. return total_price.toFixed(2);
  1345. },
  1346. getOtherCostTotal() {
  1347. var total_price = 0;
  1348. for (let i = 0; i < this.tableList.length; i++) {
  1349. if (this.tableList[i].cost_type == "其他") {
  1350. total_price +=
  1351. this.tableList[i].count_number * this.tableList[i].pric;
  1352. }
  1353. }
  1354. return total_price.toFixed(2);
  1355. },
  1356. getDrugType(id) {
  1357. var name = "";
  1358. for (let i = 0; i < this.drugTypeList.length; i++) {
  1359. if (id == this.drugTypeList[i].value) {
  1360. name = this.drugTypeList[i].name;
  1361. }
  1362. }
  1363. return name;
  1364. },
  1365. getCostType(id) {
  1366. var name = "";
  1367. for (let i = 0; i < this.costClassifyList.length; i++) {
  1368. if (id == this.costClassifyList[i].value) {
  1369. name = this.costClassifyList[i].name;
  1370. }
  1371. }
  1372. return name;
  1373. },
  1374. },
  1375. created() {
  1376. this.org_id = this.$store.getters.xt_user.org_id
  1377. let list_1 = this.$store.getters.pagedata.list;
  1378. if (!list_1.start_time || list_1.start_time == "") {
  1379. this.chargeDate[0] = moment(new Date())
  1380. .add("year", 0)
  1381. .format("YYYY-MM-DD");
  1382. } else {
  1383. this.chargeDate[0] = list_1.start_time;
  1384. }
  1385. if (!list_1.end_time || list_1.end_time == "") {
  1386. this.chargeDate[1] = moment(new Date())
  1387. .add("year", 0)
  1388. .format("YYYY-MM-DD");
  1389. } else {
  1390. this.chargeDate[1] = list_1.end_time;
  1391. }
  1392. this.start_time = this.chargeDate[0];
  1393. this.end_time = this.chargeDate[1];
  1394. this.tableList = [];
  1395. this.getGatherDetailList();
  1396. },
  1397. watch: {
  1398. patient_id: function () {
  1399. this.patient_id = this.patient_id;
  1400. this.tableList = [];
  1401. this.getGatherDetailList();
  1402. },
  1403. },
  1404. };
  1405. </script>
  1406. <style lang="scss" scoped>
  1407. .listInfo {
  1408. display: flex;
  1409. justify-content: space-around;
  1410. div {
  1411. width: 200px;
  1412. }
  1413. }
  1414. </style>