gatherStatistics.vue 49KB

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