|
@ -143,6 +143,7 @@ const updataTableColumns = (val) => { |
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
|
|
console.log('searchTableSuccess',formField, searchField, val, formRef, type, row ) |
|
|
nextTick(async () => { |
|
|
nextTick(async () => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
if(formField == 'itemCode') { |
|
|
if(formField == 'itemCode') { |
|
@ -150,8 +151,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) = |
|
|
DeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
DeliverRequestDetail.allSchemas.tableFormColumns.forEach(item => { |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
tableFormKeys[item.field] = item.default ? item.default : '' |
|
|
}) |
|
|
}) |
|
|
|
|
|
let itemCodes = val.filter(item=>tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
|
|
|
if(itemCodes.length>0){ |
|
|
|
|
|
itemCodes = itemCodes.map(item=>(item['itemCode'])) |
|
|
|
|
|
message.warning(`物料${itemCodes.join(',')}已经存在`) |
|
|
|
|
|
} |
|
|
|
|
|
val = val.filter(item=>!tableData.value.find(item1=>item1['itemCode']==item['itemCode'])) |
|
|
|
|
|
if(val.length==0) return |
|
|
val.forEach(item=>{ |
|
|
val.forEach(item=>{ |
|
|
if(tableData.value.find(item1=>item1['itemCode'] == item['itemCode'])) return |
|
|
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...item})) |
|
|
newRow['uom'] = item['customerUom'] |
|
|
newRow['uom'] = item['customerUom'] |
|
|
newRow['id'] = item['id'] |
|
|
newRow['id'] = item['id'] |
|
|