dedsudiyu 11 uur geleden
bovenliggende
commit
60d12d9939

+ 16 - 8
src/views/safetyEducationExaminationNew/dataStatistics/components/dataReport/userListPage.vue

@@ -167,12 +167,14 @@
     data() {
       return {
         exportConfig:{
-          api:'/exam/elStatistics/exam/grouped/chart-detail-export',              //导出接口地址
-          ids:'',                                        //勾选导出,勾选的IDS
-          fileName:'数据报表-人员明细',                         //导出文件的命名
-          customKey:null,                                //自定义参数KEY(非必填)
-          customValue:null,                               //自定义参数VALUE(非必填)
-          screenData:{}                                  //导出筛选数据(非必要-如有该参数组件会显示导出筛选数据按钮)
+          api:'/exam/elStatistics/exam/grouped/chart-detail-export',
+          userIds:'',
+          fileName:'数据报表-人员明细',
+          customKey:null,
+          customValue:null,
+          allData:{},
+          screenData:{},
+          type:1,
         },
         adminType:0,
         optionList:[],
@@ -280,9 +282,14 @@
         })
       },
       setExportConfig(){
+        //全部条件
+        this.exportConfig.allData = {
+          academicYear:this.queryParams.academicYear,
+          examTypeId:this.queryParams.examTypeId,
+          deptId:this.adminType == 1?this.queryParams.deptId:localStorage.getItem('deptId'),
+        };
+        //筛选条件
         this.exportConfig.screenData = {
-          page:this.queryParams.page,
-          pageSize:this.queryParams.pageSize,
           academicYear:this.queryParams.academicYear,
           category:this.queryParams.category,
           personType:this.queryParams.personType,
@@ -338,6 +345,7 @@
           this.formatTreeData(list);
           if(list[0]){
             this.$set(this,'optionListA',list[0].child);
+            this.optionListA.unshift({ deptName:'全部学院', deptId:'' })
           }else{
             this.$set(this,'optionListA',[]);
           }

+ 11 - 10
src/views/safetyEducationExaminationNew/dataStatistics/components/exportComponent/exportComponent.vue

@@ -34,7 +34,8 @@
       <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAGCAQAAABQ+cdNAAAAAXNSR0IArs4c6QAAAFxJREFUCNdFiLENwCAQxH4SqEDMlCJiB/QHzAINJTOxQNJDnaCAlHNzNrHyB1s+N3aaIg5ofONazNc4UNRcMPBsBpeoichJJPQvdSQnac0L5Bk6shf0zxlUVGeWvWfOMytyOTQwAAAAAElFTkSuQmCC">
     </div>
     <el-dropdown-menu slot="dropdown">
-      <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:3}">导出全部数据</el-dropdown-item>
+      <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:1}">导出全部数据</el-dropdown-item>
+      <el-dropdown-item style="border-bottom:1px solid #E0E0E0;margin:0 10px;color:#333;" :command="{command:3}">导出筛选数据</el-dropdown-item>
       <el-dropdown-item style="margin:0 10px;color:#333;" :command="{command:2}">导出选中数据</el-dropdown-item>
     </el-dropdown-menu>
   </el-dropdown>
