diff --git a/ant-design-vue-jeecg/src/api/api.js b/ant-design-vue-jeecg/src/api/api.js index c9e70b7..b303964 100644 --- a/ant-design-vue-jeecg/src/api/api.js +++ b/ant-design-vue-jeecg/src/api/api.js @@ -342,7 +342,8 @@ export const getInventoryByShipmentDetail = (params) => postAction('/shipment/sh export const allocation = (params) => postAction('/receipt/receiptContainerHeader/allocation', params) //添加BOM export const addBomHeader = (params) => postAction('/config/bomHeader/addBomHeader', params) - +//添加BOM +export const batchMaterialArea = (params) => postAction('/config/location/batchMaterialArea', params) // 中转HTTP请求 export const transitRESTful = { get: (url, parameter) => getAction(getTransitURL(url), parameter), diff --git a/ant-design-vue-jeecg/src/views/system/config/LocationList.vue b/ant-design-vue-jeecg/src/views/system/config/LocationList.vue index 931fd24..5409cc6 100644 --- a/ant-design-vue-jeecg/src/views/system/config/LocationList.vue +++ b/ant-design-vue-jeecg/src/views/system/config/LocationList.vue @@ -125,12 +125,17 @@ </a-upload> <a-button v-has="'material:print'" @click="batchPrint()" type="primary">打印</a-button> <a-dropdown v-if="selectedRowKeys.length > 0"> - <a-menu slot="overlay" v-has="'location:deleteBatch'"> + <a-menu slot="overlay" > <a-menu-item key="1" @click="batchDel"> - <a-icon type="delete"/> + <a-icon type="delete" v-has="'location:deleteBatch'"/> 删除 </a-menu-item> + <a-menu-item key="2" @click="batchMaterialArea()"> + <a-icon type="plus" v-has="'location:batchMaterialArea'"/> + 编辑分类区域 + </a-menu-item> </a-menu> + <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down"/> @@ -242,6 +247,7 @@ <location-modal ref="modalForm" @ok="modalFormOk"></location-modal> <location-batch-add-modal ref="batchAddModalForm" @ok="modalFormOk"></location-batch-add-modal> <location-print-modal ref="locationPrintForm" @ok="modalFormOk"></location-print-modal> + <location-batch-area-modal ref="batchMaterialAreaForm" @ok="modalFormOk"></location-batch-area-modal> </a-card> </template> @@ -255,6 +261,7 @@ import {getLocationTypeList} from '@/api/api' import {getZoneList} from '@/api/api' import LocationBatchAddModal from './modules/LocationBatchAddModal' import LocationPrintModal from './modules/LocationPrintModal' +import LocationBatchAreaModal from './modules/LocationBatchAreaModal' export default { name: 'LocationList', @@ -262,7 +269,8 @@ export default { components: { LocationPrintModal, LocationBatchAddModal, - LocationModal + LocationModal, + LocationBatchAreaModal }, data() { return { @@ -551,6 +559,19 @@ export default { } }) return actions.join('') + }, + batchMaterialArea(){ + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('请选择一条记录!') + return + } else { + var ids = '' + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ',' + } + this.$refs.batchMaterialAreaForm.edit(ids) + this.$refs.batchMaterialAreaForm.title = '批量编辑物料区域' + } } } } diff --git a/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAreaModal.vue b/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAreaModal.vue new file mode 100644 index 0000000..e1d1f0f --- /dev/null +++ b/ant-design-vue-jeecg/src/views/system/config/modules/LocationBatchAreaModal.vue @@ -0,0 +1,95 @@ +<template> + <a-modal + :title="title" + :width="900" + :visible="visible" + :maskClosable="false" + :confirmLoading="confirmLoading" + @ok="handleOk" + @cancel="handleCancel"> + + <a-spin :spinning="confirmLoading"> + <a-form-model ref="form" :label-col="labelCol" :wrapper-col="wrapperCol" :model="model"> + <!-- 主表单区域 --> + <a-row class="form-row" :gutter="0"> + <a-col :span="24"> + <a-form-model-item label="物料分区存放" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="materialAreaCode"> + <a-input v-model="model.materialAreaCode" placeholder="请输入物料分区存放"></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </a-spin> + </a-modal> +</template> + +<script> + +import {batchMaterialArea} from '@/api/api' + +export default { + name: 'LocationBatchAreaModal', + components: { + + }, + data() { + return { + title: '', + width: 800, + visible: false, + disableSubmit: false, + confirmLoading: false, + labelCol: { + xs: {span: 24}, + sm: {span: 6} + }, + wrapperCol: { + xs: {span: 24}, + sm: {span: 24 - 6} + }, + model: {}, + } + }, + methods: { + edit(record) { + console.log(record); + this.visible = true + this.model.ids=record; + }, + handleOk() { + this.submitForm() + }, + handleCancel() { + this.close() + }, + submitForm() { + // 触发表单验证 + this.$refs.form.validate(valid => { + if (valid) { + this.confirmLoading = true; + let params = { + ids: this.model.ids, + materialAreaCode: this.model.materialAreaCode, + } + batchMaterialArea(params).then((res) => { + this.confirmLoading = false; + if (res.success) { + this.$emit('ok'); + this.visible = false; + }else{ + this.$message.error(res.message); + } + + }); + } + + }) + }, + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + }, + } +} +</script> \ No newline at end of file diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java index 1360b74..8a3d812 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/controller/LocationController.java +++ b/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 jimuReportResult.setData(locationList); return jimuReportResult; } - + /** + * 批量编辑物料区域 + * + * @param location + * @return + */ + @AutoLog(value = "库位管理-批量编辑物料区域") + @ApiOperation(value = "库位管理-批量编辑物料区域", notes = "库位管理-batchMaterialArea") + @RequiresPermissions("location:batchMaterialArea") + @RequestMapping(value = "/batchMaterialArea", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result<String> batchMaterialArea(@RequestBody Location location) { + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); + locationLambdaQueryWrapper.in(Location::getId, Arrays.asList(location.getIds().split(","))); + Location location1=new Location(); + location1.setMaterialAreaCode(location.getMaterialAreaCode()); + if(!locationService.update(location1,locationLambdaQueryWrapper)){ + return Result.error("编辑失败"); + } + return Result.OK("编辑成功!"); + } } diff --git a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java index 222f25a..8ec551c 100644 --- a/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java +++ b/huaheng-wms-core/src/main/java/org/jeecg/modules/wms/config/location/entity/Location.java @@ -147,6 +147,9 @@ public class Location implements Serializable { @TableField(exist = false) @Dict(dicCode = "have_container_in_location") private Integer haveContainer; + /** id集合 */ + @TableField(exist = false) + private String ids; public void setHaveContainer(Integer haveContainer) { this.haveContainer = haveContainer;