|
|
@@ -308,6 +308,7 @@
|
|
|
import { getById } from '@/api/maintenance/patrol_maintenance';
|
|
|
import { getList } from '@/api/classifyManage/itemInformation';
|
|
|
import { planConfigPage } from '@/api/ruleManagement/plan';
|
|
|
+ import { getTreeByType } from '@/api/classifyManage';
|
|
|
export default {
|
|
|
name: 'addPatrolPlanDialog',
|
|
|
components: {
|
|
|
@@ -409,7 +410,7 @@
|
|
|
computed: {},
|
|
|
async created() {},
|
|
|
methods: {
|
|
|
- open(title, row) {
|
|
|
+ async open(title, row) {
|
|
|
this.dialogTitle = title;
|
|
|
this.formLabel = this.dialogTitle.includes('巡点检')
|
|
|
? '巡点检'
|
|
|
@@ -425,7 +426,11 @@
|
|
|
if (row?.id) {
|
|
|
// 编辑
|
|
|
this.addForm.id = row.id;
|
|
|
- this.getInfo(this.addForm.id);
|
|
|
+
|
|
|
+ await this.getInfo(this.addForm.id);
|
|
|
+
|
|
|
+ const res = await getTreeByType(0); //设备数据
|
|
|
+ this.rootData = res.data;
|
|
|
} else {
|
|
|
// 新增
|
|
|
this.addForm.planType = planRuleTypeObj[this.formLabel];
|
|
|
@@ -447,9 +452,16 @@
|
|
|
data.groupId = data.executor[0].groupName;
|
|
|
}
|
|
|
this.addForm = data;
|
|
|
-
|
|
|
+ const params = { groupId: this.addForm.executor[0].groupId };
|
|
|
+ setTimeout(async () => {
|
|
|
+ await this.$refs.executorRef.getList(params);
|
|
|
+ await this.chooseClassify(this.addForm.categoryLevelId);
|
|
|
+ }, 100);
|
|
|
this.categoryEquipment(this.addForm.categoryLevelId);
|
|
|
|
|
|
+ if (this.dialogTitle == '编辑保养计划') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (this.rootId) {
|
|
|
this._getEquipmentList();
|
|
|
} else {
|
|
|
@@ -593,10 +605,8 @@
|
|
|
rootCategoryLevelId: this.rootId ? this.rootId : ''
|
|
|
};
|
|
|
try {
|
|
|
- console.log('1', params);
|
|
|
const res = await getAssetList(params);
|
|
|
this.addForm.categoryId = res.list[0]?.categoryId;
|
|
|
- console.log('res====', res);
|
|
|
this.planDeviceList = res.list;
|
|
|
this.planDeviceList.map((item) => {
|
|
|
item.showName = item.name + '(' + item.code + ')';
|
|
|
@@ -652,6 +662,7 @@
|
|
|
},
|
|
|
//选择部门(搜索)
|
|
|
searchDeptNodeClick(info) {
|
|
|
+ console.log('==info', info);
|
|
|
// 根据部门获取人员
|
|
|
const params = { groupId: info };
|
|
|
this.$nextTick(() => {
|
|
|
@@ -691,8 +702,7 @@
|
|
|
// 规则名称下拉触发
|
|
|
handleRuleNameChange(val) {
|
|
|
// this._getMatterRulesDetails(val);
|
|
|
- const id = this.ruleNameList.find((item) => item.id == val).ruleId;
|
|
|
- this.$refs.ruleItemSelectionRef._getMatterRulesDetails(id);
|
|
|
+ this.$refs.ruleItemSelectionRef._getMatterRulesDetails(val);
|
|
|
},
|
|
|
|
|
|
// 从事项弹窗将数据丢到事项配置
|
|
|
@@ -855,6 +865,18 @@
|
|
|
}
|
|
|
});
|
|
|
console.log('x修改', this.planDeviceList);
|
|
|
+ if (this.dialogTitle == '编辑保养计划') {
|
|
|
+ let arr = [];
|
|
|
+ this.planDeviceList.map((item) => {
|
|
|
+ this.addForm.planDeviceList.map((iem) => {
|
|
|
+ if (item.id == iem.deviceId) {
|
|
|
+ arr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.planCheckNodes = arr;
|
|
|
+ }
|
|
|
+
|
|
|
this.$refs.addFormRef.validate(async (valid) => {
|
|
|
if (valid) {
|
|
|
try {
|