From e7ec27eac3102a344a55530e2dc591b967e3f27b Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Mon, 22 Jul 2024 19:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productionreturnRequestMainNo/index.vue | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue index 660783b9f..e736a4825 100644 --- a/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue +++ b/src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue @@ -177,24 +177,30 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => if (type == 'tableForm') { // 明细查询页赋值 if(formField == 'itemCode') { + if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){ + message.warning(`物料${val[0]['itemCode']}已经存在`) + return + } + const isType = await isItemType(val[0]['itemCode'], labelType.value) if(!isType){ message.warning('当前物料可制造与其他数据不一致,请重新选择!') } else { + row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch'] row['itemCode'] = val[0]['itemCode'] row['uom'] = val[0]['uom'] row['inventoryStatus'] = val[0]['inventoryStatus'] - row['qty'] = val[0]['qty'] + row['qty'] = Number(val[0]['qty']) // 修改 tableform 属性 数量最大值设置为库存余额中数量 - ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => { - if(item.field == 'qty') { - item.tableForm.max = val[0]['qty'] - } - if(item.field == 'batch') { - item.tableForm.disabled = false - } - }) + ProductionreturnRequestDetail.allSchemas.tableFormColumns.forEach(item => { + if(item.field == 'qty' && Number(val[0]['qty'])>item.tableForm.min) { + item.tableForm.max = Number(val[0]['qty']) + } + if(item.field == 'batch') { + item.tableForm.disabled = false + } + }) } } else if(formField == 'workStationCode') { val.forEach(item=>{