Explorar o código

Merge branch 'monthly_report_daily_0.0.1' of git.xiaojukeji.com:pu_qa_tool/thoth-frontend into monthly_report_daily_0.0.1

qinzhipeng_v@didiglobal.com %!s(int64=4) %!d(string=hai) anos
pai
achega
76c2b88442

+ 1 - 0
src/views/monthlyReport/childrenPage/editReport/components/Analysis.vue

@@ -5,6 +5,7 @@
     is-succes
     title="分析反馈"
     width="80%"
+    submit-button="保 存"
     @succes="updateModule"
   >
     <div class="box-wrapper">

+ 27 - 5
src/views/monthlyReport/childrenPage/editReport/components/Cascader.vue

@@ -30,7 +30,7 @@ export default {
   },
   data() {
     return {
-      selectValue: this.value,
+      selectValue: [],
       options: []
     }
   },
@@ -39,16 +39,22 @@ export default {
       return this.$store.state.monthlyReportEdit.selectEnum
     }
   },
+  watch: {
+    value() {
+      this.init()
+    }
+  },
   mounted() {
     // this.selectValue = this.value
     this.init()
   },
   methods: {
     init() {
-      if (this.selectValue && this.selectValue.length) {
+      if (this.value && this.value.length) {
         this.options = []
-        this.selectValue.forEach(elm => {
+        this.selectValue = this.value.map(elm => {
           this.find(elm, 'value')
+          return `${elm}`
         })
         this.$forceUpdate()
       }
@@ -58,10 +64,14 @@ export default {
         for (let i = 0; i < arr.length; i++) {
           const elm = arr[i]
           if (key === 'value' && `${elm[key]}` === `${id}`) {
-            this.$set(this.options, this.options.length, elm)
+            if (this.isHave(`${id}`) < 0) {
+              this.$set(this.options, this.options.length, elm)
+            }
           }
           if (key === 'label' && `${elm[key]}`.indexOf(`${id}`) > -1) {
-            this.$set(this.options, this.options.length, elm)
+            if (this.isHave(`${id}`) < 0) {
+              this.$set(this.options, this.options.length, elm)
+            }
           }
           if (elm.children) {
             run(elm.children)
@@ -70,6 +80,18 @@ export default {
       }
       run(this.selectEnum)
     },
+    isHave(id) {
+      console.log(id)
+      let itemIndex = -1
+      for (let index = 0; index < this.options.length; index++) {
+        const element = this.options[index]
+        console.log(element)
+        if (`${element.value}` === `${id}`) {
+          itemIndex = index
+        }
+      }
+      return itemIndex
+    },
     async remoteMethod(query) { // 获取部门option
       if (query !== '') {
         this.options = []

+ 1 - 1
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -49,7 +49,7 @@
           @click="publishAllReport"
           >发布
         </el-button>
-        <span v-if="pageDate.status === 30 && (roleCode === 100 || roleCode === 0)">
+        <span v-if="pageDate.status === 20 && (roleCode === 100 || roleCode === 0)">
           <span v-if="$route.query.pageType === 'read'" class="el-dropdown-link" style="cursor: pointer" @click="returnReport('only')">
             回退
           </span>