Przeglądaj źródła

首页统计数据导出

LuChongMei 23 godzin temu
rodzic
commit
74ab5f4362

+ 112 - 3
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/lyservice/controller/LyServiceController.java

@@ -5,6 +5,12 @@ package com.jeeplus.lyservice.controller;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.EasyExcelFactory;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
+import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
 import com.google.common.collect.Lists;
 import com.jeeplus.core.excel.EasyExcelUtils;
 import com.jeeplus.core.excel.ExcelOptions;
@@ -30,9 +36,8 @@ import com.jeeplus.lyservice.service.LyServiceService;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.List;
+import java.net.URLEncoder;
+import java.util.*;
 
 /**
  * LyServiceController
@@ -211,6 +216,110 @@ public class LyServiceController {
         EasyExcelUtils.newInstance ( lyServiceService, lyServiceWrapper ).exportExcel ( result,  options.getSheetName ( ), LyServiceDTO.class, fileName,options.getExportFields (), response );
     }
 
+	/**
+	 * 导出服务对接数据
+	 *
+	 * @param response
+	 * @throws Exception
+	 */
+	@ApiLog("导出服务对接数据")
+	@PreAuthorize("hasAnyAuthority('service:lyService:export')")
+	@GetMapping("export2")
+	public void exportFile2( String name,String des1,String beginTime,String endTime,String state, ExcelOptions options, HttpServletResponse response) throws Exception {
+		String fileName = options.getFilename ( );
+		List<HashMap<String,Object>> result = lyServiceService.getPersonInfo(name,des1,beginTime,endTime,state);
+		response.reset();
+		response.setContentType ( "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" );
+		response.setCharacterEncoding ( "utf-8" );
+		//响应内容格式
+		response.setHeader ( "Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx" );
+		ExcelWriter excelWriter = null;
+
+		excelWriter = EasyExcelFactory.write(response.getOutputStream()).build();
+		// 组装表头
+		List<List<String>> excelHead = getExportHead("1");
+		fileName = URLEncoder.encode ( fileName, "UTF-8" ).replaceAll ( "\\+", "%20" );
+		if (result.size()>0){
+			WriteSheet writeSheet = EasyExcel
+					.writerSheet("sheet1")
+					.head(excelHead)
+					.registerWriteHandler(new SimpleColumnWidthStyleStrategy(20))
+					.build();
+			excelWriter.write(dataList( result,"1"), writeSheet);
+			excelWriter.finish();
+		}else {
+			throw new RuntimeException("暂无数据可供下载");
+		}
+//		EasyExcelUtils.newInstance ( lyServiceService, lyServiceWrapper ).exportExcel ( result,  options.getSheetName ( ), LyServiceDTO.class, fileName,options.getExportFields (), response );
+	}
+
+	/**
+	 * 导出服务对接数据
+	 *
+	 * @param response
+	 * @throws Exception
+	 */
+	@ApiLog("导出服务对接数据")
+	@PreAuthorize("hasAnyAuthority('service:lyService:export')")
+	@GetMapping("export3")
+	public void exportFile3( String name,String des1,String beginTime,String endTime,String state, ExcelOptions options, HttpServletResponse response) throws Exception {
+		String fileName = options.getFilename ( );
+		List<HashMap<String,Object>> result = lyServiceService.getCompanyInfo(name,des1,beginTime,endTime,state);
+		response.reset();
+		response.setContentType ( "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" );
+		response.setCharacterEncoding ( "utf-8" );
+		//响应内容格式
+		response.setHeader ( "Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx" );
+		ExcelWriter excelWriter = null;
+
+		excelWriter = EasyExcelFactory.write(response.getOutputStream()).build();
+		// 组装表头
+		List<List<String>> excelHead = getExportHead("2");
+		fileName = URLEncoder.encode ( fileName, "UTF-8" ).replaceAll ( "\\+", "%20" );
+		if (result.size()>0){
+			WriteSheet writeSheet = EasyExcel
+					.writerSheet("sheet1")
+					.head(excelHead)
+					.registerWriteHandler(new SimpleColumnWidthStyleStrategy(20))
+					.build();
+			excelWriter.write(dataList( result,"2"), writeSheet);
+			excelWriter.finish();
+		}else {
+			throw new RuntimeException("暂无数据可供下载");
+		}
+//		EasyExcelUtils.newInstance ( lyServiceService, lyServiceWrapper ).exportExcel ( result,  options.getSheetName ( ), LyServiceDTO.class, fileName,options.getExportFields (), response );
+	}
+
+	private List<List<Object>> dataList( List<HashMap<String,Object>> mapList,String type) {
+		List<List<Object>> list = new ArrayList();
+		List<Map<String, Object>> table_heads = lyServiceService.getTableTitle(type);
+		for (int i = 0; i < mapList.size(); i++) {
+
+			Map row = mapList.get(i);
+			List<Object> data = new ArrayList();
+			data.add(i+1);
+			for (int j = 1; j < table_heads.size(); j++) {
+				String filed = table_heads.get(j).get("field").toString();
+				Object objVal = row.get(filed);
+				String val = Objects.toString(objVal, "");
+				data.add(val);
+			}
+			list.add(data);
+		}
+		return list;
+	}
+
+	private List<List<String>> getExportHead(String type) {
+		List<List<String>> head_list = new ArrayList<>();
+		List<Map<String, Object>> table_heads = lyServiceService.getTableTitle(type);
+		for (int i = 0; i < table_heads.size(); i++) {
+			List<String> list = new ArrayList<>();
+			list.add(table_heads.get(i).get("title").toString());
+			head_list.add(list);
+		}
+		return  head_list;
+	}
+
     /**
      * 导入服务对接数据
      *

+ 40 - 0
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/lyservice/service/LyServiceService.java

@@ -3,6 +3,8 @@
  */
 package com.jeeplus.lyservice.service;
 
