diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storage/StorageController.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storage/StorageController.java index 35accf2..84bbf06 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storage/StorageController.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/controller/admin/storage/StorageController.java @@ -17,6 +17,7 @@ import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper; import com.chanko.yunxi.mes.module.heli.service.storagelog.StorageLogService; import com.chanko.yunxi.mes.module.heli.service.storagemat.StorageMatService; import com.fasterxml.jackson.annotation.JsonTypeInfo; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -118,6 +119,7 @@ public class StorageController { } @PutMapping("/update-status") @Operation(summary = "更新入/出库") + @Transactional @PreAuthorize("@ss.hasPermission('heli:storage:update')") public CommonResult updateStorageStatus(@Valid @RequestBody StorageSaveReqVO updateReqVO) { @@ -195,6 +197,7 @@ public class StorageController { wrapper.eq(StorageInventoryDO::getDeleted,0); StorageInventoryDO storageInventoryDO = storageInventoryMapper.selectOne(wrapper); if (ObjectUtil.isNotEmpty(storageInventoryDO)){ + if (storageInventoryDO.getYardAmount().compareTo(storageMatDO.getStorageOkQty()) < 0) CommonResult.error(400,"库存数量不足,请确认"); storageInventoryDO.setYardAmount(storageInventoryDO.getYardAmount().subtract(storageMatDO.getStorageOkQty())); } storageInventoryMapper.insertOrUpdate(storageInventoryDO); diff --git a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java index 239c852..a951ded 100644 --- a/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java +++ b/mes-module-heli/mes-module-heli-biz/src/main/java/com/chanko/yunxi/mes/module/heli/dal/mysql/storagemat/StorageMatMapper.java @@ -111,6 +111,7 @@ public interface StorageMatMapper extends BaseMapperX { query.selectAll(StorageMatDO.class) .select("o.project_name as projectName ,l.name as matName ,l.material_type as matType,l.spec as matSpec,d.label as matUnit") .select("w.price as unitPrice,ROUND(COALESCE(t.storage_ok_qty * w.price, 0), 1) AS totalPrice") + .select("l.code as matCode") .leftJoin(MaterialDO.class,"l",MaterialDO::getId,StorageMatDO::getMatId) .leftJoin(DictDataDO.class,"d",DictDataDO::getValue, MaterialDO::getUnit) .leftJoin("wms_storage_inventory w on t.wh_id=w.wh_id and t.rg_id=w.rg_id and t.pn_id=w.pn_id and t.mat_id=w.material_id and w.tenant_id=2 and w.deleted=0") diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/projectOrderDialog.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/projectOrderDialog.vue index ba4f84f..96822e1 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/projectOrderDialog.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/deliverorder/projectOrderDialog.vue @@ -236,7 +236,7 @@ const resetQuery = () => { const multipleTable = ref>() const multipleSelection = ref([]) const handleSelectionChange = (val: []) => { - + multipleSelection.value = val } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/detail.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/detail.vue index a1f8b0b..b9ed1fc 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/detail.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/detail.vue @@ -1561,6 +1561,8 @@ type="textarea" v-model="formData.activeOpinion" placeholder="请输入打回原 } } getUserList(formData.value.businessDeptId); + saveDisabled.value = false + submitDisabled.value = false // } } finally { formLoading.value = false @@ -1695,8 +1697,6 @@ type="textarea" v-model="formData.activeOpinion" placeholder="请输入打回原 if (sumbefore.value == 0) { await reload() } - saveDisabled.value = false - submitDisabled.value = false } } catch (e) { saveDisabled.value = false diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/index.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/index.vue index 8516b25..4949be3 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/index.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/projectorder/index.vue @@ -280,7 +280,6 @@ const openReport = () => { const getList = async () => { loading.value = true try { - debugger const route = useRoute(); if(route){ 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 dd0fb76..f1cdf1d 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 @@ -384,9 +384,10 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete" --+++@@ -398,6 +399,7 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete" + @@ -411,6 +413,7 @@ link type="primary" size="small" :disabled="ctrView || ctrDelete" + @@ -481,6 +484,7 @@ import projects from './subproject.vue' import {Search} from "@element-plus/icons-vue"; import purchaseorderDialog from '@/views/heli/outsourcestock/purchaseorderDialog.vue' import * as StorageinApi from "@/api/heli/storagein"; +import * as storageInventoryApi from "@/api/heli/storageinventory"; const reload: any = inject('reload') @@ -532,7 +536,10 @@ const subFormRules = reactive({ price: [{ required: true, message: '入库价格不能为空', trigger: 'blur' }] }) - +const queryParams = reactive({ + materialId: undefined, + whId: undefined, +}) const matOpenFormRef = ref() const proOpenFormRef = ref() @@ -702,10 +709,11 @@ const getList = async (arrMat) => { break; } } - if (formData.value.headerId){ + if (formData.value.headerId!=null &&formData.value.headerId!=undefined){ noList.value = await PurchaseordernodetailApi.getPurchaseOrderNoDetailById(formData.value.headerId); } - arrMat.forEach((row) => { + queryParams.whId=formData.value.whId; + for (const row of arrMat) { if ( formData.value.matItemDOList.filter( (item) => @@ -717,28 +725,34 @@ const getList = async (arrMat) => { ) { row.matId = row.id // if (rgList.value.length==1){ - row.rgId =rgList.value[0].id + // row.rgId =rgList.value[0].id // }else { // row.rgId ='' // } + queryParams.materialId=row.matId; + var newVar = await storageInventoryApi.getById(queryParams); + if (newVar){ + row.rgId = newVar.rgId; + row.pnId = newVar.pnId; + }else { + formData.value.rgId = ''; + formData.value.pnId = ''; + } row.pnlist = ref([]) row.pnlist = pnList.value.filter((pn) => pn.rg_id == row.rgId) // if (row.pnlist.length == 1) { - row.pnId = row.pnlist[0].id + // row.pnId = row.pnlist[0].id // }else if (pnList.value.length == 0) { flag=false } - if (noList.value){ - console.log(noList.value) + if (noList.value.length!=0){ var filter = noList.value.filter((no)=>no.materialId==row.matId); - console.log(filter) - console.log(filter.unitPrice) - console.log(filter.purchaseAmount) - row.price=filter[0].unitPrice - row.storageOkQty=filter[0].purchaseAmount - console.log(row) + if (filter){ + row.price=filter[0].unitPrice + row.storageOkQty=filter[0].purchaseAmount + } }else { row.price='' } @@ -746,7 +760,7 @@ const getList = async (arrMat) => { formData.value.matItemDOList.push(row) } } - }) + } if (!flag){ message.error("该"+whName+"没有配置入库库位,请确认!") } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue index 93182de..1e93c9f 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue @@ -448,7 +448,7 @@ const formData = ref({ stockInType: 1, projectSubName:undefined, materialReceiver:undefined, - pickmode:undefined, + pickmode:2, pickcar:undefined, projectNo:undefined, stockOutType: undefined, @@ -585,7 +585,7 @@ const handleStockType = async (typeid) => { show.value=false // 当 typeid 不等于 5 时,移除验证规则 formData.value.projectSubName=null - formData.value.pickmode=null + // formData.value.pickmode=null formData.value.pickcar=null delete formRules.projectSubName delete formRules.pickmode @@ -655,7 +655,7 @@ const handleStatus = async (num) => { } catch (e) { return } - var isZero = false;; + var isZero = false; var repeatItem = [] formData.value.matItemDOList.forEach(item => { if(item.storageOkQty<=0){ @@ -684,18 +684,22 @@ const handleStatus = async (num) => { return } //获取最新库存信息 - const matCurrentData = await StorageMatApi.getStorageMatList(0) + // const matCurrentData = await StorageMatApi.getStorageMatList(0) var hasRestNum = true formData.value.matItemDOList.forEach((rest) => { - if ( - matCurrentData.find( - (mat) => - mat.matId == rest.matId && - mat.pnId == rest.pnId && - mat.matRest < Number(rest.storageOkQty) - ) !== undefined || - rest.storageOkQty.length == 0 - ) { + // if ( + // matCurrentData.find( + // (mat) => + // mat.matId == rest.matId && + // mat.pnId == rest.pnId && + // mat.matRest < Number(rest.storageOkQty) + // ) !== undefined || + // rest.storageOkQty.length == 0 + // ) + console.log(rest.storageOkQty) + console.log(rest.matRest) + if (Number(rest.storageOkQty)>Number(rest.matRest)) + { hasRestNum = false } }) @@ -1220,6 +1224,7 @@ onMounted(async () => { //获取状态为启用的物料信息 await getMatList('') + // 获取当前最新库存信息 // matLastData.value = await StorageMatApi.getStorageMatList(0) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/subproject.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/subproject.vue index 5e3ea9c..916e882 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/subproject.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/subproject.vue @@ -35,7 +35,7 @@ -