Commit 49ae2af3fd1bbdb913067455df834d45598297eb
1 parent
2f0ae4a1
fix:库位批量编辑区域
Showing
5 changed files
with
144 additions
and
5 deletions
ant-design-vue-jeecg/src/api/api.js
... | ... | @@ -342,7 +342,8 @@ export const getInventoryByShipmentDetail = (params) => postAction('/shipment/sh |
342 | 342 | export const allocation = (params) => postAction('/receipt/receiptContainerHeader/allocation', params) |
343 | 343 | //添加BOM |
344 | 344 | export const addBomHeader = (params) => postAction('/config/bomHeader/addBomHeader', params) |
345 | - | |
345 | +//添加BOM | |
346 | +export const batchMaterialArea = (params) => postAction('/config/location/batchMaterialArea', params) | |
346 | 347 | // 中转HTTP请求 |
347 | 348 | export const transitRESTful = { |
348 | 349 | get: (url, parameter) => getAction(getTransitURL(url), parameter), |
... | ... |
ant-design-vue-jeecg/src/views/system/config/LocationList.vue
... | ... | @@ -125,12 +125,17 @@ |
125 | 125 | </a-upload> |
126 | 126 | <a-button v-has="'material:print'" @click="batchPrint()" type="primary">打印</a-button> |
127 | 127 | <a-dropdown v-if="selectedRowKeys.length > 0"> |
128 | - <a-menu slot="overlay" v-has="'location:deleteBatch'"> | |
128 | + <a-menu slot="overlay" > | |
129 | 129 | <a-menu-item key="1" @click="batchDel"> |
130 | - <a-icon type="delete"/> | |
130 | + <a-icon type="delete" v-has="'location:deleteBatch'"/> | |
131 | 131 | 删除 |
132 | 132 | </a-menu-item> |
133 | + <a-menu-item key="2" @click="batchMaterialArea()"> | |
134 | + <a-icon type="plus" v-has="'location:batchMaterialArea'"/> | |
135 | + 编辑分类区域 | |
136 | + </a-menu-item> | |
133 | 137 | </a-menu> |
138 | + | |
134 | 139 | <a-button style="margin-left: 8px"> |
135 | 140 | 批量操作 |
136 | 141 | <a-icon type="down"/> |
... | ... | @@ -242,6 +247,7 @@ |
242 | 247 | <location-modal ref="modalForm" @ok="modalFormOk"></location-modal> |
243 | 248 | <location-batch-add-modal ref="batchAddModalForm" @ok="modalFormOk"></location-batch-add-modal> |
244 | 249 | <location-print-modal ref="locationPrintForm" @ok="modalFormOk"></location-print-modal> |
250 | + <location-batch-area-modal ref="batchMaterialAreaForm" @ok="modalFormOk"></location-batch-area-modal> | |
245 | 251 | </a-card> |
246 | 252 | </template> |
247 | 253 | |
... | ... | @@ -255,6 +261,7 @@ import {getLocationTypeList} from '@/api/api' |
255 | 261 | import {getZoneList} from '@/api/api' |
256 | 262 | import LocationBatchAddModal from './modules/LocationBatchAddModal' |
257 | 263 | import LocationPrintModal from './modules/LocationPrintModal' |
264 | +import LocationBatchAreaModal from './modules/LocationBatchAreaModal' | |
258 | 265 | |
259 | 266 | export default { |
260 | 267 | name: 'LocationList', |
... | ... | @@ -262,7 +269,8 @@ export default { |
262 | 269 | components: { |
263 | 270 | LocationPrintModal, |
264 | 271 | LocationBatchAddModal, |
265 | - LocationModal | |
272 | + LocationModal, | |
273 | + LocationBatchAreaModal | |
266 | 274 | }, |
267 | 275 | data() { |
268 | 276 | return { |
... | ... | @@ -551,6 +559,19 @@ export default { |
551 | 559 | } |
552 | 560 | }) |
553 | 561 | return actions.join('') |
562 | + }, | |
563 | + batchMaterialArea(){ | |
564 | + if (this.selectedRowKeys.length <= 0) { | |
565 | + this.$message.warning('请选择一条记录!') | |
566 | + return | |
567 | + } else { | |
568 | + var ids = '' | |
569 | + for (var a = 0; a < this.selectedRowKeys.length; a++) { | |
570 | + ids += this.selectedRowKeys[a] + ',' | |
571 | + } | |
572 | + this.$refs.batchMaterialAreaForm.edit(ids) | |
573 | + this.$refs.batchMaterialAreaForm.title = '批量编辑物料区域' | |
574 | + } | |
554 | 575 | } |
555 | 576 | } |
556 | 577 | } |
... | ... |
ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAreaModal.vue
0 → 100644
1 | +<template> | |
2 | + <a-modal | |
3 | + :title="title" | |
4 | + :width="900" | |
5 | + :visible="visible" | |
6 | + :maskClosable="false" | |
7 | + :confirmLoading="confirmLoading" | |
8 | + @ok="handleOk" | |
9 | + @cancel="handleCancel"> | |
10 | + | |
11 | + <a-spin :spinning="confirmLoading"> | |
12 | + <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model"> | |
13 | + <!-- 主表单区域 --> | |
14 | + <a-row class="form-row" :gutter="0"> | |
15 | + <a-col :span="24"> | |
16 | + <a-form-model-item label="物料分区存放" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialAreaCode"> | |
17 | + <a-input v-model="model.materialAreaCode" placeholder="请输入物料分区存放"></a-input> | |
18 | + </a-form-model-item> | |
19 | + </a-col> | |
20 | + </a-row> | |
21 | + </a-form-model> | |
22 | + </a-spin> | |
23 | + </a-modal> | |
24 | +</template> | |
25 | + | |
26 | +<script> | |
27 | + | |
28 | +import {batchMaterialArea} from '@/api/api' | |
29 | + | |
30 | +export default { | |
31 | + name: 'LocationBatchAreaModal', | |
32 | + components: { | |
33 | + | |
34 | + }, | |
35 | + data() { | |
36 | + return { | |
37 | + title: '', | |
38 | + width: 800, | |
39 | + visible: false, | |
40 | + disableSubmit: false, | |
41 | + confirmLoading: false, | |
42 | + labelCol: { | |
43 | + xs: {span: 24}, | |
44 | + sm: {span: 6} | |
45 | + }, | |
46 | + wrapperCol: { | |
47 | + xs: {span: 24}, | |
48 | + sm: {span: 24 - 6} | |
49 | + }, | |
50 | + model: {}, | |
51 | + } | |
52 | + }, | |
53 | + methods: { | |
54 | + edit(record) { | |
55 | + console.log(record); | |
56 | + this.visible = true | |
57 | + this.model.ids=record; | |
58 | + }, | |
59 | + handleOk() { | |
60 | + this.submitForm() | |
61 | + }, | |
62 | + handleCancel() { | |
63 | + this.close() | |
64 | + }, | |
65 | + submitForm() { | |
66 | + // 触发表单验证 | |
67 | + this.$refs.form.validate(valid => { | |
68 | + if (valid) { | |
69 | + this.confirmLoading = true; | |
70 | + let params = { | |
71 | + ids: this.model.ids, | |
72 | + materialAreaCode: this.model.materialAreaCode, | |
73 | + } | |
74 | + batchMaterialArea(params).then((res) => { | |
75 | + this.confirmLoading = false; | |
76 | + if (res.success) { | |
77 | + this.$emit('ok'); | |
78 | + this.visible = false; | |
79 | + }else{ | |
80 | + this.$message.error(res.message); | |
81 | + } | |
82 | + | |
83 | + }); | |
84 | + } | |
85 | + | |
86 | + }) | |
87 | + }, | |
88 | + close() { | |
89 | + this.$emit('close') | |
90 | + this.visible = false | |
91 | + this.$refs.form.clearValidate() | |
92 | + }, | |
93 | + } | |
94 | +} | |
95 | +</script> | |
0 | 96 | \ No newline at end of file |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java
... | ... | @@ -323,5 +323,24 @@ public class LocationController extends JeecgController<Location, ILocationServi |
323 | 323 | jimuReportResult.setData(locationList); |
324 | 324 | return jimuReportResult; |
325 | 325 | } |
326 | - | |
326 | + /** | |
327 | + * 批量编辑物料区域 | |
328 | + * | |
329 | + * @param location | |
330 | + * @return | |
331 | + */ | |
332 | + @AutoLog(value = "库位管理-批量编辑物料区域") | |
333 | + @ApiOperation(value = "库位管理-批量编辑物料区域", notes = "库位管理-batchMaterialArea") | |
334 | + @RequiresPermissions("location:batchMaterialArea") | |
335 | + @RequestMapping(value = "/batchMaterialArea", method = {RequestMethod.PUT, RequestMethod.POST}) | |
336 | + public Result<String> batchMaterialArea(@RequestBody Location location) { | |
337 | + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); | |
338 | + locationLambdaQueryWrapper.in(Location::getId, Arrays.asList(location.getIds().split(","))); | |
339 | + Location location1=new Location(); | |
340 | + location1.setMaterialAreaCode(location.getMaterialAreaCode()); | |
341 | + if(!locationService.update(location1,locationLambdaQueryWrapper)){ | |
342 | + return Result.error("编辑失败"); | |
343 | + } | |
344 | + return Result.OK("编辑成功!"); | |
345 | + } | |
327 | 346 | } |
... | ... |
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java
... | ... | @@ -147,6 +147,9 @@ public class Location implements Serializable { |
147 | 147 | @TableField(exist = false) |
148 | 148 | @Dict(dicCode = "have_container_in_location") |
149 | 149 | private Integer haveContainer; |
150 | + /** id集合 */ | |
151 | + @TableField(exist = false) | |
152 | + private String ids; | |
150 | 153 | |
151 | 154 | public void setHaveContainer(Integer haveContainer) { |
152 | 155 | this.haveContainer = haveContainer; |
... | ... |