瀏覽代碼

删除判断2

wangzhuo 1 年之前
父節點
當前提交
800fdb3626

+ 26 - 12
src/views/iosBasicData/baccitemstype/index.vue

@@ -383,27 +383,41 @@ export default {
       });
     },
     rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return baccitemstypeRemove(row.id);
+      if (row.status === 1) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return baccitemstypeRemove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
+      } else {
+        this.$message({
+          message: '非禁用状态无法删除',
+          type: 'warning'
         });
+      }
     },
     handleDelete() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+
+      for (const selection of this.selectionList) {
+        if (selection.status == 0) {
+          this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
+          return;
+        }
+      }
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 26 - 12
src/views/iosBasicData/bcntrtypes/index.vue

@@ -600,27 +600,41 @@ export default {
       });
     },
     rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return bcntrtypesRemove(row.id);
+      if (row.status === 1) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return bcntrtypesRemove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
+      } else {
+        this.$message({
+          message: '非禁用状态无法删除',
+          type: 'warning'
         });
+      }
     },
     handleDelete() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+      
+      for (const selection of this.selectionList) {
+        if (selection.status == 0) {
+          this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
+          return;
+        }
+      }
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 7 - 0
src/views/iosBasicData/bcommodity/index.vue

@@ -430,6 +430,13 @@ export default {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+
+      for (const selection of this.selectionList) {
+        if (selection.status == 0) {
+          this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
+          return;
+        }
+      }
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 0 - 1
src/views/iosBasicData/bcorps/index.vue

@@ -319,7 +319,6 @@ export default {
           {
             label: "国家代码",
             prop: "cntyCode",
-            search: true,
             rules: [{
               required: true,
               message: "请输入国家代码",

+ 26 - 12
src/views/iosBasicData/bfeesdefine/index.vue

@@ -582,27 +582,41 @@ export default {
       });
     },
     rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return bfeesRemove(row.id);
+      if (row.status === 1) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return bfeesRemove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
+      } else {
+        this.$message({
+          message: '非禁用状态无法删除',
+          type: 'warning'
         });
+      }
     },
     handleDelete() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+
+      for (const selection of this.selectionList) {
+        if (selection.status == 0) {
+          this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
+          return;
+        }
+      }
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 26 - 12
src/views/iosBasicData/blines/index.vue

@@ -524,27 +524,41 @@ export default {
       });
     },
     rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return blinesRemove(row.id);
+      if (row.status === 1) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return blinesRemove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
+      } else {
+        this.$message({
+          message: '非禁用状态无法删除',
+          type: 'warning'
         });
+      }
     },
     handleDelete() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+
+      for (const selection of this.selectionList) {
+        if (selection.status == 0) {
+          this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
+          return;
+        }
+      }
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",

+ 26 - 12
src/views/iosBasicData/losbfeestemplate/index.vue

@@ -535,27 +535,41 @@ export default {
       });
     },
     rowDel(row) {
-      this.$confirm("确定将选择数据删除?", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      })
-        .then(() => {
-          return losbfeestemplateRemove(row.id);
+      if (row.status === 1) {
+        this.$confirm("确定将选择数据删除?", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
         })
-        .then(() => {
-          this.onLoad(this.page);
-          this.$message({
-            type: "success",
-            message: "操作成功!"
+          .then(() => {
+            return losbfeestemplateRemove(row.id);
+          })
+          .then(() => {
+            this.onLoad(this.page);
+            this.$message({
+              type: "success",
+              message: "操作成功!"
+            });
           });
+      } else {
+        this.$message({
+          message: '非禁用状态无法删除',
+          type: 'warning'
         });
+      }
     },
     handleDelete() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
         return;
       }
+
+      for (const selection of this.selectionList) {
+        if (selection.status == 0) {
+          this.$message.warning("选中的数据中有启用数据,启用数据不可删除!");
+          return;
+        }
+      }
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",