+import com.jeeplus.sys.service.dto.UserDTO;
+import com.jeeplus.sys.utils.UserUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -17,6 +19,7 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * LyServiceService
@@ -85,6 +88,13 @@ public class LyServiceService extends ServiceImpl<LyServiceMapper, LyService> {
 		// 问题数
 		// 月份
 		HashMap<String, Object> monthNum = baseMapper.getProgressMonth(start,end);
+//		HashMap<String, Object> monthNum = new HashMap<>();
+//		UserDTO userDTO = UserUtils.getCurrentUserDTO();
+//		if(userDTO.getRoleIds().equals("1910175949166673921")){
+//
+//		}else{
+//			monthNum = baseMapper.getProgressMonth(start,end);
+//		}
 		// 计算占比
 		double unAcount =  0;
 		Integer unfinish = Integer.valueOf(monthNum.get("unfinish").toString());
@@ -174,4 +184,34 @@ public class LyServiceService extends ServiceImpl<LyServiceMapper, LyService> {
 	}
 
 
+	public List<Map<String, Object>> getTableTitle(String type) {
+		List<Map<String, Object>> table_heads_type = new ArrayList<>();
+		Map<String, Object> map1 = new HashMap<>();
+		map1.put("title", "序号");
+		map1.put("field", "xuhao");
+		table_heads_type.add(map1);
+		if(type.equals("2")){
+			Map<String, Object> map6 = new HashMap<>();
+			map6.put("title", "企业");
+			map6.put("field", "name");
+			table_heads_type.add(map6);
+		}
+		Map<String, Object> map5 = new HashMap<>();
+		map5.put("title", "属地");
+		map5.put("field", "des1");
+		table_heads_type.add(map5);
+		Map<String, Object> map2 = new HashMap<>();
+		map2.put("title", "挂钩干部");
+		if(type.equals("1")){
+			map2.put("field", "bz5");
+		} else if (type.equals("2")) {
+			map2.put("field", "des14");
+		}
+		table_heads_type.add(map2);
+		Map<String, Object> map7 = new HashMap<>();
+		map7.put("title", "走访次数");
+		map7.put("field", "sum");
+		table_heads_type.add(map7);
+		return  table_heads_type;
+	}
 }

+ 135 - 1
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/controller/DzfQuestionController.java

@@ -4,9 +4,16 @@
 package com.jeeplus.question.controller;
 
 import java.io.IOException;
+import java.net.URLEncoder;
 import java.util.*;
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.EasyExcelFactory;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
+import com.alibaba.excel.write.style.column.SimpleColumnWidthStyleStrategy;
 import com.google.common.collect.Lists;
 import com.jeeplus.core.excel.EasyExcelUtils;
 import com.jeeplus.core.excel.ExcelOptions;
