diff --git a/src/router/views/index.js b/src/router/views/index.js
index 84c17f65..8d69b1d1 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -1193,18 +1193,18 @@ export default [
],
},
- // {
- // path: '/aftersales/VueTemp',
- // component: Layout,
- // redirect: '/aftersales/VueTemp',
- // children: [
- // {
- // path: '/aftersales/VueTemp',
- // name: '工单',
- // component: () => import('@/views/aftersales/aftersalesWorkOrder.vue'),
- // },
- // ],
- // },
+ {
+ path: '/aftersales/aftersalesWorkOrder',
+ component: Layout,
+ redirect: '/aftersales/aftersalesWorkOrder',
+ children: [
+ {
+ path: '/aftersales/aftersalesWorkOrder',
+ name: '工单',
+ component: () => import('@/views/aftersales/aftersalesWorkOrder.vue'),
+ },
+ ],
+ },
{
path: '/aftersales/aftersalesWorkOrderAdd',
component: Layout,
diff --git a/src/views/aftersales/aftersalesWorkOrder.vue b/src/views/aftersales/aftersalesWorkOrder.vue
index ea513fcf..9a46ff2a 100644
--- a/src/views/aftersales/aftersalesWorkOrder.vue
+++ b/src/views/aftersales/aftersalesWorkOrder.vue
@@ -1753,6 +1753,7 @@ const view = val => {
warehouseId: val.row.warehouseId,
workOrderNumber: val.row.workOrderNumber, //添加异常记录包条码
businessId: val.row.businessId,
+ ProcessType:TabPermissions.value==2?'2':TabPermissions.value==3?'1':'', //类型 1 待处理 2 已处理
},
});
return;
diff --git a/src/views/aftersales/aftersalesWorkOrderInfo.vue b/src/views/aftersales/aftersalesWorkOrderInfo.vue
index 3791b685..792c1e9b 100644
--- a/src/views/aftersales/aftersalesWorkOrderInfo.vue
+++ b/src/views/aftersales/aftersalesWorkOrderInfo.vue
@@ -1096,6 +1096,7 @@ const EditInformation = () => {
warehouseId: $route.query.warehouseId,
workOrderNumber: $route.query.workOrderNumber,
RouterState: true,
+ ProcessType:$route.query.ProcessType, //类型 1 待处理 2 已处理
},
});
};
@@ -1378,6 +1379,7 @@ const EndJump = () => {
flex-wrap: wrap;
margin-top: 26px;
justify-content: space-between;
+ justify-content: flex-start;
.name {
display: flex;
margin-bottom: 20px;
diff --git a/src/views/aftersales/aftersalesWorkOrderend.vue b/src/views/aftersales/aftersalesWorkOrderend.vue
index c2b6c946..c0f853bd 100644
--- a/src/views/aftersales/aftersalesWorkOrderend.vue
+++ b/src/views/aftersales/aftersalesWorkOrderend.vue
@@ -1071,8 +1071,9 @@ const onLoad = () => {
// 完结信息回显
// 收款方
- CompensationParty.value = [];
+
if (res.data.data.completionRecipientEntityList.length > 0) {
+ CompensationParty.value = [];
res.data.data.completionRecipientEntityList.forEach((item, index) => {
TotalamountReceived.value += Number(item.money);
CompensationParty.value.push({
@@ -1532,7 +1533,7 @@ const PaymentConfirmation = val => {
// 提交信息
const submit = () => {
console.log(UserPermissions.value, '当前角色');
- // if (UserPermissions.value == '职能客服' || UserPermissions.value == '客服经理' ) {
+ if (UserPermissions.value == '职能客服' || UserPermissions.value == '客服经理' ) {
// 完结的逻辑
// 异常问题描述非必填
@@ -1605,25 +1606,25 @@ const submit = () => {
// 赔款方
console.log(data, '处理好的值');
- // $_addCompletionEnd(data).then(res => {
- // $router.push('/aftersales/aftersalesWorkOrder');
- // console.log(res, '完结成功返回值');
- // if (res.data.code == 200) {
- // ElMessage({
- // showClose: true,
- // message: res.data.msg,
- // type: 'success',
- // });
- // }
- // });
- // }else{
- // ElMessage({
- // message: '权限不足',
- // type: 'warning',
- // });
- // console.log(UserPermissions.value);
- // return;
- // }
+ $_addCompletionEnd(data).then(res => {
+ $router.push('/aftersales/aftersalesWorkOrder');
+ console.log(res, '完结成功返回值');
+ if (res.data.code == 200) {
+ ElMessage({
+ showClose: true,
+ message: res.data.msg,
+ type: 'success',
+ });
+ }
+ });
+ }else{
+ ElMessage({
+ message: '权限不足',
+ type: 'warning',
+ });
+ console.log(UserPermissions.value);
+ return;
+ }
} else {
if (UserPermissions.value != '仓库客服') {
ElMessage({
@@ -1684,8 +1685,7 @@ const submit = () => {
}
})
.filter(item => item !== null);
- data.aftersalesProcessingResultsDTO.processingMoneyEntityList =
- data['processingMoneyEntityList'];
+ data.aftersalesProcessingResultsDTO.processingMoneyEntityList = data['processingMoneyEntityList'];
console.log('走到了这一步');
data.aftersalesProcessingResultsDTO.workOrderId = $route.query.id; //异常工单ID
data.aftersalesProcessingResultsDTO['resultType'] = ProcessingList.value
@@ -1705,7 +1705,7 @@ const submit = () => {
console.log(data, '处理好的数据');
delete data.aftersalesProcessingResultsDTO.id; //删除ID字段
- (data.aftersalesProcessingResultsDTO.warehouseId = info.warehouseId), //仓库ID
+ data.aftersalesProcessingResultsDTO.warehouseId = info.warehouseId; //仓库ID
console.log(data, '处理好的数据');
$_addProcessingResults(data).then(res => {
console.log(res, '提交后的参数');
diff --git a/src/views/aftersales/aftersalesWorkOrdermodify.vue b/src/views/aftersales/aftersalesWorkOrdermodify.vue
index 94f7f32d..8eb3afa5 100644
--- a/src/views/aftersales/aftersalesWorkOrdermodify.vue
+++ b/src/views/aftersales/aftersalesWorkOrdermodify.vue
@@ -635,6 +635,7 @@ const deletePackageInfo = ref([]); //被删除的包间信息
const unDecreaseImageEntityList = ref([]); //移除的货损图片
const NewImageAddress = ref([]); //旧的片地址
const InitialresponsibleParty = ref(); //初始的责任方
+const ProcessingParty = ref(); //拷贝一份处理方
const CompensationParty = ref([
{ name: '', state: 0, num: null, reason: '', cld: 1, explains: '' }, //赔款方
{ name: '', state: 1, num: null, reason: '', cld: 1, explains: '' }, //收款方
@@ -817,6 +818,8 @@ const onLoad = () => {
Indexform.value.processor.push(item.businessId);
}
});
+ 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 => {
//处理结果字典
@@ -866,33 +869,38 @@ const onLoad = () => {
Indexform.value.compensationTime = res.data.data.processingResultsVO.compensationTime;
// 处理结果说明回显
Indexform.value.resultDescription = res.data.data.processingResultsVO.resultDescription;
- // 收款方
- 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.completionRecipientEntityList.length
+ ) {
+ // 如果收款方和赔款方存在数据清空初始数据
+ CompensationParty.value = [];
+
+ // 赔款方
+ 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,
});
@@ -900,6 +908,7 @@ const onLoad = () => {
}
}
+ Indexform.value.arbitrate = res.data.data.reasonArbitration; //仲裁原因
// 异常类型下标
SelectType.value = IndexException.value.find(
item => item.value == Indexform.value.workOrderType
@@ -1147,17 +1156,17 @@ const ConfirmForm = () => {
packageEntityList: [], //新增的包件信息 (完成)
unPpackageEntityList: [], //取消的包件ID(完成)
- processorEntityList: [], //新增的责任方和处理方
- unProcessorEntityList: [], //取消的责任方和处理方
+ processorEntityList: [], //新增的责任方和处理方(完成)
+ unProcessorEntityList: [], //取消的责任方和处理方(完成)
decreaseImageEntityList: [], //损货图片 (完成)
unDecreaseImageEntityList: [], //取消的损货图片(完成)
- completionRecipientEntities: [], //异常工单完结收款方
- completionRecordEntities: [], //异常工单完结赔款方
- aftersalesProcessingResultsDTO: {}, //处理结果
+ completionRecipientEntities: [], //异常工单完结收款方(完成暂不可修改)
+ completionRecordEntities: [], //异常工单完结赔款方(完成暂不可修改)
+ aftersalesProcessingResultsDTO: {}, //处理结果(完成暂不可修改)
- personResponsibleDTO: [], //添加预计责任人
- unPersonResponsibleDTO: [], //取消预计责任人
+ personResponsibleDTO: [], //添加预计责任人(完成)
+ unPersonResponsibleDTO: [], //取消预计责任人(完成)
surveyRecordDTO: {}, //调查经过
};
@@ -1167,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 => {
@@ -1212,6 +1228,7 @@ const ConfirmForm = () => {
});
}
}
+
// 移除的包件ID
DataSubmit['unPpackageEntityList'] = deletePackageInfo.value.map(item => item.id);
@@ -1228,28 +1245,173 @@ 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, //责任比例
+ businessName: warehouseData.value.find(obj => obj.value == item.businessName)?.label || null, //责任方名称//责任方名称
+ responsibilityRatio: item.responsibilityRatio, //责任比例
description: item.description, //说明
});
});
-// 被移除的责任方处理
-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, //责任人名称
- 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, //责任比例
- description: item.description, //说明
+ // 被移除的责任方处理
+ 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, //责任人名称
+ 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, //责任比例
+ 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: warehouseData.value.find(obj => obj.value == item).label, //名称
+ businessId: warehouseData.value.find(obj => obj.value == item).value, //ID
+ workOrderId: $route.query.id, //异常工单ID
+ conditions: 1, //状态 1正常 2新增 3取消
+ typesOf: 2, //1 责任方 2 处理方
+ warehouseId: $route.query.warehouseId, //仓库ID
+ 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) {
+ // 新增的责任方和处理方
+ 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: $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 => {
+ 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: $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);
+
+
//移除的货损图片
@@ -1271,38 +1433,42 @@ const Arbitrationcompleted = () => {
},
};
data.aftersalesProcessingResultsDTO.workOrderId = $route.query.id; //异常工单ID
- CompensationParty.value.forEach(item => {
- if (item.state == 0) {
- // 赔款
- data['completionRecordEntities'].push({
- 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({
- recipient: item.name, //收款方
- reasonReceivingPayment: item.reason, //收款原因
- money: Number(item.num), //金额
- responsibleParty: FangAddList.value
- .map(aItem =>
- warehouseData.value
- .filter(bItem => bItem.value === aItem.businessName)
- .map(match => match.label)
- .join(',')
- )
- .join(','),
- workOrderNumber: $route.query.workOrderNumber, //工单号
- workOrderId: $route.query.id, //异常工单
- warehouseId: $route.query.warehouseId, //仓库ID
- });
- }
+
+ 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, //异常工单
+ };
});
+
// 处理结果
data.aftersalesProcessingResultsDTO['processingMoneyEntityList'] = ProcessingList.value
diff --git a/src/views/distribution/deliverylist/distributionDeliveryListmar.vue b/src/views/distribution/deliverylist/distributionDeliveryListmar.vue
index 5af87830..f72f7882 100644
--- a/src/views/distribution/deliverylist/distributionDeliveryListmar.vue
+++ b/src/views/distribution/deliverylist/distributionDeliveryListmar.vue
@@ -124,6 +124,13 @@