diff --git a/src/plugins/vueI18n/index.ts b/src/plugins/vueI18n/index.ts index f845b13f7..f386ea814 100644 --- a/src/plugins/vueI18n/index.ts +++ b/src/plugins/vueI18n/index.ts @@ -31,6 +31,7 @@ const createI18nOptions = async (): Promise => { sync: true, silentTranslationWarn: true, missingWarn: false, + fallbackWarn:false, silentFallbackWarn: true } } diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index 16b361438..4c9127c44 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/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 ) => { //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) - } }) //有效期 diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue index 6c969f4c1..5cb88ff55 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/purchaseMain/index.vue @@ -146,7 +146,9 @@ console.log('PurchaseMain.allSchemas.searchSchema',PurchaseMain.allSchemas.searc if(val.length>0){ //frm表单回显 const setV = {} - tableData.value = [] // 清空子表数据 + if(val[0]['supplierCode']!=formRef.formModel.supplierCode){ + tableData.value = [] // 清空子表数据 + } setV['contactName']=val[0]['contacts'] setV['contactPhone']=val[0]['phone'] setV['contactEmail']=val[0]['email']