فهرست منبع

reactor:对接司法行政监督管理;

zhangchong 1 سال پیش
والد
کامیت
564dd02323

+ 12 - 0
src/api/judicial/index.ts

@@ -88,4 +88,16 @@ export const departmentStatistics = (params?: object) => {
 		method: 'get',
 		params
 	})
+}
+/**
+ * @description 部门满意度统计
+ * @param params
+ * @return {*}
+ */
+export const departmentSatisfaction = (params?: object) => {
+	return request({
+		url: '/api/v1/EnforcementOrder/enforcement_visit_org_satisfaction_statistics',
+		method: 'get',
+		params
+	})
 }

+ 1 - 0
src/views/judicial/statistics/area.vue

@@ -14,6 +14,7 @@
             :shortcuts="shortcuts"
             @change="handleQuery"
             value-format="YYYY-MM-DD"
+            :clearable="false"
           />
         </el-form-item>
         <el-form-item>

+ 1 - 0
src/views/judicial/statistics/department.vue

@@ -14,6 +14,7 @@
 						:shortcuts="shortcuts"
 						@change="handleQuery"
 						value-format="YYYY-MM-DD"
+            :clearable="false"
 					/>
 				</el-form-item>
 				<el-form-item>

+ 151 - 36
src/views/judicial/statistics/satisfaction.vue

@@ -14,6 +14,7 @@
 						:shortcuts="shortcuts"
 						@change="handleQuery"
 						value-format="YYYY-MM-DD"
+            :clearable="false"
 					/>
 				</el-form-item>
 				<el-form-item>
@@ -37,6 +38,78 @@
 				:pagination="false"
 				:summary-method="getSummaries"
 			>
+        <template #orgName="{ row }">
+          <el-button link type="primary" @click="onDetailOrg(row)" v-if="!['市直合计', '区县合计'].includes(row.orgName)">{{
+              row.orgName
+            }}</el-button>
+          <span v-else>{{ row.orgName }}</span>
+        </template>
+        <template #verySatisfiedCount="{ row }">
+          <el-button
+            link
+            type="primary"
+            @click="onDetail(row.verySatisfiedKey, row, '非常满意')"
+            v-if="!['市直合计', '区县合计'].includes(row.orgName)"
+          >{{ row.verySatisfiedCount }}</el-button
+          >
+          <span v-else>{{ row.verySatisfiedCount }}</span>
+        </template>
+        <template #satisfiedCount="{ row }">
+          <el-button link type="primary" @click="onDetail(row.satisfiedKey, row, '满意')" v-if="!['市直合计', '区县合计'].includes(row.orgName)">{{
+              row.satisfiedCount
+            }}</el-button>
+          <span v-else>{{ row.satisfiedCount }}</span>
+        </template>
+        <template #regardedAsSatisfiedCount="{ row }">
+          <el-button
+            link
+            type="primary"
+            @click="onDetail(row.regardedAsSatisfiedKey, row, '视为满意')"
+            v-if="!['市直合计', '区县合计'].includes(row.orgName)"
+          >{{ row.regardedAsSatisfiedCount }}</el-button
+          >
+          <span v-else>{{ row.regardedAsSatisfiedCount }}</span>
+        </template>
+        <template #defaultSatisfiedCount="{ row }">
+          <el-button
+            link
+            type="primary"
+            @click="onDetail(row.defaultSatisfiedKey, row, '默认满意')"
+            v-if="!['市直合计', '区县合计'].includes(row.orgName)"
+          >{{ row.defaultSatisfiedCount }}</el-button
+          >
+          <span v-else>{{ row.defaultSatisfiedCount }}</span>
+        </template>
+        <template #noSatisfiedCount="{ row }">
+          <el-button
+            link
+            type="primary"
+            @click="onDetail(row.noSatisfiedKey, row, '不满意')"
+            v-if="!['市直合计', '区县合计'].includes(row.orgName)"
+          >{{ row.noSatisfiedCount }}</el-button
+          >
+          <span v-else>{{ row.noSatisfiedCount }}</span>
+        </template>
+        <template #noEvaluateCount="{ row }">
+          <el-button
+            link
+            type="primary"
+            @click="onDetail(row.noEvaluateKey, row, '未作评价')"
+            v-if="!['市直合计', '区县合计'].includes(row.orgName)"
+          >{{ row.noEvaluateCount }}</el-button
+          >
+          <span v-else>{{ row.noEvaluateCount }}</span>
+        </template>
+        <template #noPutThroughCount="{ row }">
+          <el-button
+            link
+            type="primary"
+            @click="onDetail(row.noPutThroughKey, row, '未接通')"
+            v-if="!['市直合计', '区县合计'].includes(row.orgName)"
+          >{{ row.noPutThroughCount }}</el-button
+          >
+          <span v-else>{{ row.noPutThroughCount }}</span>
+        </template>
 			</ProTable>
 		</el-card>
 	</div>
