Преглед изворни кода

SAI开项管理 - 导出加勾选

wangggziwen пре 1 година
родитељ
комит
3ce50b108c

+ 2 - 2
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -281,8 +281,8 @@ public class TSaiApplyController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('production:apply:export')")
     @Log(title = "SAI开项管理", businessType = BusinessType.EXPORT)
-    @GetMapping("/export")
-    public AjaxResult export(SaiApplyQueryVO tSaiApply)
+    @PutMapping("/export")
+    public AjaxResult export(@RequestBody SaiApplyQueryVO tSaiApply)
     {
         List<SysUser> userList = userService.selectUserList(new SysUser());
         Map<Long, String> nameMap = new HashMap<Long, String>();

+ 10 - 0
master/src/main/java/com/ruoyi/project/production/controller/vo/SaiApplyQueryVO.java

@@ -24,6 +24,8 @@ public class SaiApplyQueryVO extends BaseEntity {
     /** 主键 */
     private Long saiApplyId;
 
+    private Long[] ids;
+
     /** tab,1待处理,2我的,3总数据 */
     private int tab;
 
@@ -174,6 +176,14 @@ public class SaiApplyQueryVO extends BaseEntity {
     /** 备注(执行阶段) */
     private String remarksExecute;
 
+    public Long[] getIds() {
+        return ids;
+    }
+
+    public void setIds(Long[] ids) {
+        this.ids = ids;
+    }
+
     public String getWorkArea() {
         return workArea;
     }

+ 5 - 0
master/src/main/resources/mybatis/production/TSaiApplyMapper.xml

@@ -111,6 +111,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="remarksAssess != null  and remarksAssess != ''"> and remarks_assess = #{remarksAssess}</if>
             <if test="remarksExecute != null  and remarksExecute != ''"> and remarks_execute = #{remarksExecute}</if>
             <if test="workArea != null  and workArea != ''"> and instr(#{workArea}, work_area ) > 0 </if>
+            <if test="ids != null and ids.length > 0"> and sai_apply_id in
+                <foreach item="id" collection="ids" open="(" separator="," close=")">
+                    #{id}
+                </foreach>
+            </if>
             and d.del_flag = 0
         </where>
         order by APPLY_DATE desc

+ 2 - 2
ui/src/api/production/apply.js

@@ -73,7 +73,7 @@ export function delApply(saiApplyId) {
 export function exportApply(query) {
   return request({
     url: '/production/apply/export',
-    method: 'get',
-    params: query
+    method: 'put',
+    data: query
   })
 }

+ 44 - 7
ui/src/views/production/apply/all/index.vue

@@ -140,7 +140,16 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['production:apply:export']"
-        >导出</el-button>
+        >导出全部</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExportSelected"
+          v-hasPermi="['production:apply:export']"
+        >导出选中数据</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -1383,6 +1392,8 @@ export default {
       this.queryParams.tab = 3;
       if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
         this.queryParams.workArea = this.queryParams.workArea.join();
+      } else {
+        this.queryParams.workArea = "";
       }
       listApply(this.queryParams).then(response => {
         if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
@@ -1636,18 +1647,44 @@ export default {
           this.msgSuccess("删除成功");
         })
     },
-    /** 导出按钮操作 */
+    /** 导出全部按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return exportApply(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
+    },
+    /** 导出选中数据按钮操作 */
+    handleExportSelected() {
+      if (this.ids.length==0){
+        return this.$alert('请选择要导出的数据项!', "警告", {
           confirmButtonText: "确定",
-          cancelButtonText: "取消",
           type: "warning"
-        }).then(function() {
-          return exportApply(queryParams);
-        }).then(response => {
-          this.download(response.msg);
         })
+      }
+      if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
+        this.queryParams.workArea = this.queryParams.workArea.join();
+      } else {
+        this.queryParams.workArea = "";
+      }
+      const queryParams = this.queryParams;
+      queryParams.ids=this.ids;
+      console.log(queryParams)
+      this.$confirm('是否确认导出选中的SAI开项管理数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function () {
+        return exportApply(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+      })
     },
       /** 导入按钮操作 */
       handleImport() {

+ 39 - 2
ui/src/views/production/apply/mine/index.vue

@@ -140,7 +140,16 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['production:apply:export']"
-        >导出</el-button>
+        >导出全部</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExportSelected"
+          v-hasPermi="['production:apply:export']"
+        >导出选中数据</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -1389,6 +1398,8 @@
           this.queryParams.tab = 2;
           if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
             this.queryParams.workArea = this.queryParams.workArea.join();
+          } else {
+            this.queryParams.workArea = "";
           }
           listApply(this.queryParams).then(response => {
             if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
@@ -1654,7 +1665,7 @@
           this.msgSuccess("删除成功");
         })
       },
-      /** 导出按钮操作 */
+      /** 导出全部按钮操作 */
       handleExport() {
         const queryParams = this.queryParams;
         this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
@@ -1667,6 +1678,32 @@
           this.download(response.msg);
         })
       },
+      /** 导出选中数据按钮操作 */
+      handleExportSelected() {
+        if (this.ids.length==0){
+          return this.$alert('请选择要导出的数据项!', "警告", {
+            confirmButtonText: "确定",
+            type: "warning"
+          })
+        }
+        if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
+          this.queryParams.workArea = this.queryParams.workArea.join();
+        } else {
+          this.queryParams.workArea = "";
+        }
+        const queryParams = this.queryParams;
+        queryParams.ids=this.ids;
+        console.log(queryParams)
+        this.$confirm('是否确认导出选中的SAI开项管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function () {
+          return exportApply(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+      },
       /** 导入按钮操作 */
       handleImport() {
         this.upload.title = "用户导入";

+ 39 - 2
ui/src/views/production/apply/pending/index.vue

@@ -140,7 +140,16 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['production:apply:export']"
-        >导出</el-button>
+        >导出全部</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExportSelected"
+          v-hasPermi="['production:apply:export']"
+        >导出选中数据</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -1388,6 +1397,8 @@
           this.queryParams.tab = 1;
           if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
             this.queryParams.workArea = this.queryParams.workArea.join();
+          } else {
+            this.queryParams.workArea = "";
           }
           listApply(this.queryParams).then(response => {
             if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
@@ -1650,7 +1661,7 @@
           this.msgSuccess("删除成功");
         })
       },
-      /** 导出按钮操作 */
+      /** 导出全部按钮操作 */
       handleExport() {
         const queryParams = this.queryParams;
         this.$confirm('是否确认导出所有SAI开项管理数据项?', "警告", {
@@ -1663,6 +1674,32 @@
           this.download(response.msg);
         })
       },
+      /** 导出选中数据按钮操作 */
+      handleExportSelected() {
+        if (this.ids.length==0){
+          return this.$alert('请选择要导出的数据项!', "警告", {
+            confirmButtonText: "确定",
+            type: "warning"
+          })
+        }
+        if (this.queryParams.workArea != null && this.queryParams.workArea != "") {
+          this.queryParams.workArea = this.queryParams.workArea.join();
+        } else {
+          this.queryParams.workArea = "";
+        }
+        const queryParams = this.queryParams;
+        queryParams.ids=this.ids;
+        console.log(queryParams)
+        this.$confirm('是否确认导出选中的SAI开项管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function () {
+          return exportApply(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+      },
       /** 导入按钮操作 */
       handleImport() {
         this.upload.title = "用户导入";