diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/StorageMatController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/StorageMatController.java index a2f778f9..0b80f945 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/StorageMatController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storagemat/StorageMatController.java @@ -50,7 +50,11 @@ public class StorageMatController { @PreAuthorize("@ss.hasPermission('heli:storage-mat:create')") public CommonResult createStorageMat(@Valid @RequestBody List createReqVO) { for (StorageMatSaveReqVO item :createReqVO){ - storageMatService.createStorageMat(item); + if(item.getId() != null && item.getId()>0){ + storageMatService.deleteStorageMat(item.getId()); + item.setId(null); + } + storageMatService.createStorageMat(item); }; return success(1L); } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue index 3fb048d6..35634d5f 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue @@ -399,17 +399,17 @@ const submitForm = async () => { commonResult = 'common.createSuccess' } else { - storageid.value = await StorageApi.getStorage(router.query.id) + storageid.value = data.id await StorageApi.updateStorage(data) commonResult = 'common.updateSuccess' } //物料信息保存 formData.value.productBomItemDOList.forEach(item => { - item.stockId = storageid.value.id + item.stockId = storageid.value item.whId = formData.value.whId }) const dataMats = formData.value.productBomItemDOList as unknown as StorageMatApi.StorageMatVO[] - //await StorageMatApi.createStorageMatBatch(dataMats) + await StorageMatApi.createStorageMatBatch(dataMats) //附件信息保存 matUploadFiles.value = { 'businessType': 'STORAGE', 'businessId': storageid, 'businessFileType': '' } @@ -420,7 +420,7 @@ const submitForm = async () => { // 成功后刷新 reload(); - router.query.id = storageid.value.id; + //router.query.id = storageid.value.id; } finally { formLoading.value = false } @@ -487,8 +487,6 @@ const handleDelete2 = (index: number) => { formData.value.productBomItemDOList.splice(index, 1) } - - //仓库全数据 const warehouseList = ref([]) //库区全数据 @@ -529,7 +527,6 @@ const handleRg = (async (scope) => { //------------------- }) - const matList = ref([]) // 物料列表 const matSelectLoading = ref(false); const remoteMatCodeSearch = async (query) => {