qb 2 months ago
parent
commit
f8db5e2b78
  1. 2
      src/components/Tableexportcomponent/Tableexportcomponent.vue
  2. 196
      src/views/aftersales/aftersalesWorkOrder.vue
  3. 195
      src/views/aftersales/aftersalesWorkOrderend.vue

2
src/components/Tableexportcomponent/Tableexportcomponent.vue

@ -159,6 +159,8 @@ const exportToExcel = () => {
//
XLSX.writeFile(workbook, `${exportFileName.value}.xlsx`);
emit('update:tcTableexport', false);
ElMessage.success('导出成功');
};
//
const emit = defineEmits(['update:tcTableexport']);

196
src/views/aftersales/aftersalesWorkOrder.vue

@ -1053,7 +1053,7 @@ const ButtonPermissions = computed(() => {
add: false, //
batchReject: false, //
assignment: false, //
applyArbitration: true, //
applyArbitration: false, //
batchFinish: false, //
Batchdetermination: false, //
ManagerConfirmed: false, //
@ -2575,7 +2575,6 @@ const WorkOrderAssignment = () => {
* @return {void} 无返回值
*/
const CustomerServiceIntervention = () => {
if (!details.selectionList.length) {
//
ElMessage({
@ -2584,11 +2583,6 @@ const CustomerServiceIntervention = () => {
});
return;
}
ElMessage({
message: '功能维护中...',
type: 'warning',
});
return;
CustomerServiceForm.value.loadingCustomer = true;
CustomerServiceForm.value.reasonRemarks = '';
};
@ -2799,49 +2793,87 @@ const DestroyWindow = () => {
const ExportSelection = () => {
ExportObjects.value.ExportSelection = true;
};
/**
*获取当前时间
*/
const getCurrentTime = () => {
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
return formattedDate;
};
//
const exportReport = () => {
console.log('12312');
ElMessageBox.confirm('是否导出报表?', {
ElMessageBox.confirm('是否确认导出数据?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
console.log(details.query, '');
let dataID = {
PageLoading.value = true;
const dataID = {
workOrderStatus: workOrderStatus.value,
ids: details.selectionList.length
? details.selectionList.map(item => item.id).join(',')
: undefined,
};
if (details.selectionList.length) {
dataID.ids = details.selectionList.map(item => item.id).join(',');
}
// JExportAll(dataID);
switch (TabPermissions.value) {
case 0:
ExportAll(dataID); //
exportData(dataID, '导出全部工单数据');
break;
case 1:
ExportingDuringProcessing(dataID);
exportData(dataID, '导出处理中工单数据');
break;
case 2:
ProcessedExported(dataID);
exportData(dataID, '导出处理完毕工单数据');
break;
case 4:
//
ExportClaimAmount(dataID);
exportData(dataID, '导出理赔金额工单数据');
break;
case 6:
//
CompleteExport(dataID);
case 6:
exportData(dataID, '导出完结工单数据');
break;
default:
ExportAll(dataID);
exportData(dataID, '导出全部工单数据');
break;
}
})
.catch(() => {});
};
/**
*导出数据
*/
const exportData = async (dataID, fileNamePrefix) => {
const exportFunctionMap = {
0: $_exportWorkOrder0,
1: $_exportWorkOrder1,
2: $_exportWorkOrder3,
4: $_exportWorkOrder2,
6: $_exportWorkOrder4,
};
try {
const exportFunction = exportFunctionMap[TabPermissions.value] || $_exportWorkOrder0;
const res = await exportFunction(dataID);
downloadXls(res.data, `${fileNamePrefix}${getCurrentTime()}.xlsx`);
ExportObjects.value.ExportSelection = false;
ElMessage.success('导出成功');
} catch (e) {
console.log(e);
} finally {
PageLoading.value = false;
}
};
//
const updateTcTableexport = newValue => {
ExportObjects.value.tcTableexport = newValue;
@ -2849,6 +2881,7 @@ const updateTcTableexport = newValue => {
//
const LocalExport = () => {
ExportObjects.value.tcTableexport = true;
ExportObjects.value.ExportSelection = false;
};
//
const NetworkExport = () => {
@ -2861,124 +2894,13 @@ const JExportAll = async dataID => {
try {
PageLoading.value = true;
let res = await $_exportAftersalesWorkOrder(dataID);
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
downloadXls(res.data, `导出工单数据${getCurrentTime()}.xlsx`);
PageLoading.value = false;
} catch (e) {
console.log(e);
} finally {
}
};
//
const ExportAll = async dataID => {
try {
let res = await $_exportWorkOrder0(dataID);
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
} catch (e) {
console.log(e);
} finally {
}
};
//
const ExportingDuringProcessing = async dataID => {
try {
let res = await $_exportWorkOrder1(dataID);
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
} catch (e) {
console.log(e);
} finally {
}
};
//
const ExportClaimAmount = async dataID => {
try {
let res = await $_exportWorkOrder2(dataID);
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
} catch (e) {
console.log(e);
} finally {
}
};
//
const CompleteExport = async dataID => {
try {
let res = await $_exportWorkOrder4(dataID);
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
} catch (e) {
console.log(e);
} finally {
}
};
//
const ProcessedExported = async dataID => {
try {
let res = await $_exportWorkOrder3(dataID);
const currentDate = new Date();
const formattedDate = `${currentDate.getFullYear()}${(currentDate.getMonth() + 1)
.toString()
.padStart(2, '0')}${currentDate.getDate().toString().padStart(2, '0')}${currentDate
.getHours()
.toString()
.padStart(2, '0')}${currentDate.getMinutes().toString().padStart(2, '0')}${currentDate
.getSeconds()
.toString()
.padStart(2, '0')}`;
downloadXls(res.data, `导出工单数据${formattedDate}.xlsx`);
} catch (e) {
console.log(e);
} finally {
}
};
</script>
<style scoped lang="scss">

195
src/views/aftersales/aftersalesWorkOrderend.vue

@ -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 => {

Loading…
Cancel
Save