From 628fd01beea81bac2f0299472d528860ae07cf3f Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期日, 02 六月 2024 10:52:30 +0800
Subject: [PATCH] 测试完成

---
 src/views/followvisit/tasklist/index.vue |  131 +++++++++++++++++++++++++++++--------------
 1 files changed, 89 insertions(+), 42 deletions(-)

diff --git a/src/views/followvisit/tasklist/index.vue b/src/views/followvisit/tasklist/index.vue
index 71c8e71..a04d02e 100644
--- a/src/views/followvisit/tasklist/index.vue
+++ b/src/views/followvisit/tasklist/index.vue
@@ -105,7 +105,6 @@
             size="medium"
             :disabled="single"
             @click="handleUpdate"
-
             >淇敼</el-button
           >
         </el-col>
@@ -149,7 +148,13 @@
         @selection-change="handleSelectionChange"
       >
         <el-table-column type="selection" width="50" align="center" />
-        <el-table-column label="搴忓彿" fixed align="center" key="taskid" prop="taskid" />
+        <el-table-column
+          label="搴忓彿"
+          fixed
+          align="center"
+          key="taskid"
+          prop="taskid"
+        />
 
         <el-table-column
           label="浠诲姟鍚嶇О"
@@ -172,9 +177,8 @@
           key="nickName"
           prop="nickName"
         >
-
           <template slot-scope="scope">
-            <span>{{ scope.row.wfs}}/{{ scope.row.yfs }}</span>
+            <span>{{ scope.row.wfs }}/{{ scope.row.yfs }}</span>
           </template>
         </el-table-column>
         <el-table-column
@@ -214,21 +218,35 @@
         >
           <template slot-scope="scope">
             <el-button
+              v-if="scope.row.sendState == 1 || scope.row.sendState == 3"
               size="medium"
               type="text"
-              @click="handleUpdate(scope.row)"
-
+              @click="sponsor(scope.row)"
               ><span class="button-zx"
                 ><i class="el-icon-s-promotion"></i>浠诲姟鍙戣捣</span
               ></el-button
             >
             <el-button
+              v-if="scope.row.sendState == 1 || scope.row.sendState == 3"
               size="medium"
               type="text"
-              @click="handleUpdate(scope.row)"
-
-              ><span class="button-zx"
-                ><i class="el-icon-s-promotion"></i>渚濈収鏂板</span
+              @click="immediateExecution(scope.row)"
+              ><span class="button-lj"
+                ><i class="el-icon-s-promotion"></i>绔嬪嵆鎵ц</span
+              ></el-button
+            >
+            <el-button size="medium" type="text" @click="newAdd(scope.row)"
+              ><span class="button-xj"
+                ><i class="el-icon-circle-plus-outline"></i>渚濈収鏂板</span
+              ></el-button
+            >
+            <el-button
+              v-if="scope.row.sendState == 2"
+              size="medium"
+              type="text"
+              @click="stop(scope.row)"
+              ><span class="button-zt"
+                ><i class="el-icon-circle-plus-outline"></i>鏆傚仠浠诲姟</span
               ></el-button
             >
           </template>
@@ -333,7 +351,13 @@
   resetUserPwd,
   changeUserStatus,
 } from "@/api/system/user";
-import { getTasklist, getTaskInfo } from "@/api/AiCentre/index";
+import {
+  getTasklist,
+  getTaskInfo,
+  Editsingletask,
+  delTaskInfo,
+  TaskTemplateSendExecution,
+} from "@/api/AiCentre/index";
 
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -376,6 +400,7 @@
       inputVisible: false,
       inputValue: "",
       previewVisible: false, //闂ㄨ瘖闅忚棰勮寮规
+      TaskOperation: {},
       radio: "",
       radios: [],
       previewtype: 2, //棰勮闂ㄨ瘖闅忚绫诲瀷
@@ -623,21 +648,7 @@
         this.options = [];
       }
     },
-    // 闂ㄨ瘖闅忚鐘舵�佷慨鏀�
-    handleStatusChange(row) {
-      let text = row.status === "0" ? "鍚敤" : "鍋滅敤";
-      this.$modal
-        .confirm('纭瑕�"' + text + '""' + row.userName + '"鐢ㄦ埛鍚楋紵')
-        .then(function () {
-          return changeUserStatus(row.userId, row.status);
-        })
-        .then(() => {
-          this.$modal.msgSuccess(text + "鎴愬姛");
-        })
-        .catch(function () {
-          row.status = row.status === "0" ? "1" : "0";
-        });
-    },
+
     // 鍙栨秷鎸夐挳
     cancel() {
       this.addalteropen = false;
@@ -715,22 +726,37 @@
       });
     },
     // 鍒犻櫎浠诲姟
-    deletefn(){},
-    /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */
-    handleResetPwd(row) {
-      this.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", {
-        confirmButtonText: "纭畾",
-        cancelButtonText: "鍙栨秷",
-        closeOnClickModal: false,
-        inputPattern: /^.{5,20}$/,
-        inputErrorMessage: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿",
-      })
-        .then(({ value }) => {
-          resetUserPwd(row.userId, value).then((response) => {
-            this.$modal.msgSuccess("淇敼鎴愬姛锛屾柊瀵嗙爜鏄細" + value);
-          });
-        })
-        .catch(() => {});
+    deletefn() {},
+    // 浠诲姟鍙戣捣
+    sponsor(row) {
+      console.log(row, "浠诲姟淇℃伅");
+      if (row.sendState != 2) {
+        this.TaskOperation.taskId = row.taskid;
+        this.TaskOperation.sendState = 2;
+        TaskTemplateSendExecution(this.TaskOperation).then((res) => {});
+      }
+    },
+    immediateExecution(row) {
+      console.log(row, "浠诲姟淇℃伅");
+      if (row.sendState != 2) {
+        this.TaskOperation.taskId = row.taskid;
+        this.TaskOperation.sendState = 2;
+        this.TaskOperation.sendType = 2;
+        TaskTemplateSendExecution(this.TaskOperation).then((res) => {});
+      }
+    },
+
+    // 渚濈収鏂板
+    newAdd(row) {
+      TaskTemplateSendExecution().then((res) => {});
+    },
+    // 鏆傚仠
+    stop(row) {
+      if (row.sendState == 2) {
+        this.TaskOperation.taskId = row.taskId;
+        this.TaskOperation.sendState = 3;
+        TaskTemplateSendExecution().then((res) => {});
+      }
     },
 
     /** 鎻愪氦鎸夐挳 */
@@ -888,6 +914,24 @@
   border-radius: 1px;
   color: #ffffff;
 }
+.button-lj {
+  background: #e9614f;
+  padding: 5px;
+  border-radius: 1px;
+  color: #ffffff;
+}
+.button-xj {
+  background: #815c94;
+  padding: 5px;
+  border-radius: 1px;
+  color: #ffffff;
+}
+.button-zt {
+  background: #f9c116;
+  padding: 5px;
+  border-radius: 1px;
+  color: #ffffff;
+}
 
 ::v-deep.el-radio-group {
   span {
@@ -895,6 +939,9 @@
   }
 }
 
+::v-deep.el-button + .el-button {
+  margin-left: 0;
+}
 ::v-deep.el-checkbox-group {
   span {
     font-size: 24px;

--
Gitblit v1.9.3