ソースを参照

删除判断3

wangzhuo 1 年間 前
コミット
5f07a1194c
1 ファイル変更21 行追加14 行削除
  1. 21 14
      src/views/iosBasicData/rateManagement/index.vue

+ 21 - 14
src/views/iosBasicData/rateManagement/index.vue

@@ -237,21 +237,28 @@ export default {
       this.isShow = false;
     },
     rowDel(row, index, done) {
-      this.$confirm("确定删除数据?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        deleteDetails(row.id).then(res => {
-          if (res.data.code == 200) {
-            this.$message({
-              type: "success",
-              message: "删除成功!"
-            });
-            this.onLoad(this.page, this.search);
-          }
+      if (row.status === 1) {
+        this.$confirm("确定删除数据?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          deleteDetails(row.id).then(res => {
+            if (res.data.code == 200) {
+              this.$message({
+                type: "success",
+                message: "删除成功!"
+              });
+              this.onLoad(this.page, this.search);
+            }
+          });
+        });
+      } else {
+        this.$message({
+          message: '非禁用状态无法删除',
+          type: 'warning'
         });
-      });
+      }
     },
     goBack() {
       if (this.$route.query.check) {