Ver código fonte

添加开始按钮

asd123a20 2 anos atrás
pai
commit
17be9bce23
1 arquivos alterados com 16 adições e 16 exclusões
  1. 16 16
      src/views/community/task/index.vue

+ 16 - 16
src/views/community/task/index.vue

@@ -69,12 +69,13 @@
             v-hasPermi="['community:task:edit']"
           >结束</el-button>
           <el-button
+            v-if="scope.row.status == 0"
             size="mini"
             type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
+            icon="el-icon-check"
+            @click="start(scope.row)"
             v-hasPermi="['community:task:edit']"
-          >修改</el-button>
+          >开始</el-button>
           <el-button
             size="mini"
             type="text"
@@ -228,24 +229,23 @@ export default {
       this.open = true;
       this.title = "添加检测任务管理";
     },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const natTaskId = row.natTaskId || this.ids
-      getTask(natTaskId).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改检测任务管理";
+    /** 开始按钮操作 */
+    start(row) {
+      const { natTaskId } = row;
+      updateTask({ natTaskId, status: '1' }).then(response => {
+        this.$modal.msgSuccess("已结束");
+        this.open = false;
+        this.getList();
       });
     },
     /** 结束按钮操作 */
     close(row) {
       const { natTaskId } = row;
-       updateTask({ natTaskId, status: '2' }).then(response => {
-              this.$modal.msgSuccess("已结束");
-              this.open = false;
-              this.getList();
-            });
+      updateTask({ natTaskId, status: '2' }).then(response => {
+        this.$modal.msgSuccess("已结束");
+        this.open = false;
+        this.getList();
+      });
     },
     /** 提交按钮 */
     submitForm() {