From 700ed998e347c220c1a857376624f073bdbcc4a2 Mon Sep 17 00:00:00 2001 From: wangyufei <2267742828@qq.com> Date: Tue, 13 Aug 2024 11:27:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B0=E5=BA=93=E4=BD=8D=E4=BB=A3=E7=A0=81-?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=B8=A6=E5=87=BA=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=BA=93=E4=BD=8D-gaojs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../inventorymoveRequestMainOKHOLD/index.vue | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue index 499e908c3..7ddee302a 100644 --- a/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue +++ b/src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue @@ -88,6 +88,7 @@ import { InventorymoveRequestMain,InventorymoveRequestMainRules,InventorymoveReq import * as InventorymoveRequestMainApi from '@/api/wms/inventorymoveRequestMain' import * as InventorymoveRequestDetailApi from '@/api/wms/inventorymoveRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import * as LocationApi from '@/api/wms/location' // 库存转移申请 defineOptions({ name: 'InventorymoveRequestMain' }) @@ -336,7 +337,32 @@ InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { const updataTableColumns = (val) => { tableColumns.value = val } - +// 物料隔离-获取到库位默认值 +const getDefaultToLocationCode = async ()=>{ + let searchCondition = [] + InventorymoveRequestDetail.allSchemas.tableFormColumns.map(item => { + if(item.field == "toLocationCode"){ + searchCondition = item.tableForm.searchCondition + } + }) + let params = {} + searchCondition.forEach(item=>{ + if(item['isMainValue']){ + params[item['key']] = formRef.value.formRef.formModel[item['value']] + }else{ + params[item['key']] = item['value'] + } + }) + let res = await LocationApi.selectBusinessTypeToLocation(params) + console.log('res',res) + if(res&&res.list.length>0){ + tableData.value.forEach(item=>{ + if(!item['toLocationCode']){ + item['toLocationCode'] = res.list[0]['code'] + } + }) + } +} // 查询页面返回 const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { @@ -371,6 +397,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => } tableData.value.push(newRow) }) + if(routeName.value == 'OktoholdRequestMain'){ + getDefaultToLocationCode() + } } else { row[formField] = val[0][searchField] }