Эх сурвалжийг харах

月报标记重点问题:部门负责人

洪海涛 4 жил өмнө
parent
commit
af091b1949

+ 22 - 3
src/views/monthlyReport/childrenPage/editReport/components/markingIssues.vue

@@ -3,13 +3,14 @@
     <normal-dialog
       v-if="modalShow"
       ref="normalDialog"
+      v-loading="loading"
       :show-dialog="false"
       is-succes
       :title="titleName"
       width="45%"
       @succes="updateModule"
     >
-      <el-form label-width="100px" style="padding-right: 20px;padding-left: 20px">
+      <el-form :key="domKey" label-width="100px" style="padding-right: 20px;padding-left: 20px">
         <el-form-item label="问题">
           <el-input
             v-model="normalAreaName"
@@ -67,11 +68,13 @@ export default {
       titleName: '标记为重点问题',
       normalAreaName: '',
       menuData: '',
+      domKey: '123456',
       callBack: null,
       columns: null,
       cascaderValue: null,
       headerTitle: null,
       subTitles: null,
+      loading: false,
       multiplePeople: null
     }
   },
@@ -86,6 +89,9 @@ export default {
   methods: {
     uuid10,
     openModal(params) {
+      this.loading = true
+      this.multiplePeople = null
+      this.domKey = new Date().getTime()
       const { title, scope, columns, normalAreaName, subTitles, headerTitle } = params
       this.titleName = title
       if (scope) this.menuData = scope.row
@@ -96,6 +102,7 @@ export default {
       this.headerTitle = headerTitle
       if (normalAreaName) this.normalAreaName = normalAreaName
       this.setDefaultValues()
+      this.loading = false
     },
     // 设置默认值
     setDefaultValues() {
@@ -155,7 +162,10 @@ export default {
           this.menuData[headerKeyMK.headerKey] &&
           `${this.menuData[headerKeyMK.headerKey]}模块一次全量回滚`
       }
-      this.setDeptCharge()
+      if (this.cascaderValue && this.cascaderValue.length) {
+        console.log(161)
+        this.setDeptCharge()
+      }
     },
     updateModule() {
       this.$store.commit('monthlyReportEdit/MARK_ISSUES', {
@@ -170,7 +180,16 @@ export default {
     async setDeptCharge() {
       const res = await getDeptCharge({ deptCode: this.cascaderValue })
       if (res.code === 200) {
-        this.multiplePeople = Array.from(new Set([...this.multiplePeople, this.cascaderValue]))
+        if (!this.multiplePeople) {
+          this.multiplePeople = []
+        }
+        console.log(this.multiplePeople)
+        console.log(res.data.map(elm => elm.manageName))
+        this.multiplePeople = [...this.multiplePeople, ...res.data.map(elm => elm.manageName)]
+        // console.log(this.multiplePeople)
+        // this.multiplePeople = Array.from(new Set([...this.multiplePeople, ...this.cascaderValue.map(elm => elm.manageName)]))
+        this.multiplePeople = Array.from(new Set(this.multiplePeople))
+        // console.log(this.multiplePeople)
       }
     }
   }