|
|
@ -126,6 +126,7 @@ import { |
|
|
|
} from './sparereceiptRequestMain.data' |
|
|
|
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' |
|
|
|
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' |
|
|
|
import * as SpareitemLocationApi from '@/api/wms/spareitemLocation' |
|
|
|
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|
|
|
import { formatDate } from '@/utils/formatTime' |
|
|
|
import * as SupplieritemApi from '@/api/wms/supplieritem' |
|
|
@ -223,7 +224,7 @@ const onEnter = async (field,value)=>{ |
|
|
|
formRef.value.setDefaultBlurValue(field,value) |
|
|
|
// getSearchTableData(value,true) |
|
|
|
} |
|
|
|
const updateTableData = (tableList)=>{ |
|
|
|
const updateTableData = async (tableList)=>{ |
|
|
|
console.log('tableList',tableList) |
|
|
|
let itemCodes = tableList.filter(item=>tableData.value.find(item1=>item1['poNumber']==item['number']&&item1['supplierCode']==item['supplierCode']&&item1['poLine']==item['lineNumber']&&item1['itemCode']==item['itemCode'])) |
|
|
|
console.log('itemCodes',itemCodes) |
|
|
@ -234,6 +235,10 @@ const updateTableData = (tableList)=>{ |
|
|
|
} |
|
|
|
tableList = tableList.filter(item=>!tableData.value.find(item1=>item1['poNumber']==item['number']&&item1['supplierCode']==item['supplierCode']&&item1['poLine']==item['lineNumber']&&item1['itemCode']==item['itemCode'])) |
|
|
|
if(tableList.length==0) return |
|
|
|
let locationList = await SpareitemLocationApi.queryItemLocation({ |
|
|
|
"itemCodeList":tableList.map(item=>(item.itemCode)) |
|
|
|
}) |
|
|
|
console.log('locationList',locationList) |
|
|
|
tableList.forEach(row=>{ |
|
|
|
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row})) |
|
|
|
newRow['poLine'] = row['lineNumber'] |
|
|
@ -249,7 +254,10 @@ const updateTableData = (tableList)=>{ |
|
|
|
newRow['arriveDate'] = dayjs().valueOf() |
|
|
|
//批次 |
|
|
|
newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); |
|
|
|
newRow['defaultToLocationCode'] =row['defaultLocation'] |
|
|
|
let locationItem = locationList.find(location=>location['itemCode'] == row['itemCode']) |
|
|
|
if(locationItem){ |
|
|
|
newRow['defaultToLocationCode'] = locationItem['locationCode'] |
|
|
|
} |
|
|
|
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) |
|
|
|
} |
|
|
@ -288,7 +296,9 @@ const getSearchTableData = async (number,isEnter=false)=>{ |
|
|
|
}).then((res)=>{ |
|
|
|
res.list.forEach((item,index)=>{ |
|
|
|
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code']) |
|
|
|
findItem['expireTime'] = item['expireTime'] |
|
|
|
if(findItem){ |
|
|
|
findItem['expireTime'] = item['expireTime'] |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|