Browse Source

采购收货申请,添加明细,不能添加数据

master_hella_20240701
yufei0306 6 months ago
parent
commit
11e37f57e9
  1. 1
      src/plugins/vueI18n/index.ts
  2. 42
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  3. 2
      src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

1
src/plugins/vueI18n/index.ts

@ -31,6 +31,7 @@ const createI18nOptions = async (): Promise<I18nOptions> => {
sync: true, sync: true,
silentTranslationWarn: true, silentTranslationWarn: true,
missingWarn: false, missingWarn: false,
fallbackWarn:false,
silentFallbackWarn: true silentFallbackWarn: true
} }
} }

42
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -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)
} }
}) })
// //

2
src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue

@ -146,7 +146,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc
if(val.length>0){ if(val.length>0){
//frm //frm
const setV = {} const setV = {}
if(val[0]['supplierCode']!=formRef.formModel.supplierCode){
tableData.value = [] // tableData.value = [] //
}
setV['contactName']=val[0]['contacts'] setV['contactName']=val[0]['contacts']
setV['contactPhone']=val[0]['phone'] setV['contactPhone']=val[0]['phone']
setV['contactEmail']=val[0]['email'] setV['contactEmail']=val[0]['email']

Loading…
Cancel
Save