Browse Source

到库位代码-默认带出第一个库位-gaojs

linshi20240813
wangyufei 3 months ago
parent
commit
700ed998e3
  1. 31
      src/views/wms/moveManage/inventorymove/inventorymoveRequestMainOKHOLD/index.vue

31
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]
}

Loading…
Cancel
Save