From 924e2130ba9f70e00ac2da13186e78a2f6e9997c Mon Sep 17 00:00:00 2001
From: yufei_wang <2267742828@qq.com>
Date: Wed, 25 Sep 2024 14:12:13 +0800
Subject: [PATCH] =?UTF-8?q?HL-5978WMS=E5=8F=91=E8=B4=A7=E7=94=B3=E8=AF=B7?=
=?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=80=89=E6=8B=A9=E5=8F=91=E8=B4=A7=E8=AE=A1?=
=?UTF-8?q?=E5=88=92=E5=8D=95=E5=8F=B7=E5=90=8E=E5=BA=94=E8=AF=A5=E8=87=AA?=
=?UTF-8?q?=E5=8A=A8=E5=B8=A6=E5=87=BA=E6=9C=88=E5=8F=B0=E5=92=8C=E6=98=8E?=
=?UTF-8?q?=E7=BB=86=EF=BC=8C=E7=9B=AE=E5=89=8D=E6=B2=A1=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E5=B8=A6=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../deliver/deliverRequestMain/index.vue | 73 ++++++++++++++++---
1 file changed, 62 insertions(+), 11 deletions(-)
diff --git a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue
index 026f47b5e..fbeb1a6d7 100644
--- a/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue
+++ b/src/views/wms/deliversettlementManage/deliver/deliverRequestMain/index.vue
@@ -34,6 +34,7 @@
+
@@ -42,7 +43,7 @@
@@ -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
}
}