Browse Source

售后数据,修复已知bug

pre-production
马远东 4 months ago
parent
commit
654dc2dbcb
  1. 12
      src/api/wel/index.js
  2. 1
      src/views/aftersales/aftersalesWorkOrder.vue
  3. 12
      src/views/aftersales/aftersalesWorkOrderInfo.vue
  4. 76
      src/views/desk/DataBoard.vue

12
src/api/wel/index.js

@ -168,3 +168,15 @@ export const postSignforData = data => {
data,
});
};
/**
* 异常数据
* @param {Object} data
* @returns
*/
export const $_aftersalesData = params => {
return request({
url: '/api/logpm-report/warehouseIndex/aftersalesData',
method: 'get',
params,
});
};

1
src/views/aftersales/aftersalesWorkOrder.vue

@ -2848,6 +2848,7 @@ const exportReport = () => {
ids: details.selectionList.length
? details.selectionList.map(item => item.id).join(',')
: undefined,
...details.query,
};
switch (TabPermissions.value) {

12
src/views/aftersales/aftersalesWorkOrderInfo.vue

@ -1186,6 +1186,13 @@ const Completionpermissions = computed(() => {
}
return false;
});
const processedText=(inputtxt)=>{
if (inputtxt.endsWith('\n') && !inputtxt.endsWith('\n ')) {
return inputtxt.slice(0, -1);
}
return inputtxt;
}
const onLoad = async () => {
pageState.value = true; //
if (await localStorage.getItem('my_data')) {
@ -1271,12 +1278,12 @@ const onLoad = async () => {
// res.data.data.personResponsibleVOS.forEach(item => {
// sum = Number(item.responsibilityRatio) + sum;
// });
FangAddList.value = res.data.data.personResponsibleVOS.map(res => {
FangAddList.value = res.data.data.personResponsibleVOS.map(res => {
return {
businessName: res.businessId, //ID
personResponsibleName: res.personResponsibleName, //
responsibilityRatio: res.responsibilityRatio, //
description: res.description, //
description: processedText(res.description), //
tripartite: res.tripartite, //
};
});
@ -1390,6 +1397,7 @@ const onLoad = async () => {
Paymentmethod.value = res.data.data;
});
};
onMounted(() => {
watch(
() => $route.path, //

76
src/views/desk/DataBoard.vue

@ -804,7 +804,17 @@
<span>待处理</span>
</div>
<div class="mt10">
<span class="data mr5px">{{ abnormal_Info.noDealNum }}</span>
<span
class="data mr5px underline"
@click="
() =>
handleShowAbnormalData('异常数据', noDealNum, {
tip: '总单数',
prop: 'noDealNum',
})
"
>{{ abnormal_Info.noDealNum }}</span
>
<span class=""></span>
</div>
</div>
@ -1492,6 +1502,7 @@ import {
postAllocationDataByWarehouseId,
postHandOrderDataByWarehouseId,
postTrunklineCarsDataByWarehouseId,
$_aftersalesData,
} from '@/api/wel/index';
import { exportExcelByDom } from '@/utils/export';
import * as echarts from 'echarts';
@ -1569,14 +1580,16 @@ const details = reactive({
},
/** 异常卸车数据 */
unloadAbnormalDataInfo: {
abnormalDayRate: '0',
abnormalMonthRate: '0',
abnormalDayRate: 0,
abnormalMonthRate: 0,
noDealDayNum: 0,
noDealMonthNum: 0,
sendDayNum: 0,
sendMonthNum: 0,
unloadDayNum: 0,
unloadMonthNum: 0,
dayData: [],
monthData: [],
},
/** 配送数据 */
deliveryDataInfo: {},
@ -1756,15 +1769,48 @@ const initTrunklineCarsData = async () => {
details.loadingObj.trunklineCarsData = false;
}
};
function accumulateData(targetInfo, dataArray, isMonthly) {
for (let i = 0; i < dataArray.length; i++) {
const item = dataArray[i];
if (isMonthly) {
targetInfo.sendMonthNum += item.totalNum; //
targetInfo.noDealMonthNum += item.unCompleteNum; //
targetInfo.abnormalMonthRate += item.completeNum; //
} else {
targetInfo.sendDayNum += item.totalNum; //
targetInfo.noDealDayNum += item.unCompleteNum; //
targetInfo.abnormalDayRate += item.completeNum; //
}
}
}
/** 卸车异常数据 */
/**异常数据 */
const initUnloadAbnormalData = async () => {
return
try {
details.loadingObj.unloadAbnormalData = true;
const res = await postUnloadAbnormalData({});
const res = await $_aftersalesData({});
console.log('resw:>> ', res);
const { code, data } = res.data;
if (code !== 200) return;
details.unloadAbnormalDataInfo = data || {};
console.log(data, '异常数据');
// dayData
await accumulateData(details.unloadAbnormalDataInfo, data.dayData, false);
// monthData
await accumulateData(details.unloadAbnormalDataInfo, data.monthData, true);
//
details.unloadAbnormalDataInfo.abnormalMonthRate =
(details.unloadAbnormalDataInfo.abnormalMonthRate /
details.unloadAbnormalDataInfo.sendMonthNum) *
100;
details.unloadAbnormalDataInfo.abnormalDayRate =
(details.unloadAbnormalDataInfo.abnormalDayRate / details.unloadAbnormalDataInfo.sendDayNum) *
100;
} catch (error) {
console.log('error :>> ', error);
} finally {
@ -2251,7 +2297,6 @@ const handleDetails = async (type, title, optionObj: OptionObjType) => {
case 'trunklineCarsDataColumn':
res = await postTrunklineCarsDataByWarehouseId({});
break;
default:
break;
}
@ -2284,6 +2329,23 @@ const handleShowDeliveryDetail = (
const { data } = details.deliveryDataInfo[type];
handleShowEcharts(data, title, optionObj);
};
/** 显示售后异常数据 */
const handleShowAbnormalData = (title, type: 'noDealNum', optionObj: any = {}) => {
details.popUpShow.isShow = true;
details.title = title;
console.log(optionObj, 'optionObj');
console.log(type, 'type');
console.log(title, 'title');
if (getObjType(details.unloadAbnormalDataInfo[type]) !== 'object') return;
const { data } = details.deliveryDataInfo[type];
handleShowEcharts(data, title, optionObj);
};

Loading…
Cancel
Save