|
@@ -43,7 +43,7 @@
|
43
|
43
|
<div>
|
44
|
44
|
</div>
|
45
|
45
|
</div>
|
46
|
|
- <el-table :data="tableList" border :row-style="{ color: '#303133' }" ref="table"
|
|
46
|
+ <el-table :data="list" border :row-style="{ color: '#303133' }" ref="table"
|
47
|
47
|
:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
48
|
48
|
show-summary
|
49
|
49
|
max-height="600"
|
|
@@ -53,31 +53,38 @@
|
53
|
53
|
<template slot-scope="scope">{{scope.row.index}}</template>
|
54
|
54
|
</el-table-column>
|
55
|
55
|
<el-table-column align="center" prop="name" label="处方日期">
|
56
|
|
- <template slot-scope="scope"></template>
|
|
56
|
+ <template slot-scope="scope">
|
|
57
|
+ {{getTime(scope.row.record_date)}}
|
|
58
|
+ </template>
|
57
|
59
|
</el-table-column>
|
58
|
60
|
<el-table-column align="center" prop="name" label="费用分类">
|
59
|
61
|
<template slot-scope="scope">
|
60
|
|
-
|
|
62
|
+ {{ scope.row.med_chrgitm_type }}
|
61
|
63
|
</template>
|
62
|
64
|
</el-table-column>
|
63
|
65
|
<el-table-column align="center" prop="name" label="项目名称">
|
64
|
66
|
<template slot-scope="scope">
|
65
|
|
- <span v-if="scope.row.advice_id > 0 ">{{getAdviceName(scope.row.advice_id)}}</span>
|
66
|
|
- <span v-if="scope.row.project_id > 0 ">{{getProjectName(scope.row.project_id)}}</span>
|
|
67
|
+ <span>{{scope.row.name}}</span>
|
67
|
68
|
</template>
|
68
|
69
|
</el-table-column>
|
69
|
70
|
<el-table-column align="center" prop="name" label="规格型号">
|
70
|
|
- <template slot-scope="scope"></template>
|
|
71
|
+ <template slot-scope="scope">
|
|
72
|
+ {{ scope.row.spec }}
|
|
73
|
+ </template>
|
71
|
74
|
</el-table-column>
|
72
|
75
|
<el-table-column align="center" prop="name" label="数量">
|
73
|
|
- <template slot-scope="scope"></template>
|
|
76
|
+ <template slot-scope="scope">
|
|
77
|
+ {{ scope.row.count }}{{ scope.row.unit }}
|
|
78
|
+ </template>
|
74
|
79
|
</el-table-column>
|
75
|
80
|
<el-table-column align="center" prop="name" label="单价">
|
76
|
|
- <template slot-scope="scope"></template>
|
|
81
|
+ <template slot-scope="scope">
|
|
82
|
+ {{scope.row.price}}
|
|
83
|
+ </template>
|
77
|
84
|
</el-table-column>
|
78
|
85
|
<el-table-column align="center" prop="name" label="金额">
|
79
|
86
|
<template slot-scope="scope">
|
80
|
|
- <div></div>
|
|
87
|
+ {{ (scope.row.price * scope.row.count).toFixed(2) }}
|
81
|
88
|
</template>
|
82
|
89
|
</el-table-column>
|
83
|
90
|
<el-table-column align="center" prop="name" label="医保类别">
|
|
@@ -92,6 +99,7 @@
|
92
|
99
|
<script>
|
93
|
100
|
import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
94
|
101
|
import { getGatherDetailList } from '@/api/his/his_tools'
|
|
102
|
+import { uParseTime } from '@/utils/tools'
|
95
|
103
|
const moment = require('moment')
|
96
|
104
|
export default {
|
97
|
105
|
components: {
|
|
@@ -124,8 +132,8 @@ export default {
|
124
|
132
|
{ id: 3, name: '耗材' },
|
125
|
133
|
{ id: 2, name: '项目' }
|
126
|
134
|
|
127
|
|
- ]
|
128
|
|
-
|
|
135
|
+ ],
|
|
136
|
+ list:[],
|
129
|
137
|
}
|
130
|
138
|
},
|
131
|
139
|
methods: {
|
|
@@ -150,42 +158,106 @@ export default {
|
150
|
158
|
keyword: this.keywords
|
151
|
159
|
}
|
152
|
160
|
getGatherDetailList(params).then(response=>{
|
153
|
|
- if(response.data.state == 1){
|
154
|
|
- var projectlist = response.data.data.projectlist
|
155
|
|
- for(let i=0;i<projectlist.length;i++){
|
156
|
|
- this.tableList.push(projectlist[i])
|
157
|
|
- }
|
158
|
|
- console.log("detailist232323322332",projectlist)
|
159
|
|
- var advicelist = response.data.data.advicelist
|
160
|
|
- for(let i=0;i<advicelist.length;i++){
|
161
|
|
- this.tableList.push(advicelist[i])
|
162
|
|
- }
|
163
|
|
- for(let i=0;i<this.tableData.length;i++){
|
164
|
|
- this.tableList[i].index = i +1
|
165
|
|
- }
|
166
|
|
- console.log("advicelist332233323232323232",this.tableList)
|
167
|
|
-
|
168
|
|
- var list = response.data.data.list
|
169
|
|
- console.log("list233223232323",list)
|
170
|
|
- for(let i=0;i<list.length;i++){
|
171
|
|
- for(let j=0;j<list[i].orders.length;j++){
|
172
|
|
- for(let z=0;z<list[i].orders[j].order_info.length;z++){
|
173
|
|
- list[i].orders[j].order_info[z].record_date = list[i].orders[j].settle_accounts_date
|
174
|
|
- list[i].orders[j].order_info[z].number = list[i].orders[j].number
|
175
|
|
- this.tableData.push(list[i].orders[j].order_info[z])
|
176
|
|
- }
|
177
|
|
- }
|
|
161
|
+ if (response.data.state == 0) {
|
|
162
|
+ this.$message.error(response.data.msg)
|
|
163
|
+ return false
|
|
164
|
+ } else {
|
|
165
|
+ this.order = response.data.data.order
|
|
166
|
+ this.order['bedCostTotal'] = response.data.data.bedCostTotal
|
|
167
|
+ this.order['operationCostTotal'] = response.data.data.operationCostTotal
|
|
168
|
+ this.order['otherCostTotal'] = response.data.data.otherCostTotal
|
|
169
|
+ this.order['materialCostTotal'] = response.data.data.materialCostTotal
|
|
170
|
+ this.order['westernMedicineCostTotal'] = response.data.data.westernMedicineCostTotal
|
|
171
|
+ this.order['chineseTraditionalMedicineCostTotal'] = response.data.data.chineseTraditionalMedicineCostTotal
|
|
172
|
+ this.order['checkCostTotal'] = response.data.data.checkCostTotal
|
|
173
|
+ this.order['zhenChaCostTotal'] = response.data.data.zhenChaCostTotal
|
|
174
|
+ this.order['laboratoryCostTotal'] = response.data.data.laboratoryCostTotal
|
|
175
|
+ this.order['treatCostTotal'] = response.data.data.treatCostTotal
|
|
176
|
+ this.patient = response.data.data.patient
|
|
177
|
+ this.admin = response.data.data.admin_info
|
|
178
|
+ this.his_hospital = response.data.data.his_hospital
|
|
179
|
+ var order_info = response.data.data.order_info
|
|
180
|
+
|
|
181
|
+ if(this.$store.getters.xt_user.org_id == 10215 || this.$store.getters.xt_user.org_id == 0){
|
|
182
|
+ //获取所有项目类型进行去重
|
|
183
|
+ let med_chrgitm_types = []
|
|
184
|
+ for (let i = 0; i < order_info.length; i++) {
|
|
185
|
+ med_chrgitm_types.push(order_info[i].med_chrgitm_type)
|
|
186
|
+ }
|
|
187
|
+ const obj = {}
|
|
188
|
+ med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
|
|
189
|
+ obj[next] ? '' : obj[next] = true && cur.push(next)
|
|
190
|
+ return cur
|
|
191
|
+ }, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
|
192
|
+
|
|
193
|
+ let tempOrderInfo = []
|
|
194
|
+
|
|
195
|
+ for (let i = 0; i < med_chrgitm_types.length; i++) {
|
|
196
|
+ let obj = {
|
|
197
|
+ total: 0,
|
|
198
|
+ details: [],
|
|
199
|
+ is_total:0,
|
|
200
|
+ }
|
|
201
|
+ let tempDetails = []
|
|
202
|
+ for (let b = 0; b < order_info.length; b++) {
|
|
203
|
+ if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
|
|
204
|
+ tempDetails.push(order_info[b])
|
|
205
|
+ }
|
|
206
|
+ }
|
|
207
|
+ obj.details = this.setNewData(tempDetails)
|
|
208
|
+
|
|
209
|
+ this.list = this.list.concat(obj.details)
|
|
210
|
+ for(let i=0;i<this.list.length;i++){
|
|
211
|
+ this.list[i].index = i
|
|
212
|
+ }
|
|
213
|
+ }
|
|
214
|
+ let newobj = {}
|
|
215
|
+ newobj['total'] = this.order.medfee_sumamt
|
|
216
|
+ newobj['is_total'] = 1
|
|
217
|
+
|
|
218
|
+ this.list.push(newobj)
|
|
219
|
+ }else{
|
|
220
|
+ console.log("hh2332322323232332232332",order_info)
|
|
221
|
+ //获取所有项目类型进行去重
|
|
222
|
+ let med_chrgitm_types = []
|
|
223
|
+ for (let i = 0; i < order_info.length; i++) {
|
|
224
|
+ med_chrgitm_types.push(order_info[i].med_chrgitm_type)
|
|
225
|
+ }
|
|
226
|
+ const obj = {}
|
|
227
|
+ med_chrgitm_types = med_chrgitm_types.reduce((cur, next) => {
|
|
228
|
+ obj[next] ? '' : obj[next] = true && cur.push(next)
|
|
229
|
+ return cur
|
|
230
|
+ }, []) // 设置cur默认类型为数组,并且初始值为空的数组
|
|
231
|
+ let tempOrderInfo = []
|
|
232
|
+ for (let i = 0; i < med_chrgitm_types.length; i++) {
|
|
233
|
+ let obj = {
|
|
234
|
+ total: 0,
|
|
235
|
+ details: []
|
|
236
|
+ }
|
|
237
|
+ let tempDetails = []
|
|
238
|
+ for (let b = 0; b < order_info.length; b++) {
|
|
239
|
+ if (med_chrgitm_types[i] == order_info[b].med_chrgitm_type) {
|
|
240
|
+ tempDetails.push(order_info[b])
|
|
241
|
+ }
|
|
242
|
+ }
|
|
243
|
+ console.log("tempdetail2323323232322332233223",tempDetails)
|
|
244
|
+ obj.details = this.setNewData(tempDetails)
|
|
245
|
+
|
|
246
|
+ obj.total = this.getTotal(obj.details)
|
|
247
|
+ obj.details.push({
|
|
248
|
+ total: obj.total,
|
|
249
|
+ is_total: 1,
|
|
250
|
+ })
|
|
251
|
+ console.log("obj3232232332323223",obj.details)
|
|
252
|
+ this.list = this.list.concat(obj.details)
|
|
253
|
+ for(let i=0;i<this.list.length;i++){
|
|
254
|
+ this.list[i].index = i+1
|
|
255
|
+ }
|
|
256
|
+ console.log("list32233223233332232323232323",this.list)
|
|
257
|
+ }
|
178
|
258
|
}
|
179
|
|
- for(let i=0;i<this.tableData.length;i++){
|
180
|
|
- this.tableData[i].index = i+1
|
181
|
|
- this.tableData[i].total_price = 0
|
182
|
|
- this.tableData[i].total_price = (this.tableData[i].cnt * this.tableData[i].pric).toFixed(2)
|
183
|
259
|
}
|
184
|
|
- console.log("322323232323322323",this.tableData)
|
185
|
|
- }
|
186
|
260
|
})
|
187
|
|
-
|
188
|
|
-
|
189
|
261
|
},
|
190
|
262
|
getAdviceName(id){
|
191
|
263
|
var drug_name = ""
|
|
@@ -204,7 +276,191 @@ export default {
|
204
|
276
|
}
|
205
|
277
|
}
|
206
|
278
|
return project_name
|
207
|
|
- }
|
|
279
|
+ },
|
|
280
|
+ setNewData(details) {
|
|
281
|
+ console.log("detail233223233223",details)
|
|
282
|
+ let drug_ids = []
|
|
283
|
+ let project_ids = []
|
|
284
|
+
|
|
285
|
+ for (let i = 0; i < details.length; i++) {
|
|
286
|
+ if (details[i].advice && details[i].advice.id > 0 && details[i].advice.prescription && details[i].advice.prescription.type == 1) { //药品
|
|
287
|
+ let obj = {
|
|
288
|
+ id: details[i].advice.drug_id,
|
|
289
|
+ price: details[i].advice.price,
|
|
290
|
+ record_date:details[i].advice.advice_date
|
|
291
|
+ }
|
|
292
|
+ drug_ids.push(obj)
|
|
293
|
+ } else if (details[i].project && details[i].project.id > 0 && details[i].project.prescription && details[i].project.prescription.type == 2) { //项目
|
|
294
|
+ let obj = {
|
|
295
|
+ id: details[i].project.project_id,
|
|
296
|
+ price: details[i].project.price,
|
|
297
|
+ record_date:details[i].advice.record_date
|
|
298
|
+ }
|
|
299
|
+ project_ids.push(obj)
|
|
300
|
+
|
|
301
|
+ }
|
|
302
|
+
|
|
303
|
+ }
|
|
304
|
+
|
|
305
|
+ let new_drug_ids = this.unique(drug_ids)
|
|
306
|
+ let new_project_ids = this.unique(project_ids)
|
|
307
|
+ let list = []
|
|
308
|
+ if (new_drug_ids.length > 0 && new_project_ids.length == 0) {
|
|
309
|
+ for (let i = 0; i < new_drug_ids.length; i++) {
|
|
310
|
+ let obj = {}
|
|
311
|
+ let count = 0
|
|
312
|
+ for (let a = 0; a < details.length; a++) {
|
|
313
|
+ if (new_drug_ids[i].id == details[a].advice.drug_id && new_drug_ids[i].price == details[a].advice.price) {
|
|
314
|
+ obj['name'] = details[a].advice.advice_name
|
|
315
|
+ 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
|
|
316
|
+ obj['unit'] = details[a].advice.drug.min_unit
|
|
317
|
+ obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
|
|
318
|
+ obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
|
|
319
|
+ obj['price'] = parseFloat(details[a].pric)
|
|
320
|
+ obj['is_total'] = 2
|
|
321
|
+ obj['record_date'] = details[a].advice.record_date
|
|
322
|
+ count = count + details[a].cnt
|
|
323
|
+ }
|
|
324
|
+ }
|
|
325
|
+ obj['count'] = count
|
|
326
|
+ list.push(obj)
|
|
327
|
+ }
|
|
328
|
+ }
|
|
329
|
+
|
|
330
|
+ if (new_drug_ids.length == 0 && new_project_ids.length > 0) {
|
|
331
|
+ for (let i = 0; i < new_project_ids.length; i++) {
|
|
332
|
+ let obj = {}
|
|
333
|
+ let count = 0
|
|
334
|
+ for (let a = 0; a < details.length; a++) {
|
|
335
|
+ if (new_project_ids[i].id == details[a].project.project_id && new_project_ids[i].price == details[a].project.price) {
|
|
336
|
+ if( details[a].project.type == 2){
|
|
337
|
+ obj['name'] = details[a].project.project.project_name
|
|
338
|
+ obj['spec'] = ''
|
|
339
|
+ obj['unit'] = details[a].project.project.unit
|
|
340
|
+
|
|
341
|
+
|
|
342
|
+ }else if(details[a].project.type == 3){
|
|
343
|
+ obj['name'] = details[a].project.good_info.good_name
|
|
344
|
+ obj['spec'] = ''
|
|
345
|
+ obj['unit'] = details[a].project.good_info.packing_unit
|
|
346
|
+
|
|
347
|
+ }
|
|
348
|
+ obj['medicine_insurance_kind'] = this.getMedicineInsuranceType(details[a].chrgitm_lv)
|
|
349
|
+ obj['med_chrgitm_type'] = this.getType(details[a].med_chrgitm_type)
|
|
350
|
+ obj['price'] = parseFloat(details[a].pric)
|
|
351
|
+ obj['is_total'] = 2
|
|
352
|
+
|
|
353
|
+ count = count + details[a].cnt
|
|
354
|
+ }
|
|
355
|
+ }
|
|
356
|
+ obj['count'] = count
|
|
357
|
+ list.push(obj)
|
|
358
|
+ }
|
|
359
|
+ }
|
|
360
|
+ return list
|
|
361
|
+ },
|
|
362
|
+
|
|
363
|
+ getMedicineInsuranceType(type) {
|
|
364
|
+ switch (type) {
|
|
365
|
+ case "01":
|
|
366
|
+ return '甲类'
|
|
367
|
+ break
|
|
368
|
+ case "02":
|
|
369
|
+ return '乙类'
|
|
370
|
+
|
|
371
|
+ break
|
|
372
|
+ case "03":
|
|
373
|
+ return '自费'
|
|
374
|
+ break
|
|
375
|
+
|
|
376
|
+ }
|
|
377
|
+
|
|
378
|
+ },
|
|
379
|
+ getType(med_chrgitm_type){
|
|
380
|
+ switch (med_chrgitm_type) {
|
|
381
|
+ case '01':
|
|
382
|
+ return '床位费'
|
|
383
|
+ break
|
|
384
|
+ case '02':
|
|
385
|
+ return '诊察费'
|
|
386
|
+
|
|
387
|
+ break
|
|
388
|
+ case '03':
|
|
389
|
+ return '检查费'
|
|
390
|
+
|
|
391
|
+ break
|
|
392
|
+ case '04':
|
|
393
|
+ return '化验费'
|
|
394
|
+ break
|
|
395
|
+ case '05':
|
|
396
|
+ return '治疗费'
|
|
397
|
+
|
|
398
|
+ break
|
|
399
|
+ case '06':
|
|
400
|
+ return '手术费'
|
|
401
|
+
|
|
402
|
+ break
|
|
403
|
+ case '07':
|
|
404
|
+ return '护理费'
|
|
405
|
+
|
|
406
|
+ break
|
|
407
|
+ case '08':
|
|
408
|
+ return '材料费'
|
|
409
|
+
|
|
410
|
+ break
|
|
411
|
+ case '09':
|
|
412
|
+ return '西药费'
|
|
413
|
+
|
|
414
|
+ break
|
|
415
|
+ case '10':
|
|
416
|
+ return '中药饮片费'
|
|
417
|
+
|
|
418
|
+ break
|
|
419
|
+ case '11':
|
|
420
|
+ return '中成药费'
|
|
421
|
+
|
|
422
|
+ break
|
|
423
|
+ case '12':
|
|
424
|
+ return '一般诊疗费'
|
|
425
|
+
|
|
426
|
+ break
|
|
427
|
+ case '13':
|
|
428
|
+ return '挂号费'
|
|
429
|
+
|
|
430
|
+ break
|
|
431
|
+ case '14':
|
|
432
|
+ return '其他费'
|
|
433
|
+
|
|
434
|
+ break
|
|
435
|
+
|
|
436
|
+ }
|
|
437
|
+ },
|
|
438
|
+ unique(array) {
|
|
439
|
+ // res用来存储结果
|
|
440
|
+ var res = []
|
|
441
|
+ for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
|
|
442
|
+ for (var j = 0, resLen = res.length; j < resLen; j++) {
|
|
443
|
+ if (array[i].id === res[j].id && array[i].price === res[j].price) {
|
|
444
|
+ break
|
|
445
|
+ }
|
|
446
|
+ }
|
|
447
|
+ // 如果array[i]是唯一的,那么执行完循环,j等于resLen
|
|
448
|
+ if (j === resLen) {
|
|
449
|
+ res.push(array[i])
|
|
450
|
+ }
|
|
451
|
+ }
|
|
452
|
+ return res
|
|
453
|
+ },
|
|
454
|
+ getTotal:function(items){
|
|
455
|
+ let total = 0
|
|
456
|
+ for(let i = 0; i < items.length; i++){
|
|
457
|
+ total = Number(total) + Number((parseFloat(items[i].count) * parseFloat(items[i].price)).toFixed(2))
|
|
458
|
+ }
|
|
459
|
+ return total.toFixed(2)
|
|
460
|
+ },
|
|
461
|
+ getTimes(time) {
|
|
462
|
+ return uParseTime(time, '{y}-{m}-{d}')
|
|
463
|
+ },
|
208
|
464
|
},
|
209
|
465
|
created() {
|
210
|
466
|
this.getGatherDetailList()
|