Browse Source

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 years ago
parent
commit
e855c5ad37

+ 1 - 1
src/store/modules/monthlyReport/edit/index.js

@@ -499,6 +499,7 @@ export default {
       { commit, state, dispatch },
       { id, subReportId, subActive }
     ) {
+      dispatch('setSubReportInfo', id)
       const { pageType } = state
       if (
         pageType === 'readAll' ||
@@ -511,7 +512,6 @@ export default {
           subReportId,
           tabsActive: `tab_${subActive || '上月问题跟进'}`
         })
-        dispatch('setSubReportInfo', id)
       } else {
         const res = await getMonthlyReport(id)
         // 设置月报子标题

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

@@ -11,7 +11,7 @@
     placeholder="请选择"
     :remote-method="remoteMethod"
     @change="changeCascader">
-    <el-option v-for="item in options" :key="item.value" :label="item.deptPath" :value="item.value">
+    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
       {{ item.deptPath }}
     </el-option>
   </el-select>

+ 15 - 3
src/views/monthlyReport/childrenPage/editReport/components/MrTable.vue

@@ -173,6 +173,9 @@
                   {{ scope.row[item.headerKey] }}
                 </div>
               </div>
+              <div v-else-if="item.displayType === 'Texterea'">
+                <TextInfo :text="scope.row[item.headerKey]" />
+              </div>
               <div v-else>
                 <span v-html="scope.row[item.headerKey]" />
               </div>
@@ -199,6 +202,7 @@ import { uuid10 } from '@/utils'
 import Analysis from './Analysis'
 import Cascader from './Cascader'
 import CascaderInfo from './CascaderInfo'
+import TextInfo from './TextInfo'
 import MultiplePeopleInfo from './MultiplePeopleInfo'
 import TableExpandRow from './TableExpandRow'
 import markingIssues from './markingIssues'
@@ -216,7 +220,8 @@ export default {
     searchPeople,
     MultiplePeopleInfo,
     TableExpandRow,
-    markingIssues
+    markingIssues,
+    TextInfo
   },
   props: {
     plusTableDataBottom: {
@@ -273,6 +278,9 @@ export default {
     pageDate() {
       return this.$store.state.monthlyReportEdit.pageDate
     },
+    roleCode() {
+      return this.$store.state.monthlyReportEdit.roleCode
+    },
     subReportName() {
       return this.$store.state.monthlyReportEdit.subReportName
     },
@@ -442,7 +450,10 @@ export default {
           updateAnalyticFeedback(params).then((res) => {
             if (res.code === 200) {
               if (res.data.search(/yellow/) > -1) {
-                res.data.replace(/yellow/, '#F0B044')
+                res.data.replace(/yellow/g, '#FAAD14')
+              }
+              if (res.data.search(/green/) > -1) {
+                res.data.replace(/green/g, '#7ED321')
               }
               this.analyticFeedback = res.data
             }
@@ -472,11 +483,12 @@ export default {
       if (this.pageType) {
         return true
       }
+      if (this.roleCode === 100 || this.roleCode === 0) return true
       if (this.pageDate.createBy === this.username) return true
       for (let i = 0; i < this.columns.length; i++) {
         const elm = this.columns[i]
         if (elm.name === '责任人') {
-          if (!row[elm.headrKey]) return false
+          if (!row[elm.headrKey]) return true
           return row[elm.headrKey].indexOf(this.username) > -1
         }
       }

+ 65 - 18
src/views/monthlyReport/childrenPage/editReport/components/TableExpandRow.vue

@@ -47,7 +47,7 @@ style="min-width: 50px;display: inline-block;"
             <!--改进项: 进度-->
             <span
               class="progress-wrapper"
-              :style="{ width: !subItem.isProgressEdit ? '80px' : '190px' }"
+              :style="{ width: !subItem.isProgressEdit ? '300px' : '380px' }"
               >进度:<span v-if="!subItem.isProgressEdit">{{
                 subItem.progress || '0'
               }}</span
@@ -59,23 +59,46 @@ style="min-width: 50px;display: inline-block;"
                   style="width:100px"
                   :min="0"
                   :max="100" /></span
-              >%<el-button v-if="subItem.isProgressEdit" type="text" @click.stop="progressEdit(subItem)">保存</el-button>
-              <span v-if="subItem.isHold" class="isHold">Hold</span>
+              >%<el-button
+                v-if="subItem.isProgressEdit"
+                type="text"
+                @click.stop="progressEdit(subItem)"
+                >保存</el-button
+              >
+              <el-tooltip
+                v-if="subItem.isHold"
+                class="item"
+                effect="dark"
+                :content="subItem.holdReason"
+                placement="top"
+              >
+                <span class="isHold">Hold</span>
+              </el-tooltip>
+              <!--改进项: 进度更新-->
+              <span
+                class="up-progress"
+                :style="{ width: !subItem.isHold ? '60px' : '60px' }"
+                ><span
+                  v-if="
+                    (!subItem.personInCharge ||
+                      subItem.personInCharge.indexOf(username) > -1) &&
+                      !subItem.isHold
+                  "
+                  @click.stop="progressEdit(subItem)"
+                  >进度更新</span
+                ></span
+              >
+              <!--改进项: Hold-->
+              <span
+                v-if="
+                  !subItem.personInCharge ||
+                    subItem.personInCharge.indexOf(username) > -1
+                "
+                class="Hold"
+                @click.stop="setHold(index, subIndex, subItem)"
+                >{{ subItem.isHold ? '解除Hold' : 'Hold' }}</span
+              >
             </span>
-            <!--改进项: 进度更新-->
-            <span
-              class="up-progress"
-              :style="{ width: !subItem.isHold ? '60px' : '60px' }"
-              ><span
-v-if="(!subItem.personInCharge || subItem.personInCharge.indexOf(username) > -1) && !subItem.isHold"
-@click.stop="progressEdit(subItem)"
-                >进度更新</span
-              ></span
-            >
-            <!--改进项: Hold-->
-            <span v-if="!subItem.personInCharge || subItem.personInCharge.indexOf(username) > -1" class="Hold" @click.stop="setHold(index, subIndex, subItem)">{{
-              subItem.isHold ? '解除Hold' : 'Hold'
-            }}</span>
           </div>
         </div>
       </span>
@@ -108,6 +131,7 @@ export default {
   methods: {
     setHold(index, subIndex, subItem) {
       subItem.isProgressEdit = false
+      console.log(this.analyticFeedback)
       if (subItem.isHold) {
         subItem.isHold = false
         this.$forceUpdate()
@@ -116,6 +140,7 @@ export default {
       this.$refs.Hold.open(index, subIndex, subItem.holdReason)
     },
     upHold({ index, subIndex, holdReason }) {
+      console.log({ index, subIndex, holdReason })
       this.analyticFeedback.analyticContents[index].improvementItems[
         subIndex
       ].isHold = true
@@ -124,6 +149,7 @@ export default {
           subIndex
         ].holdReason = holdReason
       }
+      this.$forceUpdate()
       this.$emit('upAnalyticFeedback')
     },
     progressEdit(item) {
@@ -204,13 +230,34 @@ export default {
       color: #666666;
       top: -10px;
       padding: 0 3px;
+      cursor: pointer;
+      &:hover {
+        .holdReason {
+          display: block;
+        }
+      }
+      .holdReason {
+        transition: all 0.3 ease-in-out;
+        display: none;
+        position: absolute;
+        bottom: 18px;
+        left: 30px;
+        min-width: 90px;
+        background: #e8e8e8;
+        min-height: 14px;
+        z-index: 9999;
+        box-sizing: content-box;
+        padding: 10px;
+        border-radius: 10px;
+      }
     }
   }
   .up-progress {
     color: #1890ff;
     display: inline-block;
     // width: 50px;
-    margin-right: 10px;
+    margin: 0 50px;
+    // margin-right: 10px;
     cursor: pointer;
   }
   .Hold {

+ 15 - 0
src/views/monthlyReport/childrenPage/editReport/components/TextInfo.vue

@@ -0,0 +1,15 @@
+<template>
+  <span v-if="text" style="text-align: left;display: block;"><span v-html="text.replace(/\n/g, '<br />')" /></span>
+</template>
+<script>
+export default {
+  name: 'TextInfo',
+  props: {
+    text: {
+      type: String,
+      required: false,
+      default: ''
+    }
+  }
+}
+</script>