|
|
|
@ -818,7 +818,8 @@ const onLoad = () => {
|
|
|
|
|
Indexform.value.processor.push(item.businessId); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
ProcessingParty.value = JSON.parse(JSON.stringify(Indexform.value.processor))//拷贝一份处理方 |
|
|
|
|
ProcessingParty.value = JSON.parse(JSON.stringify(Indexform.value.processor)); //拷贝一份处理方 |
|
|
|
|
console.log(ProcessingParty.value, '拷贝的处理方'); |
|
|
|
|
console.log(Indexform.value.processor, ' Indexform.value.processor'); |
|
|
|
|
getDictionaryBiz('pc_work_order').then(res => { |
|
|
|
|
//处理结果字典 |
|
|
|
@ -868,33 +869,38 @@ const onLoad = () => {
|
|
|
|
|
Indexform.value.compensationTime = res.data.data.processingResultsVO.compensationTime; |
|
|
|
|
// 处理结果说明回显 |
|
|
|
|
Indexform.value.resultDescription = res.data.data.processingResultsVO.resultDescription; |
|
|
|
|
// 收款方 |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
res.data.data.completionRecordEntities.length || |
|
|
|
|
res.data.data.completionRecipientEntityList.length |
|
|
|
|
) { |
|
|
|
|
// 如果收款方和赔款方存在数据清空初始数据 |
|
|
|
|
CompensationParty.value = []; |
|
|
|
|
if (res.data.data.completionRecipientEntityList) { |
|
|
|
|
if (res.data.data.completionRecipientEntityList.length > 0) { |
|
|
|
|
res.data.data.completionRecipientEntityList.forEach((item, index) => { |
|
|
|
|
TotalamountReceived.value += Number(item.money); |
|
|
|
|
|
|
|
|
|
// 赔款方 |
|
|
|
|
if (res.data.data.completionRecordEntities.length) { |
|
|
|
|
res.data.data.completionRecordEntities.forEach((item, index) => { |
|
|
|
|
TotalamountCompensation.value += Number(item.money); |
|
|
|
|
CompensationParty.value.push({ |
|
|
|
|
state: 1, //状态 |
|
|
|
|
state: 0, //状态 |
|
|
|
|
num: item.money, //金额 |
|
|
|
|
name: item.recipient, //收款方名字 |
|
|
|
|
reason: item.reasonReceivingPayment, //收款方原因 |
|
|
|
|
name: item.indemnitor, //收款方名字 |
|
|
|
|
reason: item.reason, //收款方原因 |
|
|
|
|
explains: item.explains, //收款方说明 |
|
|
|
|
cld: index + 1, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (res.data.data.completionRecordEntities) { |
|
|
|
|
// 赔款方 |
|
|
|
|
if (res.data.data.completionRecordEntities.length > 0) { |
|
|
|
|
res.data.data.completionRecordEntities.forEach((item, index) => { |
|
|
|
|
TotalamountCompensation.value += Number(item.money); |
|
|
|
|
|
|
|
|
|
// 收款方 |
|
|
|
|
if (res.data.data.completionRecipientEntityList.length) { |
|
|
|
|
res.data.data.completionRecipientEntityList.forEach((item, index) => { |
|
|
|
|
TotalamountReceived.value += Number(item.money); |
|
|
|
|
CompensationParty.value.push({ |
|
|
|
|
state: 0, //状态 |
|
|
|
|
state: 1, //状态 |
|
|
|
|
num: item.money, //金额 |
|
|
|
|
name: item.indemnitor, //收款方名字 |
|
|
|
|
reason: item.reason, //收款方原因 |
|
|
|
|
name: item.recipient, //收款方名字 |
|
|
|
|
reason: item.reasonReceivingPayment, //收款方原因 |
|
|
|
|
explains: item.explains, //收款方说明 |
|
|
|
|
cld: index + 1, |
|
|
|
|
}); |
|
|
|
@ -902,6 +908,7 @@ const onLoad = () => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Indexform.value.arbitrate = res.data.data.reasonArbitration; //仲裁原因 |
|
|
|
|
// 异常类型下标 |
|
|
|
|
SelectType.value = IndexException.value.find( |
|
|
|
|
item => item.value == Indexform.value.workOrderType |
|
|
|
@ -1149,14 +1156,14 @@ const ConfirmForm = () => {
|
|
|
|
|
packageEntityList: [], //新增的包件信息 (完成) |
|
|
|
|
unPpackageEntityList: [], //取消的包件ID(完成) |
|
|
|
|
|
|
|
|
|
processorEntityList: [], //新增的责任方和处理方 |
|
|
|
|
unProcessorEntityList: [], //取消的责任方和处理方 |
|
|
|
|
processorEntityList: [], //新增的责任方和处理方(完成) |
|
|
|
|
unProcessorEntityList: [], //取消的责任方和处理方(完成) |
|
|
|
|
|
|
|
|
|
decreaseImageEntityList: [], //损货图片 (完成) |
|
|
|
|
unDecreaseImageEntityList: [], //取消的损货图片(完成) |
|
|
|
|
completionRecipientEntities: [], //异常工单完结收款方 |
|
|
|
|
completionRecordEntities: [], //异常工单完结赔款方 |
|
|
|
|
aftersalesProcessingResultsDTO: {}, //处理结果 |
|
|
|
|
completionRecipientEntities: [], //异常工单完结收款方(完成暂不可修改) |
|
|
|
|
completionRecordEntities: [], //异常工单完结赔款方(完成暂不可修改) |
|
|
|
|
aftersalesProcessingResultsDTO: {}, //处理结果(完成暂不可修改) |
|
|
|
|
|
|
|
|
|
personResponsibleDTO: [], //添加预计责任人(完成) |
|
|
|
|
unPersonResponsibleDTO: [], //取消预计责任人(完成) |
|
|
|
@ -1169,6 +1176,13 @@ const ConfirmForm = () => {
|
|
|
|
|
objB => !unPackageInfo.value.some(objA => JSON.stringify(objA) === JSON.stringify(objB)) |
|
|
|
|
); //修改过的包件信息 |
|
|
|
|
|
|
|
|
|
// 调查经过 |
|
|
|
|
DataSubmit.surveyRecordDTO = { |
|
|
|
|
content: Indexform.value.investigationPocess, //内容' |
|
|
|
|
workOrderId: $route.query.id, //工单ID |
|
|
|
|
// pictureUrl: KFfeel.value.join(','), //附件路径 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (Modified.length) { |
|
|
|
|
// 如果有修改过包件信息执行 |
|
|
|
|
Modified.forEach(item => { |
|
|
|
@ -1214,6 +1228,7 @@ const ConfirmForm = () => {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 移除的包件ID |
|
|
|
|
DataSubmit['unPpackageEntityList'] = deletePackageInfo.value.map(item => item.id); |
|
|
|
|
|
|
|
|
@ -1230,8 +1245,10 @@ const ConfirmForm = () => {
|
|
|
|
|
modifyresponsibility.forEach(item => { |
|
|
|
|
DataSubmit['personResponsibleDTO'].push({ |
|
|
|
|
wordOrderId: Indexform.value.workOrderNumber, //工单异常ID |
|
|
|
|
personResponsibleId:personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.id || null, //责任人ID |
|
|
|
|
personResponsibleName:personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.name || null, //责任人名称 |
|
|
|
|
personResponsibleId: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.id || null, //责任人ID |
|
|
|
|
personResponsibleName: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.name || null, //责任人名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item.businessName)?.value || null, //责任方ID |
|
|
|
|
businessName: warehouseData.value.find(obj => obj.value == item.businessName)?.label || null, //责任方名称//责任方名称 |
|
|
|
|
responsibilityRatio: item.responsibilityRatio, //责任比例 |
|
|
|
@ -1243,78 +1260,157 @@ if(unProcessorEntityList.value.length){
|
|
|
|
|
unProcessorEntityList.value.forEach(item => { |
|
|
|
|
DataSubmit['unPersonResponsibleDTO'].push({ |
|
|
|
|
wordOrderId: Indexform.value.workOrderNumber, //工单异常ID |
|
|
|
|
personResponsibleId:personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.id || null, //责任人ID |
|
|
|
|
personResponsibleName:personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.name || null, //责任人名称 |
|
|
|
|
personResponsibleId: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.id || null, //责任人ID |
|
|
|
|
personResponsibleName: |
|
|
|
|
personResponsibleList.value.find(obj => obj.id == item.personResponsibleName)?.name || |
|
|
|
|
null, //责任人名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item.businessName)?.value || null, //责任方ID |
|
|
|
|
businessName:warehouseData.value.find(obj => obj.value == item.businessName)?.label || null, //责任方名称//责任方名称 |
|
|
|
|
businessName: |
|
|
|
|
warehouseData.value.find(obj => obj.value == item.businessName)?.label || null, //责任方名称//责任方名称 |
|
|
|
|
responsibilityRatio: item.responsibilityRatio, //责任比例 |
|
|
|
|
description: item.description, //说明 |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增的责任方和处理方 |
|
|
|
|
// 判断是否处理方发送了改变 |
|
|
|
|
let arraysAreEqual = |
|
|
|
|
ProcessingParty.value.length === Indexform.value.processor.length && |
|
|
|
|
ProcessingParty.value.every(aElement => Indexform.value.processor.includes(aElement)); |
|
|
|
|
if (arraysAreEqual) { |
|
|
|
|
Indexform.value.processor.forEach(item => { |
|
|
|
|
DataSubmit['processorEntityList'].push({ |
|
|
|
|
businessName:'',//名称 |
|
|
|
|
businessId:'',//ID |
|
|
|
|
workOrderId:$route.query.id,//异常工单ID |
|
|
|
|
conditions:2,//状态 1正常 2新增 3取消 |
|
|
|
|
typesOf:2,// 类型 1 责任方 2 处理方 |
|
|
|
|
processingStatus:'',//处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
warehouseId:$route.query.warehouseId,//仓库ID |
|
|
|
|
assignTime:'',//指派时间 |
|
|
|
|
}) |
|
|
|
|
// 取消的责任方和处理方 |
|
|
|
|
DataSubmit['unProcessorEntityList'].push({ |
|
|
|
|
businessName:'',//名称 |
|
|
|
|
businessId:'',//ID |
|
|
|
|
businessName: warehouseData.value.find(obj => obj.value == item).label, //名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item).value, //ID |
|
|
|
|
workOrderId: $route.query.id, //异常工单ID |
|
|
|
|
conditions:2,//状态 1正常 2新增 3取消 |
|
|
|
|
typesOf:2,// 类型 1 责任方 2 处理方 |
|
|
|
|
processingStatus:'',//处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
conditions: 1, //状态 1正常 2新增 3取消 |
|
|
|
|
typesOf: 2, //1 责任方 2 处理方 |
|
|
|
|
warehouseId: $route.query.warehouseId, //仓库ID |
|
|
|
|
assignTime:'',//指派时间 |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
processingStatus: $route.query.ProcessType, //处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
console.log('处理方没有发送改变'); |
|
|
|
|
} else { |
|
|
|
|
// 如果发送了改变才执行下面的操作 |
|
|
|
|
console.log(ProcessingParty.value, '初始值处理方'); |
|
|
|
|
// 筛选出发送改变的 |
|
|
|
|
let changedElements = Indexform.value.processor.filter( |
|
|
|
|
bElement => !ProcessingParty.value.some(aElement => aElement === bElement) |
|
|
|
|
); |
|
|
|
|
console.log(changedElements, '发送改变的处理方'); |
|
|
|
|
// 如果有发送改变的处理方执行 |
|
|
|
|
if (changedElements) { |
|
|
|
|
// 新增的责任方和处理方 |
|
|
|
|
Indexform.value.processor.forEach(item=>{ |
|
|
|
|
msgData['processorEntityList'].push({ |
|
|
|
|
changedElements.forEach(item => { |
|
|
|
|
DataSubmit['processorEntityList'].push({ |
|
|
|
|
businessName: warehouseData.value.find(obj => obj.value == item).label, //名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item).value, //ID |
|
|
|
|
workOrderId: $route.query.id, //异常工单ID |
|
|
|
|
conditions: 2, //状态 1正常 2新增 3取消 |
|
|
|
|
typesOf: 2, //1 责任方 2 处理方 |
|
|
|
|
warehouseId: $route.query.warehouseId, //仓库ID |
|
|
|
|
processingStatus:'',//处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
assignTime:'',//指派时间 |
|
|
|
|
processingStatus: $route.query.ProcessType, //处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 筛选出被移除的处理方 |
|
|
|
|
let removedElements = ProcessingParty.value.filter( |
|
|
|
|
aElement => !Indexform.value.processor.includes(aElement) |
|
|
|
|
); |
|
|
|
|
console.log(removedElements, '被移除的处理方'); |
|
|
|
|
if (removedElements.length) { |
|
|
|
|
// 取消的责任方和处理方 |
|
|
|
|
Indexform.value.processor.forEach(item => { |
|
|
|
|
msgData['unProcessorEntityList'].push({ |
|
|
|
|
DataSubmit['unProcessorEntityList'].push({ |
|
|
|
|
businessName: warehouseData.value.find(obj => obj.value == item).label, //名称 |
|
|
|
|
businessId: warehouseData.value.find(obj => obj.value == item).value, //ID |
|
|
|
|
workOrderId: $route.query.id, //异常工单ID |
|
|
|
|
conditions: 3, //状态 1正常 2新增 3取消 |
|
|
|
|
typesOf: 2, //1 责任方 2 处理方 |
|
|
|
|
warehouseId: $route.query.warehouseId, //仓库ID |
|
|
|
|
processingStatus:'',//处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
assignTime:'',//指派时间 |
|
|
|
|
processingStatus: $route.query.ProcessType, //处理状态 类型 1 待处理 2 已处理 |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 完结信息修改 |
|
|
|
|
// console.log(CompensationParty.value); |
|
|
|
|
// // 异常工单完结赔款方 |
|
|
|
|
// DataSubmit['completionRecordEntities'] = CompensationParty.value |
|
|
|
|
// .filter(item => item.state === 0) // 先筛选出状态为 0 的项 |
|
|
|
|
// .map(item => { |
|
|
|
|
// return { |
|
|
|
|
// indemnitor: item.name, // 赔款方 |
|
|
|
|
// reason: item.reason, // 原因 |
|
|
|
|
// money: Number(item.num), // 金额 |
|
|
|
|
// reasonArbitration: item.reason, // 说明 |
|
|
|
|
// workOrderId: $route.query.id, // 异常工单 |
|
|
|
|
// warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
// }; |
|
|
|
|
// }); |
|
|
|
|
// // 异常工单完结收款方 |
|
|
|
|
// DataSubmit['completionRecipientEntities'] = CompensationParty.value |
|
|
|
|
// .filter(item => item.state === 1) // 先筛选出状态为 1 的项 |
|
|
|
|
// .map(item => { |
|
|
|
|
// return { |
|
|
|
|
// recipient: item.name, // 收款方 |
|
|
|
|
// reasonReceivingPayment: item.reason, // 原因 |
|
|
|
|
// money: Number(item.num), // 金额 |
|
|
|
|
// workOrderNumber: $route.query.workOrderNumber, // 工单号 |
|
|
|
|
// responsibleParty: FangAddList.value |
|
|
|
|
// .map(aItem => |
|
|
|
|
// warehouseData.value |
|
|
|
|
// .filter(bItem => bItem.value === aItem.businessName) |
|
|
|
|
// .map(match => match.label) |
|
|
|
|
// .join(',') |
|
|
|
|
// ) |
|
|
|
|
// .join(','), |
|
|
|
|
// warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
// workOrderId: $route.query.id, //异常工单 |
|
|
|
|
// }; |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 支付方式 |
|
|
|
|
// DataSubmit.aftersalesProcessingResultsDTO['compensationMethod'] = ProcessingList.value |
|
|
|
|
// .map(item => item.text) |
|
|
|
|
// .join(','); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DataSubmit.aftersalesProcessingResultsDTO['processingMoneyEntityList'] = ProcessingList.value |
|
|
|
|
// .map(item => { |
|
|
|
|
// console.log(item); |
|
|
|
|
// let match = ProcessingResults.value.find(element => element.dictValue == item.name); |
|
|
|
|
// if (match) { |
|
|
|
|
// let paymentMethodMatch = Paymentmethod.value.find( |
|
|
|
|
// paymentMethod => paymentMethod.dictKey == item.payment |
|
|
|
|
// ); |
|
|
|
|
// return { |
|
|
|
|
// resultType: match.dictKey, //赔方式的key |
|
|
|
|
// money: item.input, //金额 |
|
|
|
|
// typesOf: 1, //固定参数 |
|
|
|
|
// compensationMethod: paymentMethodMatch ? paymentMethodMatch.dictKey : '未知支付方式', |
|
|
|
|
// compensationMethodName: paymentMethodMatch |
|
|
|
|
// ? paymentMethodMatch.dictValue |
|
|
|
|
// : '未知支付方式', |
|
|
|
|
// resultName: item.name, //处理结果名字 |
|
|
|
|
// }; |
|
|
|
|
// } else { |
|
|
|
|
// return null; |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// .filter(item => item !== null); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1337,23 +1433,28 @@ const Arbitrationcompleted = () => {
|
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
data.aftersalesProcessingResultsDTO.workOrderId = $route.query.id; //异常工单ID |
|
|
|
|
CompensationParty.value.forEach(item => { |
|
|
|
|
if (item.state == 0) { |
|
|
|
|
// 赔款 |
|
|
|
|
data['completionRecordEntities'].push({ |
|
|
|
|
|
|
|
|
|
DataSubmit['completionRecordEntities'] = CompensationParty.value |
|
|
|
|
.filter(item => item.state === 0) // 先筛选出状态为 0 的项 |
|
|
|
|
.map(item => { |
|
|
|
|
return { |
|
|
|
|
indemnitor: item.name, // 赔款方 |
|
|
|
|
reason: item.reason, // 原因 |
|
|
|
|
money: Number(item.num), // 金额 |
|
|
|
|
reasonArbitration: item.reason, // 说明 |
|
|
|
|
workOrderId: $route.query.id, // 异常工单 |
|
|
|
|
warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
// 收款方 |
|
|
|
|
data['completionRecipientEntities'].push({ |
|
|
|
|
|
|
|
|
|
DataSubmit['completionRecipientEntities'] = CompensationParty.value |
|
|
|
|
.filter(item => item.state === 1) // 先筛选出状态为 1 的项 |
|
|
|
|
.map(item => { |
|
|
|
|
return { |
|
|
|
|
recipient: item.name, // 收款方 |
|
|
|
|
reasonReceivingPayment: item.reason, //收款原因 |
|
|
|
|
reasonReceivingPayment: item.reason, // 原因 |
|
|
|
|
money: Number(item.num), // 金额 |
|
|
|
|
workOrderNumber: $route.query.workOrderNumber, // 工单号 |
|
|
|
|
responsibleParty: FangAddList.value |
|
|
|
|
.map(aItem => |
|
|
|
|
warehouseData.value |
|
|
|
@ -1362,12 +1463,11 @@ const Arbitrationcompleted = () => {
|
|
|
|
|
.join(',') |
|
|
|
|
) |
|
|
|
|
.join(','), |
|
|
|
|
workOrderNumber: $route.query.workOrderNumber, //工单号 |
|
|
|
|
workOrderId: $route.query.id, //异常工单 |
|
|
|
|
warehouseId: $route.query.warehouseId, // 仓库ID |
|
|
|
|
workOrderId: $route.query.id, //异常工单 |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理结果 |
|
|
|
|
|
|
|
|
|