From 9957dd00d8d46106240f418df7ab49e988de43d7 Mon Sep 17 00:00:00 2001 From: xzg <4727863@qq.com> Date: Thu, 9 May 2024 18:13:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aftersales/aftersalesWorkOrderAddTemp.vue | 426 ++++++++++-------- .../inventory/distrilbutionBillLadingList.vue | 42 +- 2 files changed, 268 insertions(+), 200 deletions(-) diff --git a/src/views/aftersales/aftersalesWorkOrderAddTemp.vue b/src/views/aftersales/aftersalesWorkOrderAddTemp.vue index 8876ba75..f1b7f458 100644 --- a/src/views/aftersales/aftersalesWorkOrderAddTemp.vue +++ b/src/views/aftersales/aftersalesWorkOrderAddTemp.vue @@ -73,12 +73,6 @@ v-loading="form.Packageloading" > -
-
- 共计包件:{{ form.PackageList.length }} -
-
- +
@@ -359,12 +358,6 @@ v-loading="form.Packageloading" > -
-
- 公司占比:{{ form.Proportion }}% -
-
-
+
+
+ 公司占比:{{ form.Proportion }}(%) +
+
@@ -539,6 +537,7 @@ :max="9999999" :controls="false" :value-on-clear="0" + @change="Totalamount" /> @@ -585,6 +584,22 @@ + + + + + + +
+
+ 总计金额:{{ form.Totalamount }}(元) +
@@ -648,6 +663,8 @@ import { ref, reactive, computed } from 'vue'; import { ElMessage, ElMessageBox } from 'element-plus'; import { getDictionaryBiz } from '@/api/system/dict'; //字典 +import { useStore } from 'vuex'; +const $store = useStore(); import { $_getList, $_submit, @@ -661,12 +678,12 @@ import { useRouter, useRoute } from 'vue-router'; import { getDetailWarehouse, getDeptWarehouse } from '@/api/basicdata/basicdataWarehouse'; //处理方 import { deepClone } from '@/utils/util'; import { getToken } from '@/utils/auth'; +import error from '@/error'; const $router = useRouter(); const formCopy = ref({}); //用于重置表单 const form = ref({ - basis: { - workOrderType: null, - }, //基础信息 + basis: {}, //基础信息 + Totalamount: 0, //总金额 TabactiveName: '0', //工单类型菜单 activPackage: '0', //包件信息菜单 responsibilities: '0', //内部责任菜单 @@ -797,12 +814,8 @@ const Handling = async () => { } }); }; -// 页面初始化数据处理 -const PageState = () => { - if (localStorage.getItem('my_data')) { - myData.value = JSON.parse(localStorage.getItem('my_data')); //获取本地仓库信息 - } - +// 内部责任划分初始化 +const responsibilities = () => { // 内部责任划分处理 form.value.responsibilitiesList = [ { @@ -826,6 +839,15 @@ const PageState = () => { id: 1, }, ]; +}; + +// 页面初始化数据处理 +const PageState = () => { + if (localStorage.getItem('my_data')) { + myData.value = JSON.parse(localStorage.getItem('my_data')); //获取本地仓库信息 + } + // 内部责任划分初始化 + responsibilities(); //包件列表 form.value.PackageList = [ { @@ -891,7 +913,13 @@ const DiscoveringNodesChange = value => { workOrderType: form.value.basis.workOrderType, discoveryNode: form.value.basis.discoveryNode, workOrderNumber: form.value.basis.workOrderNumber, + typeServiceName: form.value.basis.typeServiceName, + waybillMall: form.value.basis.waybillMall, }; + // 公司占比重置 + form.value.Proportion = 0; + // 内部责任化初始值 + responsibilities(); ruleFormRef.value.clearValidate(); }; // 菜单切换显示输入框 @@ -1016,6 +1044,16 @@ const CompanyProportionInput = value => { calculateMaxValues(); }; +// 理赔总金额计算 +const Totalamount = () => { + console.log(form.value.Claimamount); + + form.value.Totalamount = form.value.Claimamount.map(res => res.money).reduce( + (accumulator, currentValue) => accumulator + currentValue, + 0 + ); +}; + const Claimssettlement = value => { console.log(value, '理赔金额'); console.log(Processingresultsoptions.value, '参数列表'); @@ -1126,73 +1164,80 @@ const ChangePackageInfo = async item => { let data = { packageCode: item.packageCode, //输入框参数 }; - $_getAbnormalPackage(data).then(async res => { - console.log(res, '查询包条'); - let packageData = {}; - if (res.data.code == 200 && res.data && res.data.data.length) { - packageData = res.data.data[0]; //取第一个值,内容相同 - // 判断输入的是否为同一批货 - let state = await form.value.PackageList.find(res => res.orderCode || res.brandName); - if (state) { - if (state.orderCode != packageData.orderCode || state.brandName != packageData.brandName) { - ElMessage({ - message: '请选择相同订单自编号和品牌的包条码!', - type: 'warning', - }); - return; - } - } - ElMessage({ - message: '查询成功', - type: 'success', - }); - item.waybillNumber = packageData.waybillNumber || ''; //运单号 - item.orderCode = packageData.orderCode || ''; //订单自编码 - item.first = packageData.firsts || ''; //一级品 - item.secondary = packageData.second || ''; //二级品 - item.brandName = packageData.brandName || ''; //品牌 - form.value.basis.waybillMall = packageData.mallName || ''; //运单商场 - form.value.basis.typeServiceName = packageData.typeServiceName || ''; //合作模式 - // 是否显示历史包件按钮,存在多个包件则展示 - const results = res.data.data.filter(item => { - return item.workOrderId && item.workOrderNumber; - }); - // 存储历史订单 - if (results.length) { - item.history = true; - item.HistoricalPackageList = results; - } else { - item.history = false; - } - } else { - ElMessage({ - message: '暂无查询内容,请检查参数是否正确!', - type: 'warning', - }); - } - // 判断发现节点(干线车次号、车辆线路处理) - if (form.value.discoveryNode == '3') { - let addedTrainNumbers = []; // 临时变量存储已经添加过的车次号 - res.data.data.forEach(item => { - item.trunklines.forEach(itemChid => { - if (!addedTrainNumbers.includes(itemChid.trainNumber)) { - form.value.Trainoptions.push({ - trainNumber: itemChid.trainNumber, // 车次号 - vehicleRoute: itemChid.vehicleRoute, // 车辆线路 + form.value.Pageloading = true; //开启页面加载 + $_getAbnormalPackage(data) + .then(async res => { + console.log(res, '查询包条'); + let packageData = {}; + if (res.data.code == 200 && res.data && res.data.data.length) { + form.value.Pageloading = false; //关闭页面加载 + packageData = res.data.data[0]; //取第一个值,内容相同 + // 判断输入的是否为同一批货 + let state = await form.value.PackageList.find(res => res.orderCode || res.brandName); + if (state) { + if ( + state.orderCode != packageData.orderCode || + state.brandName != packageData.brandName + ) { + ElMessage({ + message: '请选择相同订单自编号和品牌!', + type: 'warning', }); - addedTrainNumbers.push(itemChid.trainNumber); + return; } + } + ElMessage({ + message: '查询成功', + type: 'success', }); - }); - } - - // item.mallName = packageData.mallName; //运单商场 + item.waybillNumber = packageData.waybillNumber || ''; //运单号 + item.orderCode = packageData.orderCode || ''; //订单自编码 + item.first = packageData.firsts || ''; //一级品 + item.secondary = packageData.second || ''; //二级品 + item.brandName = packageData.brandName || ''; //品牌 + form.value.basis.waybillMall = packageData.mallName || ''; //运单商场 + form.value.basis.typeServiceName = packageData.typeServiceName || ''; //合作模式 + // 是否显示历史包件按钮,存在多个包件则展示 + const results = res.data.data.filter(item => { + return item.workOrderId && item.workOrderNumber; + }); + // 存储历史订单 + if (results.length) { + item.history = true; + item.HistoricalPackageList = results; + } else { + item.history = false; + } - // Indexform.value.waybillMall = packageData.mallName; //客户名称(运单商场) - // Indexform.value.typeServiceName = packageData.typeServiceName - // ? packageData.typeServiceName - // : ''; //合作模式 - }); + // 判断发现节点(干线车次号、车辆线路处理) + if (form.value.discoveryNode == '3') { + let addedTrainNumbers = []; // 临时变量存储已经添加过的车次号 + res.data.data.forEach(item => { + if (item.trunklines && item.trunklines.length) { + item.trunklines.forEach(itemChid => { + if (!addedTrainNumbers.includes(itemChid.trainNumber)) { + form.value.Trainoptions.push({ + trainNumber: itemChid.trainNumber, // 车次号 + vehicleRoute: itemChid.vehicleRoute, // 车辆线路 + }); + addedTrainNumbers.push(itemChid.trainNumber); + } + }); + } + }); + } + } else { + form.value.Pageloading = false; //关闭页面加载 + ElMessage({ + message: '暂无查询内容,请检查参数是否正确!', + type: 'warning', + }); + } + }) + .catch(error => { + console.log(error, 'error'); + form.value.Pageloading = false; //关闭页面加载 + }); }; // 查看历史包件详情 const Viewdetails = value => { @@ -1254,7 +1299,6 @@ const DeliveryTrainnumber = value => { }; // 提交 const onSubmit = () => { - console.log(form.value.fileList); console.log(form.value); ruleFormRef.value.validate(valid => { if (!valid) { @@ -1264,6 +1308,26 @@ const onSubmit = () => { }); return; } + // 货损照片上传判断 + if (form.value.groundlineType == '1') { + if (form.value.fileList.length < 2) { + ElMessage({ + message: '请上传最低2张图片附件', + type: 'warning', + }); + return; + } + } + // 串货图片附件 + if (form.value.groundlineType == '3') { + if (!form.value.fileList.length) { + ElMessage({ + message: '请上传图片附件', + type: 'warning', + }); + return; + } + } const message = `注意信息填写正确!点击确定将提交工单是否继续?`; ElMessageBox.confirm(message, '提示', { @@ -1275,66 +1339,7 @@ const onSubmit = () => { form.value.Pageloading = true; //开启页面加载 let submitData = { - // 包件信息 - // packageEntityList: [ - // { - // packageCode: '', //包条码 - // waybillNumber: '', //运单号 - // orderCode: '', //订单自编号 - // first: '', //一级品 - // secondary: '', //二级品 - // brandName: '', //品牌 - // }, - // ], - // 基础信息 ...form.value.basis, - // 内部责任划分 - // personResponsibleDTO: [ - // { - // businessName: '', //责任方 - // businessId: '', //责任方id - // personResponsibleName: '', //责任人 - // personResponsibleId: '', //责任人ID - // responsibilityRatio: 0, //责任占比 - // tripartite: '', //三方责任人 - // description: '', //说明 - // }, - // ], - // 处理方OR责任方 - // processorEntityList: [ - // { - // businessName: '', //仓库名称 - // businessId: '', //仓库ID - // conditions: 1, //固定参数 - // typesOf: '', //1责任方 ,2处理方 - // }, - // ], - // 处理结果 - // aftersalesProcessingResultsDTO: { - // compensationMethod: '', //赔付方式名称 多个名称逗号拼接 银行卡赔付,现付款中扣除 - // money: 0, //总金额 - // resultType: '', //处理结果名称 多个逗号拼接 下补单,维修/补漆 - // processingMoneyEntityList: [ - // { - // compensationMethodName: '', //支付方式名称 - // compensationMethod: '2', //支付方式value - // compensationTime: '', //支付时间 - // money: 0, //支付金额 - // paymentUnit: '', //支付单位 - // resultName: '', //处理结果方式 下补单 - // resultType: '', //处理结果方式 value - // typesOf: 1, //固定参数 - // }, - // ], - // }, - // 图片 - // decreaseImageEntityList: [ - // { - // imageName: '', //图片名称 - // imagePath: '', //图片地址 - // imageType: '', //图片类型 - // }, - // ], }; // 包件处理 if (form.value.PackageList.length) { @@ -1382,17 +1387,10 @@ const onSubmit = () => { form.value.responsibilitiesList.forEach(item => { console.log(item); let data = { - // businessName: item.Responsibleoptions.find(res => res.id == item.businessId).label || '', //责任方 - // businessId: item.businessId, //责任方id - // personResponsibleName: item.ResponsibleoNameptions.find( - // res => res.id == item.personResponsibleId - // ).name, //责任人名称 - // personResponsibleId: item.personResponsibleId, //责任人ID responsibilityRatio: item.responsibilityRatio, //责任占比 tripartite: item.tripartite, //三方责任人 description: item.description, //说明 }; - if (form.value.groundlineType == '1') { data.personResponsibleName = item.personResponsibleId; //责任人名称 data.businessName = item.Processingoptions.find( @@ -1429,33 +1427,78 @@ const onSubmit = () => { }); } - console.log(submitData, '处理好的参数'); + // 处理结果 + if (form.value.basis.result.length) { + submitData.aftersalesProcessingResultsDTO = { + money: 0, //金额总和 + resultType: [], //处理结果名称 + processingMoneyEntityList: [], + }; + let PlayName = []; //赔付方式名称 + form.value.Claimamount.forEach(item => { + PlayName.push(item.Paymentmethod.find(res => res.value == item.compensationMethod).label); + submitData.aftersalesProcessingResultsDTO['processingMoneyEntityList'].push({ + compensationMethodName: item.Paymentmethod.find( + res => res.value == item.compensationMethod + ).label, //支付方式名称 + compensationMethod: item.compensationMethod, //支付方式value + compensationTime: item.compensationTime, //支付时间 + money: item.money, //支付金额 + paymentUnit: item.paymentUnit, //支付单位 + resultName: item.title, //处理结果方式 下补单 + resultType: Processingresultsoptions.value.find(res => res.label == item.title).value, //处理结果方式 value + typesOf: 1, //固定参数 + }); + }); + submitData.aftersalesProcessingResultsDTO.resultType = form.value.Claimamount.map( + res => res.title + ).join(','); //处理结果名称 - $_submit(submitData).then(res => { - console.log(res, '提交成功'); - }); - // 关闭页面加载 - let _time = setTimeout(() => { - form.value.Pageloading = false; //开启页面加载 - clearTimeout(_time); - }, 300); + let filteredArray = form.value.Claimamount.map(res => res.money); //金额总和 - // console.log(valid, '校验状态'); - // console.log(form.value, 'form表单'); - // if (!form.value.fileList || !form.value.fileList.length) { - // console.log('请上传图片'); - // return; - // } else if (form.value.fileList || form.value.fileList.length) { - // let state = form.value.fileList.every( - // item => item.response && item.response.data && item.response.data.link - // ); - // if (!state) { - // ElMessage({ - // message: '图片未上传成功,请重新上传', - // type: 'warning', - // }); - // } - // } + submitData.aftersalesProcessingResultsDTO.money = filteredArray.reduce( + (accumulator, currentValue) => accumulator + currentValue, + 0 + ); + // 支付方式名称 + submitData.aftersalesProcessingResultsDTO.compensationMethod = PlayName.join(','); + submitData.aftersalesProcessingResultsDTO.resultDescription = + form.value.basis.resultDescription; //处理结果说明 + delete form.value.basis.resultDescription; //删除无用信息 + } + + console.log(submitData, '处理好的参数'); + form.value.Pageloading = true; //关闭页面加载 + $_submit(submitData) + .then(res => { + ElMessage({ + message: res.data.msg || '创建成功', + type: 'success', + }); + if (res.data.code == 200) { + form.value.Pageloading = false; //关闭页面加载 + ElMessageBox.confirm('当前工单创建成功,是否继续创建?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '返回', + type: 'warning', + }) + .then(async () => { + form.value = await deepClone(formCopy.value); //用于拷贝一份重置数据 + await PageState(); + await ruleFormRef.value.resetFields(); + }) + .catch(() => { + $store.commit('DEL_TAG_CURRENT'); //关闭当前页面 + $router.push({ + path: '/aftersales/aftersalesWorkOrder', + }); + }); + } + }) + .catch(error => { + console.log(error, 'error'); + form.value.Pageloading = false; //关闭页面加载 + }); }); }); }; @@ -1583,7 +1626,7 @@ const TabactiveClick = (a, b) => { } } .Basicinformation { - width: 80%; + width: 100%; display: flex; flex-wrap: wrap; :deep(.el-form-item) { @@ -1604,9 +1647,9 @@ const TabactiveClick = (a, b) => { .el_Basic { flex: 1; display: flex; - min-width: 20%; + min-width: 38%; .el_Processing { - min-width: 430px; + min-width: 50%; } :deep(.el_Investigation) { flex: 1; @@ -1692,6 +1735,29 @@ const TabactiveClick = (a, b) => { .is-active { font-weight: bold; } + .el_top { + display: flex; + align-items: center; + margin-bottom: 10px; + height: 40px; + .el_addPackage { + border: none; + } + .el_Package_num { + font-size: 14px; + height: 80%; + border-bottom: 1px solid #409eff; + display: flex; + align-items: center; + justify-content: center; + padding: 2px; + box-sizing: border-box; + span { + color: #666; + font-weight: 500; + } + } + } .el_Processingresults { display: flex; flex-wrap: wrap; @@ -1747,6 +1813,6 @@ const TabactiveClick = (a, b) => { :deep(.el-loading-mask) { position: fixed; left: 12%; - top: 11%; + top: 10%; } diff --git a/src/views/distribution/inventory/distrilbutionBillLadingList.vue b/src/views/distribution/inventory/distrilbutionBillLadingList.vue index a8d30e59..f6e08313 100644 --- a/src/views/distribution/inventory/distrilbutionBillLadingList.vue +++ b/src/views/distribution/inventory/distrilbutionBillLadingList.vue @@ -302,6 +302,26 @@ export default { fixed: false, sortable: true, }, + { + prop: 'pickUpTime', + label: '提货时间', + type: 2, + values: '', + width: '140', + checkarr: [], + fixed: false, + sortable: false, + }, + { + prop: 'consignee', + label: '提货人', + type: 2, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: false, + }, { prop: 'consigneeUnit', label: '收货单位', @@ -470,16 +490,7 @@ export default { fixed: false, sortable: false, }, - { - prop: 'consignee', - label: '提货人', - type: 2, - values: '', - width: '130', - checkarr: [], - fixed: false, - sortable: false, - }, + { prop: 'pickUpPlate', label: '提货车牌', @@ -490,16 +501,7 @@ export default { fixed: false, sortable: false, }, - { - prop: 'pickUpTime', - label: '提货时间', - type: 2, - values: '', - width: '140', - checkarr: [], - fixed: false, - sortable: false, - }, + { prop: 'deliveryDocument', label: '提货证件',