huang_an пре 2 година
родитељ
комит
4462ee5031

+ 5 - 5
src/components/CommomSelect/dept-select.vue

@@ -30,16 +30,16 @@
         default: '请选择'
       }
     },
-    data () {
+    data() {
       return {
         treeData: []
       };
     },
-    created () {
+    created() {
       this.getData();
     },
     methods: {
-      async getData (parmas = {}) {
+      async getData(parmas = {}) {
         const data = await listOrganizations(parmas);
         this.treeData = this.$util.toTreeData({
           data: data || [],
@@ -48,11 +48,11 @@
         });
       },
       /* 更新选中数据 */
-      updateValue (value) {
+      updateValue(value) {
         this.$emit('input', value);
       },
 
-      changeChoose (val) {
+      changeChoose(val) {
         this.$emit(
           'changeGroup',
           val,

+ 8 - 6
src/components/CommomSelect/person-select.vue

@@ -33,14 +33,14 @@
         default: true
       }
     },
-    data () {
+    data() {
       return {
         dictList: []
       };
     },
     computed: {
       selectVal: {
-        set (val) {
+        set(val) {
           this.$emit(
             'selfChange',
             val,
@@ -48,25 +48,27 @@
           );
           this.$emit('updateVal', val);
         },
-        get () {
+        get() {
           return this.value;
         }
       }
     },
-    created () {
+    created() {
       if (this.init) {
         this.getList();
       }
     },
     methods: {
-      async getList (params) {
+      async getList(params) {
         let data = { pageNum: 1, size: -1 };
         // 如果传了参数就是获取巡点检人员数据
         if (params) {
           data = Object.assign(data, params);
         }
         const res = await getUserPage(data);
-        this.selectVal = '';
+        if (!this.selectVal) {
+          this.selectVal = '';
+        }
         this.dictList = res.list;
       }
     }

+ 29 - 7
src/components/addPatrolPlanDialog/index.vue

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

+ 1 - 1
src/views/maintenance/equipment/plan/index.vue

@@ -140,7 +140,7 @@
           },
           {
             prop: 'planStatus',
-            label: '状态',
+            label: '计划状态',
             align: 'center',
             showOverflowTooltip: true,
             minWidth: 110