@@ -437,7 +444,134 @@ public class DzfQuestionController {
         EasyExcelUtils.newInstance ( dzfQuestionService, dzfQuestionWrapper ).exportExcel ( result,  options.getSheetName ( ), DzfQuestionDTO.class, fileName,options.getExportFields (), response );
     }
 
-    /**
+	/**
+	 * 导出问题诉求数据
+	 *
+	 * @param page
+	 * @param response
+	 * @throws Exception
+	 */
+	@ApiLog("导出问题诉求数据")
+	@PreAuthorize("hasAnyAuthority('question:dzfQuestion:export')")
+	@GetMapping("export2")
+	public void exportFile2(String start,String end,String state, Page <DzfQuestionDTO> page, ExcelOptions options, HttpServletResponse response) throws Exception {
+		String fileName = options.getFilename ( );
+		if ( ExportMode.current.equals ( options.getMode ( ) ) ) { // 导出当前页数据
+
+		}  else { // 导出全部数据
+			page.setSize ( -1 );
+			page.setCurrent ( 0 );
+		}
+		List<DzfQuestionDTO> result = new ArrayList<>();
+		UserDTO userDTO = UserUtils.getCurrentUserDTO();
+		//办理部门
+		if(userDTO.getRoleIds().equals("1910175949166673921")){
+			 result = dzfQuestionService.findPage4 (page, state,start,end,userDTO.getLoginName()).getRecords();
+
+		} else if (userDTO.getRoleIds().equals("1910175386924417025")) {
+			 result = dzfQuestionService.findPage5 (page, state,start,end).getRecords();
+
+		} else{
+			 result = dzfQuestionService.findPage3 (page, state,start,end).getRecords();
+
+		}
+		response.reset();
+		response.setContentType ( "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" );
+		response.setCharacterEncoding ( "utf-8" );
+		//响应内容格式
+		response.setHeader ( "Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx" );
+		ExcelWriter excelWriter = null;
+
+		excelWriter = EasyExcelFactory.write(response.getOutputStream()).build();
+		 // 组装表头
+		List<List<String>> excelHead = getExportHead();
+		fileName = URLEncoder.encode ( fileName, "UTF-8" ).replaceAll ( "\\+", "%20" );
+		if (result.size()>0){
+		WriteSheet writeSheet = EasyExcel
+				.writerSheet("sheet1")
+				.head(excelHead)
+				.registerWriteHandler(new SimpleColumnWidthStyleStrategy(20))
+				.build();
+		excelWriter.write(dataList( result), writeSheet);
+		excelWriter.finish();
+		}else {
+			throw new RuntimeException("暂无数据可供下载");
+		}
+	}
+
+	private List<List<Object>> dataList(List<DzfQuestionDTO> result) {
+		List<List<Object>> list = new ArrayList();
+		List<Map<String, Object>> table_heads = dzfQuestionService.getTableTitle();
+		for (int i = 0; i < result.size(); i++) {
+
+			DzfQuestionDTO row = result.get(i);
+			List<Object> data = new ArrayList();
+//			data.add(i+1);
+			for (int j = 0; j < table_heads.size(); j++) {
+				String filed = table_heads.get(j).get("field").toString();
+				String objVal = "";
+				switch (filed){
+					case "qyName": objVal = row.getQyName(); break;
+					case "detailName": objVal = row.getDetailName(); break;
+					case "detailType": objVal = row.getDetailType(); break;
+					case "qySd": objVal = row.getQySd(); break;
+					case "qyFzr": objVal = row.getQyFzr(); break;
+					case "phone": objVal = row.getPhone(); break;
+					case "officer": objVal = row.getOfficer(); break;
+					case "officeName": objVal = row.getOfficeName(); break;
+					case "detailStates": objVal = getStates(row.getDetailStates()); break;
+				}
+				data.add(objVal);
+			}
+			list.add(data);
+		}
+		return list;
+	}
+	private String getStates(String officename){
+		String area="";
+		switch (officename) {
+			case "0":
+				area = "办结";
+				break;
+			case "1":
+				area = "提交";
+				break;
+			case "4":
+				area = "反馈大走访";
+				break;
+			case "5":
+				area = "正在办理";
+				break;
+			case "6":
+				area = "难以化解";
+				break;
+			case "7":
+				area = "持续跟踪";
+				break;
+			case "8":
+				area = "提请会办";
+				break;
+			case "9":
+				area = "交办";
+				break;
+		}
+
+		return area;
+	}
+
+
+	private List<List<String>> getExportHead() {
+		List<List<String>> head_list = new ArrayList<>();
+		List<Map<String, Object>> table_heads = dzfQuestionService.getTableTitle();
+		for (int i = 0; i < table_heads.size(); i++) {
+			List<String> list = new ArrayList<>();
+			list.add(table_heads.get(i).get("title").toString());
+			head_list.add(list);
+		}
+		return  head_list;
+	}
+
+	/**
      * 导入问题诉求数据
      *
      * @return

+ 1 - 26
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/mapper/xml/DzfQuestionMapper.xml

@@ -145,32 +145,7 @@
 
 	<select id="findList4" resultType="com.jeeplus.question.service.dto.DzfQuestionDTO" >
 		SELECT
-		a.id AS "id",
-		a.qy_id AS "qyId",
-		a.qy_name AS "qyName",
-		a.qy_sd AS "qySd",
-		a.qy_fzr AS "qyFzr",
-		a.phone AS "phone",
-		a.officer AS "officer",
-		a.office_name AS "officeName",
-		a.states AS "states",
-		a.finish_time AS "finishTime",
-		a.remark AS "remark",
-		a.des1 AS "des1",
-		a.des2 AS "des2",
-		a.des3 AS "des3",
-		a.des4 AS "des4",
-		a.des5 AS "des5",
-		a.des6 AS "des6",
-		a.des7 AS "des7",
-		a.des8 AS "des8",
-		a.des9 AS "des9",
-		a.des10 AS "des10",
-		a.create_by AS "createBy.id",
-		a.create_date AS "createDate",
-		a.update_by AS "updateBy.id",
-		a.update_date AS "updateDate",
-		a.del_flag AS "delFlag"
+		<include refid="dzfQuestionColumns"/>
 		FROM
 		(SELECT a.qid
 		FROM

+ 46 - 0
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/service/DzfQuestionService.java

@@ -23,6 +23,7 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 问题诉求Service
@@ -401,4 +402,49 @@ public class DzfQuestionService extends ServiceImpl<DzfQuestionMapper, DzfQuesti
 	}
 
 
+	public List<Map<String, Object>> getTableTitle() {
+		List<Map<String, Object>> table_heads_type = new ArrayList<>();
+//		Map<String, Object> map1 = new HashMap<>();
+//		map1.put("title", "序号");
+//		map1.put("field", "xuhao");
+//		table_heads_type.add(map1);
+		Map<String, Object> map2 = new HashMap<>();
+		map2.put("title", "企业名称");
+		map2.put("field", "qyName");
+		table_heads_type.add(map2);
+
+			Map<String, Object> map3 = new HashMap<>();
+			map3.put("title", "问题名称");
+			map3.put("field", "detailName");
+			table_heads_type.add(map3);
+			Map<String, Object> map10 = new HashMap<>();
+				map10.put("title", "问题类别");
+			map10.put("field", "detailType");
+			table_heads_type.add(map10);
+		Map<String, Object> map5 = new HashMap<>();
+		map5.put("title", "属地");
+		map5.put("field", "qySd");
+		table_heads_type.add(map5);
+		Map<String, Object> map6 = new HashMap<>();
+		map6.put("title", "企业负责人");
+		map6.put("field", "qyFzr");
+		table_heads_type.add(map6);
+		Map<String, Object> map7 = new HashMap<>();
+		map7.put("title", "负责人号码");
+		map7.put("field", "phone");
+		table_heads_type.add(map7);
+		Map<String, Object> map8 = new HashMap<>();
+		map8.put("title", "挂钩干部");
+		map8.put("field", "officer");
+		table_heads_type.add(map8);
+		Map<String, Object> map9 = new HashMap<>();
+		map9.put("title", "挂钩干部号码");
+		map9.put("field", "officeName");
+		table_heads_type.add(map9);
+		Map<String, Object> map1 = new HashMap<>();
+		map1.put("title", "问题状态");
+		map1.put("field", "detailStates");
+		table_heads_type.add(map1);
+		return  table_heads_type;
+	}
 }

+ 4 - 4
jp-console/jeeplus-module/ly/src/main/java/com/jeeplus/question/service/dto/DzfQuestionDTO.java

@@ -35,7 +35,7 @@ public class DzfQuestionDTO extends BaseDTO {
      * 企业名称
      */
     @Query(tableColumn = "a.qy_name", javaField = "qyName", type = QueryType.LIKE)
