|
@@ -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() {
|