From a3717d4eca1f229fc9e850ec1265368cdd99c625 Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Wed, 6 Nov 2024 11:30:30 +0800 Subject: [PATCH] =?UTF-8?q?YT-641=E5=88=B6=E5=93=81=E5=9B=9E=E6=94=B6?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/productredressRequestDetail/index.ts | 8 +++++- .../productredressRequestMain/index.vue | 11 +++++++- .../productredressRequestMain.data.ts | 27 ++++++++++++++++--- 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/api/wms/productredressRequestDetail/index.ts b/src/api/wms/productredressRequestDetail/index.ts index 150891c58..20012a345 100644 --- a/src/api/wms/productredressRequestDetail/index.ts +++ b/src/api/wms/productredressRequestDetail/index.ts @@ -27,9 +27,11 @@ export interface ProductredressRequestDetailVO { itemDesc2: string projectCode: string qty: number + inventoryQty: number uom: string toOwnerCode: string } +const message = useMessage() // 消息弹窗 // 查询制品回收申请子列表 export const getProductredressRequestDetailPage = async (params) => { @@ -54,6 +56,10 @@ export const createProductredressRequestDetail = async (data: ProductredressRequ // 修改制品回收申请子 export const updateProductredressRequestDetail = async (data: ProductredressRequestDetailVO) => { + if(parseFloat(data.inventoryQty) < parseFloat(data.qty)){ + message.warning("回收数量不能大于库存数量") + return + } return await request.put({ url: `/wms/productredress-request-detail/update`, data }) } @@ -70,4 +76,4 @@ export const exportProductredressRequestDetail = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/productredress-request-detail/get-import-template' }) -} \ No newline at end of file +} diff --git a/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue b/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue index f96480c2f..5a8d7379d 100644 --- a/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue +++ b/src/views/wms/productionManage/productredress/productredressRequestMain/index.vue @@ -155,6 +155,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) newRow['itemCode'] = item['itemCode'] newRow['qty'] = item['qty'] + newRow['inventoryQty'] = item['qty'] newRow['uom'] = item['uom'] newRow['packingNumber'] = item['packingNumber'] newRow['batch'] = item['batch'] @@ -189,6 +190,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { if (formField == 'itemCode') { setV['itemCode'] = val[0]['itemCode'] setV['qty'] = val[0]['qty'] + setV['inventoryQty'] = val[0]['qty'] setV['uom'] = val[0]['uom'] setV['packingNumber'] = val[0]['packingNumber'] setV['batch'] = val[0]['batch'] @@ -450,8 +452,15 @@ const submitForm = async (formType, submitData) => { data.subList.forEach(item=>{ item['workStationCode'] = data['workStationCode'] }) + const cmdExists = data.subList.some(filter => + parseFloat(filter.inventoryQty) < parseFloat(filter.qty) + ); + if(cmdExists){ + message.warning("回收数量不能大于库存数量") + return + } if(data.subList.find(item => (item.qty <= 0))) { - message.warning('数量必须大于0') + message.warning('回收数量必须大于0') formRef.value.formLoading = false return } diff --git a/src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts b/src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts index ecd55e220..a7c96b37e 100644 --- a/src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts +++ b/src/views/wms/productionManage/productredress/productredressRequestMain/productredressRequestMain.data.ts @@ -644,6 +644,21 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive } } }, + { + label: '库存数量 ', + field: 'inventoryQty', + sort: 'custom', + isSearch: false, + isTable: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled:true + } + } + }, { label: '回收数量', field: 'qty', @@ -651,13 +666,17 @@ export const ProductredressRequestDetail = useCrudSchemas(reactive table: { width: 150 }, - tableForm: { - disabled: true - }, form: { + component: 'InputNumber', componentProps: { - disabled: true + min: 0, + precision: 6, } + }, + tableForm: { + type: 'InputNumber', + min: 0, + precision: 6, } }, // {