Browse Source

reactor:报表调整;

zhangchong 1 year ago
parent
commit
0fa7d9fc35
2 changed files with 16 additions and 9 deletions
  1. 12 5
      src/views/statistics/call/telephonist.vue
  2. 4 4
      src/views/statistics/order/specials.vue

+ 12 - 5
src/views/statistics/call/telephonist.vue

@@ -186,14 +186,21 @@ const getSummaries = (param: any) => {
 			return;
 		}
 		const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
-		if (
-			['inAnsweredRate', 'outAnsweredRate', 'inAvailableAnswer', 'outDurationAvg', 'loginDuration', 'restDuration', 'workRate'].includes(
-				column.property
-			)
-		) {
+		if (['inAnsweredRate', 'outAnsweredRate', 'inAvailableAnswer', 'outDurationAvg', 'workRate'].includes(column.property)) {
 			//百分比不能计算
 			sums[index] = '';
 			return '';
+		} else if (['loginDuration', 'restDuration'].includes(column.property)) {
+			sums[index] = formatDurationDay(
+				values.reduce((prev: any, curr: any) => {
+					const value = Number(curr);
+					if (!Number.isNaN(value)) {
+						return prev + curr;
+					} else {
+						return prev;
+					}
+				}, 0)
+			);
 		} else if (!values.every((value: unknown) => Number.isNaN(value))) {
 			sums[index] = `${values.reduce((prev: any, curr: any) => {
 				const value = Number(curr);

+ 4 - 4
src/views/statistics/order/specials.vue

@@ -123,10 +123,10 @@ const handleDetail = (row: any) => {
 			cause: row.cause,
 			tagsViewName: `特提统计明细`,
 		},
-    state:{
-      startTime: startTime ?? 'null',
-      endTime: endTime ?? 'null',
-    }
+		state: {
+			startTime: startTime ?? 'null',
+			endTime: endTime ?? 'null',
+		},
 	});
 };
 onMounted(() => {