index.vue
10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<template>
<div class="app-container">
<el-row :gutter="24">
<el-col :span="8" :xs="24" style="margin-bottom: 10px; ">
<el-form :model="queryHeaderParams" ref="queryForm" :inline="true">
<el-form-item label="出库单号" prop="code">
<el-input
v-model="queryHeaderParams.code"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="headerQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="small" @click="headerQuery">搜索</el-button>
<!--<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>-->
</el-form-item>
</el-form>
</el-col>
<el-col :span="12" :offset="4" :xs="24" class="info_text">
物料总数:<span>25</span> 总单据数量:<span>40</span>已出库数量:<span>80</span>
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="12" :xs="24" style="margin: 10px 0">
<el-card shadow="always">
<el-table v-loading="headerLoading" :data="HeaderList" border @selection-change="headerSelectionChange">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="物料编码" align="center" prop="materialCode" :formatter="materialFormat" />
<el-table-column label="物料名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="物料规格" align="center" prop="materialSpec" :show-overflow-tooltip="true" />
<el-table-column label="单据数量" align="center" prop="shipQty" />
<el-table-column label="已出数量" align="center" prop="requestQty" />
<el-table-column label="库存状态" align="center" prop="inventorySts" :formatter="kcstatusFormat">
<template slot-scope="scope">
<el-tag :type="scope.row.inventorySts | statusFilter">{{scope.row.inventorySts}}</el-tag>
</template>
</el-table-column>
<el-table-column label="单位" align="center" prop="materialUnit" />
</el-table>
<pagination
v-show="headerTotal > 0"
:total="headerTotal"
:page.sync="queryHeaderParams.pageNum"
:limit.sync="queryHeaderParams.pageSize"
@pagination="getHeaderList"
/>
</el-card>
</el-col>
<el-col :span="12" :xs="24" style="margin: 10px 0">
<el-card shadow="always">
<el-form :model="queryDetailParams" ref="detailForm">
<el-form-item label="出库数量" prop="receiveNum">
<el-input
v-model="queryDetailParams.receiveNum"
clearable
size="small"
style="width: 240px"
@keyup.enter.native="detailQuery"
/>
</el-form-item>
</el-form>
<el-table v-loading="detailLoading" :data="DetailList" border @selection-change="detailSelectionChange">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['shipment:shippingCombination:combination']"
>组盘</el-button>
</template>
</el-table-column>
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="货主" align="center" prop="companyCode" />
<el-table-column label="库位编号" align="center" prop="locationCode"/>
<el-table-column label="容器编号" align="center" prop="containerCode"/>
<el-table-column label="数量" align="center" prop="qty" />
<el-table-column label="物料编码" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="物料规格" align="center" prop="materialSpec" :show-overflow-tooltip="true" />
<el-table-column label="库存状态" align="center" prop="inventorySts" :formatter="kcstatusFormat">
<template slot-scope="scope">
<el-tag :type="scope.row.inventorySts | statusFilter">{{scope.row.inventorySts}}</el-tag>
</template>
</el-table-column>
</el-table>
<pagination
v-show="detailTotal > 0"
:total="detailTotal"
:page.sync="queryDetailParams.pageNum"
:limit.sync="queryDetailParams.pageSize"
@pagination="getDetailList"
/>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import {listHeader,listDetail,delDetail,} from "@/api/shipment/shippingCombination";
export default {
name: "ShippingCombination",
data() {
return {
// 主表遮罩层
headerLoading: true,
// 主表选中数组
headerIds: [],
// 主表非单个禁用
headerSingle: true,
// 主表非多个禁用
headerMultiple: true,
// 主表显示搜索条件
showHeaderSearch: true,
// 主表总条数
headerTotal: 0,
// 主表表格数据
HeaderList: [],
// 主表弹出层标题
headerTitle: "",
// 主表是否显示弹出层
headerOpen: false,
// 主表数据字典
// 主表查询参数
queryHeaderParams: {
/*pageNum: 1,
pageSize: 10,*/
code: undefined,
},
// 主表表单参数
headerForm: {},
// 主表表单校验
headerRules: {
},
// 明细遮罩层
detailLoading: true,
// 明细选中数组
detailIds: [],
// 明细非单个禁用
detailSingle: true,
// 明细非多个禁用
detailMultiple: true,
// 明细显示搜索条件
showDetailSearch: true,
// 明细总条数
detailTotal: 0,
// 明细表格数据
DetailList: [],
// 明细弹出层标题
detailTitle: "",
// 明细是否显示弹出层
detailOpen: false,
// 明细库存数据字典
kcstatusOptions: [],
// 明细查询参数
queryDetailParams: {
receiveNum:undefined,
/*pageNum: 1,
pageSize: 10,*/
},
// 明细表单参数
detailForm: {},
// 明细表单校验
detailRules: {
shipQty: [
{
required: true,
message: "发货数量不能为空",
trigger: ["blur", "change"],
},
],
sequence: [
{
required: true,
message: "序号不能为空",
trigger: ["blur", "change"],
},
],
},
activeName: "first",
activeName2: "first1",
};
},
created() {
this.getHeaderList();
this.getDicts("sys_yes_no").then((response) => {
console.log(response)
this.typeOptions = response.data;
});
// 明细字典下拉
this.getDetailList();
this.getDicts("sys_common_status").then(response => {
this.materialOptions = response.data;
});
},
methods: {
/** 查询主表列表 */
getHeaderList() {
this.headerLoading = true;
listHeader(this.queryHeaderParams).then((response) => {
console.log(response);
this.HeaderList = response.rows;
this.headerTotal = response.total;
this.headerLoading = false;
});
},
/** 查询明细列表 */
getDetailList() {
this.detailLoading = true;
(this.queryDetailParams).then((response) => {
console.log(response);
this.DetailList = response.rows;
this.DetailTotal = response.total;
this.detailLoading = false;
});
},
// 明细字典翻译(库存状态、明细状态)
kcstatusFormat(row, column) {
return this.selectDictLabel(this.kcstatusOptions, row.inventorySts);
},
/** 主表搜索按钮操作 */
headerQuery() {
this.queryHeaderParams.pageNum = 1;
this.getHeaderList();
},
/** 主表重置按钮操作 */
resetHeaderQuery() {
this.resetForm("queryHeaderForm");
this.headerQuery();
},
// 主表多选框选中数据
headerSelectionChange(selection) {
console.log(selection);
this.headerIds = selection.map((item) => item.id);
this.headerSingle = selection.length != 1;
this.headerMultiple = !selection.length;
},
/** 明细搜索按钮操作 */
detailQuery() {
this.queryDetailParams.pageNum = 1;
this.getDetailList();
},
// 明细多选框选中数据
detailSelectionChange(selection) {
console.log(selection);
this.detailIds = selection.map((item) => item.id);
this.detailSingle = selection.length != 1;
this.detailMultiple = !selection.length;
},
/** 明细删除按钮操作 */
detailDelete(row) {
const detailIds = row.id || this.detailIds;
this.$confirm(
'是否确认取消组盘编号为"' + detailIds + '"的数据项?',
"警告",
{
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}
)
.then(function () {
return delDetail(detailIds);
})
.then(() => {
this.getDetailList();
this.msgSuccess("删除成功");
})
.catch(function () {});
},
//状态渲染
filters: {
statusFilter(shipmentType) {
const statusMap = {
published: 'success',
draft: 'gray',
deleted: 'danger'
}
return statusMap[shipmentType]
}
}
},
};
</script>
<style lang="scss">
.info_text{margin-top: 10px;text-align: right}
.info_text span {
font-size: 20px;
font-weight: bold;
margin-right: 20px;
color: rgb(28,132,198);
}
</style>