|
|
@@ -89,6 +89,7 @@
|
|
|
v-model="addForm.categoryLevelId"
|
|
|
@changeNode="chooseClassify"
|
|
|
@setRootId="getRootId"
|
|
|
+ :disabled="isBindPlan"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -135,6 +136,7 @@
|
|
|
<deptSelect
|
|
|
v-model="addForm.groupId"
|
|
|
@changeGroup="searchDeptNodeClick"
|
|
|
+ :disabled="isBindPlan"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -163,6 +165,7 @@
|
|
|
dictName="紧急程度"
|
|
|
clearable
|
|
|
v-model="addForm.urgent"
|
|
|
+ :disabled="isBindPlan"
|
|
|
>
|
|
|
</DictSelection>
|
|
|
</el-form-item>
|
|
|
@@ -368,12 +371,6 @@
|
|
|
return '新增巡点检计划配置';
|
|
|
}
|
|
|
},
|
|
|
- isBindPlan: {
|
|
|
- type: Boolean,
|
|
|
- default: function () {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -452,7 +449,8 @@
|
|
|
ruleNameList: [],
|
|
|
addDialogLoading: false,
|
|
|
equipmentList: [],
|
|
|
- rootId: null
|
|
|
+ rootId: null,
|
|
|
+ isBindPlan:false
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
|
@@ -481,6 +479,7 @@
|
|
|
} else {
|
|
|
// 获取计划配置单号
|
|
|
this.getOrderCode(tips);
|
|
|
+ this.isBindPlan = false
|
|
|
this.planRuleEquiList = [];
|
|
|
this.matterRulesList = [];
|
|
|
}
|
|
|
@@ -489,6 +488,7 @@
|
|
|
async getInfo(id) {
|
|
|
const res = await getInfoById(id);
|
|
|
this.addForm = res;
|
|
|
+ this.isBindPlan = res.isBindPlan
|
|
|
this.categoryEquipment(res.categoryLevelId);
|
|
|
const params = { groupId: res.groupId };
|
|
|
this.getUserList(params);
|
|
|
@@ -497,7 +497,7 @@
|
|
|
this.$set(this.addForm, 'urgent', JSON.stringify(res.urgent));
|
|
|
this.$set(this.addForm, 'executeIdList', res.executeId.split(','));
|
|
|
this.$set(this.addForm, 'imageUrl', {});
|
|
|
- this._getEquipmentList(res.categoryId);
|
|
|
+ this._getEquipmentList(res.categoryId,this.isBindPlan);
|
|
|
let keys = [];
|
|
|
res.deviceInfo.map((item) => {
|
|
|
keys.push(item.substanceId);
|
|
|
@@ -538,35 +538,33 @@
|
|
|
async handleEquipmentClassChange(item) {
|
|
|
this.clickedTreeNode = true;
|
|
|
this.equipmentInfo = {};
|
|
|
- this._getEquipmentList(item.id);
|
|
|
+ this._getEquipmentList(item.id,this.isBindPlan);
|
|
|
},
|
|
|
// 封装 - 获取设备分类列表
|
|
|
- async _getEquipmentList(val) {
|
|
|
+ async _getEquipmentList(val,bind) {
|
|
|
const params = {
|
|
|
pageNum: 1,
|
|
|
size: -1,
|
|
|
categoryId: val,
|
|
|
rootCategoryLevelId: this.rootId
|
|
|
};
|
|
|
- try {
|
|
|
const res = await getAssetList(params);
|
|
|
- this.planRuleEquiList = res.list;
|
|
|
+ this.planRuleEquiList = res.list
|
|
|
+ if(!res.list.length) return
|
|
|
this.planRuleEquiList.map((item) => {
|
|
|
- item.showName = item.name + '(' + item.code + ')';
|
|
|
- });
|
|
|
- this.currentEquItemIndex = 0;
|
|
|
- const item = this.planRuleEquiList[0];
|
|
|
- const equiLocation = this.getEquiLocation(item);
|
|
|
+ item.showName = item.name + '(' + item.code + ')'
|
|
|
+ item.disabled = bind
|
|
|
+ })
|
|
|
+ this.currentEquItemIndex = 0
|
|
|
+ const item = this.planRuleEquiList[0]
|
|
|
this.$nextTick(() => {
|
|
|
- this.$refs.equiListTree.setCurrentKey(item.id);
|
|
|
+ this.$refs.equiListTree.setCurrentKey(item.id)
|
|
|
this.equipmentInfo = {
|
|
|
equiCode: item.code,
|
|
|
equiName: item.name,
|
|
|
equiModel: item.category.modelType,
|
|
|
- equiLocation: equiLocation
|
|
|
- };
|
|
|
- this.planRuleEquiList[0]['equiLocation'] = equiLocation;
|
|
|
-
|
|
|
+ equiLocation: item.position[0].pathName
|
|
|
+ }
|
|
|
// 对比详情返回的数据和设备分类下面所有的设备列表,将sparePart同步过去
|
|
|
if (this.addForm.deviceInfo) {
|
|
|
for (let i = 0; i < this.planRuleEquiList.length; i++) {
|
|
|
@@ -589,10 +587,7 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
- } catch (error) {
|
|
|
- this.planRuleEquiList = [];
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
// 获取审核人列表、巡点检人员
|
|
|
@@ -636,6 +631,7 @@
|
|
|
async categoryEquipment(id) {
|
|
|
const params = { categoryLevelId: id, pageNum: 1, size: -1 };
|
|
|
const data = await getCategory(params);
|
|
|
+ // this.addForm.categoryId = '';
|
|
|
this.equipmentList = data.list;
|
|
|
},
|
|
|
|
|
|
@@ -651,34 +647,20 @@
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // 封装 - 获取设备位置名称和code方法
|
|
|
- getEquiLocation(data) {
|
|
|
- // 设备位置名称
|
|
|
- const path = data.position[0].path;
|
|
|
- const arry = [];
|
|
|
- path.map((item) => {
|
|
|
- arry.push(item.name);
|
|
|
- });
|
|
|
- const equiLocation = arry.join('/');
|
|
|
- return equiLocation;
|
|
|
- },
|
|
|
// 设备列表树点击
|
|
|
handleNodeClick(data, node) {
|
|
|
- const equiLocation = this.getEquiLocation(data);
|
|
|
this.equipmentInfo = {
|
|
|
equiCode: data.code,
|
|
|
equiName: data.name,
|
|
|
equiId: data.id,
|
|
|
equiModel: data.category.modelType,
|
|
|
- equiLocation: equiLocation
|
|
|
+ equiLocation: data.position[0].pathName
|
|
|
};
|
|
|
// 保存当前点击的设备列表某节点的index,在添加操作事项的时候,可以将事项list放到对应的节点对象中,以及切换节点的时候回显事项list
|
|
|
this.currentEquItemIndex = this.planRuleEquiList.findIndex(
|
|
|
(item) => item.code === data.code
|
|
|
);
|
|
|
this.clickedTreeNode = true;
|
|
|
- this.planRuleEquiList[this.currentEquItemIndex]['equiLocation'] =
|
|
|
- equiLocation;
|
|
|
},
|
|
|
// 获取规则名列表
|
|
|
async _getRuleNameList() {
|