@@ -46,6 +119,7 @@ import { onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
 import { shortcuts } from '@/utils/constants';
 import dayjs from 'dayjs';
+import { departmentSatisfaction } from '@/api/judicial';
 // 定义变量内容
 
 const columns = ref<any>([
@@ -129,12 +203,12 @@ const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive({
 	queryParams: {
 		// 查询条件
-		VisitName: null, // 关键词
 		crTime: [dayjs().startOf('day').format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')], // 时间默认今天开始到今天结束
 	},
 	tableData: [],
 	loading: false, // 加载
 	total: 0, // 总数
+  totalCount:{}
 });
 /** 搜索按钮操作 */
 const handleQuery = () => {
@@ -153,16 +227,21 @@ const queryList = () => {
 	const request = {
 		StartDate,
 		EndDate,
-		VisitName: state.queryParams.VisitName,
+    TypeId:'1'
 	};
-	/* departmentVisit(request)
-     .then((res: any) => {
-       state.tableData = res.result;
-       state.loading = false;
-     })
-     .catch(() => {
-       state.loading = false;
-     });*/
+	departmentSatisfaction(request)
+		.then((res: any) => {
+      state.tableData = res.result?.dataList ?? [];
+      if (res.result.dataList.length) {
+        state.tableData.push(res.result.citySumModel);
+        state.tableData.push(res.result.countySumModel);
+      }
+      state.totalCount = res.result.sumModel;
+			state.loading = false;
+		})
+		.catch(() => {
+			state.loading = false;
+		});
 	state.loading = false;
 };
 /** 重置按钮操作 */
@@ -173,32 +252,68 @@ const resetQuery = (formEl: FormInstance | undefined) => {
 };
 // 合计
 const getSummaries = (param: any) => {
-	const { columns, data } = param;
-	const sums: string[] = [];
-	columns.forEach((column: { property: string }, index: number) => {
-		if (index === 0) {
-			sums[index] = '合计';
-			return;
-		}
-		const values = data.map((item: { [x: string]: any }) => Number(item[column.property]));
-		if (['visitName'].includes(column.property)) {
-			//百分比不能计算
-			sums[index] = '';
-			return '';
-		} else if (!values.every((value: unknown) => Number.isNaN(value))) {
-			sums[index] = `${values.reduce((prev: any, curr: any) => {
-				const value = Number(curr);
-				if (!Number.isNaN(value)) {
-					return prev + curr;
-				} else {
-					return prev;
-				}
-			}, 0)}`;
-		} else {
-			sums[index] = ' ';
-		}
-	});
-	return sums;
+  const { columns } = param;
+  const sums: string[] = [];
+  columns.forEach((column: { property: string }, index: number) => {
+    if (index === 0) {
+      sums[index] = '合计';
+      return;
+    }
+    switch (column.property) {
+      case 'totalSumCount':
+        sums[index] = state.totalCount?.totalSumCount;
+        break;
+      case 'totalSumRate':
+        sums[index] = `${state.totalCount?.totalSumRate}%`;
+        break;
+      case 'verySatisfiedCount':
+        sums[index] = state.totalCount?.verySatisfiedCount;
+        break;
+      case 'verySatisfiedRate':
+        sums[index] = `${state.totalCount?.verySatisfiedRate}%`;
+        break;
+      case 'satisfiedCount':
+        sums[index] = state.totalCount?.satisfiedCount;
+        break;
+      case 'satisfiedRate':
+        sums[index] = `${state.totalCount?.satisfiedRate}%`;
+        break;
+      case 'regardedAsSatisfiedCount':
+        sums[index] = state.totalCount?.regardedAsSatisfiedCount;
+        break;
+      case 'regardedAsSatisfiedRate':
+        sums[index] = `${state.totalCount?.regardedAsSatisfiedRate}%`;
+        break;
+      case 'defaultSatisfiedCount':
+        sums[index] = state.totalCount?.defaultSatisfiedCount;
+        break;
+      case 'defaultSatisfiedRate':
+        sums[index] = `${state.totalCount?.defaultSatisfiedRate}%`;
+        break;
+      case 'noSatisfiedCount':
+        sums[index] = state.totalCount?.noSatisfiedCount;
+        break;
+      case 'noSatisfiedRate':
+        sums[index] = `${state.totalCount?.noSatisfiedRate}%`;
+        break;
+      case 'noEvaluateCount':
+        sums[index] = state.totalCount?.noEvaluateCount;
+        break;
+      case 'noEvaluateRate':
+        sums[index] = `${state.totalCount?.noEvaluateRate}%`;
+        break;
+      case 'noPutThroughCount':
+        sums[index] = state.totalCount?.noPutThroughCount;
+        break;
+      case 'noPutThroughRate':
+        sums[index] = `${state.totalCount?.noPutThroughRate}%`;
+        break;
+      default:
+        sums[index] = '';
+        break;
+    }
+  });
+  return sums;
 };
 onMounted(() => {
 	queryList();