|
@@ -23,18 +23,9 @@
|
23
|
23
|
>汇总导出
|
24
|
24
|
</el-button>
|
25
|
25
|
<div class="cell clearfix">
|
26
|
|
- <label class="title"><span class="name">仓库</span> :</label>
|
27
|
|
- <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px" @change="changeHouseList">
|
28
|
|
- <el-option
|
29
|
|
- v-for="(option, index) in houseList"
|
30
|
|
- :key="index"
|
31
|
|
- :label="option.storehouse_name"
|
32
|
|
- :value="option.id">
|
33
|
|
- </el-option>
|
34
|
|
- </el-select>
|
35
|
26
|
<el-input
|
36
|
27
|
size="small"
|
37
|
|
- style="width: 200px;"
|
|
28
|
+ style="width: 400px;"
|
38
|
29
|
class="filter-item"
|
39
|
30
|
v-model.trim="searchKey"
|
40
|
31
|
placeholder="单据编码/制单人/药品名称"
|
|
@@ -47,7 +38,7 @@
|
47
|
38
|
@click="search"
|
48
|
39
|
>搜索</el-button
|
49
|
40
|
>
|
50
|
|
-
|
|
41
|
+ <div style="margin-left:10px;">
|
51
|
42
|
<label class="title"><span class="name">日期查询</span> : </label>
|
52
|
43
|
<el-date-picker
|
53
|
44
|
size="small"
|
|
@@ -76,7 +67,7 @@
|
76
|
67
|
value-format="yyyy-MM-dd"
|
77
|
68
|
@change="endTimeChange"
|
78
|
69
|
></el-date-picker>
|
79
|
|
-
|
|
70
|
+ </div>
|
80
|
71
|
</div>
|
81
|
72
|
|
82
|
73
|
<el-row :gutter="12" style="margin-top: 10px">
|
|
@@ -137,11 +128,6 @@
|
137
|
128
|
{{getAdminUser(scope.row.creater)}}
|
138
|
129
|
</template>
|
139
|
130
|
</el-table-column>
|
140
|
|
- <el-table-column label="仓库名称" align="center">
|
141
|
|
- <template slot-scope="scope">
|
142
|
|
- {{getStorehouseName(scope.row.storehouse_id)}}
|
143
|
|
- </template>
|
144
|
|
- </el-table-column>
|
145
|
131
|
<el-table-column label="退货价" align="center">
|
146
|
132
|
<template slot-scope="scope">
|
147
|
133
|
{{scope.row.price}}
|
|
@@ -249,8 +235,6 @@ export default {
|
249
|
235
|
tableList:[],
|
250
|
236
|
tableDataList:[],
|
251
|
237
|
drugTypeList:[],
|
252
|
|
- storehouse_id:0,
|
253
|
|
- houseList:[],
|
254
|
238
|
};
|
255
|
239
|
},
|
256
|
240
|
methods: {
|
|
@@ -288,7 +272,7 @@ export default {
|
288
|
272
|
|
289
|
273
|
fetchAllAdminUsers() {
|
290
|
274
|
fetchAllAdminUsers().then(response => {
|
291
|
|
-
|
|
275
|
+ console.log(response);
|
292
|
276
|
if (response.data.state == 1) {
|
293
|
277
|
this.adminUserOptions = response.data.data.users;
|
294
|
278
|
}
|
|
@@ -359,18 +343,12 @@ export default {
|
359
|
343
|
keyword:this.searchKey,
|
360
|
344
|
limit:this.limit,
|
361
|
345
|
page:this.page,
|
362
|
|
- storehouse_id:this.storehouse_id,
|
363
|
346
|
}
|
364
|
347
|
getDrugCancelDetail(params).then(response=>{
|
365
|
348
|
if(response.data.state == 1){
|
366
|
349
|
var order = response.data.data.order
|
367
|
350
|
var list = response.data.data.orderPrint
|
368
|
|
- var obj = {id:0,storehouse_name:"全部"}
|
369
|
|
- this.houseList = []
|
370
|
|
- this.houseList.push(obj)
|
371
|
|
- for(let i=0;i<response.data.data.houseList.length;i++){
|
372
|
|
- this.houseList.push(response.data.data.houseList[i])
|
373
|
|
- }
|
|
351
|
+ //this.drugTypeList = response.data.data.drugTypeList
|
374
|
352
|
for(let i=0;i<list.length;i++){
|
375
|
353
|
list[i].child = []
|
376
|
354
|
for(let j=0;j<order.length;j++){
|
|
@@ -391,6 +369,7 @@ export default {
|
391
|
369
|
order_number: "合计",
|
392
|
370
|
is_total: 1,
|
393
|
371
|
specification_name:"",
|
|
372
|
+ unit:"",
|
394
|
373
|
ctime:"",
|
395
|
374
|
total_price:total_price.toFixed(2),
|
396
|
375
|
});
|
|
@@ -430,7 +409,7 @@ export default {
|
430
|
409
|
// if(this.tableDataList[i].drug_type == 3){
|
431
|
410
|
// this.tableDataList[i].drug_type == "成药"
|
432
|
411
|
// }
|
433
|
|
- this.tableList[i].drug_type = this.getTypeList(scope.row.drug_type)
|
|
412
|
+ this.tableDataList[i].drug_type = this.getTypeList(this.tableDataList[i].drug_type)
|
434
|
413
|
this.tableDataList[i].index = i+1
|
435
|
414
|
this.tableDataList[i].unit = this.tableDataList[i].dose + this.tableDataList[i].dose_unit + "*"+this.tableDataList[i].min_number + this.tableDataList[i].min_unit+"/"+this.tableDataList[i].max_unit
|
436
|
415
|
this.tableDataList[i].user_name = this.getAdminUser(this.tableDataList[i].creater)
|
|
@@ -440,7 +419,7 @@ export default {
|
440
|
419
|
}
|
441
|
420
|
import('@/vendor/Export2Excel').then(excel => {
|
442
|
421
|
const tHeader = ['序号','单据编号', '药品名称', '规格型号','单据类型','操作时间','制单人','数量','退库价','总价']
|
443
|
|
- const filterVal = ['index','order_number','drug_name', 'unit', 'drug_type','ctime','user_name','total_count','price','total_price']
|
|
422
|
+ const filterVal = ['index','order_number','drug_name', 'specification_name', 'drug_type','ctime','user_name','total_count','price','total_price']
|
444
|
423
|
|
445
|
424
|
const data = this.formatJson(filterVal, this.tableDataList)
|
446
|
425
|
|
|
@@ -456,33 +435,35 @@ export default {
|
456
|
435
|
return jsonData.map(v => filterVal.map(j => v[j]));
|
457
|
436
|
},
|
458
|
437
|
exportListOne(){
|
459
|
|
- let obj = {'index':'合计','total_price':0}
|
|
438
|
+ // let obj = {'index':'合计','total_price':0}
|
|
439
|
+ console.log("@332322323232332",this.tableList)
|
|
440
|
+
|
460
|
441
|
for(let i=0;i<this.tableList.length;i++){
|
461
|
442
|
this.tableList[i].index = i+1
|
462
|
443
|
this.tableList[i].unit = this.tableList[i].dose + this.tableList[i].dose_unit + "*"+this.tableList[i].min_number + this.tableList[i].min_unit+"/"+this.tableList[i].max_unit
|
463
|
|
- if(this.tableData[i].drug_type == 1){
|
464
|
|
- this.tableData[i].drugtype = "西药"
|
|
444
|
+ if(this.tableList[i].drug_type == 1){
|
|
445
|
+ this.tableList[i].drugtype = "西药"
|
465
|
446
|
}
|
466
|
|
- if(this.tableData[i].drug_type == 2){
|
467
|
|
- this.tableData[i].drugtype = "草药"
|
|
447
|
+ if(this.tableList[i].drug_type == 2){
|
|
448
|
+ this.tableList[i].drugtype = "草药"
|
468
|
449
|
}
|
469
|
|
- if(this.tableData[i].drug_type == 3){
|
470
|
|
- this.tableData[i].drugtype = "成药"
|
|
450
|
+ if(this.tableList[i].drug_type == 3){
|
|
451
|
+ this.tableList[i].drugtype = "成药"
|
471
|
452
|
}
|
472
|
|
- this.tableData[i].time = this.getTime(this.tableData[i].ctime)
|
473
|
|
- this.tableData[i].user_name = this.getAdminUser(this.tableData[i].creater)
|
|
453
|
+ this.tableList[i].time = this.getTime(this.tableList[i].ctime)
|
|
454
|
+ this.tableList[i].user_name = this.getAdminUser(this.tableList[i].creater)
|
474
|
455
|
|
475
|
|
- this.tableData[i].total_price = this.tableData[i].count * this.tableData[i].price
|
476
|
|
- obj.total_price += this.tabelePrintList[i].count * this.tabelePrintList[i].price
|
|
456
|
+ //this.tableList[i].total_price = this.tableList[i].count * this.tableList[i].price
|
|
457
|
+ // obj.total_price += this.tableList[i].count * this.tableList[i].price
|
477
|
458
|
}
|
478
|
|
- obj.total_price = obj.total_price.toFixed(2)
|
479
|
|
- this.tableData.push(obj)
|
480
|
|
- for(let i=0;i<this.tableData.length;i++){
|
481
|
|
- this.tableData[i].total_price = this.tableData[i].total_price.toFixed(2)
|
482
|
|
- }
|
|
459
|
+ // obj.total_price = obj.total_price.toFixed(2)
|
|
460
|
+ // this.tableList.push(obj)
|
|
461
|
+ // for(let i=0;i<this.tableData.length;i++){
|
|
462
|
+ // this.tableData[i].total_price = (this.tableData[i].total_price).toFixed(2)
|
|
463
|
+ // }
|
483
|
464
|
import('@/vendor/Export2Excel').then(excel => {
|
484
|
465
|
const tHeader = ['序号','单据编号', '药品类型','药品名称', '规格型号','操作时间','制单人','退货价','数量','总价']
|
485
|
|
- const filterVal = ['index','order_number','drugtype','drug_name', 'unit', 'time','user_name','price','count','total_price']
|
|
466
|
+ const filterVal = ['index','order_number','drugtype','drug_name', 'specification_name', 'time','user_name','price','count','total_price']
|
486
|
467
|
|
487
|
468
|
const data = this.formatJson(filterVal, this.tableList)
|
488
|
469
|
|
|
@@ -511,24 +492,7 @@ export default {
|
511
|
492
|
}
|
512
|
493
|
}
|
513
|
494
|
return name
|
514
|
|
- },
|
515
|
|
- getStorehouseName(id){
|
516
|
|
- var storehouse_name = ""
|
517
|
|
- for(let i=0;i<this.houseList.length;i++){
|
518
|
|
- if(id == this.houseList[i].id){
|
519
|
|
- storehouse_name = this.houseList[i].storehouse_name
|
520
|
|
- }
|
521
|
|
- }
|
522
|
|
- if(storehouse_name == "全部"){
|
523
|
|
- return ""
|
524
|
|
- }else{
|
525
|
|
- return storehouse_name
|
526
|
|
- }
|
527
|
|
- },
|
528
|
|
- changeHouseList(){
|
529
|
|
- this.houseList = []
|
530
|
|
- this.getlist()
|
531
|
|
- }
|
|
495
|
+ }
|
532
|
496
|
}
|
533
|
497
|
};
|
534
|
498
|
</script>
|