|
@@ -4,23 +4,58 @@
|
4
|
4
|
<bread-crumb :crumbs="crumbs"></bread-crumb>
|
5
|
5
|
</div>
|
6
|
6
|
<div class="app-container ">
|
7
|
|
- <div class="cell clearfix">
|
8
|
|
- <el-input
|
9
|
|
- size="small"
|
10
|
|
- style="width: 400px;"
|
11
|
|
- class="filter-item"
|
12
|
|
- v-model.trim="keywords"
|
13
|
|
- placeholder="商品编码/商品名称/规格名称"
|
14
|
|
- />
|
15
|
|
- <el-button
|
16
|
|
- size="small"
|
17
|
|
- class="filter-item"
|
18
|
|
- type="primary"
|
19
|
|
- icon="el-icon-search"
|
20
|
|
- @click="search"
|
21
|
|
- >搜索</el-button
|
22
|
|
- >
|
|
7
|
+ <div style="justify-content: space-between;margin: 0px 0 12px 0;display: flex;align-items: center;">
|
|
8
|
+ <div>
|
|
9
|
+ <el-select v-model="value" style="width:140px;margin-right:10px;" placeholder="请选择">
|
|
10
|
+ <el-option
|
|
11
|
+ v-for="item in options"
|
|
12
|
+ :key="item.value"
|
|
13
|
+ :label="item.label"
|
|
14
|
+ :value="item.value">
|
|
15
|
+ </el-option>
|
|
16
|
+ </el-select>
|
|
17
|
+ <el-time-select
|
|
18
|
+ style="width:140px;"
|
|
19
|
+ v-model="value"
|
|
20
|
+ :picker-options="{
|
|
21
|
+ start: '08:30',
|
|
22
|
+ step: '00:15',
|
|
23
|
+ end: '18:30'
|
|
24
|
+ }"
|
|
25
|
+ placeholder="选择时间">
|
|
26
|
+ </el-time-select>-
|
|
27
|
+ <el-time-select
|
|
28
|
+ style="width:140px;"
|
|
29
|
+ v-model="value"
|
|
30
|
+ :picker-options="{
|
|
31
|
+ start: '08:30',
|
|
32
|
+ step: '00:15',
|
|
33
|
+ end: '18:30'
|
|
34
|
+ }"
|
|
35
|
+ placeholder="选择时间">
|
|
36
|
+ </el-time-select>
|
|
37
|
+ <el-input
|
|
38
|
+ size="small"
|
|
39
|
+ style="width: 200px;margin-left:10px;"
|
|
40
|
+ class="filter-item"
|
|
41
|
+ v-model.trim="keywords"
|
|
42
|
+ placeholder="商品编码/商品名称/规格名称"
|
|
43
|
+ />
|
|
44
|
+ <el-button
|
|
45
|
+ size="small"
|
|
46
|
+ class="filter-item"
|
|
47
|
+ type="primary"
|
|
48
|
+ icon="el-icon-search"
|
|
49
|
+ @click="search"
|
|
50
|
+ >搜索</el-button
|
|
51
|
+ >
|
|
52
|
+ </div>
|
|
53
|
+ <div>
|
|
54
|
+ <el-button size="small" type="primary" @click="exportList">导出</el-button>
|
|
55
|
+ <el-button size="small" type="primary">打印</el-button>
|
|
56
|
+ </div>
|
23
|
57
|
</div>
|
|
58
|
+
|
24
|
59
|
|
25
|
60
|
<el-table
|
26
|
61
|
:row-style="{ color: '#303133' }"
|
|
@@ -161,7 +196,9 @@ export default {
|
161
|
196
|
WarehouseInfo: {
|
162
|
197
|
loading: false,
|
163
|
198
|
warehouseInfoDate: []
|
164
|
|
- }
|
|
199
|
+ },
|
|
200
|
+ options:[],
|
|
201
|
+ value:""
|
165
|
202
|
};
|
166
|
203
|
},
|
167
|
204
|
methods: {
|
|
@@ -183,12 +220,30 @@ export default {
|
183
|
220
|
this.WarehouseInfo.loading = false;
|
184
|
221
|
this.total = response.data.data.total;
|
185
|
222
|
for (let i = 0; i < response.data.data.list.length; i++) {
|
186
|
|
-
|
187
|
|
- this.WarehouseInfo.warehouseInfoDate.push(
|
188
|
|
- response.data.data.list[i]
|
189
|
|
- );
|
|
223
|
+ this.WarehouseInfo.warehouseInfoDate.push( response.data.data.list[i]);
|
190
|
224
|
}
|
191
|
225
|
}
|
|
226
|
+ console.log("数据源头",this.WarehouseInfo.warehouseInfoDate)
|
|
227
|
+
|
|
228
|
+ for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
|
|
229
|
+ this.WarehouseInfo.warehouseInfoDate[i].type_name = this.WarehouseInfo.warehouseInfoDate[i].type.type_name
|
|
230
|
+
|
|
231
|
+ this.WarehouseInfo.warehouseInfoDate[i].stockInCount = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
232
|
+
|
|
233
|
+ this.WarehouseInfo.warehouseInfoDate[i].salesReturnCount = this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
234
|
+
|
|
235
|
+ this.WarehouseInfo.warehouseInfoDate[i].realCount = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) - this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
236
|
+
|
|
237
|
+ this.WarehouseInfo.warehouseInfoDate[i].stockOutCount = this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
238
|
+
|
|
239
|
+ this.WarehouseInfo.warehouseInfoDate[i].cancelStockCount = this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
240
|
+
|
|
241
|
+ this.WarehouseInfo.warehouseInfoDate[i].realOutCount = this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) - this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
242
|
+
|
|
243
|
+ this.WarehouseInfo.warehouseInfoDate[i].overplus = this.stockInCount(this.WarehouseInfo.warehouseInfoDate[i]) -this.salesReturnCount(this.WarehouseInfo.warehouseInfoDate[i]) - this.stockOutCount(this.WarehouseInfo.warehouseInfoDate[i]) + this.cancelStockCount(this.WarehouseInfo.warehouseInfoDate[i])
|
|
244
|
+ }
|
|
245
|
+
|
|
246
|
+ console.log("数据2222222",this.WarehouseInfo.warehouseInfoDate)
|
192
|
247
|
});
|
193
|
248
|
},
|
194
|
249
|
|
|
@@ -270,7 +325,25 @@ export default {
|
270
|
325
|
showCancelStockDetailDialog: function() {},
|
271
|
326
|
search: function() {
|
272
|
327
|
this.GetAllStockQuery();
|
273
|
|
- }
|
|
328
|
+ },
|
|
329
|
+
|
|
330
|
+ exportList(){
|
|
331
|
+ import('@/vendor/Export2Excel').then(excel => {
|
|
332
|
+ const tHeader = ['商品编码', '耗材名称', '耗材类型','规格型号','入库数量','入库退货','实际入库','出库数量','出库退库','实际出库','剩余库存']
|
|
333
|
+ const filterVal = ['good_code', 'good_name', 'type_name','specification_name','stockInCount','salesReturnCount','realCount','stockOutCount','cancelStockCount','realOutCount','overplus']
|
|
334
|
+ const data = this.formatJson(filterVal, this.WarehouseInfo.warehouseInfoDate)
|
|
335
|
+
|
|
336
|
+ excel.export_json_to_excel({
|
|
337
|
+ header: tHeader,
|
|
338
|
+ data,
|
|
339
|
+ filename: '库存查询'
|
|
340
|
+ })
|
|
341
|
+ this.downloadLoading = false
|
|
342
|
+ })
|
|
343
|
+ },
|
|
344
|
+ formatJson(filterVal, jsonData) {
|
|
345
|
+ return jsonData.map(v => filterVal.map(j => v[j]));
|
|
346
|
+ },
|
274
|
347
|
}
|
275
|
348
|
};
|
276
|
349
|
</script>
|