diff --git a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue index abc99b0a1..6c04bc0fd 100644 --- a/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue @@ -225,12 +225,11 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row } }) } - // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { //console.log("formRef",formRef) console.log("searchTableSuccess",formField, searchField, val, formRef, type, row) - nextTick(() => { + nextTick(async () => { if (type == 'tableForm') { // 明细查询页赋值 //row[formField] = val[0][searchField] @@ -276,8 +275,14 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => //新增--采购订单-- setV['supplierCode'] = val[0]['supplierCode'] setV['poNumber'] = val[0]['number'] - const newRow = val[0] - newRow['poNumber'] = val[0]['number'] + let res = await PurchasereceiptRequestMainApi.queryPurchasePlan({ + "poNumber": val[0]['number']//采购订单号 + }) + console.log('默认到库位res',res) + if(res&&res['toLocationCode']){ + setV['onlyDefaultToLocationCode'] = res['toLocationCode'] // 仅仅用来存储数据--用于给子表赋值 + } + // 请求明细数据 getSearchTableData(val[0]['number']) // tableData.value = [newRow] @@ -580,7 +585,11 @@ const updateTableData = (tableList)=>{ newRow['arriveDate'] = dayjs().valueOf() //批次 newRow['batch'] = formatDate(newRow['produceDate'],'YYYYMMDD'); - newRow['defaultToLocationCode'] =row['defaultLocation'] + // newRow['defaultToLocationCode'] =row['defaultLocation'] + if(!newRow['defaultToLocationCode']){ + newRow['defaultToLocationCode'] = formRef.value.formRef.formModel['onlyDefaultToLocationCode'] + } + 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) }