@@ -60,21 +61,21 @@
       /** 导出按钮操作 */
       exportButton(item) {
         let self = this;
-        console.log('self.exportConfig.screenData',self.exportConfig.screenData)
         let currentDate=this.getCurrentTime()
         if(item.command == 1){
+          if(self.exportConfig.type == 2){
+            if(!self.exportConfig.allData.examId){
+              this.msgError('请先选择考试并查询')
+              return
+            }
+          }
           self.$confirm(`确认导出全部数据?`, "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"
           }).then(async () => {
-            let obj = {
-              userIds :''
-            }
-            if(self.exportConfig.customKey){
-              obj[self.exportConfig.customKey] = self.exportConfig.customValue
-            }
-            self.download(self.exportConfig.api,obj, self.exportConfig.fileName+currentDate+'.xlsx')
+            let screenData = JSON.parse(JSON.stringify(self.exportConfig.allData))
+            self.download(self.exportConfig.api,screenData, self.exportConfig.fileName+currentDate+'.xlsx')
             if(self.$parent.$refs['table-box']){
               self.$parent.$refs['table-box'].clearSelection();
             }else if(self.$parent.$parent.$refs['table-box']){
@@ -105,7 +106,7 @@
             this.msgError('请勾选数据')
           }
         }else if(item.command == 3){
-          self.$confirm(`确认导出全部数据?`, "提示", {
+          self.$confirm(`确认导出当前筛选条件查出的数据?`, "提示", {
             confirmButtonText: "确定",
             cancelButtonText: "取消",
             type: "warning"

+ 16 - 8
src/views/safetyEducationExaminationNew/dataStatistics/components/regularExam/userListPage.vue

@@ -151,12 +151,14 @@
     data() {
       return {
         exportConfig:{
-          api:'/exam/elStatistics/exam/list-detail-export',              //导出接口地址
-          ids:'',                                        //勾选导出,勾选的IDS
-          fileName:'常规考试-人员明细',                         //导出文件的命名
-          customKey:null,                                //自定义参数KEY(非必填)
-          customValue:null,                               //自定义参数VALUE(非必填)
-          screenData:{}                                  //导出筛选数据(非必要-如有该参数组件会显示导出筛选数据按钮)
+          api:'/exam/elStatistics/exam/list-detail-export',
+          userIds:'',
+          fileName:'常规考试-人员明细',
+          customKey:null,
+          customValue:null,
+          allData:{},
+          screenData:{},
+          type:2,
         },
         adminType:0,
         optionList:[],
@@ -255,9 +257,14 @@
         })
       },
       setExportConfig(){
+        //全部条件
+        this.exportConfig.allData = {
+          academicYear:this.queryParams.academicYear,
+          examId:this.queryParams.examId,
+          deptId:this.adminType == 1?this.queryParams.deptId:localStorage.getItem('deptId'),
+        };
+        //筛选条件
         this.exportConfig.screenData = {
-          page:this.queryParams.page,
-          pageSize:this.queryParams.pageSize,
           academicYear:this.queryParams.academicYear,
           examId:this.queryParams.examId,
           category:this.queryParams.category,
@@ -279,6 +286,7 @@
           this.formatTreeData(list);
           if(list[0]){
             this.$set(this,'optionListA',list[0].child);
+            this.optionListA.unshift({ deptName:'全部学院', deptId:'' })
           }else{
             this.$set(this,'optionListA',[]);
           }

+ 15 - 9
src/views/safetyEducationExaminationNew/dataStatistics/userListPage.vue

@@ -112,12 +112,14 @@
     data() {
       return {
         exportConfig:{
-          api:'/exam/elStatistics/lab/detail-page-export',              //导出接口地址
-          userIds:'',                                        //勾选导出,勾选的IDS
-          fileName:'实验室匹配-人员明细',                         //导出文件的命名
-          customKey:null,                                //自定义参数KEY(非必填)
-          customValue:null,                               //自定义参数VALUE(非必填)
-          screenData:{}                                  //导出筛选数据(非必要-如有该参数组件会显示导出筛选数据按钮)
+          api:'/exam/elStatistics/lab/detail-page-export',
+          userIds:'',
+          fileName:'实验室匹配-人员明细',
+          customKey:null,
+          customValue:null,
+          allData:{},
+          screenData:{},
+          type:3,
         },
         adminType:0,
         optionListA:[],
@@ -208,9 +210,13 @@
         })
       },
       setExportConfig(){
+        //全部条件
+        this.exportConfig.allData = {
+          academicYear:this.queryParams.valueYear,
+          deptId:this.adminType == 1?this.queryParams.deptId:localStorage.getItem('deptId'),
+        };
+        //筛选条件
         this.exportConfig.screenData = {
-          page:this.queryParams.page,
-          pageSize:this.queryParams.pageSize,
           academicYear:this.queryParams.valueYear,
           personType:this.queryParams.personType,
           account:this.queryParams.account,
@@ -226,7 +232,6 @@
         }else{
           this.exportConfig.screenData.deptId = localStorage.getItem('deptId');
         }
-        console.log('')
       },
       //学院列表
       systemDeptCurrentDept(){
@@ -235,6 +240,7 @@
           this.formatTreeData(list);
           if(list[0]){
             this.$set(this,'optionListA',list[0].child);
+            this.optionListA.unshift({ deptName:'全部学院', deptId:'' })
           }else{
             this.$set(this,'optionListA',[]);
           }