|
|
|
@ -706,13 +706,6 @@
|
|
|
|
|
@click="AppealRejection" |
|
|
|
|
>申诉驳回</el-button |
|
|
|
|
> |
|
|
|
|
<!-- <el-button |
|
|
|
|
v-if="$route.query.RouteIndexs == '0' && $route.query.workOrderStatus != '21'" |
|
|
|
|
type="primary" |
|
|
|
|
class="button" |
|
|
|
|
@click="ElProcessingResults" |
|
|
|
|
>处理结果</el-button |
|
|
|
|
> --> |
|
|
|
|
</div> |
|
|
|
|
</el-form> |
|
|
|
|
</div> |
|
|
|
@ -1013,6 +1006,7 @@ import {
|
|
|
|
|
$_updateProcessingParty, |
|
|
|
|
$_batchRepulseCompleted, |
|
|
|
|
$_Cancelappeal, |
|
|
|
|
$_arbitrateEnd, |
|
|
|
|
} from '@/api/aftersales/aftersalesWorkOrder'; |
|
|
|
|
import { columnList, recordList } from '@/option/aftersales/vueTvemp.js'; |
|
|
|
|
import { getToken } from '@/utils/auth'; |
|
|
|
@ -2260,7 +2254,7 @@ const submitresults = async value => {
|
|
|
|
|
// 传递要刷新的菜单 |
|
|
|
|
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true }); //要刷新的页面 |
|
|
|
|
$useStore.commit('Customer_Menu', Number($route.query.RouteIndexs)); //要刷新的菜单 |
|
|
|
|
AddressClosed('/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
$useStore.commit('DEL_ONCE_TAG', '/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
$router.push('/aftersales/aftersalesWorkOrder'); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
@ -2294,7 +2288,7 @@ const submitresults = async value => {
|
|
|
|
|
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true }); //要刷新的页面 |
|
|
|
|
$useStore.commit('Customer_Menu', Number($route.query.RouteIndexs)); //要刷新的菜单 |
|
|
|
|
$router.push('/aftersales/aftersalesWorkOrder'); |
|
|
|
|
AddressClosed('/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
$useStore.commit('DEL_ONCE_TAG', '/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -2313,11 +2307,9 @@ const reasonChange = (item, index) => {
|
|
|
|
|
item.reasoncheck = false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
// 完结信息提交() |
|
|
|
|
const submitCompletion = async () => { |
|
|
|
|
console.log(CompensationParty.value, 'CompensationParty'); |
|
|
|
|
// 完结信息校验 |
|
|
|
|
const CompleteInformationVerification = () => { |
|
|
|
|
let _flag = CompensationParty.value.filter(item => item.state == 0); |
|
|
|
|
console.log(_flag, '_flag'); |
|
|
|
|
_flag.forEach(item => { |
|
|
|
|
if (!item.warehouseId) { |
|
|
|
|
item.warehouseIdcheck = true; |
|
|
|
@ -2327,13 +2319,21 @@ const submitCompletion = async () => {
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
let _result = _flag.every(item => item.warehouseId && item.reason); |
|
|
|
|
console.log(_result, '_result'); |
|
|
|
|
if (!endFrom.value.arbitrate) { |
|
|
|
|
ReasonarbClass.value = true; |
|
|
|
|
} else { |
|
|
|
|
ReasonarbClass.value = false; |
|
|
|
|
} |
|
|
|
|
if (!_result || !endFrom.value.arbitrate) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
// 完结信息提交() |
|
|
|
|
const submitCompletion = async () => { |
|
|
|
|
let _State = await CompleteInformationVerification(); |
|
|
|
|
if (!_State) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '完结信息必填项未填写完整!', |
|
|
|
|
type: 'warning', |
|
|
|
@ -2341,18 +2341,6 @@ const submitCompletion = async () => {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// state:0赔款方 |
|
|
|
|
// state:1受款方 |
|
|
|
|
// let _warehouseId = CompensationParty.value |
|
|
|
|
// .filter(item => item.state === 0) |
|
|
|
|
// .find(res => !res.warehouseId); |
|
|
|
|
// if (_warehouseId) { |
|
|
|
|
// ElMessage({ |
|
|
|
|
// message: `有赔款方未选择仓库`, |
|
|
|
|
// type: 'warning', |
|
|
|
|
// }); |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
ElMessageBox.confirm('是否提交完结信息?', '完结', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
@ -2429,7 +2417,7 @@ const submitCompletion = async () => {
|
|
|
|
|
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true }); //要刷新的页面 |
|
|
|
|
$useStore.commit('Customer_Menu', Number($route.query.RouteIndexs)); //要刷新的菜单 |
|
|
|
|
$router.push('/aftersales/aftersalesWorkOrder'); |
|
|
|
|
AddressClosed('/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
$useStore.commit('DEL_ONCE_TAG', '/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(error => { |
|
|
|
@ -2591,44 +2579,123 @@ const ViewPackageDetails = val => {
|
|
|
|
|
}); |
|
|
|
|
dialogHistoricalPackage.value = false; //打开历史包件弹窗 |
|
|
|
|
}; |
|
|
|
|
// 处理结果跳转按钮 |
|
|
|
|
const ElProcessingResults = () => { |
|
|
|
|
$router.push({ |
|
|
|
|
path: '', |
|
|
|
|
query: { |
|
|
|
|
id: $route.query.id, |
|
|
|
|
name: $route.query.businessId + '-添加异常记录', |
|
|
|
|
businessId: $route.query.workOrderNumber, |
|
|
|
|
RouterState: 'determine', |
|
|
|
|
RouteIndexs: $route.query.RouteIndexs, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
$useStore.commit('DEL_TAG_CURRENT'); |
|
|
|
|
}; |
|
|
|
|
// 客服完结完结 |
|
|
|
|
const CustomerServiceCompleted = () => { |
|
|
|
|
$router.push({ |
|
|
|
|
path: '/aftersales/aftersalesWorkOrdermodify', |
|
|
|
|
query: { |
|
|
|
|
id: $route.query.id, |
|
|
|
|
name: $route.query.businessId + '-客服仲裁完结', |
|
|
|
|
businessId: $route.query.businessId, |
|
|
|
|
warehouseId: $route.query.warehouseId ? $route.query.warehouseId : '', |
|
|
|
|
workOrderNumber: $route.query.workOrderNumber, |
|
|
|
|
RouteIndexs: $route.query.RouteIndexs, |
|
|
|
|
RouterState: 'Kfend', |
|
|
|
|
index: '1', |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
$useStore.commit('DEL_TAG_CURRENT'); |
|
|
|
|
}; |
|
|
|
|
// 客服仲裁完结提交 |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 客服仲裁完结提交 |
|
|
|
|
*/ |
|
|
|
|
const ArbitrationSubmission = () => { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '功能维护中...', |
|
|
|
|
let _State = CompleteInformationVerification(); |
|
|
|
|
if (!_State) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: '完结信息填写不完整', |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ElMessageBox.confirm('请检查信息是否填写完整/正确,是否确认提交?', '提示', { |
|
|
|
|
confirmButtonText: '确认', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
}) |
|
|
|
|
.then(async () => { |
|
|
|
|
try { |
|
|
|
|
Pageloading.value = true; //开启页面加载 |
|
|
|
|
let data = { |
|
|
|
|
id: $route.query.id, |
|
|
|
|
completionRecipientEntities: [], //处理结果受款方 |
|
|
|
|
completionRecordEntities: [], //处理结果赔款方 |
|
|
|
|
reasonArbitration: endFrom.value.arbitrate, //仲裁原因 |
|
|
|
|
aftersalesProcessingResultsDTO: { |
|
|
|
|
workOrderId: $route.query.id, //异常工单ID |
|
|
|
|
resultDescription: endFrom.value.resultDescription, |
|
|
|
|
}, |
|
|
|
|
assignList: [], |
|
|
|
|
}; |
|
|
|
|
data.aftersalesProcessingResultsDTO.workOrderId = $route.query.id; //异常工单ID |
|
|
|
|
data['assignList'].push($route.query.id); |
|
|
|
|
|
|
|
|
|
// 处理结果 |
|
|
|
|
// 创建一个 dictValue 到 dictKey 的映射对象 |
|
|
|
|
const processingResultsMap = new Map( |
|
|
|
|
ProcessingResults.value.map(element => [element.dictValue, element.dictKey]) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// 创建一个支付方式的映射对象 |
|
|
|
|
const paymentMethodMap = new Map( |
|
|
|
|
Paymentmethodoptions.value.map(method => [method.value, method.label]) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
data.aftersalesProcessingResultsDTO['processingMoneyEntityList'] = ProcessingList.value |
|
|
|
|
.map(item => { |
|
|
|
|
const match = processingResultsMap.get(item.title); |
|
|
|
|
if (match) { |
|
|
|
|
return { |
|
|
|
|
resultType: match, // 赔方式的key |
|
|
|
|
money: item.money, // 金额 |
|
|
|
|
typesOf: 1, // 固定参数 |
|
|
|
|
compensationMethod: item.compensationMethod, // 支付方式value |
|
|
|
|
compensationMethodName: paymentMethodMap.get(item.compensationMethod) || '', // 支付方式label |
|
|
|
|
resultName: item.title, // 处理结果名字 |
|
|
|
|
paymentUnit: item.paymentUnit, // 支付单位 compensationMethodName |
|
|
|
|
compensationTime: item.compensationTime, //理赔时间 |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.filter(Boolean); // 过滤掉 null 值 |
|
|
|
|
data.aftersalesProcessingResultsDTO.money = TotalClaimAmount.value; //金额汇总 |
|
|
|
|
// 创建一个仓库ID到标签的映射对象,避免重复查找 |
|
|
|
|
const warehouseIdToLabelMap = new Map( |
|
|
|
|
warehouseData.value.map(item => [item.value, item.label]) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
data['completionRecordEntities'] = CompensationParty.value |
|
|
|
|
.filter(item => item.state === 0) // 筛选出状态为 0 的项 |
|
|
|
|
.map(item => { |
|
|
|
|
return { |
|
|
|
|
indemnitor: warehouseIdToLabelMap.get(item.warehouseId) || '', // 赔款方 |
|
|
|
|
money: Number(item.num), // 金额 |
|
|
|
|
reason: item.reason, // 仲裁原因 |
|
|
|
|
workOrderId: $route.query.id, // 异常工单 |
|
|
|
|
warehouseId: item.warehouseId, // 仓库ID |
|
|
|
|
compensationPersonnel: item.compensationPersonnel, // 责任人 |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
data['completionRecipientEntities'] = CompensationParty.value |
|
|
|
|
.filter(item => item.state === 1) // 筛选出状态为 1 的项 |
|
|
|
|
.map(item => { |
|
|
|
|
return { |
|
|
|
|
recipient: warehouseIdToLabelMap.get(item.warehouseId) || '', // 受款方 |
|
|
|
|
reasonReceivingPayment: item.reason, // 原因 |
|
|
|
|
money: Number(item.num), // 金额 |
|
|
|
|
workOrderNumber: $route.query.workOrderNumber, // 工单号 |
|
|
|
|
warehouseId: item.warehouseId, // 仓库ID |
|
|
|
|
workOrderId: $route.query.id, // 异常工单 |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
console.log(data, '处理好的值'); |
|
|
|
|
let res = await $_arbitrateEnd(data); |
|
|
|
|
const { code, msg } = res.data; |
|
|
|
|
if (code != 200) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
ElMessage({ |
|
|
|
|
message: msg, |
|
|
|
|
type: 'success', |
|
|
|
|
}); |
|
|
|
|
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true }); //要刷新的页面 |
|
|
|
|
$useStore.commit('Customer_Menu', Number($route.query.RouteIndexs)); //要刷新的菜单 |
|
|
|
|
$router.push('/aftersales/aftersalesWorkOrder'); |
|
|
|
|
$useStore.commit('DEL_ONCE_TAG', '/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
|
} finally { |
|
|
|
|
Pageloading.value = false; //关闭页面加载 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}; |
|
|
|
|
// 处理结果打回 |
|
|
|
|
const resultreturnedFun = () => { |
|
|
|
@ -2672,7 +2739,7 @@ const ConfirmReturn = async () => {
|
|
|
|
|
$useStore.commit('EDIT_REFRESHITEM', { title: 'aftersalesWorkOrder', status: true }); //要刷新的页面 |
|
|
|
|
$useStore.commit('Customer_Menu', Number($route.query.RouteIndexs)); //要刷新的菜单 |
|
|
|
|
$router.push('/aftersales/aftersalesWorkOrder'); |
|
|
|
|
AddressClosed('/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
$useStore.commit('DEL_ONCE_TAG', '/aftersales/aftersalesWorkOrderend'); //删除当前页面 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(error => { |
|
|
|
|