|
@ -169,12 +169,31 @@ const onEnter = async (field,value) => { |
|
|
}]) |
|
|
}]) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 获取默认包装规格 |
|
|
|
|
|
const getDefaultPackUnit = async (packUnitList)=>{ |
|
|
|
|
|
console.log('获取默认包装规格',packUnitList) |
|
|
|
|
|
let res = await IssueRequestMainApi.getPackUnit({ |
|
|
|
|
|
list:packUnitList |
|
|
|
|
|
}) |
|
|
|
|
|
console.log('res',res) |
|
|
|
|
|
if(res&&res.list.length>0){ |
|
|
|
|
|
tableData.value.forEach(item=>{ |
|
|
|
|
|
if(!item['packUnit']){ |
|
|
|
|
|
let findItem = res.list.find(item1=>item1.itemCode == item.itemCode) |
|
|
|
|
|
if(findItem){ |
|
|
|
|
|
item['packUnit'] = findItem['packUnit'] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
nextTick(async() => { |
|
|
nextTick(async() => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
|
if (formField == 'itemCode') { |
|
|
if (formField == 'itemCode') { |
|
|
|
|
|
let packUnitList = [] |
|
|
val.forEach(item=>{ |
|
|
val.forEach(item=>{ |
|
|
let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
let tableForm = JSON.parse(JSON.stringify(tableFormKeys)) |
|
|
if (tableData.value.length > 0) { |
|
|
if (tableData.value.length > 0) { |
|
@ -185,8 +204,15 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
const newRow = JSON.parse(JSON.stringify({...tableForm,...item})) |
|
|
const newRow = JSON.parse(JSON.stringify({...tableForm,...item})) |
|
|
newRow['itemCode'] = item['code'] |
|
|
newRow['itemCode'] = item['code'] |
|
|
newRow['uom'] = item['uom'] |
|
|
newRow['uom'] = item['uom'] |
|
|
|
|
|
packUnitList.push({ |
|
|
|
|
|
itemCode:item['code'], |
|
|
|
|
|
workshopCode:formRef.formModel['workshopCode'],//车间代码 |
|
|
|
|
|
productionLineCode:formRef.formModel['productionLineCode'],//生产线代码 |
|
|
|
|
|
workStationCode:formRef.formModel['workStationCode'],//工位代码 |
|
|
|
|
|
}) |
|
|
tableData.value.push(newRow) |
|
|
tableData.value.push(newRow) |
|
|
}) |
|
|
}) |
|
|
|
|
|
getDefaultPackUnit(packUnitList) |
|
|
}else if(formField == 'packUnit'){ |
|
|
}else if(formField == 'packUnit'){ |
|
|
row['packQty'] = val[0]['packQty'] |
|
|
row['packQty'] = val[0]['packQty'] |
|
|
row[formField] = val[0][searchField] |
|
|
row[formField] = val[0][searchField] |
|
|