From 232cdf071bfe3bd2b77ba05accba89b67fcc1edc Mon Sep 17 00:00:00 2001
From: Zhang-Hong-Lin <a3219986988@163.com>
Date: 星期四, 26 六月 2025 18:51:14 +0800
Subject: [PATCH] 优化bug与添加一键删除按钮

---
 项目代码/WCS/WIDESEAWCS_Client/src/components/basic/ViewGrid/methods.js |   85 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 85 insertions(+), 0 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/components/basic/ViewGrid/methods.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/components/basic/ViewGrid/methods.js"
index fa02eca..0763ff6 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/components/basic/ViewGrid/methods.js"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WIDESEAWCS_Client/src/components/basic/ViewGrid/methods.js"
@@ -1,4 +1,5 @@
 import detailMethods from './detailMethods.js';
+import axios from "axios";
 //涓氬姟澶勭悊鏂规硶,鍏ㄩ儴鍙互鐢卞紑鍙戣鐩�
 import serviceFilter from './serviceFilter.js';
 let methods = {
@@ -907,6 +908,85 @@
     this.modelOpenProcess();
     // this.modelOpenAfter();
   },
+  async complete(rows) {
+    this.boxOptions.title = '绔嬪嵆瀹屾垚';
+    this.currentAction = this.const.EDIT;
+    if (rows) {
+      if (!(rows instanceof Array)) {
+        rows = [rows];
+      }
+    } else {
+      rows = this.$refs.table.getSelected();
+    }
+    if (rows.length == 0) {
+      return this.$error('璇烽�夋嫨瑕佺紪杈戠殑琛�!');
+    }
+    if (rows.length != 1) {
+      return this.$error('鍙兘閫夋嫨涓�琛屾暟鎹繘琛岀紪杈�!');
+    }
+    //璁板綍褰撳墠缂栬緫鐨勮
+    this.currentRow = rows[0];
+    let w = this.currentRow.taskId;
+    axios.post("api/Task/AtOnceUpdate/?taskid=" + w, {}).then(x => {
+      alert("瀹屾垚");
+
+    })
+  },
+  async speciadelete(rows) {
+    this.boxOptions.title = '鐗规畩鍒犻櫎1';
+    this.currentAction = this.const.EDIT;
+    if (rows) {
+      if (!(rows instanceof Array)) {
+        rows = [rows];
+      }
+    } else {
+      rows = this.$refs.table.getSelected();
+    }
+    if (rows.length == 0) {
+      return this.$error('璇烽�夋嫨瑕佺紪杈戠殑琛�!');
+    }
+    if (rows.length != 1) {
+      return this.$error('鍙兘閫夋嫨涓�琛屾暟鎹繘琛岀紪杈�!');
+    }
+    //璁板綍褰撳墠缂栬緫鐨勮
+    this.currentRow = rows[0];
+    axios.post("api/Task/speciadelete/", this.currentRow).then(x => {
+      if (x.data.message == 1) {
+        alert("澶辫触");
+      } else {
+        alert("瀹屾垚");
+        this.refresh();
+      }
+    })
+  },
+  async speciaupdate(rows) {
+    this.boxOptions.title = '鐗规畩缂栬緫';
+    this.currentAction = this.const.EDIT;
+    if (rows) {
+      if (!(rows instanceof Array)) {
+        rows = [rows];
+      }
+    } else {
+      rows = this.$refs.table.getSelected();
+    }
+    if (rows.length == 0) {
+      return this.$error('璇烽�夋嫨瑕佺紪杈戠殑琛�!');
+    }
+    if (rows.length != 1) {
+      return this.$error('鍙兘閫夋嫨涓�琛屾暟鎹繘琛岀紪杈�!');
+    }
+    //璁板綍褰撳墠缂栬緫鐨勮
+    this.currentRow = rows[0];
+    let w = this.currentRow.taskId;
+    axios.post("api/Task/speciaupdate/", this.currentRow).then(x => {
+      if (x.data.message != 1) {
+        alert("澶辫触");
+      } else {
+        alert("瀹屾垚");
+        this.refresh();
+      }
+    })
+  },
   async edit(rows) {
     this.boxOptions.title = '缂栬緫';
     //缂栬緫
@@ -926,6 +1006,11 @@
     }
     //璁板綍褰撳墠缂栬緫鐨勮
     this.currentRow = rows[0];
+
+
+    console.log("123", this.currentRow);
+
+
     //鍒濆鍖栧脊鍑烘
     if (!(await this.initBox())) return;
     this.setContinueAdd(false);

--
Gitblit v1.9.3