Quellcode durchsuchen

支部党费收支管理导出

Wang Zi Wen vor 1 Jahr
Ursprung
Commit
0e7294739c

+ 19 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/branch/TBranchDuesController.java

@@ -5,6 +5,8 @@ import java.math.BigInteger;
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 
+import com.ruoyi.common.core.domain.entity.SysDictData;
+import com.ruoyi.system.service.ISysDictTypeService;
 import com.ruoyi.web.controller.branch.vo.CalcVO;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +40,9 @@ public class TBranchDuesController extends BaseController
     @Autowired
     private ITBranchDuesService tBranchDuesService;
 
+    @Autowired
+    private ISysDictTypeService sysDictTypeService;
+
     /**
      * 查询支部党费计算
      */
@@ -95,7 +100,21 @@ public class TBranchDuesController extends BaseController
     @PostMapping("/export")
     public void export(HttpServletResponse response, TBranchDues tBranchDues)
     {
+        List<SysDictData> duesInOut = sysDictTypeService.selectDictDataByType("dues_in_out");
+        List<SysDictData> duesType = sysDictTypeService.selectDictDataByType("dues_type");
         List<TBranchDues> list = tBranchDuesService.selectTBranchDuesList(tBranchDues);
+        for (TBranchDues branchDues : list) {
+            for (SysDictData data : duesInOut) {
+                if (data.getDictValue().equals(branchDues.getDuesInOut())) {
+                    branchDues.setDuesInOut(data.getDictLabel());
+                }
+            }
+            for (SysDictData data : duesType) {
+                if (data.getDictValue().equals(branchDues.getDuesType())) {
+                    branchDues.setDuesType(data.getDictLabel());
+                }
+            }
+        }
         ExcelUtil<TBranchDues> util = new ExcelUtil<TBranchDues>(TBranchDues.class);
         util.exportExcel(response, list, "支部党费收支管理数据");
     }

+ 3 - 5
ruoyi-system/src/main/java/com/ruoyi/branch/domain/TBranchDues.java

@@ -18,7 +18,6 @@ public class TBranchDues extends BaseEntity
     private static final long serialVersionUID = 1L;
 
     /** 主键id */
-    @Excel(name = "主键id")
     private Long duesId;
 
     /** 年份 */
@@ -26,7 +25,7 @@ public class TBranchDues extends BaseEntity
 
     /** 时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @Excel(name = "时间", dateFormat = "yyyy-MM-dd")
     private Date duesTime;
 
     /** 项目 */
@@ -34,11 +33,11 @@ public class TBranchDues extends BaseEntity
     private String duesItem;
 
     /** 党费进出,1收/0支 */
-    @Excel(name = "党费进出,1收/0支")
+    @Excel(name = "收/支")
     private String duesInOut;
 
     /** 支付类型,1账面/0现金 */
-    @Excel(name = "支付类型,1账面/0现金")
+    @Excel(name = "账面/现金")
     private String duesType;
 
     /** 金额 */
@@ -53,7 +52,6 @@ public class TBranchDues extends BaseEntity
     private String delFlag;
 
     /** 部门id */
-    @Excel(name = "部门id")
     private Long deptId;
 
     public void setDuesId(Long duesId) 

+ 14 - 21
ruoyi-ui/src/views/branch/zbjs/dues/index.vue

@@ -60,16 +60,16 @@
           <!--v-hasPermi="['branch:dues:edit']"-->
         <!--&gt;导入</el-button>-->
       <!--</el-col>-->
-      <!--<el-col :span="1.5">-->
-        <!--<el-button-->
-          <!--type="warning"-->
-          <!--plain-->
-          <!--icon="el-icon-download"-->
-          <!--size="mini"-->
-          <!--@click="handleExport"-->
-          <!--v-hasPermi="['branch:dues:export']"-->
-        <!--&gt;导出</el-button>-->
-      <!--</el-col>-->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['branch:dues:export']"
+        >导出</el-button>
+      </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -192,7 +192,7 @@
                 <em>点击上传</em>
             </div>
             <div class="el-upload__tip" slot="tip">
-                <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
+                <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
                 <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
             </div>
             <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
@@ -512,16 +512,9 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有支部党费收支数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return exportDues(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-        })
+      this.download('branch/dues/export', {
+        ...this.queryParams
+      }, `党费收支_${new Date().getTime()}.xlsx`)
     },
       /** 导入按钮操作 */
       handleImport() {