提交 | 用户 | 时间
|
bdd09a
|
1 |
<template> |
44f5fa
|
2 |
<div class="box"> |
W |
3 |
<el-card class="box-card1"> |
1308d4
|
4 |
<div> |
W |
5 |
<el-menu |
|
6 |
class="sidebar-el-menu" |
|
7 |
background-color="white" |
|
8 |
text-color="#7a8297" |
|
9 |
active-text-color="#2d8cf0" |
|
10 |
> |
|
11 |
<div v-for="(item, index) in leftListdata" :key="item.werksId"> |
|
12 |
<!-- 一级菜单 --> |
|
13 |
<el-menu-item |
|
14 |
:index="index.toString()" |
|
15 |
:class="{ 'is-active': currentIndex === index.toString() }" |
|
16 |
v-if="item.detailList == null" |
|
17 |
@click="handleClick(item, index.toString())" |
|
18 |
> |
|
19 |
<span slot="title">{{ item.werksName }}</span> |
|
20 |
</el-menu-item> |
|
21 |
<!-- 二级菜单 --> |
|
22 |
<el-submenu |
|
23 |
:index="index.toString()" |
|
24 |
v-else |
|
25 |
> |
|
26 |
<template #title> |
|
27 |
<span>{{ item.werksName }}</span> |
|
28 |
</template> |
|
29 |
<el-menu-item-group :class="{ 'is-active': currentIndex === index.toString() }"> |
|
30 |
<el-menu-item |
|
31 |
v-for="(it, subIndex) in item.detailList" |
|
32 |
:key="it.warehouseId" |
|
33 |
:index="`${index}-${subIndex}`" |
|
34 |
:class="{ 'is-active': currentIndex === `${index}-${subIndex}` }" |
|
35 |
@click="handleClick(it, `${index}-${subIndex}`)" |
|
36 |
> |
|
37 |
{{ it.warehouseName }} |
|
38 |
</el-menu-item> |
|
39 |
</el-menu-item-group> |
|
40 |
</el-submenu> |
|
41 |
</div> |
|
42 |
</el-menu> |
|
43 |
</div> |
|
44 |
</el-card> |
|
45 |
<!-- 右侧 --> |
|
46 |
<el-card class="box-card2"> |
|
47 |
<div class="box1"> |
|
48 |
<el-form |
|
49 |
:model="queryParams" |
|
50 |
ref="queryForm" |
|
51 |
size="small" |
|
52 |
:inline="true" |
|
53 |
v-show="showSearch" |
|
54 |
label-width="68px" |
|
55 |
> |
|
56 |
<el-form-item label="仓库" prop="lgort"> |
|
57 |
<el-input |
|
58 |
v-model="queryParams.lgort" |
|
59 |
placeholder="请输入仓库" |
|
60 |
clearable |
|
61 |
@keyup.enter.native="handleQuery" |
|
62 |
/> |
|
63 |
</el-form-item> |
|
64 |
<el-form-item label="名称" prop="locationName"> |
|
65 |
<el-input |
|
66 |
v-model="queryParams.locationName" |
|
67 |
placeholder="请输入名称" |
|
68 |
clearable |
|
69 |
@keyup.enter.native="handleQuery" |
|
70 |
/> |
|
71 |
</el-form-item> |
|
72 |
<el-form-item label="状态" prop="state"> |
|
73 |
<el-input |
|
74 |
v-model="queryParams.state" |
|
75 |
placeholder="请输入状态" |
|
76 |
clearable |
|
77 |
@keyup.enter.native="handleQuery" |
|
78 |
/> |
|
79 |
</el-form-item> |
|
80 |
<el-form-item> |
|
81 |
<el-button |
|
82 |
type="primary" |
|
83 |
icon="el-icon-search" |
|
84 |
size="mini" |
|
85 |
@click="handleQuery" |
|
86 |
>搜索</el-button |
|
87 |
> |
|
88 |
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
|
89 |
>重置</el-button |
|
90 |
> |
|
91 |
</el-form-item> |
|
92 |
</el-form> |
|
93 |
|
|
94 |
<el-row :gutter="10" class="mb8"> |
|
95 |
<el-col :span="1.5"> |
|
96 |
<el-button |
|
97 |
type="primary" |
|
98 |
plain |
|
99 |
icon="el-icon-plus" |
|
100 |
size="mini" |
|
101 |
@click="handleAdd" |
|
102 |
v-hasPermi="['system:location:add']" |
|
103 |
>新增</el-button |
|
104 |
> |
|
105 |
</el-col> |
|
106 |
<el-col :span="1.5"> |
|
107 |
<el-button |
|
108 |
type="success" |
|
109 |
plain |
|
110 |
icon="el-icon-edit" |
|
111 |
size="mini" |
|
112 |
:disabled="single" |
|
113 |
@click="handleUpdate" |
|
114 |
v-hasPermi="['system:location:edit']" |
|
115 |
>修改</el-button |
|
116 |
> |
|
117 |
</el-col> |
|
118 |
<el-col :span="1.5"> |
|
119 |
<el-button |
|
120 |
type="danger" |
|
121 |
plain |
|
122 |
icon="el-icon-delete" |
|
123 |
size="mini" |
|
124 |
:disabled="multiple" |
|
125 |
@click="handleDelete" |
|
126 |
v-hasPermi="['system:location:remove']" |
|
127 |
>删除</el-button |
|
128 |
> |
|
129 |
</el-col> |
|
130 |
<el-col :span="1.5"> |
|
131 |
<el-button |
|
132 |
type="warning" |
|
133 |
plain |
|
134 |
icon="el-icon-download" |
|
135 |
size="mini" |
|
136 |
@click="handleExport" |
|
137 |
v-hasPermi="['system:location:export']" |
|
138 |
>导出</el-button |
|
139 |
> |
|
140 |
</el-col> |
|
141 |
<right-toolbar |
|
142 |
:showSearch.sync="showSearch" |
|
143 |
@queryTable="getList" |
|
144 |
></right-toolbar> |
|
145 |
</el-row> |
|
146 |
|
|
147 |
<el-table |
|
148 |
v-loading="loading" |
|
149 |
border |
|
150 |
:data="locationList" |
|
151 |
@selection-change="handleSelectionChange" |
|
152 |
> |
|
153 |
<el-table-column type="selection" width="55" align="center" /> |
|
154 |
<el-table-column label="序号" type="index" fixed width="50" /> |
|
155 |
<!-- <el-table-column label="库位ID" align="center" prop="locationId" v-if="true"/> --> |
|
156 |
<el-table-column |
|
157 |
label="隶属库位ID" |
|
158 |
align="center" |
|
159 |
prop="parentLocationId" |
|
160 |
/> |
|
161 |
<el-table-column label="仓库" align="center" prop="lgort" /> |
|
162 |
<el-table-column label="库位序号" align="center" prop="locationNo" /> |
|
163 |
<el-table-column label="名称" align="center" prop="locationName" /> |
|
164 |
<el-table-column label="工厂" align="center" prop="werks" /> |
|
165 |
<el-table-column label="类型" align="center" prop="type" /> |
|
166 |
<el-table-column |
|
167 |
label="体积限制" |
|
168 |
align="center" |
|
169 |
prop="volumeRestriction" |
|
170 |
/> |
|
171 |
<el-table-column label="重量限制" align="center" prop="weightLimit" /> |
|
172 |
<el-table-column |
|
173 |
label="箱数限制" |
|
174 |
align="center" |
|
175 |
prop="containerNumberLimit" |
|
176 |
/> |
|
177 |
<el-table-column |
|
178 |
label="数量限制" |
|
179 |
align="center" |
|
180 |
prop="quantitativeRestrictions" |
|
181 |
/> |
|
182 |
<el-table-column label="托盘限制" align="center" prop="trayLimit" /> |
|
183 |
<el-table-column label="长度" align="center" prop="length" /> |
|
184 |
<el-table-column label="宽" align="center" prop="width" /> |
|
185 |
<el-table-column label="高" align="center" prop="height" /> |
|
186 |
<el-table-column label="坐标X" align="center" prop="coordinateX" /> |
|
187 |
<el-table-column label="坐标Y" align="center" prop="coordinateY" /> |
|
188 |
<el-table-column label="坐标Z" align="center" prop="coordinateZ" /> |
|
189 |
<el-table-column label="像素X" align="center" prop="pixelX" /> |
|
190 |
<el-table-column label="像素Y" align="center" prop="pixelY" /> |
|
191 |
<el-table-column label="空间层数" align="center" prop="paceLayer" /> |
|
192 |
<el-table-column |
|
193 |
label="1-允许" |
|
194 |
align="center" |
|
195 |
prop="allowMixedProduct" |
|
196 |
/> |
|
197 |
<el-table-column |
|
198 |
label="1-允许" |
|
199 |
align="center" |
|
200 |
prop="allowMixedProductLot" |
|
201 |
/> |
|
202 |
<el-table-column label="层级" align="center" prop="layer" /> |
|
203 |
<el-table-column label="1-存在" align="center" prop="hasChild" /> |
|
204 |
<el-table-column label="路径" align="center" prop="path" /> |
|
205 |
<el-table-column label="描述" align="center" prop="description" /> |
|
206 |
<!-- <el-table-column label="状态" align="center" prop="state" /> --> |
|
207 |
<el-table-column |
|
208 |
label="最后更新人id" |
|
209 |
align="center" |
|
210 |
prop="lastUpdatedUserId" |
|
211 |
/> |
|
212 |
<el-table-column |
|
213 |
label="最后更新人姓名" |
|
214 |
align="center" |
|
215 |
prop="lastUpdatedUserName" |
|
216 |
/> |
|
217 |
<el-table-column |
|
218 |
label="最后更新时间" |
|
219 |
align="center" |
|
220 |
prop="lastUpdatedDateTime" |
|
221 |
width="180" |
|
222 |
> |
|
223 |
<template slot-scope="scope"> |
|
224 |
<span>{{ |
|
225 |
parseTime(scope.row.lastUpdatedDateTime, "{y}-{m}-{d}") |
|
226 |
}}</span> |
|
227 |
</template> |
|
228 |
</el-table-column> |
|
229 |
<el-table-column |
|
230 |
label="操作" |
|
231 |
align="center" |
|
232 |
class-name="small-padding fixed-width" |
|
233 |
> |
|
234 |
<template slot-scope="scope"> |
|
235 |
<el-button |
|
236 |
size="mini" |
|
237 |
type="text" |
|
238 |
icon="el-icon-edit" |
|
239 |
@click="handleUpdate(scope.row)" |
|
240 |
v-hasPermi="['system:location:edit']" |
|
241 |
>修改</el-button |
|
242 |
> |
|
243 |
<el-button |
|
244 |
size="mini" |
|
245 |
type="text" |
|
246 |
icon="el-icon-delete" |
|
247 |
@click="handleDelete(scope.row)" |
|
248 |
v-hasPermi="['system:location:remove']" |
|
249 |
>删除</el-button |
|
250 |
> |
|
251 |
</template> |
|
252 |
</el-table-column> |
|
253 |
</el-table> |
|
254 |
|
|
255 |
<pagination |
|
256 |
v-show="total > 0" |
|
257 |
:total="total" |
|
258 |
:page.sync="queryParams.pageNum" |
|
259 |
:limit.sync="queryParams.pageSize" |
|
260 |
@pagination="getList" |
|
261 |
/> |
|
262 |
</div> |
|
263 |
</el-card> |
|
264 |
<!-- 添加或修改库位对话框 --> |
|
265 |
<el-dialog |
|
266 |
:title="title" |
|
267 |
v-if="open" |
|
268 |
:visible.sync="open" |
|
269 |
width="500px" |
|
270 |
append-to-body |
|
271 |
> |
|
272 |
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
|
273 |
<!-- <el-form-item label="隶属库位ID" prop="parentLocationId"> |
|
274 |
<el-input v-model="form.parentLocationId" placeholder="请输入隶属库位ID" /> |
|
275 |
</el-form-item> --> |
|
276 |
<el-form-item label="仓库" prop="lgort"> |
|
277 |
<el-input v-model="form.lgort" placeholder="请输入仓库" /> |
|
278 |
</el-form-item> |
|
279 |
<el-form-item label="库位序号" prop="locationNo"> |
|
280 |
<el-input v-model="form.locationNo" placeholder="请输入库位序号" /> |
|
281 |
</el-form-item> |
|
282 |
<el-form-item label="名称" prop="locationName"> |
|
283 |
<el-input v-model="form.locationName" placeholder="请输入名称" /> |
|
284 |
</el-form-item> |
|
285 |
<el-form-item label="工厂" prop="werks"> |
|
286 |
<!-- <el-input v-model="form.werks" placeholder="请输入工厂" /> --> |
|
287 |
<el-select |
|
288 |
v-model="form.werks" |
|
289 |
placeholder="请选择工厂" |
|
290 |
style="width: 100%" |
|
291 |
> |
|
292 |
<el-option |
|
293 |
v-for="dict in werksList" |
|
294 |
:key="dict.werks" |
|
295 |
:label="dict.werksName" |
|
296 |
:value="dict.werks" |
|
297 |
> |
|
298 |
</el-option> |
|
299 |
</el-select> |
|
300 |
</el-form-item> |
|
301 |
<el-form-item label="体积限制" prop="volumeRestriction"> |
|
302 |
<el-input |
|
303 |
v-model.number="form.volumeRestriction" |
|
304 |
placeholder="请输入体积限制" |
|
305 |
/> |
|
306 |
</el-form-item> |
|
307 |
<el-form-item label="重量限制" prop="weightLimit"> |
|
308 |
<el-input |
|
309 |
v-model.number="form.weightLimit" |
|
310 |
placeholder="请输入重量限制" |
|
311 |
/> |
|
312 |
</el-form-item> |
|
313 |
<el-form-item label="箱数限制" prop="containerNumberLimit"> |
|
314 |
<el-input |
|
315 |
v-model.number="form.containerNumberLimit" |
|
316 |
placeholder="请输入箱数限制" |
|
317 |
/> |
|
318 |
</el-form-item> |
|
319 |
<el-form-item label="数量限制" prop="quantitativeRestrictions"> |
|
320 |
<el-input |
|
321 |
v-model.number="form.quantitativeRestrictions" |
|
322 |
placeholder="请输入数量限制" |
|
323 |
/> |
|
324 |
</el-form-item> |
|
325 |
<el-form-item label="托盘限制" prop="trayLimit"> |
|
326 |
<el-input v-model="form.trayLimit" placeholder="请输入托盘限制" /> |
|
327 |
</el-form-item> |
|
328 |
<el-form-item label="长度" prop="length"> |
|
329 |
<el-input v-model.number="form.length" placeholder="请输入长度" /> |
|
330 |
</el-form-item> |
|
331 |
<el-form-item label="宽" prop="width"> |
|
332 |
<el-input v-model.number="form.width" placeholder="请输入宽" /> |
|
333 |
</el-form-item> |
|
334 |
<el-form-item label="高" prop="height"> |
|
335 |
<el-input v-model.number="form.height" placeholder="请输入高" /> |
|
336 |
</el-form-item> |
|
337 |
<el-form-item label="坐标X" prop="coordinateX"> |
|
338 |
<el-input v-model="form.coordinateX" placeholder="请输入坐标X" /> |
|
339 |
</el-form-item> |
|
340 |
<el-form-item label="坐标Y" prop="coordinateY"> |
|
341 |
<el-input v-model="form.coordinateY" placeholder="请输入坐标Y" /> |
|
342 |
</el-form-item> |
|
343 |
<el-form-item label="坐标Z" prop="coordinateZ"> |
|
344 |
<el-input v-model="form.coordinateZ" placeholder="请输入坐标Z" /> |
|
345 |
</el-form-item> |
|
346 |
<el-form-item label="像素X" prop="pixelX"> |
|
347 |
<el-input v-model="form.pixelX" placeholder="请输入像素X" /> |
|
348 |
</el-form-item> |
|
349 |
<el-form-item label="像素Y" prop="pixelY"> |
|
350 |
<el-input v-model="form.pixelY" placeholder="请输入像素Y" /> |
|
351 |
</el-form-item> |
|
352 |
<el-form-item label="空间层数" prop="paceLayer"> |
|
353 |
<el-input v-model="form.paceLayer" placeholder="请输入空间层数" /> |
|
354 |
</el-form-item> |
|
355 |
<el-form-item label="是否允许" prop="allowMixedProduct"> |
|
356 |
<el-input |
|
357 |
v-model="form.allowMixedProduct" |
|
358 |
placeholder="请输入1-允许" |
|
359 |
/> |
|
360 |
</el-form-item> |
|
361 |
<el-form-item label="是否允许" prop="allowMixedProductLot"> |
|
362 |
<el-input |
|
363 |
v-model="form.allowMixedProductLot" |
|
364 |
placeholder="请输入1-允许" |
|
365 |
/> |
|
366 |
</el-form-item> |
|
367 |
<el-form-item label="层级" prop="layer"> |
|
368 |
<el-input v-model="form.layer" placeholder="请输入层级" /> |
|
369 |
</el-form-item> |
|
370 |
<el-form-item label="是否存在" prop="hasChild"> |
|
371 |
<el-input v-model="form.hasChild" placeholder="请输入1-存在" /> |
|
372 |
</el-form-item> |
|
373 |
<el-form-item label="路径" prop="path"> |
|
374 |
<el-input v-model="form.path" placeholder="请输入路径" /> |
|
375 |
</el-form-item> |
|
376 |
<el-form-item label="描述" prop="description"> |
|
377 |
<el-input v-model="form.description" placeholder="请输入描述" /> |
|
378 |
</el-form-item> |
|
379 |
<!-- <el-form-item label="状态" prop="state"> |
|
380 |
<el-input v-model="form.state" placeholder="请输入状态" /> |
|
381 |
</el-form-item> --> |
|
382 |
<!-- <el-form-item label="最后更新人id" prop="lastUpdatedUserId"> |
|
383 |
<el-input v-model="form.lastUpdatedUserId" placeholder="请输入最后更新人id" /> |
|
384 |
</el-form-item> |
|
385 |
<el-form-item label="最后更新人姓名" prop="lastUpdatedUserName"> |
|
386 |
<el-input v-model="form.lastUpdatedUserName" placeholder="请输入最后更新人姓名" /> |
|
387 |
</el-form-item> |
|
388 |
<el-form-item label="最后更新时间" prop="lastUpdatedDateTime"> |
|
389 |
<el-date-picker clearable |
|
390 |
v-model="form.lastUpdatedDateTime" |
|
391 |
type="datetime" |
|
392 |
value-format="yyyy-MM-dd HH:mm:ss" |
|
393 |
placeholder="请选择最后更新时间"> |
|
394 |
</el-date-picker> |
|
395 |
</el-form-item> --> |
|
396 |
</el-form> |
|
397 |
<div slot="footer" class="dialog-footer"> |
|
398 |
<el-button :loading="buttonLoading" type="primary" @click="submitForm" |
|
399 |
>确 定</el-button |
|
400 |
> |
|
401 |
<el-button @click="cancel">取 消</el-button> |
|
402 |
</div> |
|
403 |
</el-dialog> |
bdd09a
|
404 |
</div> |
W |
405 |
</template> |
|
406 |
|
|
407 |
<script> |
1308d4
|
408 |
import { |
W |
409 |
listLocation, |
|
410 |
getLocation, |
|
411 |
delLocation, |
|
412 |
addLocation, |
|
413 |
updateLocation, |
|
414 |
listWaresList, |
|
415 |
listwerkshouse, |
|
416 |
} from "@/api/basicData/location"; |
44f5fa
|
417 |
|
1308d4
|
418 |
export default { |
W |
419 |
name: "Location", |
|
420 |
data() { |
|
421 |
return { |
|
422 |
// 按钮loading |
|
423 |
buttonLoading: false, |
|
424 |
// 遮罩层 |
|
425 |
loading: true, |
|
426 |
// 选中数组 |
|
427 |
ids: [], |
|
428 |
// 非单个禁用 |
|
429 |
single: true, |
|
430 |
// 非多个禁用 |
|
431 |
multiple: true, |
|
432 |
// 显示搜索条件 |
|
433 |
showSearch: true, |
|
434 |
// 总条数 |
|
435 |
total: 0, |
|
436 |
// 库位表格数据 |
|
437 |
locationList: [], |
|
438 |
// 弹出层标题 |
|
439 |
title: "", |
|
440 |
// 是否显示弹出层 |
|
441 |
open: false, |
|
442 |
// 查询参数 |
|
443 |
queryParams: { |
|
444 |
pageNum: 1, |
|
445 |
pageSize: 10, |
|
446 |
lgort: undefined, |
|
447 |
locationName: undefined, |
|
448 |
warehouseName:undefined, |
|
449 |
werks:undefined, |
|
450 |
lgort:undefined, |
|
451 |
type: undefined, |
|
452 |
state: undefined, |
|
453 |
}, |
|
454 |
// 表单参数 |
|
455 |
form: {}, |
|
456 |
werksList: [], |
|
457 |
leftListdata: [], |
|
458 |
currentIndex: null, |
|
459 |
defaultProps: { |
|
460 |
children: "detailList", |
|
461 |
label: "werksName", |
|
462 |
}, |
|
463 |
// 表单校验 |
|
464 |
rules: { |
|
465 |
// locationId: [ |
|
466 |
// { required: true, message: "库位ID不能为空", trigger: "blur" } |
|
467 |
// ], |
|
468 |
parentLocationId: [ |
|
469 |
{ required: true, message: "隶属库位ID不能为空", trigger: "blur" }, |
|
470 |
], |
|
471 |
lgort: [{ required: true, message: "仓库不能为空", trigger: "blur" }], |
|
472 |
locationNo: [ |
|
473 |
{ required: true, message: "库位序号不能为空", trigger: "blur" }, |
|
474 |
], |
|
475 |
locationName: [ |
|
476 |
{ required: true, message: "名称不能为空", trigger: "blur" }, |
|
477 |
], |
|
478 |
werks: [{ required: true, message: "工厂不能为空", trigger: "blur" }], |
|
479 |
type: [{ required: true, message: "类型不能为空", trigger: "change" }], |
|
480 |
volumeRestriction: [ |
|
481 |
{ required: true, message: "体积限制不能为空", trigger: "blur" }, |
|
482 |
], |
|
483 |
weightLimit: [ |
|
484 |
{ required: true, message: "重量限制不能为空", trigger: "blur" }, |
|
485 |
], |
|
486 |
containerNumberLimit: [ |
|
487 |
{ required: true, message: "箱数限制不能为空", trigger: "blur" }, |
|
488 |
], |
|
489 |
quantitativeRestrictions: [ |
|
490 |
{ required: true, message: "数量限制不能为空", trigger: "blur" }, |
|
491 |
], |
|
492 |
trayLimit: [ |
|
493 |
{ required: true, message: "托盘限制不能为空", trigger: "blur" }, |
|
494 |
], |
|
495 |
length: [{ required: true, message: "长度不能为空", trigger: "blur" }], |
|
496 |
width: [{ required: true, message: "宽不能为空", trigger: "blur" }], |
|
497 |
height: [{ required: true, message: "高不能为空", trigger: "blur" }], |
|
498 |
coordinateX: [ |
|
499 |
{ required: true, message: "坐标X不能为空", trigger: "blur" }, |
|
500 |
], |
|
501 |
coordinateY: [ |
|
502 |
{ required: true, message: "坐标Y不能为空", trigger: "blur" }, |
|
503 |
], |
|
504 |
coordinateZ: [ |
|
505 |
{ required: true, message: "坐标Z不能为空", trigger: "blur" }, |
|
506 |
], |
|
507 |
pixelX: [{ required: true, message: "像素X不能为空", trigger: "blur" }], |
|
508 |
pixelY: [{ required: true, message: "像素Y不能为空", trigger: "blur" }], |
|
509 |
paceLayer: [ |
|
510 |
{ required: true, message: "空间层数不能为空", trigger: "blur" }, |
|
511 |
], |
|
512 |
allowMixedProduct: [ |
|
513 |
{ required: true, message: "1-允许不能为空", trigger: "blur" }, |
|
514 |
], |
|
515 |
allowMixedProductLot: [ |
|
516 |
{ required: true, message: "1-允许不能为空", trigger: "blur" }, |
|
517 |
], |
|
518 |
layer: [{ required: true, message: "层级不能为空", trigger: "blur" }], |
|
519 |
hasChild: [ |
|
520 |
{ required: true, message: "1-存在不能为空", trigger: "blur" }, |
|
521 |
], |
|
522 |
path: [{ required: true, message: "路径不能为空", trigger: "blur" }], |
|
523 |
description: [ |
|
524 |
{ required: true, message: "描述不能为空", trigger: "blur" }, |
|
525 |
], |
|
526 |
// state: [{ required: true, message: "状态不能为空", trigger: "blur" }], |
|
527 |
displayOrder: [ |
|
528 |
{ required: true, message: "排序不能为空", trigger: "blur" }, |
|
529 |
], |
|
530 |
createdUserId: [ |
|
531 |
{ required: true, message: "创建人id不能为空", trigger: "blur" }, |
|
532 |
], |
|
533 |
createdUserName: [ |
|
534 |
{ required: true, message: "创建人姓名不能为空", trigger: "blur" }, |
|
535 |
], |
|
536 |
createdDateTime: [ |
|
537 |
{ required: true, message: "创建日期时间不能为空", trigger: "blur" }, |
|
538 |
], |
|
539 |
lastUpdatedUserId: [ |
|
540 |
{ required: true, message: "最后更新人id不能为空", trigger: "blur" }, |
|
541 |
], |
|
542 |
lastUpdatedUserName: [ |
|
543 |
{ |
|
544 |
required: true, |
|
545 |
message: "最后更新人姓名不能为空", |
|
546 |
trigger: "blur", |
|
547 |
}, |
|
548 |
], |
|
549 |
lastUpdatedDateTime: [ |
|
550 |
{ required: true, message: "最后更新时间不能为空", trigger: "blur" }, |
|
551 |
], |
|
552 |
isDeleted: [ |
|
553 |
{ required: true, message: "是否删除不能为空", trigger: "blur" }, |
|
554 |
], |
|
555 |
}, |
|
556 |
}; |
|
557 |
}, |
|
558 |
created() { |
|
559 |
this.getList(); |
|
560 |
this.leftList(); |
|
561 |
}, |
|
562 |
methods: { |
|
563 |
/** 查询库位列表 */ |
|
564 |
getList() { |
|
565 |
this.loading = true; |
|
566 |
listLocation(this.queryParams).then((response) => { |
|
567 |
this.locationList = response.rows; |
|
568 |
this.total = response.total; |
|
569 |
this.loading = false; |
|
570 |
}); |
|
571 |
}, |
|
572 |
leftList() { |
|
573 |
listWaresList().then((res) => { |
|
574 |
console.log(res, "左侧数据信息"); |
|
575 |
this.leftListdata = res.data; |
|
576 |
}); |
|
577 |
|
|
578 |
listwerkshouse({ |
|
579 |
pageNum: 1, |
|
580 |
pageSize: 99, |
|
581 |
}).then((res) => { |
|
582 |
console.log(res, "工厂"); |
|
583 |
this.werksList = res.rows; |
|
584 |
}); |
|
585 |
}, |
|
586 |
// 取消按钮 |
|
587 |
cancel() { |
|
588 |
this.open = false; |
|
589 |
this.reset(); |
|
590 |
}, |
|
591 |
// 表单重置 |
|
592 |
reset() { |
|
593 |
this.form = { |
|
594 |
locationId: undefined, |
|
595 |
parentLocationId: undefined, |
|
596 |
lgort: undefined, |
|
597 |
locationNo: undefined, |
|
598 |
locationName: undefined, |
|
599 |
werks: undefined, |
|
600 |
type: undefined, |
|
601 |
volumeRestriction: undefined, |
|
602 |
weightLimit: undefined, |
|
603 |
containerNumberLimit: undefined, |
|
604 |
quantitativeRestrictions: undefined, |
|
605 |
trayLimit: undefined, |
|
606 |
length: undefined, |
|
607 |
width: undefined, |
|
608 |
height: undefined, |
|
609 |
coordinateX: undefined, |
|
610 |
coordinateY: undefined, |
|
611 |
coordinateZ: undefined, |
|
612 |
pixelX: undefined, |
|
613 |
pixelY: undefined, |
|
614 |
paceLayer: undefined, |
|
615 |
allowMixedProduct: undefined, |
|
616 |
allowMixedProductLot: undefined, |
|
617 |
layer: undefined, |
|
618 |
hasChild: undefined, |
|
619 |
path: undefined, |
|
620 |
description: undefined, |
|
621 |
state: undefined, |
|
622 |
displayOrder: undefined, |
|
623 |
createdUserId: undefined, |
|
624 |
createdUserName: undefined, |
|
625 |
createdDateTime: undefined, |
|
626 |
lastUpdatedUserId: undefined, |
|
627 |
lastUpdatedUserName: undefined, |
|
628 |
lastUpdatedDateTime: undefined, |
|
629 |
isDeleted: undefined, |
|
630 |
}; |
|
631 |
this.resetForm("form"); |
|
632 |
}, |
|
633 |
/** 搜索按钮操作 */ |
|
634 |
handleQuery() { |
|
635 |
this.queryParams.pageNum = 1; |
|
636 |
this.getList(); |
|
637 |
}, |
|
638 |
/** 重置按钮操作 */ |
|
639 |
resetQuery() { |
|
640 |
this.resetForm("queryForm"); |
|
641 |
this.handleQuery(); |
|
642 |
}, |
|
643 |
// 多选框选中数据 |
|
644 |
handleSelectionChange(selection) { |
|
645 |
this.ids = selection.map((item) => item.locationId); |
|
646 |
this.single = selection.length !== 1; |
|
647 |
this.multiple = !selection.length; |
|
648 |
}, |
|
649 |
/** 新增按钮操作 */ |
|
650 |
handleAdd() { |
|
651 |
this.reset(); |
|
652 |
this.open = true; |
|
653 |
this.title = "添加库位"; |
|
654 |
}, |
|
655 |
/** 修改按钮操作 */ |
|
656 |
handleUpdate(row) { |
|
657 |
this.loading = true; |
|
658 |
this.reset(); |
|
659 |
const locationId = row.locationId || this.ids; |
|
660 |
getLocation(locationId).then((response) => { |
|
661 |
this.loading = false; |
|
662 |
this.form = response.data; |
|
663 |
this.open = true; |
|
664 |
this.title = "修改库位"; |
|
665 |
}); |
|
666 |
}, |
|
667 |
/** 提交按钮 */ |
|
668 |
submitForm() { |
|
669 |
this.$refs["form"].validate((valid) => { |
|
670 |
if (valid) { |
|
671 |
this.buttonLoading = true; |
|
672 |
if (this.form.locationId != null) { |
|
673 |
updateLocation(this.form) |
|
674 |
.then((response) => { |
|
675 |
this.$modal.msgSuccess("修改成功"); |
|
676 |
this.open = false; |
|
677 |
this.getList(); |
|
678 |
}) |
|
679 |
.finally(() => { |
|
680 |
this.buttonLoading = false; |
|
681 |
}); |
|
682 |
} else { |
|
683 |
addLocation(this.form) |
|
684 |
.then((response) => { |
|
685 |
this.$modal.msgSuccess("新增成功"); |
|
686 |
this.open = false; |
|
687 |
this.getList(); |
|
688 |
}) |
|
689 |
.finally(() => { |
|
690 |
this.buttonLoading = false; |
|
691 |
}); |
|
692 |
} |
|
693 |
} |
|
694 |
}); |
|
695 |
}, |
|
696 |
/** 删除按钮操作 */ |
|
697 |
handleDelete(row) { |
|
698 |
const locationIds = row.locationId || this.ids; |
|
699 |
this.$modal |
|
700 |
.confirm('是否确认删除库位编号为"' + locationIds + '"的数据项?') |
|
701 |
.then(() => { |
|
702 |
this.loading = true; |
|
703 |
return delLocation(locationIds); |
|
704 |
}) |
|
705 |
.then(() => { |
|
706 |
this.loading = false; |
|
707 |
this.getList(); |
|
708 |
this.$modal.msgSuccess("删除成功"); |
|
709 |
}) |
|
710 |
.catch(() => {}) |
|
711 |
.finally(() => { |
|
712 |
this.loading = false; |
|
713 |
}); |
|
714 |
}, |
|
715 |
/** 导出按钮操作 */ |
|
716 |
handleExport() { |
|
717 |
this.download( |
|
718 |
"system/location/export", |
|
719 |
{ |
|
720 |
...this.queryParams, |
|
721 |
}, |
|
722 |
`location_${new Date().getTime()}.xlsx` |
|
723 |
); |
|
724 |
}, |
|
725 |
handleClick(item, index) { |
|
726 |
this.currentIndex = index; |
|
727 |
if (item.lgort) { |
|
728 |
this.queryParams.lgort = item.lgort; |
|
729 |
this.getList(); |
|
730 |
}else{ |
|
731 |
this.queryParams.werks = item.werks; |
|
732 |
this.getList(); |
|
733 |
} |
|
734 |
console.log(item); // 处理点击事件,可以在这里获取到当前点击行的信息 |
|
735 |
}, |
|
736 |
}, |
|
737 |
}; |
bdd09a
|
738 |
</script> |
44f5fa
|
739 |
|
1308d4
|
740 |
|
44f5fa
|
741 |
<style scoped> |
1308d4
|
742 |
.box { |
44f5fa
|
743 |
width: 100%; |
W |
744 |
height: calc(100vh - 124px); |
|
745 |
display: flex; |
1308d4
|
746 |
padding: 20px 10px 0; |
W |
747 |
background-color: #f0f0f0; |
44f5fa
|
748 |
} |
1308d4
|
749 |
.box-card1 { |
44f5fa
|
750 |
width: 20%; |
W |
751 |
height: 100%; |
1308d4
|
752 |
background-color: #fff; |
W |
753 |
margin-right: 10px; |
44f5fa
|
754 |
} |
1308d4
|
755 |
.box-card2 { |
44f5fa
|
756 |
width: 80%; |
W |
757 |
height: 100%; |
1308d4
|
758 |
background-color: #fff; |
W |
759 |
} |
|
760 |
.box1 { |
|
761 |
width: 100%; |
|
762 |
height: 100%; |
|
763 |
} |
|
764 |
|
|
765 |
.is-active { |
|
766 |
background-color: #2d8cf0 !important; /* 高亮颜色 */ |
|
767 |
} |
|
768 |
|
|
769 |
::v-deep .el-menu-item { |
|
770 |
border: none !important; /* 使用 !important 来确保覆盖默认样式 */ |
|
771 |
} |
|
772 |
|
|
773 |
/* 如果边框是由 submenu 引起的,可以这样写 */ |
|
774 |
::v-deep .el-submenu .el-submenu__title { |
|
775 |
border: none !important; |
|
776 |
} |
|
777 |
|
|
778 |
::v-deep .box-card1 > .el-card__body{ |
|
779 |
padding: 20px 0 10px 10px !important; |
44f5fa
|
780 |
} |
W |
781 |
</style> |
|
782 |
|
|
783 |
|