|
@ -198,7 +198,7 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row |
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
//console.log("formRef",formRef) |
|
|
//console.log("formRef",formRef) |
|
|
//console.log("supplierCode",formRef.value.formRef.formModel.supplierCode) |
|
|
console.log("searchTableSuccess",formField, searchField, val, formRef, type, row) |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
|
if (type == 'tableForm') { |
|
|
if (type == 'tableForm') { |
|
|
// 明细查询页赋值 |
|
|
// 明细查询页赋值 |
|
@ -206,7 +206,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
if(formField == 'itemCode') { |
|
|
if(formField == 'itemCode') { |
|
|
row['itemCode'] = val[0]['code'] |
|
|
row['itemCode'] = val[0]['code'] |
|
|
} else if(formField == 'poNumber') { |
|
|
} else if(formField == 'poNumber') { |
|
|
row['poNumber'] = val[0]['number'] |
|
|
updateTableData(val) |
|
|
|
|
|
// row['poNumber'] = val[0]['number'] |
|
|
|
|
|
|
|
|
} else if(formField == 'poLine'){ |
|
|
} else if(formField == 'poLine'){ |
|
|
//添加费用明细--点击确定 |
|
|
//添加费用明细--点击确定 |
|
|
val.forEach(item=>{ |
|
|
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 getSearchTableData = async (number,isEnter=false)=>{ |
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
const {tableObject ,tableMethods} = useTable({ |
|
|
defaultParams:{number}, |
|
|
defaultParams:{number}, |
|
@ -470,29 +493,16 @@ const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
item.width = item.table?.width || 150 |
|
|
item.width = item.table?.width || 150 |
|
|
}) |
|
|
}) |
|
|
tableData.value = [] |
|
|
tableData.value = [] |
|
|
|
|
|
updateTableData(tableObject.tableList) |
|
|
const itemCodes = [] |
|
|
const itemCodes = [] |
|
|
tableObject.tableList.forEach(row=>{ |
|
|
tableObject.tableList.forEach(row=>{ |
|
|
itemCodes.push(row['itemCode']) |
|
|
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){ |
|
|
if(isEnter){ |
|
|
//回车--供应商代码 |
|
|
//回车--供应商代码 |
|
|
const setV = {} |
|
|
const setV = {} |
|
|
setV['poNumber'] = number |
|
|
setV['poNumber'] = number |
|
|
setV['supplierCode'] = row.supplierCode |
|
|
setV['supplierCode'] = row.supplierCode |
|
|
formRef.value.formRef.setValues(setV) |
|
|
formRef.value.formRef.setValues(setV) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
//有效期 |
|
|
//有效期 |
|
|