|
|
@@ -177,7 +177,8 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="设备型号" prop="deviceModel">
|
|
|
- <el-select @change="brandSelectChange1" style="width: 100%" v-model="form.deviceModel" placeholder="请选择设备型号">
|
|
|
+ <el-select @change="brandSelectChange1" style="width: 100%" v-model="form.deviceModel"
|
|
|
+ placeholder="请选择设备型号">
|
|
|
<el-option v-for="item in brandChildrenDictList" :key="item.id" :label="item.name"
|
|
|
:value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
@@ -287,22 +288,24 @@ import orgDropDown from "../../../components/orgTree/orgDropDown.vue";
|
|
|
import OrgTree from "@/components/orgTree";
|
|
|
import tableList from "@/mixins/tableList";
|
|
|
import {deptTreeSelect} from "@/api/system/public";
|
|
|
-import {getDeviceType} from "@/api/system/dict/data";
|
|
|
import {
|
|
|
addDevice,
|
|
|
+ checkExitSyncSubSystem,
|
|
|
delDevice,
|
|
|
- getDevice, getDictList,
|
|
|
- getDictTree, getDictTreeByParentId,
|
|
|
+ getDevice,
|
|
|
+ getDictList,
|
|
|
+ getDictTree,
|
|
|
+ getDictTreeByParentId,
|
|
|
getHostByOrgId,
|
|
|
listDevice,
|
|
|
- updateDevice,
|
|
|
+ updateDevice
|
|
|
} from "@/api/system/device";
|
|
|
import request from "@/utils/request";
|
|
|
|
|
|
export default {
|
|
|
/** 引入基础minxins*/
|
|
|
mixins: [tableList],
|
|
|
- dicts: ["sys_asset_type", "sys_device_type",'asset_status'],
|
|
|
+ dicts: ["sys_asset_type", "sys_device_type", 'asset_status'],
|
|
|
name: "Device",
|
|
|
components: {OrgTree, orgDropDown},
|
|
|
data() {
|
|
|
@@ -321,8 +324,8 @@ export default {
|
|
|
deviceName: [{required: true, message: "请输入设备名称", trigger: "change"}],
|
|
|
orgId: [{required: true, message: "请选择所属机构", trigger: "blur"}],
|
|
|
assetType: [{required: true, message: '请选择资产分类', trigger: 'change'}],
|
|
|
- /* hostId: [{required: true, message: '请选择主机', trigger: 'change'}],
|
|
|
- channel: [{required: true, message: '请输入通道号', trigger: 'change'}],*/
|
|
|
+ /* hostId: [{required: true, message: '请选择主机', trigger: 'change'}],
|
|
|
+ channel: [{required: true, message: '请输入通道号', trigger: 'change'}],*/
|
|
|
deviceType: [{required: true, message: "请选择设备分类", trigger: "change"}],
|
|
|
deviceStatus: [{required: true, message: "请选择资产状态", trigger: "blur"}],
|
|
|
},
|
|
|
@@ -484,7 +487,7 @@ export default {
|
|
|
this.upload.open = false;
|
|
|
this.upload.isUploading = false;
|
|
|
this.$refs.upload.clearFiles();
|
|
|
- if (response&&response.size >0) {
|
|
|
+ if (response && response.size > 0) {
|
|
|
this.$alert(
|
|
|
"导入失败,请根据返回的Excel检查文件内容"
|
|
|
);
|
|
|
@@ -719,7 +722,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
brandSelectChange1(val) {
|
|
|
- console.log(this.form.deviceModel,val)
|
|
|
+ console.log(this.form.deviceModel, val)
|
|
|
},
|
|
|
clearAsset() {
|
|
|
this.queryParams.deviceType = null;
|
|
|
@@ -732,7 +735,7 @@ export default {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "编辑设备信息";
|
|
|
- console.log(this.form.assetType,this.form.deviceBrand)
|
|
|
+ console.log(this.form.assetType, this.form.deviceBrand)
|
|
|
getDictTreeByParentId(this.form.assetType).then((response) => {
|
|
|
this.assetChildrenDictList = response.data;
|
|
|
});
|
|
|
@@ -746,16 +749,28 @@ export default {
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
if (this.form.id != null) {
|
|
|
- updateDevice(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess("处理成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
+ checkExitSyncSubSystem(this.form.orgId, this.form.deviceType, this.form.id).then((response) => {
|
|
|
+ if (response.code == 200 && response.data == 0) {
|
|
|
+ updateDevice(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess("处理成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return this.$modal.msgError("该机构已接入巡检主机,无需手动新增/编辑该类型设备");
|
|
|
+ }
|
|
|
});
|
|
|
} else {
|
|
|
- addDevice(this.form).then((response) => {
|
|
|
- this.$modal.msgSuccess("处理成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
+ checkExitSyncSubSystem(this.form.orgId, this.form.deviceType, null).then((response) => {
|
|
|
+ if (response.code == 200 && response.data == 0) {
|
|
|
+ addDevice(this.form).then((response) => {
|
|
|
+ this.$modal.msgSuccess("处理成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return this.$modal.msgError("该机构已接入巡检主机,无需手动新增/编辑该类型设备");
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|