|
@@ -6,18 +6,27 @@
|
6
|
6
|
<div>
|
7
|
7
|
<div style="display: flex;justify-content: space-between;margin-bottom:10px;">
|
8
|
8
|
<div>
|
9
|
|
- <!--<el-button size="small" style="margin-left:10px;" class="filter-item" type="primary"-->
|
10
|
|
- <!--@click="Action">-->
|
11
|
|
- <!--导出-->
|
12
|
|
- <!--</el-button>-->
|
13
|
|
- <el-input size="small" style="width:150px;" v-model="keywords" @input="searchAction"
|
14
|
|
- @keyup.enter.native='searchAction'
|
15
|
|
- placeholder="请输入患者姓名"
|
16
|
|
- class="filter-item"/>
|
|
9
|
+
|
|
10
|
+ <el-autocomplete
|
|
11
|
+ class="checkSearch"
|
|
12
|
+ popper-class="my-autocomplete"
|
|
13
|
+ v-model="search_value"
|
|
14
|
+ :fetch-suggestions="querySearchAsync"
|
|
15
|
+ :trigger-on-focus="false"
|
|
16
|
+ placeholder="病人透析号/姓名"
|
|
17
|
+ @select="handleSelect"
|
|
18
|
+ >
|
|
19
|
+ <i class="el-icon-search el-input__icon" slot="suffix"></i>
|
|
20
|
+ <template slot-scope="{ item }">
|
|
21
|
+ <div class="name">{{ item.name }}</div>
|
|
22
|
+ </template>
|
|
23
|
+ </el-autocomplete>
|
|
24
|
+
|
|
25
|
+
|
17
|
26
|
<el-select size="small" v-model="item_type" placeholder="请选择"
|
18
|
|
- style="width:150px;margin-left:10px;" @change="changeItem">
|
|
27
|
+ style="width:150px;margin-left:10px;" >
|
19
|
28
|
<el-option
|
20
|
|
- label="全部"
|
|
29
|
+ label="不限"
|
21
|
30
|
value="0">
|
22
|
31
|
</el-option>
|
23
|
32
|
<el-option
|
|
@@ -28,17 +37,6 @@
|
28
|
37
|
</el-option>
|
29
|
38
|
</el-select>
|
30
|
39
|
|
31
|
|
- <el-select size="small" v-model="item_time_type" placeholder="请选择"
|
32
|
|
- style="width:150px;margin-left:10px;" @change="changeTimeItem">
|
33
|
|
- <el-option
|
34
|
|
- label="处方时间"
|
35
|
|
- value="0">
|
36
|
|
- </el-option>
|
37
|
|
- <el-option
|
38
|
|
- label="结算时间"
|
39
|
|
- value="1">
|
40
|
|
- </el-option>
|
41
|
|
- </el-select>
|
42
|
40
|
|
43
|
41
|
<el-date-picker
|
44
|
42
|
v-model="chargeDate"
|
|
@@ -46,7 +44,6 @@
|
46
|
44
|
value-format="yyyy-MM-dd"
|
47
|
45
|
range-separator="至"
|
48
|
46
|
start-placeholder="开始日期"
|
49
|
|
- @change="handleDateChange"
|
50
|
47
|
end-placeholder="结束日期">
|
51
|
48
|
</el-date-picker>
|
52
|
49
|
<!--<el-radio v-model="radio" label="1">明细</el-radio>-->
|
|
@@ -62,16 +59,14 @@
|
62
|
59
|
<el-button slot="reference" style="margin:0 10px;" type="primary" size="small">打印</el-button>
|
63
|
60
|
|
64
|
61
|
</el-popover> -->
|
65
|
|
- <el-button size="small" type="primary" @click="export_detail">报表下载</el-button>
|
|
62
|
+ <el-button size="small" type="primary" @click="getSummaryDetailList">查询</el-button>
|
|
63
|
+ <el-button size="small" type="primary" @click="export_detail">下载报表</el-button>
|
|
64
|
+
|
66
|
65
|
</div>
|
67
|
66
|
</div>
|
68
|
67
|
<el-table :data="tableData" border :row-style="{ color: '#303133' }" ref="table"
|
69
|
68
|
:header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}"
|
70
|
|
- :span-method="merge"
|
71
|
|
- show-summary
|
72
|
|
- :summary-method="getTotal"
|
73
|
69
|
max-height="600"
|
74
|
|
-
|
75
|
70
|
v-loading="detail_loading"
|
76
|
71
|
highlight-current-row>
|
77
|
72
|
|
|
@@ -79,17 +74,25 @@
|
79
|
74
|
<template slot-scope="scope">{{ scope.row.name }}</template>
|
80
|
75
|
</el-table-column>
|
81
|
76
|
<el-table-column align="center" prop="name" label="处方日期">
|
82
|
|
- <template slot-scope="scope">{{ scope.row.name }}</template>
|
|
77
|
+ <template slot-scope="scope">{{ scope.row.record_date }}</template>
|
83
|
78
|
</el-table-column>
|
84
|
79
|
<!--<el-table-column align="center" prop="name" label="患者类型">-->
|
85
|
80
|
<!--<template slot-scope="scope"></template>-->
|
86
|
81
|
<!--</el-table-column>-->
|
87
|
82
|
<el-table-column align="center" prop="name" label="费用类型">
|
88
|
|
- <template slot-scope="scope">{{ scope.row.name }}</template>
|
|
83
|
+ <template slot-scope="scope">
|
|
84
|
+ <div v-if="scope.row.type == 1">{{getDrugType(scope.row.item_cost_type)}}</div>
|
|
85
|
+ <div v-if="scope.row.type == 2">{{getCostType(scope.row.item_cost_type)}}</div>
|
|
86
|
+ <div v-if="scope.row.type == 3">耗材</div>
|
|
87
|
+
|
|
88
|
+ </template>
|
89
|
89
|
</el-table-column>
|
90
|
90
|
|
91
|
91
|
<el-table-column align="center" prop="name" label="处方类型">
|
92
|
|
- <template slot-scope="scope">{{ scope.row.name }}</template>
|
|
92
|
+ <template slot-scope="scope">
|
|
93
|
+ <div v-if="scope.row.med_type == 11">普通门诊</div>
|
|
94
|
+ <div v-if="scope.row.med_type == 14">门诊特殊病</div>
|
|
95
|
+ </template>
|
93
|
96
|
</el-table-column>
|
94
|
97
|
|
95
|
98
|
|
|
@@ -106,26 +109,21 @@
|
106
|
109
|
</el-table-column>
|
107
|
110
|
|
108
|
111
|
<el-table-column align="center" prop="name" label="单位">
|
109
|
|
- <template slot-scope="scope">{{scope.row.count}}</template>
|
|
112
|
+ <template slot-scope="scope">{{scope.row.unit}}</template>
|
110
|
113
|
</el-table-column>
|
111
|
114
|
|
112
|
115
|
<el-table-column align="center" prop="name" label="单价">
|
113
|
116
|
<template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
|
114
|
117
|
</el-table-column>
|
115
|
118
|
|
116
|
|
- <el-table-column align="center" prop="name" label="金额">
|
|
119
|
+ <el-table-column align="center" prop="sum" label="金额">
|
117
|
120
|
<template slot-scope="scope">
|
118
|
121
|
<div>{{((scope.row.price*scope.row.count).toFixed(2))}}</div>
|
119
|
122
|
</template>
|
120
|
123
|
</el-table-column>
|
121
|
124
|
|
122
|
125
|
<el-table-column align="center" prop="name" label="是否结算">
|
123
|
|
- <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
|
124
|
|
- </el-table-column>
|
125
|
|
-
|
126
|
|
-
|
127
|
|
- <el-table-column align="center" prop="name" label="结算日期">
|
128
|
|
- <template slot-scope="scope">{{scope.row.price.toFixed(2)}}</template>
|
|
126
|
+ <template slot-scope="scope">{{scope.row.order_status == 2?'已结算':'未结算'}}</template>
|
129
|
127
|
</el-table-column>
|
130
|
128
|
|
131
|
129
|
</el-table>
|
|
@@ -137,7 +135,11 @@
|
137
|
135
|
|
138
|
136
|
<script>
|
139
|
137
|
import BreadCrumb from '@/xt_pages/components/bread-crumb'
|
140
|
|
-import { GetSummaryDetail } from '@/api/his/his'
|
|
138
|
+import { GetPSummaryDetail } from '@/api/his/his'
|
|
139
|
+import { getPrescriptionInitdata } from '@/api/his/his_tools'
|
|
140
|
+
|
|
141
|
+import { PostSearch } from '@/api/patient'
|
|
142
|
+
|
141
|
143
|
import { uParseTime } from '@/utils/tools'
|
142
|
144
|
import axios from 'axios'
|
143
|
145
|
import pako from 'pako';
|
|
@@ -166,9 +168,12 @@ export default {
|
166
|
168
|
detail_loading: false,
|
167
|
169
|
tempArr: [],
|
168
|
170
|
pos: 0,
|
169
|
|
-
|
|
171
|
+ patient_id:0,
|
170
|
172
|
sameRowArr: [],
|
171
|
173
|
keywords: '',
|
|
174
|
+ search_value:"",
|
|
175
|
+ drugTypeList:[],
|
|
176
|
+ costClassifyList:[],
|
172
|
177
|
tableData: [],
|
173
|
178
|
chargeDate: [moment(new Date()).add('year', 0).format('YYYY-MM-DD'), moment(new Date()).add('year', 0).format('YYYY-MM-DD')],
|
174
|
179
|
item_type: '0',
|
|
@@ -181,6 +186,83 @@ export default {
|
181
|
186
|
}
|
182
|
187
|
},
|
183
|
188
|
methods: {
|
|
189
|
+ export_detail() {
|
|
190
|
+
|
|
191
|
+ let list = []
|
|
192
|
+ for (let i = 0; i < this.tableData.length; i++) {
|
|
193
|
+ let order = this.tableData[i]
|
|
194
|
+ let name = order.name
|
|
195
|
+ let item_name = order.item_name
|
|
196
|
+ let count = order.count
|
|
197
|
+ let price = order.price.toFixed(2)
|
|
198
|
+ let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
|
|
199
|
+ let total = order.total.toFixed(2)
|
|
200
|
+
|
|
201
|
+ let obj = {
|
|
202
|
+ '患者姓名': name,
|
|
203
|
+ '项目名称': item_name,
|
|
204
|
+ '数量': count,
|
|
205
|
+ '单价': price,
|
|
206
|
+ '费用': pay_sumamt,
|
|
207
|
+ '费用总额': total
|
|
208
|
+ }
|
|
209
|
+ list.push(obj)
|
|
210
|
+ }
|
|
211
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
212
|
+ const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
|
|
213
|
+ const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
|
|
214
|
+ const data = this.formatJson(filterVal, list)
|
|
215
|
+ excel.export_json_to_excel1({
|
|
216
|
+ header: tHeader,
|
|
217
|
+ data,
|
|
218
|
+ filename: '明细',
|
|
219
|
+ ref: this.$refs['table'].$el
|
|
220
|
+ })
|
|
221
|
+ })
|
|
222
|
+
|
|
223
|
+ },
|
|
224
|
+ getCostType(type){
|
|
225
|
+ console.log(this.costClassifyList)
|
|
226
|
+ console.log(type)
|
|
227
|
+ var name = "";
|
|
228
|
+ for (let i = 0; i < this.costClassifyList.length; i++) {
|
|
229
|
+ if (type == this.costClassifyList[i].value) {
|
|
230
|
+ name = this.costClassifyList[i].name;
|
|
231
|
+ }
|
|
232
|
+ }
|
|
233
|
+ return name;
|
|
234
|
+ },
|
|
235
|
+ getDrugType(type){
|
|
236
|
+ console.log(this.drugTypeList)
|
|
237
|
+ console.log(type)
|
|
238
|
+
|
|
239
|
+ var name = "";
|
|
240
|
+ for (let i = 0; i < this.drugTypeList.length; i++) {
|
|
241
|
+ if (type == this.drugTypeList[i].value) {
|
|
242
|
+ name = this.drugTypeList[i].name;
|
|
243
|
+ }
|
|
244
|
+ }
|
|
245
|
+ return name;
|
|
246
|
+ },
|
|
247
|
+ handleSelect(val) {
|
|
248
|
+ this.patient_id = val.id
|
|
249
|
+ this.search_value = val.name
|
|
250
|
+ },
|
|
251
|
+ querySearchAsync(keyword, cb) {
|
|
252
|
+ let key = ''
|
|
253
|
+ if (keyword != undefined) {
|
|
254
|
+ key = keyword
|
|
255
|
+ }
|
|
256
|
+ let searchArray = []
|
|
257
|
+ PostSearch(key).then(response => {
|
|
258
|
+ if (response.data.state == 1) {
|
|
259
|
+ searchArray = response.data.data.patient
|
|
260
|
+ cb(searchArray)
|
|
261
|
+ } else {
|
|
262
|
+ cb([])
|
|
263
|
+ }
|
|
264
|
+ })
|
|
265
|
+ },
|
184
|
266
|
handleDateChangetwo(value) {
|
185
|
267
|
this.$confirm('提示', '接口优化升级,如有数据需要,请联系客服!', {
|
186
|
268
|
confirmButtonText: '确 定',
|
|
@@ -188,7 +270,6 @@ export default {
|
188
|
270
|
type: 'warning'
|
189
|
271
|
}).then(() => {
|
190
|
272
|
|
191
|
|
-
|
192
|
273
|
}).catch(() => {
|
193
|
274
|
})
|
194
|
275
|
|
|
@@ -224,11 +305,10 @@ export default {
|
224
|
305
|
// }else{
|
225
|
306
|
// this.getSummaryDetailListtwo()
|
226
|
307
|
// }
|
227
|
|
- this.getSummaryDetailList()
|
228
|
|
-
|
|
308
|
+ // this.getSummaryDetailList()
|
229
|
309
|
|
230
|
310
|
},
|
231
|
|
- Action(){
|
|
311
|
+ Action() {
|
232
|
312
|
var that = this
|
233
|
313
|
axios.get('http://127.0.0.1:9531/handelExcel', {
|
234
|
314
|
params: {}
|
|
@@ -237,18 +317,17 @@ export default {
|
237
|
317
|
if (response.data.state == 0) {
|
238
|
318
|
that.$message.error(response.data.msg)
|
239
|
319
|
|
240
|
|
-
|
241
|
320
|
return false
|
242
|
321
|
} else {
|
243
|
322
|
|
244
|
323
|
var list = []
|
245
|
|
- for(let i = 0; i < response.data.data.list.length; i++){
|
246
|
|
- let team = response.data.data.list[i]
|
247
|
|
- for(let b = 0; b < team.list.length; b++){
|
|
324
|
+ for (let i = 0; i < response.data.data.list.length; i++) {
|
|
325
|
+ let team = response.data.data.list[i]
|
|
326
|
+ for (let b = 0; b < team.list.length; b++) {
|
248
|
327
|
let name = ""
|
249
|
|
- if(team.list[b].type == 2){
|
|
328
|
+ if (team.list[b].type == 2) {
|
250
|
329
|
name = team.list[b].project.project_name
|
251
|
|
- }else{
|
|
330
|
+ } else {
|
252
|
331
|
|
253
|
332
|
name = team.list[b].good_info.good_name
|
254
|
333
|
|
|
@@ -270,8 +349,8 @@ export default {
|
270
|
349
|
}
|
271
|
350
|
|
272
|
351
|
import('@/vendor/Export2Excel').then(excel => {
|
273
|
|
- const tHeader = [ '客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
|
274
|
|
- const filterVal = [ '客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
|
|
352
|
+ const tHeader = ['客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
|
|
353
|
+ const filterVal = ['客户组合编码', '客户组合名称', '客户单项编码', '客户单项名称', '中心组合编码', '中心组合名称', '中心单项编码', '中心单项名称']
|
275
|
354
|
const data = that.formatJson(filterVal, list)
|
276
|
355
|
excel.export_json_to_excel({
|
277
|
356
|
header: tHeader,
|
|
@@ -280,17 +359,13 @@ export default {
|
280
|
359
|
})
|
281
|
360
|
})
|
282
|
361
|
|
283
|
|
-
|
284
|
362
|
}
|
285
|
363
|
})
|
286
|
364
|
.catch(function(error) {
|
287
|
365
|
|
288
|
366
|
})
|
289
|
367
|
|
290
|
|
-
|
291
|
|
-
|
292
|
|
-
|
293
|
|
- },formatJson(filterVal, jsonData) {
|
|
368
|
+ }, formatJson(filterVal, jsonData) {
|
294
|
369
|
return jsonData.map(v => filterVal.map(j => v[j]))
|
295
|
370
|
},
|
296
|
371
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
|
@@ -321,108 +396,83 @@ export default {
|
321
|
396
|
},
|
322
|
397
|
changeItem() {
|
323
|
398
|
this.getSummaryDetailList()
|
324
|
|
- },changeTimeItem(){
|
|
399
|
+ }, changeTimeItem() {
|
325
|
400
|
|
326
|
401
|
this.getSummaryDetailList()
|
327
|
402
|
|
|
403
|
+ }, uniqueProjectAndAdvice(array) {
|
|
404
|
+ // res用来存储结果
|
|
405
|
+ var res = []
|
|
406
|
+ for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
|
|
407
|
+ for (var j = 0, resLen = res.length; j < resLen; j++) {
|
|
408
|
+ if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
|
|
409
|
+ break
|
|
410
|
+ }
|
|
411
|
+ }
|
|
412
|
+ // 如果array[i]是唯一的,那么执行完循环,j等于resLen
|
|
413
|
+ if (j === resLen) {
|
|
414
|
+ res.push(array[i])
|
|
415
|
+ }
|
|
416
|
+ }
|
|
417
|
+ return res
|
328
|
418
|
},
|
329
|
419
|
searchAction() {
|
330
|
420
|
this.item_type = '0'
|
331
|
421
|
this.getSummaryDetailList()
|
332
|
422
|
|
333
|
|
- }, getSummaryDetailListtwo() {
|
334
|
|
- this.detail_loading = true
|
335
|
|
- let start_time = this.chargeDate[0]
|
336
|
|
- let end_time = this.chargeDate[1]
|
337
|
|
- let params = {
|
338
|
|
- start_time: start_time,
|
339
|
|
- end_time: end_time,
|
340
|
|
- type: this.item_type,
|
341
|
|
- keyword: this.keywords
|
|
423
|
+ },handleSpanTempArr() {
|
|
424
|
+ this.tempArr = []
|
|
425
|
+
|
|
426
|
+ for (let i = 0; i < this.tableData.length; i++) {
|
|
427
|
+ if (i === 0) {
|
|
428
|
+ this.tempArr.push(1)
|
|
429
|
+ this.pos = 0
|
|
430
|
+ } else {
|
|
431
|
+ // 判断当前元素与上一个元素是否相同
|
|
432
|
+ if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
|
|
433
|
+ this.tempArr[this.pos] += 1
|
|
434
|
+ this.tempArr.push(0)
|
|
435
|
+ } else {
|
|
436
|
+ this.tempArr.push(1)
|
|
437
|
+ this.pos = i
|
|
438
|
+ }
|
|
439
|
+ }
|
342
|
440
|
}
|
343
|
|
- GetSummaryDetail(params).then(response => {
|
|
441
|
+
|
|
442
|
+ let sameRowArr = [], sIdx = 0
|
|
443
|
+ this.tableData.forEach((item, index) => {
|
|
444
|
+ item.index = index
|
|
445
|
+ if (index === 0) {
|
|
446
|
+ sameRowArr.push([index])
|
|
447
|
+ } else {
|
|
448
|
+ if (item.patient_id === this.tableData[index - 1].patient_id) {
|
|
449
|
+ sameRowArr[sIdx].push(index)
|
|
450
|
+ } else {
|
|
451
|
+ sIdx = sIdx + 1
|
|
452
|
+ sameRowArr.push([index])
|
|
453
|
+ }
|
|
454
|
+ }
|
|
455
|
+ })
|
|
456
|
+ this.sameRowArr = sameRowArr
|
|
457
|
+ },getInit(){
|
|
458
|
+ getPrescriptionInitdata().then(response => {
|
344
|
459
|
if (response.data.state == 0) {
|
345
|
460
|
this.detail_loading = false
|
346
|
461
|
|
347
|
462
|
this.$message.error(response.data.msg)
|
348
|
463
|
return false
|
349
|
464
|
} else {
|
350
|
|
- this.detail_loading = false
|
351
|
|
-
|
352
|
|
- this.$confirm('提示', '接口优化升级,如有数据需要,请联系客服!', {
|
353
|
|
- confirmButtonText: '确 定',
|
354
|
|
- cancelButtonText: '取 消',
|
355
|
|
- type: 'warning'
|
356
|
|
- }).then(() => {
|
357
|
|
-
|
358
|
|
-
|
359
|
|
- }).catch(() => {
|
360
|
|
- })
|
361
|
|
-
|
362
|
|
-
|
|
465
|
+ this.drugTypeList = response.data.data.drugTypeList;
|
|
466
|
+ this.costClassifyList = response.data.data.costClassifyList;
|
363
|
467
|
}
|
364
|
468
|
|
365
|
|
-
|
366
|
|
-
|
367
|
|
-
|
368
|
|
- //
|
369
|
|
- // console.log('去重前')
|
370
|
|
- // console.log(advice)
|
371
|
|
- // console.log(project)
|
372
|
|
- // //
|
373
|
|
- // //
|
374
|
|
-
|
375
|
|
- // //
|
376
|
|
- // console.log('去重后')
|
377
|
|
- //
|
378
|
|
- // console.log(advice.length)
|
379
|
|
- // console.log(project.length)
|
380
|
|
- //
|
381
|
|
- // for (let i = 0; i < project.length; i++) {
|
382
|
|
- // let obj = {}
|
383
|
|
- // let count = 0
|
384
|
|
- // for (let a = 0; a < tempPatientsTwo.length; a++) {
|
385
|
|
- // if (project[i].patient_id == tempPatientsTwo[a].patient_id && project[i].item_id == tempPatientsTwo[a].item_id && project[i].price == tempPatientsTwo[a].price) {
|
386
|
|
- // count = count + tempPatientsTwo[a].count
|
387
|
|
- // obj['count'] = count
|
388
|
|
- //
|
389
|
|
- // }
|
390
|
|
- // obj['price'] = project[i].price
|
391
|
|
- // obj['type'] = project[i].type
|
392
|
|
- // obj['item_name'] = project[i].item_name
|
393
|
|
- // obj['item_id'] = project[i].item_id
|
394
|
|
- // obj['name'] = project[i].name
|
395
|
|
- // obj['patient_id'] = project[i].patient_id
|
396
|
|
- // obj['count'] = count
|
397
|
|
- // this.tableData.push(obj)
|
398
|
|
- // }
|
399
|
|
- // }
|
400
|
|
- //
|
401
|
|
- //
|
402
|
|
- // for (let i = 0; i < advice.length; i++) {
|
403
|
|
- // let obj = {}
|
404
|
|
- // let count = 0
|
405
|
|
- // for (let a = 0; a < tempPatientsTwo.length; a++) {
|
406
|
|
- // if (advice[i].patient_id == tempPatientsTwo[a].patient_id && advice[i].item_id == tempPatientsTwo[a].item_id && advice[i].price == tempPatientsTwo[a].price) {
|
407
|
|
- // count = count + tempPatientsTwo[a].count
|
408
|
|
- // obj['count'] = count
|
409
|
|
- //
|
410
|
|
- // }
|
411
|
|
- // obj['price'] = advice[i].price
|
412
|
|
- // obj['type'] = advice[i].type
|
413
|
|
- // obj['item_name'] = advice[i].item_name
|
414
|
|
- // obj['item_id'] = advice[i].item_id
|
415
|
|
- // obj['name'] = advice[i].name
|
416
|
|
- // obj['patient_id'] = advice[i].patient_id
|
417
|
|
- // this.tableData.push(obj)
|
418
|
|
- // }
|
419
|
|
- // }
|
420
|
|
- // console.log(this.tableData.length)
|
421
|
|
- // this.tableData = this.sort(this.tableData)
|
422
|
|
-
|
423
|
469
|
})
|
|
470
|
+
|
424
|
471
|
},
|
425
|
472
|
getSummaryDetailList() {
|
|
473
|
+ if(this.search_value.length == 0){
|
|
474
|
+ this.patient_id = 0
|
|
475
|
+ }
|
426
|
476
|
this.detail_loading = true
|
427
|
477
|
let start_time = this.chargeDate[0]
|
428
|
478
|
let end_time = this.chargeDate[1]
|
|
@@ -430,26 +480,22 @@ export default {
|
430
|
480
|
start_time: start_time,
|
431
|
481
|
end_time: end_time,
|
432
|
482
|
type: this.item_type,
|
433
|
|
- keyword: this.keywords,
|
434
|
|
- time_type:this.item_time_type
|
|
483
|
+ patient_id: this.patient_id,
|
435
|
484
|
}
|
436
|
|
- GetSummaryDetail(params).then(response => {
|
|
485
|
+ GetPSummaryDetail(params).then(response => {
|
437
|
486
|
if (response.data.state == 0) {
|
438
|
487
|
this.detail_loading = false
|
439
|
488
|
|
440
|
489
|
this.$message.error(response.data.msg)
|
441
|
490
|
return false
|
442
|
491
|
} else {
|
443
|
|
-
|
444
|
|
-
|
445
|
492
|
this.detail_loading = false
|
446
|
|
-
|
447
|
493
|
this.tableData = []
|
448
|
494
|
let tempPatients = []
|
449
|
495
|
let tempPatientsTwo = []
|
450
|
496
|
//
|
451
|
497
|
let tempData = response.data
|
452
|
|
- let allData = response.data
|
|
498
|
+ let allData = response.data
|
453
|
499
|
tempData = this.uniquepid(tempData)
|
454
|
500
|
//
|
455
|
501
|
let order_infos = []
|
|
@@ -476,40 +522,37 @@ export default {
|
476
|
522
|
order_info: []
|
477
|
523
|
}
|
478
|
524
|
let orders = tempPatients[i].orders
|
479
|
|
-
|
480
|
525
|
for (let c = 0; c < orders.length; c++) {
|
481
|
526
|
let newObj = {}
|
482
|
527
|
newObj['count'] = orders[c].cnt
|
483
|
528
|
newObj['price'] = orders[c].pric
|
484
|
|
- newObj['item_total'] = orders[c].det_item_fee_sumamt
|
|
529
|
+
|
|
530
|
+ newObj['order_status'] = orders[c].order_status
|
|
531
|
+ newObj['med_type'] = orders[c].med_type
|
|
532
|
+ newObj['record_date'] = orders[c].record_date
|
|
533
|
+ newObj['unit'] = orders[c].unit
|
|
534
|
+
|
|
535
|
+ newObj['item_cost_type'] = orders[c].item_cost_type
|
|
536
|
+
|
|
537
|
+ // newObj['item_total'] = orders[c].det_item_fee_sumamt
|
485
|
538
|
|
486
|
539
|
if (orders[c].advice_id > 0 && orders[c].project_id == 0) {
|
487
|
540
|
newObj['type'] = 1
|
488
|
541
|
newObj['item_name'] = orders[c].item_name
|
489
|
542
|
newObj['item_id'] = orders[c].item_id
|
490
|
|
-
|
491
|
|
- if (orders[c].min_unit != orders[c].dose_unit) {
|
492
|
|
- newObj['item_spec'] = orders[c].dose + orders[c].dose_unit + '*' + orders[c].min_number + orders[c].min_unit + '/' + orders[c].max_unit
|
493
|
|
- } else {
|
494
|
|
-
|
495
|
|
- newObj['item_spec'] = ''
|
496
|
|
- }
|
497
|
|
-
|
|
543
|
+ newObj['item_spec'] = orders[c].spec
|
498
|
544
|
}
|
499
|
545
|
if (orders[c].advice_id == 0 && orders[c].project_id > 0) {
|
500
|
|
- newObj['type'] = 2
|
501
|
546
|
newObj['item_id'] = orders[c].item_id
|
502
|
|
-
|
503
|
547
|
if (orders[c].p_type == 2) {
|
504
|
|
- newObj['item_spec'] =""
|
505
|
|
- newObj['item_name'] = orders[c].item_name
|
506
|
|
-
|
|
548
|
+ newObj['type'] = 2
|
507
|
549
|
|
|
550
|
+ newObj['item_spec'] = ""
|
|
551
|
+ newObj['item_name'] = orders[c].item_name
|
508
|
552
|
} else if (orders[c].p_type == 3) {
|
509
|
|
- newObj['item_spec'] = orders[c].specification_name
|
|
553
|
+ newObj['type'] = 3
|
|
554
|
+ newObj['item_spec'] = orders[c].spec
|
510
|
555
|
newObj['item_name'] = orders[c].item_name
|
511
|
|
-
|
512
|
|
-
|
513
|
556
|
}
|
514
|
557
|
}
|
515
|
558
|
obj.order_info.push(newObj)
|
|
@@ -517,9 +560,7 @@ export default {
|
517
|
560
|
}
|
518
|
561
|
tempPatientsTwo.push(obj)
|
519
|
562
|
}
|
520
|
|
- console.log(tempPatientsTwo)
|
521
|
563
|
|
522
|
|
- //
|
523
|
564
|
for (let d = 0; d < tempPatientsTwo.length; d++) {
|
524
|
565
|
tempPatientsTwo[d]['new_order_info'] = []
|
525
|
566
|
let project = []
|
|
@@ -543,13 +584,19 @@ export default {
|
543
|
584
|
}
|
544
|
585
|
}
|
545
|
586
|
|
546
|
|
-
|
547
|
|
-
|
548
|
587
|
obj['price'] = project[i].price
|
549
|
588
|
obj['type'] = project[i].type
|
550
|
589
|
obj['item_name'] = project[i].item_name
|
551
|
590
|
obj['item_spec'] = project[i].item_spec
|
552
|
|
- obj['item_total'] = project[i].item_total
|
|
591
|
+
|
|
592
|
+ obj['order_status'] = project[i].order_status
|
|
593
|
+ obj['med_type'] = project[i].med_type
|
|
594
|
+ obj['record_date'] = project[i].record_date
|
|
595
|
+ obj['item_cost_type'] = project[i].item_cost_type
|
|
596
|
+ obj['unit'] = project[i].unit
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+ // obj['item_total'] = project[i].item_total
|
553
|
600
|
|
554
|
601
|
obj['item_id'] = project[i].item_id
|
555
|
602
|
obj['name'] = tempPatientsTwo[d].name
|
|
@@ -572,8 +619,14 @@ export default {
|
572
|
619
|
obj['item_name'] = advice[i].item_name
|
573
|
620
|
obj['item_spec'] = advice[i].item_spec
|
574
|
621
|
obj['item_id'] = advice[i].item_id
|
|
622
|
+ obj['unit'] = advice[i].unit
|
|
623
|
+
|
575
|
624
|
obj['name'] = tempPatientsTwo[d].name
|
576
|
|
- obj['item_total'] = advice[i].item_total
|
|
625
|
+ obj['order_status'] = advice[i].order_status
|
|
626
|
+ obj['med_type'] = advice[i].med_type
|
|
627
|
+ obj['record_date'] = advice[i].record_date
|
|
628
|
+ obj['item_cost_type'] = advice[i].item_cost_type
|
|
629
|
+ // obj['item_total'] = advice[i].item_total
|
577
|
630
|
obj['patient_id'] = tempPatientsTwo[d].patient_id
|
578
|
631
|
obj['count'] = count
|
579
|
632
|
tempPatientsTwo[d].new_order_info.push(obj)
|
|
@@ -584,17 +637,14 @@ export default {
|
584
|
637
|
let total = 0
|
585
|
638
|
for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
|
586
|
639
|
let new_name = tempPatientsTwo[i].new_order_info[b].item_name
|
587
|
|
- if (new_name != undefined){
|
|
640
|
+ if (new_name != undefined) {
|
588
|
641
|
if (new_name.length != 0) {
|
589
|
642
|
console.log(parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price))
|
590
|
643
|
total = parseFloat(total) + parseFloat((parseFloat(tempPatientsTwo[i].new_order_info[b].count) * parseFloat(tempPatientsTwo[i].new_order_info[b].price)).toFixed(2))
|
591
|
644
|
}
|
592
|
645
|
|
593
|
|
-
|
594
|
|
-
|
595
|
646
|
}
|
596
|
647
|
|
597
|
|
-
|
598
|
648
|
}
|
599
|
649
|
tempPatientsTwo[i]['total'] = total
|
600
|
650
|
}
|
|
@@ -603,11 +653,6 @@ export default {
|
603
|
653
|
if (tempPatientsTwo[i].new_order_info.length > 0) {
|
604
|
654
|
|
605
|
655
|
for (let b = 0; b < tempPatientsTwo[i].new_order_info.length; b++) {
|
606
|
|
- // let new_name = tempPatientsTwo[i].new_order_info[b].item_name
|
607
|
|
- // console.log('2 ' + new_name)
|
608
|
|
- //
|
609
|
|
- // new_name = new_name.replace('( ', '')
|
610
|
|
- // new_name = new_name.replace(' )', '')
|
611
|
656
|
|
612
|
657
|
let obj = {
|
613
|
658
|
name: tempPatientsTwo[i].name,
|
|
@@ -617,53 +662,50 @@ export default {
|
617
|
662
|
item_name: tempPatientsTwo[i].new_order_info[b].item_name,
|
618
|
663
|
item_id: tempPatientsTwo[i].new_order_info[b].item_id,
|
619
|
664
|
count: tempPatientsTwo[i].new_order_info[b].count,
|
620
|
|
- item_spec: tempPatientsTwo[i].new_order_info[b].item_spec
|
621
|
|
- }
|
|
665
|
+ item_spec: tempPatientsTwo[i].new_order_info[b].item_spec,
|
|
666
|
+ order_status: tempPatientsTwo[i].new_order_info[b].order_status,
|
|
667
|
+ med_type: tempPatientsTwo[i].new_order_info[b].med_type,
|
|
668
|
+ record_date: tempPatientsTwo[i].new_order_info[b].record_date,
|
|
669
|
+ item_cost_type: tempPatientsTwo[i].new_order_info[b].item_cost_type,
|
|
670
|
+ unit: tempPatientsTwo[i].new_order_info[b].unit,
|
622
|
671
|
|
623
|
672
|
|
624
|
|
- // if(b == 0){
|
|
673
|
+ }
|
625
|
674
|
obj['total'] = tempPatientsTwo[i].total
|
626
|
|
- // }else{
|
627
|
|
- // obj['total'] = 0
|
628
|
|
- // }
|
629
|
675
|
this.tableData.push(obj)
|
630
|
676
|
|
631
|
|
-
|
632
|
|
-
|
633
|
|
-
|
634
|
677
|
}
|
635
|
678
|
}
|
636
|
679
|
}
|
637
|
|
- console.log( this.tableData)
|
|
680
|
+ console.log(this.tableData)
|
638
|
681
|
this.handleSpanTempArr()
|
|
682
|
+ console.log(this.tableData)
|
|
683
|
+
|
639
|
684
|
// this.tableData = tempPatientsTwo
|
640
|
685
|
|
641
|
686
|
// console.log(tempPatientsTwo.length)
|
642
|
687
|
//
|
643
|
|
- let advices = []
|
644
|
|
- let projects = []
|
645
|
|
- let goods = []
|
646
|
|
- for(let i = 0; i < order_infos.length; i++){
|
647
|
|
- if(order_infos[i].advice_id > 0 && order_infos[i].project_id == 0){
|
648
|
|
- advices.push(order_infos[i].advice)
|
649
|
|
- }
|
650
|
|
- if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
|
651
|
|
- if(order_infos[i].project.type == 3){
|
652
|
|
- goods.push(order_infos[i].project)
|
653
|
|
- }
|
654
|
|
- }
|
655
|
|
- if(order_infos[i].advice_id == 0 && order_infos[i].project_id > 0){
|
656
|
|
- if(order_infos[i].project.type == 2){
|
657
|
|
- projects.push(order_infos[i].project)
|
658
|
|
- }
|
659
|
|
- }
|
660
|
|
- }
|
|
688
|
+ // let advices = []
|
|
689
|
+ // let projects = []
|
|
690
|
+ // let goods = []
|
|
691
|
+ // for (let i = 0; i < order_infos.length; i++) {
|
|
692
|
+ // if (order_infos[i].advice_id > 0 && order_infos[i].project_id == 0) {
|
|
693
|
+ // advices.push(order_infos[i].advice)
|
|
694
|
+ // }
|
|
695
|
+ // if (order_infos[i].advice_id == 0 && order_infos[i].project_id > 0) {
|
|
696
|
+ // if (order_infos[i].project.type == 3) {
|
|
697
|
+ // goods.push(order_infos[i].project)
|
|
698
|
+ // }
|
|
699
|
+ // }
|
|
700
|
+ // if (order_infos[i].advice_id == 0 && order_infos[i].project_id > 0) {
|
|
701
|
+ // if (order_infos[i].project.type == 2) {
|
|
702
|
+ // projects.push(order_infos[i].project)
|
|
703
|
+ // }
|
|
704
|
+ // }
|
|
705
|
+ // }
|
661
|
706
|
|
662
|
707
|
}
|
663
|
708
|
|
664
|
|
-
|
665
|
|
-
|
666
|
|
-
|
667
|
709
|
//
|
668
|
710
|
// console.log('去重前')
|
669
|
711
|
// console.log(advice)
|
|
@@ -720,145 +762,11 @@ export default {
|
720
|
762
|
// this.tableData = this.sort(this.tableData)
|
721
|
763
|
|
722
|
764
|
})
|
723
|
|
- }, uniqueProjectAndAdvice(array) {
|
724
|
|
- // res用来存储结果
|
725
|
|
- var res = []
|
726
|
|
- for (var i = 0, arrayLen = array.length; i < arrayLen; i++) {
|
727
|
|
- for (var j = 0, resLen = res.length; j < resLen; j++) {
|
728
|
|
- if (array[i].item_id === res[j].item_id && array[i].price === res[j].price) {
|
729
|
|
- break
|
730
|
|
- }
|
731
|
|
- }
|
732
|
|
- // 如果array[i]是唯一的,那么执行完循环,j等于resLen
|
733
|
|
- if (j === resLen) {
|
734
|
|
- res.push(array[i])
|
735
|
|
- }
|
736
|
|
- }
|
737
|
|
- return res
|
738
|
|
- }, sort(arr) {
|
739
|
|
- for (var i = 0; i < arr.length - 1; i++) {
|
740
|
|
- for (var j = 0; j < arr.length - i - 1; j++) {
|
741
|
|
- if (arr[j].patient_id > arr[j + 1].patient_id) {// 相邻元素两两对比
|
742
|
|
- var hand = arr[j]
|
743
|
|
- arr[j] = arr[j + 1]
|
744
|
|
- arr[j + 1] = hand
|
745
|
|
-
|
746
|
|
- }
|
747
|
|
- }
|
748
|
|
- }
|
749
|
|
- return arr
|
750
|
|
- }, handleSpanTempArr() {
|
751
|
|
- this.tempArr = []
|
752
|
|
-
|
753
|
|
- for (let i = 0; i < this.tableData.length; i++) {
|
754
|
|
- if (i === 0) {
|
755
|
|
- this.tempArr.push(1)
|
756
|
|
- this.pos = 0
|
757
|
|
- } else {
|
758
|
|
- // 判断当前元素与上一个元素是否相同
|
759
|
|
- if (this.tableData[i].patient_id === this.tableData[i - 1].patient_id) {
|
760
|
|
- this.tempArr[this.pos] += 1
|
761
|
|
- this.tempArr.push(0)
|
762
|
|
- } else {
|
763
|
|
- this.tempArr.push(1)
|
764
|
|
- this.pos = i
|
765
|
|
- }
|
766
|
|
- }
|
767
|
|
- }
|
768
|
|
-
|
769
|
|
- let sameRowArr = [], sIdx = 0
|
770
|
|
- this.tableData.forEach((item, index) => {
|
771
|
|
- item.index = index
|
772
|
|
- if (index === 0) {
|
773
|
|
- sameRowArr.push([index])
|
774
|
|
- } else {
|
775
|
|
- if (item.patient_id === this.tableData[index - 1].patient_id) {
|
776
|
|
- sameRowArr[sIdx].push(index)
|
777
|
|
- } else {
|
778
|
|
- sIdx = sIdx + 1
|
779
|
|
- sameRowArr.push([index])
|
780
|
|
- }
|
781
|
|
- }
|
782
|
|
- })
|
783
|
|
- this.sameRowArr = sameRowArr
|
784
|
|
- }, merge({ row, column, rowIndex, columnIndex }) {
|
785
|
|
- if (columnIndex === 0 || columnIndex === 6) {
|
786
|
|
- const _row = this.tempArr[rowIndex]
|
787
|
|
- const _col = _row > 0 ? 1 : 0
|
788
|
|
- return {
|
789
|
|
- rowspan: _row,
|
790
|
|
- colspan: _col
|
791
|
|
- }
|
792
|
|
- }
|
793
|
|
- }, export_detail() {
|
794
|
|
-
|
795
|
|
- let list = []
|
796
|
|
- for (let i = 0; i < this.tableData.length; i++) {
|
797
|
|
- let order = this.tableData[i]
|
798
|
|
- let name = order.name
|
799
|
|
- let item_name = order.item_name
|
800
|
|
- let count = order.count
|
801
|
|
- let price = order.price.toFixed(2)
|
802
|
|
- let pay_sumamt = (order.price.toFixed(2) * order.count).toFixed(2)
|
803
|
|
- let total = order.total.toFixed(2)
|
804
|
|
-
|
805
|
|
- let obj = {
|
806
|
|
- '患者姓名': name,
|
807
|
|
- '项目名称': item_name,
|
808
|
|
- '数量': count,
|
809
|
|
- '单价': price,
|
810
|
|
- '费用': pay_sumamt,
|
811
|
|
- '费用总额': total
|
812
|
|
- }
|
813
|
|
- list.push(obj)
|
814
|
|
- }
|
815
|
|
- import('@/vendor/Export2Excel').then(excel => {
|
816
|
|
- const tHeader = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
|
817
|
|
- const filterVal = ['患者姓名', '项目名称', '数量', '单价', '费用', '费用总额']
|
818
|
|
- const data = this.formatJson(filterVal, list)
|
819
|
|
- excel.export_json_to_excel1({
|
820
|
|
- header: tHeader,
|
821
|
|
- data,
|
822
|
|
- filename: '明细',
|
823
|
|
- ref: this.$refs['table'].$el
|
824
|
|
- })
|
825
|
|
- })
|
826
|
|
-
|
827
|
|
- }, formatJson(filterVal, jsonData) {
|
828
|
|
- return jsonData.map(v => filterVal.map(j => v[j]))
|
829
|
|
- }, getTotal(param) {
|
830
|
|
- const { columns, data } = param
|
831
|
|
- const sums = []
|
832
|
|
- columns.forEach((column, index) => {
|
833
|
|
- if (index === 0) {
|
834
|
|
- sums[index] = '合计'
|
835
|
|
- return
|
836
|
|
- }
|
837
|
|
- const values = data.map(item => Number(item[column.property]))
|
838
|
|
- if (column.property === 'total') {
|
839
|
|
- // sums[index] = values.reduce((prev, curr) => {
|
840
|
|
- // const value = Number(curr)
|
841
|
|
- // if (!isNaN(value)) {
|
842
|
|
- // return prev + curr
|
843
|
|
- // } else {
|
844
|
|
- // return prev
|
845
|
|
- // }
|
846
|
|
- // }, 0)
|
847
|
|
- // sums[index] = sums[index].toFixed(2)
|
848
|
|
- let num = 0
|
849
|
|
- data.map(item => {
|
850
|
|
- num += item.price * item.count
|
851
|
|
- })
|
852
|
|
- sums[index] = num.toFixed(2)
|
853
|
|
- } else {
|
854
|
|
- sums[index] = ''
|
855
|
|
- }
|
856
|
|
- })
|
857
|
|
-
|
858
|
|
- return sums
|
859
|
|
- }
|
|
765
|
+ },
|
860
|
766
|
},
|
|
767
|
+
|
861
|
768
|
created() {
|
|
769
|
+ this.getInit()
|
862
|
770
|
this.getSummaryDetailList()
|
863
|
771
|
|
864
|
772
|
}
|