From 19bf6d810481ae2239aa88a2ba04316c1e2be630 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期二, 27 十二月 2022 19:44:35 +0800
Subject: [PATCH] 数据申请

---
 src/api/api.js                        |   19 ++++++++-
 src/views/Archive/dataApplication.vue |   61 ++++++++++++++++++++++++++++--
 2 files changed, 73 insertions(+), 7 deletions(-)

diff --git a/src/api/api.js b/src/api/api.js
index f175bd6..2e7f5e2 100644
--- a/src/api/api.js
+++ b/src/api/api.js
@@ -681,9 +681,22 @@
 export function apply_selectFlows(params) {
   return request.get('/apply/selectFlows', { params: params });
 }
-
-
-
+//鏁版嵁鐢宠=銆嬪簾寮冪敵璇�
+export function apply_updateForDiscard(params) {
+  return request.get('/apply/updateForDiscard', { params: params });
+}
+//鏁版嵁鐢宠=銆嬫彁浜ゆ祦绋�
+export function apply_updateForSubmit(params) {
+  return request.get('/apply/updateForSubmit', { params: params });
+}
+//鏁版嵁鐢宠=銆嬫墦鍥炵敵璇�
+export function apply_updateForReject(params) {
+  return request.get('/apply/updateForReject', { params: params });
+}
+//鏁版嵁鐢宠=銆嬮噸鏂版彁浜�
+export function apply_updateForResubmit(params) {
+  return request.get('/apply/updateForResubmit', { params: params });
+}
 
 //璇锋眰绔欏満鐐瑰唴瀹�
 export function querySitePoint(size, index, name) {
diff --git a/src/views/Archive/dataApplication.vue b/src/views/Archive/dataApplication.vue
index a4295a3..99c1034 100644
--- a/src/views/Archive/dataApplication.vue
+++ b/src/views/Archive/dataApplication.vue
@@ -131,17 +131,17 @@
           :label="$t('common.operate')"
         >
           <template slot-scope="scope">
-
             <el-button
               type="danger"
               size="mini"
+              @click="handleApplyCancel(scope.$index, scope.row)"
               v-if="matchState(scope,/[]/)"
               plain
             >{{$t('dataApply.type1')}}</el-button>
-
             <el-button
               type="warning"
               size="mini"
+              @click="handleReApply(scope.$index, scope.row)"
               v-if="matchState1(scope,/[]/)"
               plain
             >{{$t('dataApply.ReApply')}}</el-button>
@@ -247,12 +247,16 @@
             <template slot-scope="scope">
 
               <el-button
+                v-if="scope.row.status == 0"
                 type="danger"
                 size="mini"
+                @click="handleApplyRepulse(scope.$index, scope.row)"
                 plain
               >鎵撳洖</el-button>
 
               <el-button
+                v-if="scope.row.status == 0"
+                @click="handleApplyAdopt(scope.$index, scope.row)"
                 type="success"
                 size="mini"
                 plain
@@ -271,7 +275,11 @@
 import MyBread from "../../components/MyBread.vue";
 import {
   apply_selectByPage,
-  apply_selectFlows
+  apply_selectFlows,
+  apply_updateForDiscard,
+  apply_updateForSubmit,
+  apply_updateForReject,
+  apply_updateForResubmit
 } from "../../api/api";
 export default {
   //import寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢�
@@ -299,14 +307,59 @@
         status: null
       },
       count: 0,
+      detailsId: null,
     };
   },
   methods: {
+    async handleApplyRepulse(index, row) {
+      const data = await apply_updateForReject({ flowId: row.id });
+      if (data.code != 200) {
+        return this.$message.error("鍒楄〃璋冪敤澶辫触");
+      }
+      this.showRestData();
+    },
+    async handleApplyAdopt(index, row) {
+
+      const data = await apply_updateForSubmit({ flowId: row.id });
+      if (data.code != 200) {
+        return this.$message.error("鍒楄〃璋冪敤澶辫触");
+      }
+      this.showRestData();
+    },
+    async showRestData() {
+      const data1 = await apply_selectFlows({
+        applyid:
+          this.detailsId
+      })
+      if (data1.code != 200) {
+        return this.$message.error("鍒楄〃璋冪敤澶辫触");
+      }
+      this.detailsFrom.tableData = data.result;
+    },
+    async handleReApply(index, row) {
+      const data = await apply_updateForResubmit({ applyid: row.id });
+      if (data.code != 200) {
+        return this.$message.error("鍒楄〃璋冪敤澶辫触");
+      }
+      this.listData.pageIndex = 1;
+      this.listData.pageSize = 10;
+      this.getAllData();
+    },
+    async handleApplyCancel(index, row) {
+      const data = await apply_updateForDiscard({ applyid: row.id });
+      if (data.code != 200) {
+        return this.$message.error("鍒楄〃璋冪敤澶辫触");
+      }
+      this.listData.pageIndex = 1;
+      this.listData.pageSize = 10;
+      this.getAllData();
+    },
     async handlDetails(index, row) {
 
+      this.detailsId = row.id;
       const data = await apply_selectFlows({ applyid: row.id })
       if (data.code != 200) {
-
+        return this.$message.error("鍒楄〃璋冪敤澶辫触");
       }
       this.detailsFrom.tableData = data.result;
       this.detailsFrom.tabs = row.tabs;

--
Gitblit v1.9.3