ソースを参照

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 4 年 前
コミット
607cea1220

+ 5 - 2
src/store/modules/monthlyReport/edit/index.js

@@ -448,6 +448,9 @@ export default {
       // })
       state.reportList && state.reportList.forEach(elm => {
         if (`${elm.id}` === id) {
+          state.pageDate = {
+            status: elm.status
+          }
           // 如果是
           if (elm.status === 30) {
             state.subTitle = `查看|${elm.reportName}`
@@ -590,9 +593,9 @@ export default {
       }
     },
     // 月报发送
-    async sendReport({ commit, state, context }, { cb }) {
+    async sendReport({ commit, state, context }, { id, cb }) {
       const res = await sendConfirm({
-        id: state.pageDate.id
+        id
       })
       if (res.code === 200) {
         message.success('发送成功!')

+ 3 - 2
src/store/modules/monthlyReport/edit/utils.js

@@ -1,5 +1,5 @@
 // import { v4 as uuidv4 } from 'uuid'
-import { uuid10, strToArr, arrToStr } from '@/utils'
+import { uuid10, strToArr } from '@/utils'
 import _ from 'lodash'
 
 // 月报标签页基础数据过滤设置
@@ -140,7 +140,8 @@ export function objToArr(obj, tableHeaders) {
         }
         if (param.value) {
           if (item.displayType && item.displayType === 'Cascader') {
-            param.value = arrToStr(param.value)
+            // param.value = arrToStr(param.value)
+            param.value = JSON.stringify(param.value)
           }
           if (item.selectType && item.selectType === 'MultiplePeople') {
             // param.value = JSON.stringify(param.value)

+ 84 - 0
src/views/monthlyReport/childrenPage/editReport/components/Cascader.vue

@@ -0,0 +1,84 @@
+<template>
+  <el-select
+    v-model="selectValue"
+    multiple
+    filterable
+    remote
+    collapse-tags
+    style="width: 100%"
+    reserve-keyword
+    placeholder="请选择"
+    :remote-method="remoteMethod"
+    @change="changeCascader">
+    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
+      {{ item.level }} {{ item.label }}
+    </el-option>
+  </el-select>
+</template>
+
+<script>
+
+export default {
+  name: 'CascaderInfo',
+  props: {
+    value: {
+      type: [Array, String],
+      required: false,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      selectValue: this.value,
+      options: []
+    }
+  },
+  computed: {
+    selectEnum() {
+      return this.$store.state.monthlyReportEdit.selectEnum
+    }
+  },
+  mounted() {
+    // this.selectValue = this.value
+    this.init()
+  },
+  methods: {
+    init() {
+      if (this.selectValue && this.selectValue.length) {
+        this.options = []
+        this.selectValue.forEach(elm => {
+          this.find(elm, 'value')
+        })
+        this.$forceUpdate()
+      }
+    },
+    find(id, key = 'value') {
+      const run = (arr) => {
+        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 (key === 'label' && `${elm[key]}`.indexOf(`${id}`) > -1) {
+            this.$set(this.options, this.options.length, elm)
+          }
+          if (elm.children) {
+            run(elm.children)
+          }
+        }
+      }
+      run(this.selectEnum)
+    },
+    async remoteMethod(query) { // 获取部门option
+      if (query !== '') {
+        this.find(query, 'label')
+      }
+    },
+    changeCascader(value) {
+      this.$emit('input', value)
+    }
+  }
+}
+</script>
+
+<style scoped lang="less"></style>

+ 7 - 5
src/views/monthlyReport/childrenPage/editReport/components/CascaderInfo.vue

@@ -8,7 +8,7 @@
 </template>
 
 <script>
-import _ from 'lodash'
+// import _ from 'lodash'
 
 export default {
   name: 'CascaderInfo',
@@ -42,6 +42,7 @@ export default {
   },
   methods: {
     init() {
+      console.log(this.teamData, 45)
       if (this.teamData && this.teamData.length) {
         // const [first, second] = this.teamData
         // // console.log(first, second)
@@ -51,10 +52,11 @@ export default {
         // }
         const itemName = []
         this.teamData.forEach((elm) => {
-          if (_.isArray(elm)) {
-            const last = elm[elm.length - 1]
-            itemName.push(this.find(last))
-          }
+          // if (_.isArray(elm)) {
+          // const last = elm[elm.length - 1]
+          //   itemName.push(this.find(elm))
+          // }
+          itemName.push(this.find(elm))
         })
         // 数组去重
         this.itemName = [...new Set(itemName)]

+ 6 - 2
src/views/monthlyReport/childrenPage/editReport/components/MrTable.vue

@@ -139,7 +139,7 @@
                 show-word-limit
               />
               <div v-else-if="item.displayType === 'Cascader'">
-                <el-cascader
+                <!-- <el-cascader
                   :ref="`${scope.row.rowKey}_${index}`"
                   v-model="scope.row[item.headerKey]"
                   :options="selectEnum"
@@ -150,7 +150,8 @@
                   @change="
                     (value) => cascaderChange(value, item.headerKey, scope.row)
                   "
-                />
+                />-->
+                <Cascader v-model="scope.row[item.headerKey]" />
               </div>
               <div v-else-if="item.defaultValue === 'Select'" />
               <el-input
@@ -224,6 +225,7 @@
 import _ from 'lodash'
 import { uuid10 } from '@/utils'
 import Analysis from './Analysis'
+import Cascader from './Cascader'
 import CascaderInfo from './CascaderInfo'
 import MultiplePeopleInfo from './MultiplePeopleInfo'
 import TableExpandRow from './TableExpandRow'
@@ -231,11 +233,13 @@ import markingIssues from './markingIssues'
 import searchPeople from '@/components/select/searchPeople' // 人员select
 import { updateAnalyticFeedback } from '@/api/qualityMonthlyReport/edit'
 import { reportDataBack } from '@/store/modules/monthlyReport/edit/utils.js'
+// import { getDeptByKeyWord } from '@/api/qualityMonthlyReport'
 
 export default {
   name: 'MrTable',
   components: {
     Analysis,
+    Cascader,
     CascaderInfo,
     searchPeople,
     MultiplePeopleInfo,

+ 11 - 5
src/views/monthlyReport/childrenPage/editReport/components/RichText.vue

@@ -6,9 +6,17 @@
       :id="item.domKey"
       :value.sync="item.value"
       :height="200"
-      :full-position-style="{ top:'20px',left:'15%', right: '15%' }"
+      :full-position-style="{ top: '20px', left: '15%', right: '15%' }"
+    />
+    <div
+      v-else
+      style="cursor: pointer;color: #333;"
+      :style="{
+        paddingLeft: pageDate.status > 10 && item.value ? '30px' : '0'
+      }"
+      @click.stop="editDom"
+      v-html="item.value || '请点此处击添加数据!'"
     />
-    <div v-else style="cursor: pointer;color: #333;padding-left: 30px;" @click.stop="editDom" v-html="item.value||'请点此处击添加数据!'" />
   </div>
 </template>
 
@@ -53,6 +61,4 @@ export default {
 }
 </script>
 
-<style scoped>
-
-</style>
+<style scoped></style>

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

@@ -153,6 +153,7 @@ export default {
   // border-bottom: 1px solid #EBEEF5;
   padding-bottom: 10px;
   margin-bottom: 10px;
+  font-size: 14px;
   &::after {
     content: '';
     position: absolute;

+ 8 - 2
src/views/monthlyReport/childrenPage/editReport/components/core.vue

@@ -9,13 +9,17 @@
     <div
       v-if="baseData.type.search(/Head2|Head3/) > -1"
       :id="baseData.domKey"
-      :style="{ marginTop: baseData.type === 'head3' ? '0' : '10.2px' }"
+      :style="{
+        marginTop: baseData.type === 'head3' ? '0' : '10.3px',
+        marginBottom: '10px'
+      }"
     >
       <!-- 不是业务线 -->
       <span
         v-if="fontWeightFont.indexOf(baseData.title) < 0"
         :style="{
           color: '#333',
+          marginBottom: '10px',
           fontWeight: fontWeightFont.indexOf(baseData.title) > -1 ? 500 : 400
         }"
         v-html="headerIndex"
@@ -23,11 +27,13 @@
       <SubTitle
         v-if="headerTitle.indexOf('线下缺陷') > -1"
         :sub-title="baseData.subTitles"
+        style="margin-bottom: 10px;"
       />
       <span
         v-else-if="isSHowContent()"
         :style="{
           color: '#333',
+          marginBottom: '10px',
           fontWeight: fontWeightFont.indexOf(baseData.title) > -1 ? 500 : 400
         }"
         v-html="headerTitle"
@@ -220,7 +226,7 @@ export default {
        * 当页面处于全部查看时,并且页面数据状态 大于 10 ,并且 是业务线标题,并且 tab页签是·本月优秀·时,才进行判断当前数据是否显示*/
 
       if (
-        this.tabsActive.search(/本月优秀/ > -1) &&
+        this.pageDate.status > 10 &&
         this.tabsActive.search(/本月优秀/ > -1) &&
         this.baseData &&
         this.baseData.content[0] &&

+ 3 - 2
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -43,7 +43,7 @@
           @click="publishAllReport"
         >发布
         </el-button>
-        <el-dropdown v-if="pageDate && pageDate.status === 30 && (roleCode === 100 || roleCode === 0)" trigger="click" @command="returnReport">
+        <el-dropdown v-if="pageType.search(/All/) > -1 && pageDate && pageDate.status === 30 && (roleCode === 100 || roleCode === 0)" trigger="click" @command="returnReport">
           <span class="el-dropdown-link">
             回退<i class="el-icon-arrow-down el-icon--right" />
           </span>
@@ -58,7 +58,7 @@
           </el-dropdown-menu>
         </el-dropdown>
         <el-button
-          v-if="(!$route.query.type || $route.query.type !== 'create') && (pageDate && pageDate.status < 20) && (roleCode === 100 || roleCode === 0)"
+          v-if="pageType.search(/All/) > -1 && (!$route.query.type || $route.query.type !== 'create') && (pageDate && pageDate.status < 20) && (roleCode === 100 || roleCode === 0)"
           slot="reference"
           type="danger"
           size="small"
@@ -388,6 +388,7 @@ export default {
         return
       }
       this.$store.dispatch('monthlyReportEdit/sendReport', {
+        id: this.$route.query.reportId,
         cb: () => {
           this.$router.push({ path: '/monthlyReport/index' })
         }