-    @ExcelProperty(value = "企业名称", converter = ExcelUserDTOConverter.class)
+    @ExcelProperty("企业名称")
 	private String qyName;
 
 	/**
@@ -154,17 +154,17 @@ public class DzfQuestionDTO extends BaseDTO {
 	/**
 	 * 问题名称
 	 */
-	@Query(tableColumn = "b.q_name", javaField = "detailName", type = QueryType.LIKE)
+	@ExcelProperty("问题名称")
 	private String detailName;
 	/**
 	 * 问题类别
 	 */
-	@Query(tableColumn = "b.q_type", javaField = "detailType", type = QueryType.LIKE)
+	@ExcelProperty("问题类别")
 	private String detailType;
 	/**
 	 * 问题状态
 	 */
-	@Query(tableColumn = "b.states", javaField = "detailStates", type = QueryType.LIKE)
+	@ExcelProperty("问题详情状态")
 	private String detailStates;
     /**
      *子表列表

+ 9 - 0
jp-ui/src/api/question/dzfQuestionService.js

@@ -82,4 +82,13 @@ export default {
         params: params,
       })
     },
+
+    exportExcel2: function(params) {
+      return request({
+          url: '/question/dzfQuestion/export2',
+          method: 'get',
+          params: params,
+          responseType: 'blob'
+        })
+      },
   }

+ 18 - 0
jp-ui/src/api/service/lyServiceService.js

@@ -91,6 +91,24 @@ export default {
     })
   },
 
+  exportExcel2: function(params) {
+    return request({
+        url: '/lyservice/lyService/export2',
+        method: 'get',
+        params: params,
+        responseType: 'blob'
+      })
+    },
+
+    exportExcel3: function(params) {
+      return request({
+          url: '/lyservice/lyService/export3',
+          method: 'get',
+          params: params,
+          responseType: 'blob'
+        })
+      },
+
   importExcel: function (data) {
     return request({
       url: '/lyservice/lyService/import',

+ 4 - 11
jp-ui/src/views/modules/sys/dashboard/analysis/indexInfo.vue

@@ -22,17 +22,18 @@
       </el-form>
 
       <div style="height: calc(70vh - 80px);">
+        <vxe-toolbar export>
+        </vxe-toolbar>
         <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
           ref="lyServiceTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
           :print-config="{}" :export-config="{
                 remote: true,
-                filename: `走访统计${moment(new Date()).format(
+                filename: `挂钩干部走访统计${moment(new Date()).format(
             		'YYYY-MM-DD'
                 )}`,
                 sheetName: '走访统计',
                 exportMethod: exportMethod,
                 types: ['xlsx'],
-                modes: ['current', 'selected', 'all'],
             }" :data="dataList" :checkbox-config="{}">
           <vxe-column type="seq" width="80" title="序号"></vxe-column>
           <vxe-column field="bz5" title="挂钩干部">
@@ -145,20 +146,12 @@
       }) {
         // 传给服务端的参数
         const params = {
-          current: this.tablePage.currentPage,
-          size: this.tablePage.pageSize,
-          orders: this.tablePage.orders,
           ...this.searchForm,
           filename: options.filename,
           sheetName: options.sheetName,
-          isHeader: options.isHeader,
-          original: options.original,
-          mode: options.mode,
-          selectIds: options.mode === 'selected' ? options.data.map((item) => item.id) : [],
-          exportFields: options.columns.map((column) => column.property && column.property.split('.')[0])
         }
         this.loading = true
-        return lyServiceService.exportExcel(params).then(({
+        return lyServiceService.exportExcel2(params).then(({
           data
         }) => {
           // 将二进制流文件写入excel表,以下为重要步骤

+ 4 - 10
jp-ui/src/views/modules/sys/dashboard/analysis/indexInfo2.vue

@@ -25,11 +25,13 @@
       </el-form>
 
       <div style="height: calc(70vh - 80px);">
+        <vxe-toolbar export>
+        </vxe-toolbar>
         <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
           ref="lyServiceTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
           :print-config="{}" :export-config="{
                 remote: true,
-                filename: `走访统计${moment(new Date()).format(
+                filename: `企业走访统计${moment(new Date()).format(
             		'YYYY-MM-DD'
                 )}`,
                 sheetName: '走访统计',
@@ -153,20 +155,12 @@
       }) {
         // 传给服务端的参数
         const params = {
-          current: this.tablePage.currentPage,
-          size: this.tablePage.pageSize,
-          orders: this.tablePage.orders,
           ...this.searchForm,
           filename: options.filename,
           sheetName: options.sheetName,
-          isHeader: options.isHeader,
-          original: options.original,
-          mode: options.mode,
-          selectIds: options.mode === 'selected' ? options.data.map((item) => item.id) : [],
-          exportFields: options.columns.map((column) => column.property && column.property.split('.')[0])
         }
         this.loading = true
-        return lyServiceService.exportExcel(params).then(({
+        return lyServiceService.exportExcel3(params).then(({
           data
         }) => {
           // 将二进制流文件写入excel表,以下为重要步骤

+ 46 - 6
jp-ui/src/views/modules/sys/dashboard/analysis/questionInfo.vue

@@ -21,12 +21,25 @@
         </el-form-item>
       </el-form>
 
-      <div style="height: calc(70vh - 80px);">
+      <div style="height: calc(65vh - 80px);">
+        <vxe-toolbar :refresh="{query: refreshList}" export>
+        </vxe-toolbar>
         <vxe-table border="inner" auto-resize resizable height="auto" :loading="loading" size="small"
           ref="dzfQuestionTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
-          :print-config="{}" :data="dataList" :checkbox-config="{}">
+          :print-config="{}"
+          :export-config="{
+              remote: true,
+              filename: `问题诉求数据${moment(new Date()).format(
+          		'YYYY-MM-DD'
+              )}`,
+              sheetName: '问题诉求数据',
+              exportMethod: exportMethod,
+              types: ['xlsx'],
+              modes: ['current', 'all'],
+          }"
+          :data="dataList" :checkbox-config="{}">
           <vxe-column type="seq" width="40"></vxe-column>
-          <vxe-column field="" title="企业名称">
+          <vxe-column field="qyName" title="企业名称">
             <template slot-scope="scope">
               {{scope.row.qyName }}
             </template>
@@ -43,9 +56,9 @@
           </vxe-column>
           <vxe-column field="officer" title="挂钩干部">
           </vxe-column>
-          <vxe-column field="officeName" title="挂钩干部姓名">
+          <vxe-column field="officeName" title="挂钩干部号码">
           </vxe-column>
-          <vxe-column field="" title="问题状态">
+          <vxe-column field="detailStates" title="问题状态">
             <template slot-scope="scope">
               {{getState(scope.row.detailStates)}}
             </template>
@@ -187,7 +200,34 @@
       resetSearch() {
         this.$refs.searchForm.resetFields()
         this.refreshList()
-      }
+      },
+      // 自定义服务端导出
+      exportMethod ({ options }) {
+      // 传给服务端的参数
+        const params = {
+          current: this.tablePage.currentPage,
+          size: this.tablePage.pageSize,
+          orders: this.tablePage.orders,
+          ...this.searchForm,
+          filename: options.filename,
+          sheetName: options.sheetName,
+          isHeader: options.isHeader,
+          original: options.original,
+          mode: options.mode,
+          selectIds: options.mode === 'selected' ? options.data.map((item) => item.id) : [],
+          exportFields: options.columns.map((column) => column.property && column.property.split('.')[0])
+        }
+        this.loading = true
+        return dzfQuestionService.exportExcel2(params).then(({data}) => {
+      // 将二进制流文件写入excel表,以下为重要步骤
+          this.$utils.downloadExcel(data, options.filename)
+          this.loading = false
+        }).catch(function (err) {
+          if (err.response) {
+            console.log(err.response)
+          }
+        })
+      },
     }
   }
 </script>