|
|
@ -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 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|