|
@@ -66,8 +66,8 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <el-button @click="onCancel">取消</el-button>
|
|
|
|
- <el-button type="primary" @click="addSubDevice">立即创建</el-button>
|
|
|
|
|
|
+ <el-button @click="onCancel">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="addSubDevice">保 存</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -87,7 +87,7 @@ export default {
|
|
showAddSubDevice: false,
|
|
showAddSubDevice: false,
|
|
form: {
|
|
form: {
|
|
// deviceNo: "",
|
|
// deviceNo: "",
|
|
- communicationId: null,
|
|
|
|
|
|
+ communicationId: '',
|
|
channelNo: "",
|
|
channelNo: "",
|
|
// hardTypeId: null,
|
|
// hardTypeId: null,
|
|
enable: 1
|
|
enable: 1
|
|
@@ -134,7 +134,7 @@ export default {
|
|
api: "/device/device-slave/delete",
|
|
api: "/device/device-slave/delete",
|
|
method: "POST",
|
|
method: "POST",
|
|
data: {
|
|
data: {
|
|
- communicationId: row.communicationId
|
|
|
|
|
|
+ id: row.id
|
|
},
|
|
},
|
|
success: res => {
|
|
success: res => {
|
|
this.subDeviceList = res;
|
|
this.subDeviceList = res;
|
|
@@ -143,8 +143,13 @@ export default {
|
|
},
|
|
},
|
|
fail: err => {
|
|
fail: err => {
|
|
console.log(err);
|
|
console.log(err);
|
|
- if (err.errMsg) this.$message.error(err.errMsg);
|
|
|
|
- else this.$message.error("服务器发生异常");
|
|
|
|
|
|
+ if (err.errCode == '200') {
|
|
|
|
+ this.$message.error(err.errMsg);
|
|
|
|
+ // 获取子设备信息列表
|
|
|
|
+ this.doSubDeviceList();
|
|
|
|
+ } else if(err.errMsg) {
|
|
|
|
+ this.$message.success(err.errMsg);
|
|
|
|
+ } else this.$message.error("服务器发生异常");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|