@@ -1521,7 +1594,7 @@ import {
postOpenOrderDataByWarehouseId,
postAllocationDataByWarehouseId,
postHandOrderDataByWarehouseId,
- postTrunklineCarsDataByWarehouseId,
+ getCarsStattisNum,
$_aftersalesData,
} from '@/api/wel/index';
import { exportExcelByDom } from '@/utils/export';
@@ -1628,13 +1701,53 @@ const details = reactive({
/** 签收数据 */
signforDataInfo: {
/** 当日签收数据 */
- daySignData: {},
+ daySignData: {
+ signNum: 0,
+ clerkOverTimeSignfoNum: 0,
+ clerkOverTimeScale: 0,
+ signScale: 0,
+ clerkSignNum: 0,
+ planNum: 0,
+ unSignNum: 0,
+ clerkSignforScale: 0,
+ data: [],
+ },
/** 当月签收数据 */
- monthSignData: {},
+ monthSignData: {
+ signNum: 0,
+ clerkOverTimeSignfoNum: 0,
+ clerkOverTimeScale: 0,
+ signScale: 0,
+ clerkSignNum: 0,
+ planNum: 0,
+ unSignNum: 0,
+ clerkSignforScale: 0,
+ data: [],
+ },
/** 当日自提签收数据 */
- dayBillLadingSignData: {},
+ dayBillLadingSignData: {
+ signNum: 0,
+ clerkOverTimeSignfoNum: 0,
+ clerkOverTimeScale: 0,
+ signScale: 0,
+ clerkSignNum: 0,
+ planNum: 0,
+ unSignNum: 0,
+ clerkSignforScale: 0,
+ data: [],
+ },
/** 当月自提签收数据 */
- monthBillLadingSignData: {},
+ monthBillLadingSignData: {
+ signNum: 0,
+ clerkOverTimeSignfoNum: 0,
+ clerkOverTimeScale: 0,
+ signScale: 0,
+ clerkSignNum: 0,
+ planNum: 0,
+ unSignNum: 0,
+ clerkSignforScale: 0,
+ data: [],
+ },
},
loadingObj: {
/** 开单数据 */
@@ -1789,15 +1902,37 @@ const initTrunklineHandOrderData = async () => {
/** 请求干线车次数据 */
const initTrunklineCarsData = async () => {
+ const _obj: any = {};
+ const _keyArr = ['inTransitNum', 'totalNum', 'unloadNum', 'workNum'];
+ for (let i = 0; i < _keyArr.length; i++) {
+ const value = _keyArr[i];
+
+ _obj[value] = 0;
+ }
+ _obj.list = [];
+
try {
details.loadingObj.trunklineCarsData = true;
- const res = await postTrunklineCarsData({});
+ const res = await getCarsStattisNum({});
const { code, data } = res.data;
if (code !== 200) return;
- details.trunklineCarsDataInfo = data || {};
+
+ for (let i = 0; i < data.length; i++) {
+ const value = data[i];
+
+ for (let i = 0; i < _keyArr.length; i++) {
+ const key = _keyArr[i];
+ value[key] = isNumber(value[key]) ? Number(value[key]) : 0;
+
+ _obj[key] = computeNumber(_obj[key], '+', value[key]).result;
+ }
+
+ _obj.list.push(value);
+ }
} catch (error) {
console.log('error :>> ', error);
} finally {
+ details.trunklineCarsDataInfo = _obj;
details.loadingObj.trunklineCarsData = false;
}
};
@@ -1996,17 +2131,9 @@ const initDeliveryData = async () => {
/** 签收数据 */
const initSignforData = async () => {
- const _keyArr = [
- 'signNum',
- 'unSignNum',
- 'signScale',
- 'clerkSignNum',
- 'clerkSignforScale',
- 'clerkOverTimeSignfoNum',
- 'clerkOverTimeScale',
- ];
+ const _keyArr = ['signNum', 'unSignNum', 'clerkSignNum', 'planNum', 'clerkOverTimeSignfoNum'];
- const _obj = {
+ const _obj: any = {
daySignData: { data: [] },
monthSignData: { data: [] },
dayBillLadingSignData: { data: [] },
@@ -2042,6 +2169,7 @@ const initSignforData = async () => {
const key = _keyArr[j];
const _val = isNumber(value[key]) ? Number(value[key]) : 0;
+ value[key] = _val;
// 签收数据
if (Number(value.type) === 1) {
@@ -2063,6 +2191,104 @@ const initSignforData = async () => {
: // 自提签收数据
_obj.monthBillLadingSignData.data.push(value);
}
+
+ _obj.monthBillLadingSignData.totalSinNum = computeNumber(
+ _obj.monthBillLadingSignData.signNum,
+ '+',
+ _obj.monthBillLadingSignData.unSignNum
+ ).result;
+ _obj.monthSignData.totalSinNum = computeNumber(
+ _obj.monthSignData.signNum,
+ '+',
+ _obj.monthSignData.unSignNum
+ ).result;
+
+ // 签收率
+ if (
+ !isNumber(_obj.monthBillLadingSignData.signNum) ||
+ !isNumber(_obj.monthBillLadingSignData.totalSinNum) ||
+ Number(_obj.monthBillLadingSignData.totalSinNum) === 0
+ ) {
+ _obj.monthBillLadingSignData.signScale = 0;
+ } else {
+ _obj.monthBillLadingSignData.signScale = computeNumber(
+ _obj.monthBillLadingSignData.signNum,
+ '/',
+ _obj.monthBillLadingSignData.totalSinNum
+ ).result;
+ }
+
+ if (
+ !isNumber(_obj.monthSignData.signNum) ||
+ !isNumber(_obj.monthSignData.totalSinNum) ||
+ Number(_obj.monthSignData.totalSinNum) === 0
+ ) {
+ _obj.monthSignData.signScale = 0;
+ } else {
+ _obj.monthSignData.signScale = computeNumber(
+ _obj.monthSignData.signNum,
+ '/',
+ _obj.monthSignData.totalSinNum
+ ).result;
+ }
+
+ // 文员签收率
+ if (
+ !isNumber(_obj.monthBillLadingSignData.clerkSignNum) ||
+ !isNumber(_obj.monthBillLadingSignData.planNum) ||
+ Number(_obj.monthBillLadingSignData.planNum) === 0
+ ) {
+ _obj.monthBillLadingSignData.clerkSignforScale = 0;
+ } else {
+ _obj.monthBillLadingSignData.clerkSignforScale = computeNumber(
+ Number(_obj.monthBillLadingSignData.clerkSignNum),
+ '/',
+ Number(_obj.monthBillLadingSignData.planNum)
+ ).result;
+ }
+
+ if (
+ !isNumber(_obj.monthSignData.clerkSignNum) ||
+ !isNumber(_obj.monthSignData.planNum) ||
+ Number(_obj.monthSignData.planNum) === 0
+ ) {
+ _obj.monthSignData.clerkSignforScale = 0;
+ } else {
+ _obj.monthSignData.clerkSignforScale = computeNumber(
+ Number(_obj.monthSignData.clerkSignNum),
+ '/',
+ Number(_obj.monthSignData.planNum)
+ ).result;
+ }
+
+ // 异常签收率
+ if (
+ !isNumber(_obj.monthBillLadingSignData.clerkOverTimeSignfoNum) ||
+ !isNumber(_obj.monthBillLadingSignData.planNum) ||
+ Number(_obj.monthBillLadingSignData.planNum) === 0
+ ) {
+ _obj.monthBillLadingSignData.clerkOverTimeScale = 0;
+ } else {
+ _obj.monthBillLadingSignData.clerkOverTimeScale = computeNumber(
+ _obj.monthBillLadingSignData.clerkOverTimeSignfoNum,
+ '/',
+ _obj.monthBillLadingSignData.planNum
+ ).result;
+ }
+
+ if (
+ !isNumber(_obj.monthSignData.clerkOverTimeSignfoNum) ||
+ !isNumber(_obj.monthSignData.planNum) ||
+ Number(_obj.monthSignData.planNum) === 0
+ ) {
+ _obj.monthSignData.clerkOverTimeScale = 0;
+ } else {
+ _obj.monthSignData.clerkOverTimeScale = computeNumber(
+ _obj.monthSignData.clerkOverTimeSignfoNum,
+ '/',
+ _obj.monthSignData.planNum
+ ).result;
+ }
}
// 当日数据
@@ -2097,11 +2323,12 @@ const initSignforData = async () => {
}
}
- details.signforDataInfo = data || [];
+ // details.signforDataInfo = data || [];
} catch (error) {
console.log('error :>> ', error);
} finally {
details.signforDataInfo = _obj;
+ console.log('details.signforDataInfo :>> ', details.signforDataInfo);
details.loadingObj.signforData = false;
}
};
@@ -2156,7 +2383,7 @@ const delivery_bill_info = computed(() => {
/** 签收数据 */
const signforData = computed
(() => {
const _obj: any = details.signforDataInfo[signforData_status.value] || {};
- console.log('_obj :>> ', _obj);
+ // console.log('_obj :>> ', _obj);
_obj.signScaleNum ? _obj.signScaleNum : (_obj.signScaleNum = _obj.signScale || 0);
_obj.clerkSignforScaleNum
@@ -2202,7 +2429,6 @@ const billSignforData = computed(() => {
type OptionObjType = { prop: string; tip: string };
-
// 定义两种颜色
const colors = ['#008CBA', '#808080']; // 蓝色和灰色
// /** 获取百分比 */
@@ -2317,10 +2543,15 @@ const getProportion = (value: number) => {
// });
// };
// 定义显示图表的函数,接受数据、标题、选项对象和图表类型(默认为饼图)
-const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType, chartType: string = 'pie') => {
- console.log('data :>> ', data);
- console.log('title :>> ', title);
- console.log('optionObj :>> ', optionObj);
+const handleShowEcharts = (
+ data: any[],
+ title: string,
+ optionObj: OptionObjType,
+ chartType: string = 'pie'
+) => {
+ console.log('data :>> ', data);
+ console.log('title :>> ', title);
+ console.log('optionObj :>> ', optionObj);
if (getObjType(data) !== 'array') return; // 检查传入的数据是否为数组,如果不是则返回
@@ -2344,7 +2575,8 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
const item = _arr[j]; // 获取当前 _arr 中的数据项
if (item.value > value[optionObj.prop]) continue; // 如果当前 _arr 中的数据项值大于当前数据项的值,继续下一个循环
- _arr.splice(j, 0, { // 在当前位置插入当前数据项
+ _arr.splice(j, 0, {
+ // 在当前位置插入当前数据项
name: value.warehouseName, // 数据项的名称
value: value[optionObj.prop], // 数据项的值
});
@@ -2353,13 +2585,15 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
}
if (isContinue) continue; // 如果已插入当前数据项,跳过插入到数组末尾的操作
- _arr.push({ // 如果未插入,将当前数据项添加到数组末尾
+ _arr.push({
+ // 如果未插入,将当前数据项添加到数组末尾
name: value.warehouseName, // 数据项的名称
value: value[optionObj.prop], // 数据项的值
});
}
- nextTick(() => { // 确保 DOM 更新完成后再进行图表初始化
+ nextTick(() => {
+ // 确保 DOM 更新完成后再进行图表初始化
// 获取图表容器元素
const chartDom = document.getElementById('echartBox');
if (!chartDom) return; // 如果未找到图表容器元素,则返回
@@ -2373,7 +2607,7 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
},
tooltip: {
trigger: 'item', // 设置提示框触发方式为数据项
- formatter: (params) => {
+ formatter: params => {
if (chartType === 'pie') {
return `${params.name}: ${params.value} (${params.percent}%)`; // 如果是饼图,格式化提示信息为名称、值和百分比
} else {
@@ -2385,7 +2619,8 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
orient: 'vertical', // 图例布局方向
left: 'left', // 图例位置
},
- ...(chartType === 'bar' && { // 如果是柱状图,添加柱状图的配置
+ ...(chartType === 'bar' && {
+ // 如果是柱状图,添加柱状图的配置
xAxis: {
type: 'category', // x 轴类型为类别
data: _arr.map(item => item.name), // x 轴数据为类别名称
@@ -2397,24 +2632,25 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
yAxis: {
type: 'value', // y 轴类型为数值
axisLabel: {
- formatter: (value) => {
+ formatter: value => {
return getProportion(value); // 将 y 轴标签格式化为百分比形式
- }
+ },
},
},
series: [
{
name: optionObj.tip, // 系列名称
type: 'bar', // 系列类型为柱状图
- data: _arr.map(item => ({ // 系列数据
+ data: _arr.map(item => ({
+ // 系列数据
name: item.name, // 数据项名称
value: item.value, // 数据项值
})),
itemStyle: {
- color: (params) => {
+ color: params => {
// 根据数据项的索引选择颜色
return colors[params.dataIndex % 2];
- }
+ },
},
emphasis: {
itemStyle: {
@@ -2426,9 +2662,9 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
show: true, // 显示高亮标签
fontSize: 20, // 高亮标签字体大小
fontWeight: 'bold', // 高亮标签字体粗细
- formatter: (params) => {
+ formatter: params => {
return getProportion(params.value); // 高亮标签格式化为百分比形式
- }
+ },
},
},
barGap: '30%', // 柱子之间的间隔
@@ -2437,12 +2673,14 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
},
],
}),
- ...(chartType === 'pie' && { // 如果是饼图,添加饼图的配置
+ ...(chartType === 'pie' && {
+ // 如果是饼图,添加饼图的配置
series: [
{
name: optionObj.tip, // 系列名称
type: 'pie', // 系列类型为饼图
- data: _arr.map((item) => ({ // 系列数据
+ data: _arr.map(item => ({
+ // 系列数据
name: item.name + ' - ' + getProportion(item.value / _total), // 数据项名称,附加百分比
value: item.value, // 数据项值
})),
@@ -2469,8 +2707,6 @@ const handleShowEcharts = (data: any[], title: string, optionObj: OptionObjType,
});
};
-
-
/** 请求详情 */
const handleDetails = async (type, title, optionObj: OptionObjType) => {
details.popUpShow.isShow = true;
@@ -2497,8 +2733,8 @@ const handleDetails = async (type, title, optionObj: OptionObjType) => {
// 干线车次数据
case 'trunklineCarsDataColumn':
- res = await postTrunklineCarsDataByWarehouseId({});
- break;
+ handleShowEcharts(details.trunklineCarsDataInfo.list, title, optionObj);
+ return;
default:
break;
}
@@ -2534,7 +2770,12 @@ const handleShowDeliveryDetail = (
handleShowEcharts(data, title, optionObj);
};
/** 显示售后异常数据 */
-const handleShowAbnormalData = (title, type: 'dayData' | 'monthData', optionObj: any = {},chartType) => {
+const handleShowAbnormalData = (
+ title,
+ type: 'dayData' | 'monthData',
+ optionObj: any = {},
+ chartType = 'pie'
+) => {
details.popUpShow.isShow = true;
details.title = title;
console.log(optionObj, 'optionObj');
@@ -2544,7 +2785,7 @@ const handleShowAbnormalData = (title, type: 'dayData' | 'monthData', optionObj:
if (getObjType(details.unloadAbnormalDataInfo[type]) !== 'object') return;
const { data } = details.unloadAbnormalDataInfo[type];
- handleShowEcharts(data, title, optionObj,chartType);
+ handleShowEcharts(data, title, optionObj, chartType);
};
/** 显示签收详情 */
@@ -2567,7 +2808,7 @@ const handleShowSignDetail = (
console.log('data :>> ', data);
- handleShowEcharts(data, title, optionObj,chartType);
+ handleShowEcharts(data, title, optionObj, chartType);
};
/** 导出 */
diff --git a/src/views/reportforms/DeliveryStatisticsReport.vue b/src/views/reportforms/DeliveryStatisticsReport.vue
index 5c25e5a4..ebe52d6b 100644
--- a/src/views/reportforms/DeliveryStatisticsReport.vue
+++ b/src/views/reportforms/DeliveryStatisticsReport.vue
@@ -106,7 +106,7 @@
{
item.reviewOnTimeRate = parsePercentage(item.reviewOnTimeRate);
}
+
details.data = data.records;
details.page.total = data.total;
+ console.log(details.data,'details.data');
} catch (e) {
console.error(e);
} finally {
@@ -485,6 +487,10 @@ const getRateValue = (label, row) => {
return row.signStockRate;
case '计划准确率':
return row.planAccuracy;
+ case '签收及时率':
+ return row.signOnTimeRate;
+ case '复核及时率':
+ return row.reviewOnTimeRate;
default:
return 0;
}
diff --git a/src/views/reportforms/SalesDepartmentIncomeReport.vue b/src/views/reportforms/SalesDepartmentIncomeReport.vue
new file mode 100644
index 00000000..0fce5108
--- /dev/null
+++ b/src/views/reportforms/SalesDepartmentIncomeReport.vue
@@ -0,0 +1,522 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/waybill/orderPackageList.vue b/src/views/waybill/orderPackageList.vue
index 7e2954ea..5fb7e237 100644
--- a/src/views/waybill/orderPackageList.vue
+++ b/src/views/waybill/orderPackageList.vue
@@ -120,24 +120,22 @@
-
-
-
+