Explorar el Código

App端对监控调阅报表,履职情况表,社检查情况表,网点自查情况表修改为完成率降序排列

jingyuanchao hace 1 año
padre
commit
9c7a9e8dff

+ 16 - 1
src/views/menu/monitorStatistics/index.vue

@@ -123,7 +123,22 @@ export default {
         endDate: dayjs(this.endTime).endOf('day').format('YYYY-MM-DD'),
       }
       selectMonitorReport(data).then(res => {
-        this.dataList = res.data
+        if (res.data.length > 0){
+          let arr=res.data;
+          // 将百分比字符串转换为数字
+          arr.forEach(item => {
+            item.accessRate = parseFloat(item.accessRate);
+          });
+
+          // 根据percentage字段进行降序排列
+          arr.sort((a, b) => b.accessRate - a.accessRate);
+          // 将排序后的数字转换回带有百分比符号的字符串
+          arr.forEach(item => {
+            item.accessRate = `${item.accessRate}%`;
+          });
+          // 重新赋值给dataList
+          this.dataList = arr;
+        }
       })
     },
     //搜索选择状态时触发

+ 16 - 2
src/views/menu/resumptionStatistics/index.vue

@@ -147,7 +147,22 @@ export default {
         appSelect : 1, //App与Web端共用一个接口,以此字段区分
       }
       selectResumptionReport(data).then(res => {
-        this.dataList = res.data
+        if (res.data.length > 0){
+          let arr=res.data;
+          // 将百分比字符串转换为数字
+          arr.forEach(item => {
+            item.totalRate = parseFloat(item.totalRate);
+          });
+
+          // 根据percentage字段进行降序排列
+          arr.sort((a, b) => b.totalRate - a.totalRate);
+          // 将排序后的数字转换回带有百分比符号的字符串
+          arr.forEach(item => {
+            item.totalRate = `${item.totalRate}%`;
+          });
+          // 重新赋值给dataList
+          this.dataList = arr;
+        }
       })
     },
     //搜索选择状态时触发
@@ -173,7 +188,6 @@ export default {
       this.startDate = val;
       this.showStartDate = false;
       this.showEndDate = true;
-      this.getDataList()
     },
     //月份选中触发
     onEndDateConfirm(val) {

+ 16 - 1
src/views/menu/safeCheckSelfStatistics/index.vue

@@ -153,7 +153,22 @@ export default {
       }
 
       safeCheckSelfReport(data).then(res => {
-        this.dataList = res.data
+        if (res.data.length > 0){
+          let arr=res.data;
+          // 将百分比字符串转换为数字
+          arr.forEach(item => {
+            item.inspectRate = parseFloat(item.inspectRate);
+          });
+
+          // 根据percentage字段进行降序排列
+          arr.sort((a, b) => b.inspectRate - a.inspectRate);
+          // 将排序后的数字转换回带有百分比符号的字符串
+          arr.forEach(item => {
+            item.inspectRate = `${item.inspectRate}%`;
+          });
+          // 重新赋值给dataList
+          this.dataList = arr;
+        }
       })
     },
 

+ 16 - 1
src/views/menu/safeCheckStatistics/index.vue

@@ -153,7 +153,22 @@ export default {
       }
 
       safeCheckReport(data).then(res => {
-        this.dataList = res.data
+        if (res.data.length > 0){
+          let arr=res.data;
+          // 将百分比字符串转换为数字
+          arr.forEach(item => {
+            item.inspectRate = parseFloat(item.inspectRate);
+          });
+
+          // 根据percentage字段进行降序排列
+          arr.sort((a, b) => b.inspectRate - a.inspectRate);
+          // 将排序后的数字转换回带有百分比符号的字符串
+          arr.forEach(item => {
+            item.inspectRate = `${item.inspectRate}%`;
+          });
+          // 重新赋值给dataList
+          this.dataList = arr;
+        }
       })
     },
     onCancel() {

+ 1 - 1
src/views/menu/securityCheckRegister/api.js

@@ -76,7 +76,7 @@ export function safeCheckReport(data) {
   })
 }
 
-//行社检查报表
+//网点自查报表
 export function safeCheckSelfReport(data) {
   return request({
     url: '/core/safetyInspectReport/selfInspectList',