|
|
|
@ -819,11 +819,10 @@ const ruleForm = reactive({
|
|
|
|
|
investigationProcess: [ |
|
|
|
|
{ required: true, message: '请输入调查经过', trigger: ['bulr', 'change'] }, |
|
|
|
|
], |
|
|
|
|
result: [{ required: true, message: '请输选择处理结果', trigger: ['bulr'] }], |
|
|
|
|
result: [{ required: false, message: '请输选择处理结果', trigger: ['bulr'] }], |
|
|
|
|
processor: [{ required: true, message: '请选择处理方', trigger: ['bulr'] }], |
|
|
|
|
processorEntityList: [{ required: true, message: '请选择责任方', trigger: ['bulr'] }], |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
packageCode: [{ required: true, message: '请输入包条码', trigger: ['bulr', 'change'] }], |
|
|
|
|
waybillNumber: [{ required: true, message: '请输入运单号', trigger: ['bulr', 'change'] }], |
|
|
|
|
orderCode: [{ required: true, message: '请输入订单自编号', trigger: ['bulr', 'change'] }], |
|
|
|
@ -836,11 +835,11 @@ const ruleForm = reactive({
|
|
|
|
|
tripartite: [{ required: false, message: '请输入三方责任人', trigger: ['bulr', 'change'] }], |
|
|
|
|
description: [{ required: true, message: '请输入说明', trigger: ['bulr', 'change'] }], |
|
|
|
|
money: [{ required: true, message: '请输入金额', trigger: ['bulr', 'change'] }], |
|
|
|
|
paymentUnit: [{ required: true, message: '请输入支付单位', trigger: ['bulr', 'change'] }], |
|
|
|
|
compensationTime: [{ required: true, message: '请选择理赔支付时间', trigger: ['bulr', 'change'] }], |
|
|
|
|
compensationMethod: [ |
|
|
|
|
{ required: true, message: '请选择支付方式', trigger: ['bulr', 'change'] }, |
|
|
|
|
paymentUnit: [{ required: false, message: '请输入支付单位', trigger: ['bulr', 'change'] }], |
|
|
|
|
compensationTime: [ |
|
|
|
|
{ required: false, message: '请选择理赔支付时间', trigger: ['bulr', 'change'] }, |
|
|
|
|
], |
|
|
|
|
compensationMethod: [{ required: false, message: '请选择支付方式', trigger: ['bulr', 'change'] }], |
|
|
|
|
}); |
|
|
|
|
const ResponsibleParty = ref([]); //提货责任方 |
|
|
|
|
const ruleFormRef = ref(); //表单示例 |
|
|
|
@ -1506,6 +1505,8 @@ const onSubmit = () => {
|
|
|
|
|
}); |
|
|
|
|
// 订单自编号 |
|
|
|
|
submitData.orderCode = form.value.PackageList[0].orderCode; |
|
|
|
|
// 运单号 |
|
|
|
|
submitData.waybillNumber = form.value.PackageList[0].waybillNumber; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 处理方处理 |
|
|
|
@ -1553,7 +1554,7 @@ const onSubmit = () => {
|
|
|
|
|
// 干线卸车环节不需要内部责任划分 |
|
|
|
|
if (form.value.responsibilitiesList.length) { |
|
|
|
|
submitData.personResponsibleDTO = []; |
|
|
|
|
let Responsibleperson='' |
|
|
|
|
let Responsibleperson = ''; |
|
|
|
|
form.value.responsibilitiesList.forEach(item => { |
|
|
|
|
console.log(item); |
|
|
|
|
let data = { |
|
|
|
@ -1562,20 +1563,28 @@ const onSubmit = () => {
|
|
|
|
|
description: item.description, //说明 |
|
|
|
|
}; |
|
|
|
|
// 责任人查询 |
|
|
|
|
Responsibleperson = item.ResponsibleoNameptions.find(res => res.id == item.personResponsibleId) |
|
|
|
|
Responsibleperson = item.ResponsibleoNameptions.find( |
|
|
|
|
res => res.id == item.personResponsibleId |
|
|
|
|
); |
|
|
|
|
if (form.value.groundlineType == '1') { |
|
|
|
|
data.personResponsibleName = item.personResponsibleId; //责任人名称 |
|
|
|
|
data.businessName = item.Processingoptions.find( res => res.value == item.businessId).label; //责任方 |
|
|
|
|
data.personResponsibleName = item.personResponsibleId; //责任人名称 |
|
|
|
|
data.businessName = item.Processingoptions.find( |
|
|
|
|
res => res.value == item.businessId |
|
|
|
|
).label; //责任方 |
|
|
|
|
data.businessId = item.businessId; //责任方id |
|
|
|
|
} else { |
|
|
|
|
data.personResponsibleId = Responsibleperson?item.personResponsibleId:''; //责任人id |
|
|
|
|
data.personResponsibleName = Responsibleperson? Responsibleperson.name:item.personResponsibleId; //责任人名称 |
|
|
|
|
data.businessName = item.Responsibleoptions.find( res => res.value == item.businessId).label; //责任方 |
|
|
|
|
data.personResponsibleId = Responsibleperson ? item.personResponsibleId : ''; //责任人id |
|
|
|
|
data.personResponsibleName = Responsibleperson |
|
|
|
|
? Responsibleperson.name |
|
|
|
|
: item.personResponsibleId; //责任人名称 |
|
|
|
|
data.businessName = item.Responsibleoptions.find( |
|
|
|
|
res => res.value == item.businessId |
|
|
|
|
).label; //责任方 |
|
|
|
|
data.businessId = item.businessId; //责任方id |
|
|
|
|
} |
|
|
|
|
// 如果是自定义责任人就删除ID |
|
|
|
|
if(!data.personResponsibleId){ |
|
|
|
|
delete data.personResponsibleId |
|
|
|
|
if (!data.personResponsibleId) { |
|
|
|
|
delete data.personResponsibleId; |
|
|
|
|
} |
|
|
|
|
submitData['personResponsibleDTO'].push(data); |
|
|
|
|
}); |
|
|
|
@ -1583,7 +1592,7 @@ const onSubmit = () => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 图片处理 |
|
|
|
|
if ( |
|
|
|
|
if ( |
|
|
|
|
form.value.fileList.length && |
|
|
|
|
(form.value.basis.workOrderType == '1' || form.value.basis.workOrderType == '3') |
|
|
|
|
) { |
|
|
|
@ -1607,46 +1616,52 @@ const onSubmit = () => {
|
|
|
|
|
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, //固定参数 |
|
|
|
|
if (form.value.Claimamount.length) { |
|
|
|
|
form.value.Claimamount.forEach(item => { |
|
|
|
|
let resultTypeValue = Processingresultsoptions.value.find(res => res.label == item.title).value |
|
|
|
|
if(item.compensationMethod){ |
|
|
|
|
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:ProcessingresultsoptiTons.value.find(res => res.label == item.title).value, //处理结果方式 value |
|
|
|
|
resultType:resultTypeValue?resultypeValue.value:null, //处理结果方式 value |
|
|
|
|
typesOf: 1, //固定参数 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
submitData.aftersalesProcessingResultsDTO.resultType = form.value.Claimamount.map( |
|
|
|
|
res => res.title |
|
|
|
|
).join(','); //处理结果名称 |
|
|
|
|
submitData.aftersalesProcessingResultsDTO.resultType = form.value.Claimamount.map( |
|
|
|
|
res => res.title |
|
|
|
|
).join(','); //处理结果名称 |
|
|
|
|
|
|
|
|
|
let filteredArray = form.value.Claimamount.map(res => res.money); //金额总和 |
|
|
|
|
let filteredArray = form.value.Claimamount.map(res => res.money); //金额总和 |
|
|
|
|
|
|
|
|
|
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; //删除无用信息 |
|
|
|
|
} else { |
|
|
|
|
delete submitData.result; //删除处理结果字段 |
|
|
|
|
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; //删除无用信息 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
form.value.Pageloading = true; //关闭页面加载 |
|
|
|
|
|
|
|
|
|
//是否直接提交到处理结果 |
|
|
|
|
if (form.value.Processed) { |
|
|
|
|
submitData.workOrderStatus = 30; |
|
|
|
|
} |
|
|
|
|
delete submitData.result; //删除处理结果字段 |
|
|
|
|
//移除责任方表单(必须) |
|
|
|
|
delete submitData.processor; |
|
|
|
|
console.log(submitData, '处理好的参数'); |
|
|
|
@ -1674,7 +1689,7 @@ const onSubmit = () => {
|
|
|
|
|
title: 'aftersalesWorkOrder', |
|
|
|
|
status: true, |
|
|
|
|
}); |
|
|
|
|
$useStore.commit('Customer_Menu',0);//要刷新的菜单 |
|
|
|
|
$useStore.commit('Customer_Menu', 0); //要刷新的菜单 |
|
|
|
|
$useStore.commit('DEL_TAG_CURRENT'); //关闭当前页面 |
|
|
|
|
$router.push({ |
|
|
|
|
path: '/aftersales/aftersalesWorkOrder', |
|
|
|
|