Browse Source

HL-5978WMS发货申请新增选择发货计划单号后应该自动带出月台和明细,目前没自动带出

hella_online_20240927
王宇飞 5 months ago
parent
commit
924e2130ba
  1. 73
      src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

73
src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue

@ -34,6 +34,7 @@
</el-button>
</template>
<template #action="{ row,$index }">
<ButtonBase :Butttondata="butttondata(row,$index)" @button-base-click="buttonTableClick($event,row)" />
</template>
@ -42,7 +43,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="formRef"
ref="basicFormRef"
:isOpenSearchTable="true"
fieldTableColumn="itemCode"
@success="getList"
@ -62,6 +63,7 @@
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
:isShowButton = isShowButton
@clearSearchInput="clearSearchInput"
/>
<!-- 详情 -->
@ -93,6 +95,10 @@ import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { DeliverRequestMain,DeliverRequestMainRules,DeliverRequestDetail,DeliverRequestDetailRules } from './deliverRequestMain.data'
import * as DeliverRequestMainApi from '@/api/wms/deliverRequestMain'
import * as DeliverRequestDetailApi from '@/api/wms/deliverRequestDetail'
import * as CustomerdockApi from '@/api/wms/customerdock'
import * as CustomerItemApi from '@/api/wms/customeritem'
import { Customeritem } from '@/views/wms/basicDataManage/customerManage/customeritem/customeritem.data'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as AreabasicApi from '@/api/wms/areabasic'
import { formatDate } from '@/utils/formatTime'
@ -175,10 +181,29 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =
if(formField == 'deliverPlanNumber') {
setV['deliverPlanNumber'] = val[0]['number']
setV['customerCode'] = val[0]['customerCode']
if(formField == 'itemCode'){
console.log( val[0]);
row['uom'] = val[0]['customerUom']
let res = await CustomerdockApi.getCustomerdockPage({
by:"ASC",
pageNo:1,
pageSize:20,
available: "TRUE",
customerCode: val[0]['customerCode']
})
if(res&&res.list&&res.list.length>0){
setV['customerDockCode'] = res.list[0]['code']//-
setV['toWarehouseCode'] = res.list[0]['warehouseCode']//
setV['toLocationCode'] = res.list[0]['defaultLocationCode']//
let res2 = await AreabasicApi.selectAreabasicDOByCode(res.list[0]['defaultLocationCode'])
if(res2){
setV['deliverType'] = res2['type']
}
}else{
setV['toWarehouseCode'] = ''//
setV['toLocationCode'] = ''//
setV['deliverType'] = ''//
}
tableData.value = []
} else if(formField == 'customerDockCode') {
//
setV['toWarehouseCode'] = val[0]['warehouseCode']//
@ -187,13 +212,39 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =
if(res){
setV['deliverType'] = res['type']
}
} else {
} else if(formField == 'customerCode'){
//
setV['customerDockCode'] = ''
setV['toWarehouseCode'] = ''
setV['toLocationCode'] = ''
setV['deliverType'] = ''
tableData.value = []
}else {
setV[formField] = val[0][searchField]
}
formRef.setValues(setV)
}
})
}
const clearSearchInput = (field)=>{
console.log('field',field)
if('customerCode'==field){
//
basicFormRef.value.formRef.setValues({
customerDockCode: '',
toWarehouseCode: '',
toLocationCode: '',
deliverType: '',
})
tableData.value = []
}else if('customerDockCode'==field){
basicFormRef.value.formRef.setValues({
toWarehouseCode: '',
toLocationCode: '',
deliverType: '',
})
}
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
@ -383,7 +434,7 @@ const buttonTableClick = async (val, row) => {
}
/** 添加/修改操作 */
const formRef = ref()
const basicFormRef = ref()
const openForm =async (type: string, row?: number) => {
if(type == "update"){
DeliverRequestMain.allSchemas.formSchema.forEach((item) => {
@ -414,7 +465,7 @@ const openForm =async (type: string, row?: number) => {
})
}
tableData.value = [] //
formRef.value.open(type, row)
basicFormRef.value.open(type, row)
}
/**
@ -546,13 +597,13 @@ const submitForm = async (formType, submitData) => {
if(flag.value){
return
}
formRef.value.formLoading = true
basicFormRef.value.formLoading = true
try {
if (formType === 'create') {
if(tableData.value.length <= 0){
message.warning(`子表明细不能为空!`)
flag.value = true
formRef.value.formLoading = false
basicFormRef.value.formLoading = false
return;
}
await DeliverRequestMainApi.createDeliverRequestMain(data)
@ -561,7 +612,7 @@ const submitForm = async (formType, submitData) => {
await DeliverRequestMainApi.updateDeliverRequestMain(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false
basicFormRef.value.dialogVisible = false
//
if (formType === 'create') {
getList()
@ -569,7 +620,7 @@ const submitForm = async (formType, submitData) => {
buttonBaseClick('refresh',null)
}
} finally {
formRef.value.formLoading = false
basicFormRef.value.formLoading = false
}
}

Loading…
Cancel
Save