|
|
@ -198,7 +198,7 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row |
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
//console.log("formRef",formRef) |
|
|
|
//console.log("supplierCode",formRef.value.formRef.formModel.supplierCode) |
|
|
|
console.log("searchTableSuccess",formField, searchField, val, formRef, type, row) |
|
|
|
nextTick(() => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
@ -206,7 +206,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
if(formField == 'itemCode') { |
|
|
|
row['itemCode'] = val[0]['code'] |
|
|
|
} else if(formField == 'poNumber') { |
|
|
|
row['poNumber'] = val[0]['number'] |
|
|
|
updateTableData(val) |
|
|
|
// row['poNumber'] = val[0]['number'] |
|
|
|
|
|
|
|
} else if(formField == 'poLine'){ |
|
|
|
//添加费用明细--点击确定 |
|
|
|
val.forEach(item=>{ |
|
|
@ -457,6 +459,27 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const updateTableData = (tableList)=>{ |
|
|
|
tableList.forEach(row=>{ |
|
|
|
//poNumber poLine itemCode batch |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow['poLine'] = row['lineNumber'] |
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
newRow['uom'] = row['uom'] |
|
|
|
newRow['poNumber'] =row['number'] |
|
|
|
newRow['supplierCode'] =row['supplierCode'] |
|
|
|
//生产日期 到货日期 默认当天 |
|
|
|
newRow['produceDate'] = dayjs().valueOf() |
|
|
|
newRow['arriveDate'] = dayjs().valueOf() |
|
|
|
//批次 |
|
|
|
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); |
|
|
|
newRow['defaultToLocationCode'] =row['defaultLocation'] |
|
|
|
if(!tableData.value.find((item:object)=>item.poNumber == newRow.poNumber&&item.itemCode == newRow.itemCode&&item.poLine == newRow.poLine&&item.batch == newRow.batch)){ |
|
|
|
tableData.value.push(newRow) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
|
defaultParams:{number}, |
|
|
@ -470,29 +493,16 @@ const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
item.width = item.table?.width || 150 |
|
|
|
}) |
|
|
|
tableData.value = [] |
|
|
|
updateTableData(tableObject.tableList) |
|
|
|
const itemCodes = [] |
|
|
|
tableObject.tableList.forEach(row=>{ |
|
|
|
itemCodes.push(row['itemCode']) |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow['poLine'] = row['lineNumber'] |
|
|
|
newRow['itemCode'] = row['itemCode'] |
|
|
|
newRow['uom'] = row['uom'] |
|
|
|
newRow['poNumber'] =row['number'] |
|
|
|
newRow['supplierCode'] =row['supplierCode'] |
|
|
|
//生产日期 到货日期 默认当天 |
|
|
|
newRow['produceDate'] = dayjs().valueOf() |
|
|
|
newRow['arriveDate'] = dayjs().valueOf() |
|
|
|
//批次 |
|
|
|
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); |
|
|
|
newRow['defaultToLocationCode'] =row['defaultLocation'] |
|
|
|
tableData.value.push(newRow) |
|
|
|
if(isEnter){ |
|
|
|
//回车--供应商代码 |
|
|
|
const setV = {} |
|
|
|
setV['poNumber'] = number |
|
|
|
setV['supplierCode'] = row.supplierCode |
|
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
//有效期 |
|
|
|