|
|
@ -205,15 +205,15 @@ const clearSearchInput = (formField) => { |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
console.log('searchTableSuccess',formRef.formModel) |
|
|
|
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row) |
|
|
|
nextTick(async () => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
if(formField == 'itemCode') { |
|
|
|
if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){ |
|
|
|
message.warning(`物料${val[0]['itemCode']}已经存在`) |
|
|
|
return |
|
|
|
} |
|
|
|
// if(tableData.value.find(item1=>item1['itemCode'] == val[0]['itemCode'])){ |
|
|
|
// message.warning(`物料${val[0]['itemCode']}已经存在`) |
|
|
|
// return |
|
|
|
// } |
|
|
|
let enableBuy = val[0]['enableBuy'] |
|
|
|
if(tableData.value.length>0){ |
|
|
|
enableBuy = tableData.value[0]['enableBuy'] |
|
|
@ -227,6 +227,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
} |
|
|
|
val = val.filter(item=>item['enableBuy']==enableBuy) |
|
|
|
|
|
|
|
let messageItemCodes = [] |
|
|
|
val.forEach(item=>{ |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
|
newRow['itemCode'] = item['itemCode'] |
|
|
@ -242,8 +243,17 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
} |
|
|
|
newRow['packUnit'] = item['packUnit'] |
|
|
|
newRow['packQty'] = item['packQty'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])){ |
|
|
|
messageItemCodes.push(item['itemCode']) |
|
|
|
}else{ |
|
|
|
tableData.value.push(newRow) |
|
|
|
} |
|
|
|
}) |
|
|
|
if(messageItemCodes.length>0){ |
|
|
|
message.warning(`物料${messageItemCodes.join(',')}已经存在`) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// HL-4885 聂喜婷:@邱晨 @王宇飞 先把数量的校验拿掉 |
|
|
|
// 修改 tableform 属性 数量最大值设置为库存余额中数量 |
|
|
@ -291,8 +301,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
// 来源工位代码 |
|
|
|
setV['workStationCode'] = val[0]['code'] |
|
|
|
setV['fromLocationCode'] = val[0]['rawLocationCode'] |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
} |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|