Pārlūkot izejas kodu

未选择公司时不可启用模具

Reiskuchen 5 gadi atpakaļ
vecāks
revīzija
826a4b539a
1 mainītis faili ar 29 papildinājumiem un 22 dzēšanām
  1. 29 22
      ys_vue/src/views/base/allocation.vue

+ 29 - 22
ys_vue/src/views/base/allocation.vue

@@ -435,32 +435,39 @@
 
             //启用设备
             enable() {
-                this.operateDialogVisible = false;
-                this.allocations[this.activeIndex].isUse = 1;
-                this.http.post( this.port.base.enableMould, {
-                    id: this.allocations[this.activeIndex].id,
-                    isUse: 1
-                },
-                res => {
-                    if (res.code == "ok") {
-                        this.$message({
-                            message: "修改成功",
-                            type: "success"
-                        });
-                        this.getMoulds();
-                    } else {
+                if(this.allocations[this.activeIndex].belongCompanyId == null){
+                    this.$message({
+                        message: "填写所属公司后才能启用模具",
+                        type: "error"
+                    });
+                }else{
+                    this.operateDialogVisible = false;
+                    this.allocations[this.activeIndex].isUse = 1;
+                    this.http.post( this.port.base.enableMould, {
+                        id: this.allocations[this.activeIndex].id,
+                        isUse: 1
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            this.$message({
+                                message: "修改成功",
+                                type: "success"
+                            });
+                            this.getMoulds();
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
                         this.$message({
-                            message: res.msg,
+                            message: error,
                             type: "error"
                         });
-                    }
-                },
-                error => {
-                    this.$message({
-                        message: error,
-                        type: "error"
                     });
-                });
+                }
             }
         },
         created() {