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

+ 1 - 0
src/api/qualityMonthlyReport/index.js

@@ -15,6 +15,7 @@ export function getAvaliableInfo() {
 // 获取月报主页data
 export function monthlyReportIndex(id) {
   return request({
+    timeout: '10000',
     url: TeamManagement + `/monthlyReport/monthlyReportIndex?id=${id}`,
     method: 'get'
   })

+ 42 - 14
src/components/dialog/normalDialog.vue

@@ -4,6 +4,7 @@
       :title="title"
       :visible.sync="visible"
       :width="width"
+      :modal="modal"
       :modal-append-to-body="false"
       :close-on-click-modal="closeOnClick"
       :top="top"
@@ -11,9 +12,21 @@
     >
       <slot />
       <span v-show="showFooter" slot="footer" class="dialog-footer">
-        <el-button v-show="buttomType ==='danger'" :type="buttomType" size="small" @click="confirm()">{{ submitButton }}</el-button>
+        <el-button
+          v-show="buttomType === 'danger'"
+          :type="buttomType"
+          size="small"
+          @click="confirm()"
+          >{{ submitButton }}</el-button
+        >
         <el-button size="small" @click="cancel()">取 消</el-button>
-        <el-button v-show="buttomType !=='danger'" :type="buttomType" size="small" @click="confirm()">{{ submitButton }}</el-button>
+        <el-button
+          v-show="buttomType !== 'danger'"
+          :type="buttomType"
+          size="small"
+          @click="confirm()"
+          >{{ submitButton }}</el-button
+        >
         <slot name="save" />
       </span>
     </el-dialog>
@@ -47,30 +60,41 @@ export default {
       default: true,
       required: false
     },
-    submitButton: {// 提交按钮名字
+    submitButton: {
+      // 提交按钮名字
       type: String,
       default: '确 定',
       required: false
     },
-    buttomType: {// 提交按钮类型
+    buttomType: {
+      // 提交按钮类型
       type: String,
       default: 'primary',
       required: false
     },
-    isDefaultClose: { // 是否确定后关闭弹框
+    isDefaultClose: {
+      // 是否确定后关闭弹框
       type: Boolean,
       default: true,
       required: false
     },
-    closeOnClick: { // 点击外区域消失
+    closeOnClick: {
+      // 点击外区域消失
       type: Boolean,
       default: false,
       required: false
     },
-    isSucces: { // 点击外区域消失
+    isSucces: {
+      // 点击外区域消失
       type: Boolean,
       default: false,
       required: false
+    },
+    modal: {
+      // 点击外区域消失
+      type: Boolean,
+      default: true,
+      required: false
     }
   },
   data() {
@@ -102,23 +126,27 @@ export default {
 }
 </script>
 <style scoped lang="scss">
-/deep/.el-dialog__header {
+/deep/ .el-dialog__header {
   padding: 20px !important;
   // border-bottom:1px solid rgba(238,238,238,1);
 }
-/deep/.el-dialog__footer {
+
+/deep/ .el-dialog__footer {
   // border-top:1px solid rgba(238,238,238,1);
   padding: 20px;
 }
-/deep/.el-dialog__body {
+
+/deep/ .el-dialog__body {
   padding: 20px;
 }
-/deep/.el-dialog__title{
+
+/deep/ .el-dialog__title {
   padding-left: 10px;
   position: relative;
 }
-/deep/.el-dialog__title::before {
-  content:" ";
+
+/deep/ .el-dialog__title::before {
+  content: ' ';
   display: inline-block;
   position: absolute;
   top: 2px;
@@ -126,6 +154,6 @@ export default {
   width: 5px;
   height: 20px;
   border-radius: 2px;
-  background-color: rgb(64, 158, 255);;
+  background-color: rgb(64, 158, 255);
 }
 </style>

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

@@ -59,7 +59,8 @@ export default {
      */
     roleCode: 50, // 默认为用户
     reportList: [], // 默认为用户
-    pageType: 'edit' // edit:(月报编辑和新建); readAll:(查看月报详情)
+    pageType: 'edit', // edit:(月报编辑和新建); readAll:(查看月报详情)
+    loading: false
   },
   mutations: {
     // 页面基础数据赋值
@@ -491,7 +492,12 @@ export default {
     // 设置子月报数据
     SET_REPORT_INFO(state, params) {
       state.subReportInfo = params
+    },
+    // 设置页面状态
+    SET_LOADING(state, isShow) {
+      state.loading = isShow
     }
+
   },
   actions: {
     // 月报数据获取

+ 56 - 39
src/views/monthlyReport/childrenPage/editReport/components/Analysis.vue

@@ -1,14 +1,15 @@
 <template>
-  <normal-dialog
-    ref="normalDialog"
-    :show-dialog="false"
-    is-succes
-    title="分析反馈"
-    width="80%"
-    submit-button="保 存"
-    @succes="updateModule"
-  >
-    <div class="box-wrapper">
+  <div>
+    <normal-dialog
+      ref="normalDialog"
+      :show-dialog="false"
+      is-succes
+      title="分析反馈"
+      width="80%"
+      submit-button="保 存"
+      @succes="updateModule"
+    >
+      <div class="box-wrapper">
       <span v-if="analyticFeedback && analyticFeedback.analyticContents">
         <el-form
           v-for="(item, index) in analyticFeedback.analyticContents"
@@ -17,10 +18,10 @@
         >
           <span class="del-item">
             <el-button
-icon="el-icon-delete"
-type="text"
-@click.stop="delItem(index)"
-              >删除</el-button
+              icon="el-icon-delete"
+              type="text"
+              @click.stop="delItem(index)"
+            >删除</el-button
             >
           </span>
           <el-form-item label="问题" :label-width="formLabelWidth">
@@ -105,27 +106,43 @@ type="text"
               type="text"
               icon="el-icon-plus"
               @click.stop="addSubItem(index)"
-              >新增改进项</el-button
+            >新增改进项</el-button
             >
           </el-form-item>
         </el-form>
       </span>
-    </div>
-    <el-button
-type="text"
-icon="el-icon-plus"
-@click.stop="addItem"
-      >新增问题
-    </el-button>
-    <template slot="save">
+      </div>
       <el-button
-        type="primary"
-        size="small"
-        @click.stop="updateModule('Submission')"
-        >提交
+        type="text"
+        icon="el-icon-plus"
+        @click.stop="addItem"
+      >新增问题
       </el-button>
-    </template>
-  </normal-dialog>
+      <template slot="save">
+        <el-button
+          type="primary"
+          size="small"
+          @click.stop="$refs['dialogConfirm'].visible = true;$refs['normalDialog'].visible = false;"
+        >提交<!-- @click.stop="updateModule('Submission')" -->
+        </el-button>
+      </template>
+    </normal-dialog>
+    <!-- 月报确认 -->
+    <normal-dialog
+      ref="dialogConfirm"
+      is-succes
+      :show-dialog="false"
+      :title="'确认月报'"
+      width="335px"
+      @succes="updateModule('Submission')"
+      @cancel="$refs['normalDialog'].visible = true;$refs['dialogConfirm'].visible = false;"
+    >
+      <div class="report-delete">
+        分析反馈提交后将不可修改,请确认是否提交?
+      </div>
+    </normal-dialog>
+  </div>
+
 </template>
 
 <script>
@@ -184,16 +201,16 @@ export default {
       )
     },
     updateModule(key) {
-      const { analyticFeedback, rowIndex } = this
-      if (key && key === 'Submission') {
-        analyticFeedback.isCommitted = true
-      }
-      this.$emit('upData', {
-        analyticFeedback,
-        rowIndex
-      })
-      this.oldBaseData = _.cloneDeep(this.baseData)
-      this.$refs.normalDialog.visible = false
+      // const { analyticFeedback, rowIndex } = this
+      // if (key && key === 'Submission') {
+      //   analyticFeedback.isCommitted = true
+      // }
+      // this.$emit('upData', {
+      //   analyticFeedback,
+      //   rowIndex
+      // })
+      // this.oldBaseData = _.cloneDeep(this.baseData)
+      // this.$refs.normalDialog.visible = false
     }
   }
 }

+ 80 - 34
src/views/monthlyReport/childrenPage/editReport/components/MrTable.vue

@@ -4,7 +4,7 @@
     <el-table
       :data="tableData"
       border
-      style="width: 100%;margin-top: 10px;"
+      style="width: 100%; margin-top: 10px"
       highlight-current-row
       row-key="rowKey"
       :expand-row-keys="expandRowKeys"
@@ -46,23 +46,23 @@
                 v-if="isShowButton(scope.row, item)"
                 type="text"
                 @click.stop="btnFun({ value: '分析反馈' }, scope)"
-              >分析反馈
+                >分析反馈
               </el-button>
             </div>
             <span v-else>
-            <span
-              v-for="(btnItem, btnIndex) in item.defaultValue"
-              :key="btnIndex"
-            >
-              <el-button
-                v-if="isShowButton(scope.row, item)"
-                style="margin-right: 10px;"
-                type="text"
-                @click.stop="btnFun(btnItem, scope)"
-              >{{ btnItem.value }}</el-button
+              <span
+                v-for="(btnItem, btnIndex) in item.defaultValue"
+                :key="btnIndex"
               >
+                <el-button
+                  v-if="isShowButton(scope.row, item)"
+                  style="margin-right: 10px"
+                  type="text"
+                  @click.stop="btnFun(btnItem, scope)"
+                  >{{ btnItem.value }}</el-button
+                >
+              </span>
             </span>
-          </span>
           </div>
           <div
             v-else
@@ -148,25 +148,39 @@
                 placeholder="请输入"
               />
             </div>
-            <span v-else-if="item.displayType === 'Text'">{{ item.defaultValue[0].value }}</span>
+            <span v-else-if="item.displayType === 'Text'">{{
+              item.defaultValue[0].value
+            }}</span>
             <!--  <div v-else class="edit-cell" @click.stop="editLine(scope.row, index)">  -->
-            <div v-else class="edit-cell" @click.stop="editLine(scope.row, index)">
+            <div
+              v-else
+              class="edit-cell"
+              @click.stop="editLine(scope.row, index)"
+            >
               <div v-if="item.displayType === 'Cascader'">
                 <CascaderInfo :team-data="scope.row[item.headerKey]" />
               </div>
               <div v-else-if="item.displayType === 'Select'">
                 <!-- 单个人员选择 -->
-                <div v-if="item.selectType && item.selectType === 'SinglePeople'">
+                <div
+                  v-if="item.selectType && item.selectType === 'SinglePeople'"
+                >
                   <MultiplePeopleInfo :team-data="scope.row[item.headerKey]" />
                 </div>
                 <!-- 多个人员选择 -->
-                <div v-else-if="item.selectType && item.selectType === 'MultiplePeople'">
+                <div
+                  v-else-if="
+                    item.selectType && item.selectType === 'MultiplePeople'
+                  "
+                >
                   <!-- <searchPeople :value.sync="scope.row[item.headerKey]"
                   :multiple="true" disabled />-->
                   <MultiplePeopleInfo :team-data="scope.row[item.headerKey]" />
                 </div>
                 <!-- 多个人员选择 -->
-                <div v-else-if="item.selectType && item.selectType === 'people'">
+                <div
+                  v-else-if="item.selectType && item.selectType === 'people'"
+                >
                   <MultiplePeopleInfo :team-data="scope.row[item.headerKey]" />
                 </div>
                 <div v-else>
@@ -185,7 +199,11 @@
       </el-table-column>
     </el-table>
     <div class="plus-table-data" :style="{ marginBottom: plusTableDataBottom }">
-      <el-button v-if="pageDate && pageDate.status < 20" type="text" @click.stop="addTableData">
+      <el-button
+        v-if="pageDate && pageDate.status < 20"
+        type="text"
+        @click.stop="addTableData"
+      >
         <svg-icon icon-class="data-plus" class="icon" />
         新增
       </el-button>
@@ -261,7 +279,14 @@ export default {
   },
   computed: {
     isExpand() {
-      return this.pageDate && this.pageDate.status && this.pageDate.status === 30 && ((this.tabsActive.search(/本月重点问题/) > -1 && this.pageType === 'readAll') || (this.pageType === 'read' && this.title === '本月重点问题'))
+      return (
+        this.pageDate &&
+        this.pageDate.status &&
+        this.pageDate.status === 30 &&
+        ((this.tabsActive.search(/本月重点问题/) > -1 &&
+          this.pageType === 'readAll') ||
+          (this.pageType === 'read' && this.title === '本月重点问题'))
+      )
     },
     selectEnum() {
       return this.$store.state.monthlyReportEdit.selectEnum
@@ -301,15 +326,23 @@ export default {
   methods: {
     isEdit() {},
     setMinWidth(item) {
-      let width = 100
+      let width = 80
       if (item.name === '操作') {
         if (item.defaultValue.length) {
-          width = item.defaultValue.length * 50
+          width = item.defaultValue.length * 30
         }
         if (this.isExpand) {
           width = 90
         }
       }
+      if (item.name === '定级') {
+        width = 22
+      }
+
+      if (item.name === '影响') {
+        width = 130
+      }
+
       return `${width}px`
     },
     isFixed(item, index, columns) {
@@ -449,13 +482,14 @@ export default {
         if (obj && obj.content[0].tableRows.length) {
           updateAnalyticFeedback(params).then((res) => {
             if (res.code === 200) {
-              if (res.data.search(/yellow/) > -1) {
-                res.data.replace(/yellow/g, '#FAAD14')
+              this.analyticFeedback = res.data
+              if (this.analyticFeedback.search(/yellow/) > -1) {
+                this.analyticFeedback = this.analyticFeedback.replace(/yellow/g, '#FAAD14')
               }
-              if (res.data.search(/green/) > -1) {
-                res.data.replace(/green/g, '#7ED321')
+              if (this.analyticFeedback.search(/green/) > -1) {
+                this.analyticFeedback = this.analyticFeedback.replace(/green/g, '#7ED321')
               }
-              this.analyticFeedback = res.data
+              // this.analyticFeedback = res.data
             }
           })
         }
@@ -473,7 +507,11 @@ export default {
      * @returns {boolean}
      */
     isShowButton(row) {
-      if (this.pageType.search(/edit/) > -1 && this.pageDate && this.pageDate.status < 20) {
+      if (
+        this.pageType.search(/edit/) > -1 &&
+        this.pageDate &&
+        this.pageDate.status < 20
+      ) {
         return true
       }
       if (row.analyticFeedback && row.analyticFeedback.isCommitted) {
@@ -496,8 +534,13 @@ export default {
     },
     setExpandRowKeys() {
       if (this.isExpand && this.tableData && this.tableData.length) {
-        this.tableData.forEach(elm => {
-          if (elm.analyticFeedback && elm.analyticFeedback.hasOwnProperty('isCommitted') && elm.analyticFeedback.isCommitted && this.expandRowKeys.indexOf(elm.rowKey) < 0) {
+        this.tableData.forEach((elm) => {
+          if (
+            elm.analyticFeedback &&
+            elm.analyticFeedback.hasOwnProperty('isCommitted') &&
+            elm.analyticFeedback.isCommitted &&
+            this.expandRowKeys.indexOf(elm.rowKey) < 0
+          ) {
             this.expandRowKeys.push(elm.rowKey)
           }
         })
@@ -549,17 +592,20 @@ export default {
     }
   }
 }
-/deep/.el-button{
+
+/deep/ .el-button {
   font-weight: 400;
 }
-/deep/.red {
+
+/deep/ .red {
   color: red;
 }
-/deep/.green {
+
+/deep/ .green {
   color: green;
 }
 
-/deep/.yellow {
+/deep/ .yellow {
   color: yellow;
 }
 </style>

+ 20 - 17
src/views/monthlyReport/childrenPage/editReport/components/RichText.vue

@@ -1,22 +1,25 @@
 <template>
   <div>
-    <div v-if="pageDate.status > 10" v-html="item.value || '暂无数据!'" />
-    <normal-area
-      v-else-if="editKeys.indexOf(item.domKey) > -1"
-      :id="item.domKey"
-      :value.sync="item.value"
-      :height="200"
-      :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-if="pageType.search(/edit/) > -1">
+      <normal-area
+        v-if="editKeys.indexOf(item.domKey) > -1"
+        :id="item.domKey"
+        :value.sync="item.value"
+        :height="200"
+        :full-position-style="{ top: '20px', left: '15%', right: '15%' }"
+      />
+      <div
+        v-else
+        style="cursor: pointer; color: #333; margin-bottom: 10px"
+        :style="{
+          paddingLeft: pageDate.status > 10 && item.value ? '30px' : '0',
+          marginTop: '10px'
+        }"
+        @click.stop="editDom"
+        v-html="item.value || '请点此处击添加数据!'"
+      />
+    </div>
+    <div v-else v-html="item.value || '暂无数据!'" />
   </div>
 </template>
 

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

@@ -174,12 +174,14 @@ export default {
     text-overflow: ellipsis; //溢出用省略号显示
     white-space: nowrap; //溢出不换行
   }
+
   color: #333333;
   position: relative;
   // border-bottom: 1px solid #EBEEF5;
   padding-bottom: 10px;
   margin-bottom: 10px;
   font-size: 14px;
+
   &::after {
     content: '';
     position: absolute;
@@ -189,14 +191,17 @@ export default {
     height: 1px;
     border-bottom: 1px solid #ebeef5;
   }
+
   &:last-child {
     border-bottom: 0;
     padding-bottom: 0;
     margin-bottom: 0;
+
     &::after {
       border-bottom: 0;
     }
   }
+
   .item-index {
     position: absolute;
     left: -26px;
@@ -209,18 +214,22 @@ export default {
     opacity: 1;
     display: inline-block;
   }
+
   .item-title {
     color: #666666;
     margin-bottom: 5px;
   }
+
   .item-content {
     margin-bottom: 5px;
   }
+
   .progress-wrapper {
     width: 75px;
     display: inline-block;
     margin-right: 60px;
     position: relative;
+
     .isHold {
       position: absolute;
       background: #e8e8e8;
@@ -231,11 +240,13 @@ export default {
       top: -10px;
       padding: 0 3px;
       cursor: pointer;
+
       &:hover {
         .holdReason {
           display: block;
         }
       }
+
       .holdReason {
         transition: all 0.3 ease-in-out;
         display: none;
@@ -252,6 +263,7 @@ export default {
       }
     }
   }
+
   .up-progress {
     color: #1890ff;
     display: inline-block;
@@ -260,11 +272,13 @@ export default {
     // margin-right: 10px;
     cursor: pointer;
   }
+
   .Hold {
     color: #1890ff;
     display: inline-block;
     cursor: pointer;
   }
+
   // .description-wrapper {
   // }
   // .item-problem {

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

@@ -1,5 +1,10 @@
 <template>
-  <span v-if="text" style="text-align: left;display: block;"><span v-html="text.replace(/\n/g, '<br />')" /></span>
+	<span
+v-if="text"
+style="text-align: left; display: block"
+		><span
+v-html="text.replace(/\n/g, '<br />')"
+	/></span>
 </template>
 <script>
 export default {

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

@@ -74,7 +74,7 @@
               class="title"
               :class="{ active: active === item.domKey, hide: !item.isVisible }"
             >
-              {{ setTitle(item.title) }}</span
+              <span v-html="headerIndex(item, index)" />{{ setTitle(item.title) }}</span
             >
         </div>
 
@@ -95,6 +95,7 @@
 
 <script>
 // import _ from 'lodash'
+import { toChinesNum } from '@/utils'
 
 export default {
   name: 'Anchor',
@@ -132,6 +133,13 @@ export default {
     }, 1500)
   },
   methods: {
+    headerIndex(item, index) {
+      if (item.type === 'Head1') return ''
+      if (item.depth === 3) {
+        return `<hhtsubtitle>${toChinesNum(index + 1)}、</hhtsubtitle>`
+      }
+      return `${index + 1}、`
+    },
     mouseMoveItem(event, item) {
       // console.log(event, item, 66)
       this.$emit('mouseMoveItem', { event, item })

+ 21 - 7
src/views/monthlyReport/childrenPage/editReport/components/content.vue

@@ -3,25 +3,31 @@
     <div v-for="item in baseData" :key="item.domKey">
       <!--   表格:Table   -->
       <div v-if="item.type === 'Table'">
+        <!-- 是否查看页面 -->
         <mrTable
+          v-if="pageType.search(/edit/) > -1 || item.tableRows.length"
           :title="title"
           :columns="item.tableHeaders"
           :table-data="item.tableRows"
           :dom-key="item.domKey"
           plus-table-data-bottom="0px"
         />
+        <div v-else class="no-data">暂无{{ title }}数据</div>
       </div>
       <!--   表格和富文本:TableAndRichText   -->
       <div v-else-if="item.type === 'TableAndRichText'">
         <mrTable
+          v-if="pageType.search(/edit/) > -1 || item.tableRows.length"
           :columns="item.tableHeaders"
           :table-data="item.tableRows"
           :dom-key="item.domKey"
+          :title="title"
           plus-table-data-bottom="0px"
           style="margin-bottom: 18px"
         >
           <template slot="fixedText">
             <VarText
+              v-if="pageType.search(/edit/) > -1 || item.value"
               v-model="item.value"
               style="margin-top: -5px;"
               :title="item.title"
@@ -29,30 +35,34 @@
             />
           </template>
         </mrTable>
+        <div v-else class="no-data">暂无{{ title }}数据</div>
       </div>
       <!--   固定文本--由后端生成:FixedText   -->
       <div v-else-if="item.type === 'FixedText'">{{ item.value }}</div>
       <!--   可变文本:VarText   -->
       <div v-else-if="item.type === 'VarText'">
         <VarText
+          v-if="pageType.search(/edit/) > -1 || item.value"
           v-model="item.value"
           style="margin-top: -10px;"
           :title="item.title"
           :name="item.name"
           :dom-key="item.domKey"
         />
+<!--        <div v-else class="no-data">暂无{{ title }}数据</div>-->
       </div>
       <!--   富文本--用户可编辑:RichText   -->
       <div v-else-if="item.type === 'RichText'">
-        <RichText :dom-key="item.domKey" :item="item" />
+        <RichText v-if="pageType.search(/edit/) > -1 || item.value" :dom-key="item.domKey" :item="item" />
+        <div v-else class="no-data">暂无{{ title }}数据</div>
       </div>
       <div v-else>
-<!--        <fixedText-->
-<!--          v-model="item.value"-->
-<!--          :title="item.title"-->
-<!--          :name="item.name"-->
-<!--          :dom-key="item.domKey"-->
-<!--        />-->
+        <!--        <fixedText-->
+        <!--          v-model="item.value"-->
+        <!--          :title="item.title"-->
+        <!--          :name="item.name"-->
+        <!--          :dom-key="item.domKey"-->
+        <!--        />-->
       </div>
     </div>
   </div>
@@ -94,5 +104,9 @@ export default {
 .content-wrapper {
   //margin-top: 10px;
   //margin-bottom: 15px;
+  .no-data{
+    margin-top: 10px;
+    color: #666;
+  }
 }
 </style>

+ 20 - 16
src/views/monthlyReport/childrenPage/editReport/components/core.vue

@@ -2,17 +2,18 @@
   <div v-if="baseData.isVisible">
     <div v-if="baseData.type === 'Head1'" :id="baseData.domKey">
       <headTitle
-        style="margin-top: 40px;"
+        style="margin-top: 40px"
         :title="baseData.title"
+        @click.native.stop="baseDataShow"
       />
     </div>
     <div
       v-if="baseData.type.search(/Head2|Head3/) > -1"
       :id="baseData.domKey"
       :style="{
-        marginTop: baseData.type === 'Head3' ? '0' : '10.3px',
+        marginTop: baseData.type === 'Head3' ? '0' : '20.3px',
         marginBottom: '10px',
-        paddingTop: baseData.type === 'Head3' ? '0px' : '0.1px',
+        paddingTop: baseData.type === 'Head3' ? '0px' : '0.1px'
       }"
     >
       <!-- 不是业务线 -->
@@ -28,7 +29,7 @@
       <SubTitle
         v-if="headerTitle.indexOf('线下缺陷') > -1"
         :sub-title="baseData.subTitles"
-        style="margin-bottom: 10px;"
+        style="margin-bottom: 10px"
       />
       <span
         v-else-if="isSHowContent()"
@@ -49,7 +50,7 @@
     </div>
     <div
       v-if="baseData.content && baseData.content.length"
-      style="margin-bottom: 0px"
+      style="margin-bottom: 0"
     >
       <contentDom
         v-if="isSHowContent()"
@@ -226,18 +227,21 @@ export default {
       /*
        * 当页面处于全部查看时,并且页面数据状态 大于 10 ,并且 是业务线标题,并且 tab页签是·本月优秀·时,才进行判断当前数据是否显示*/
 
-      if (
-        this.pageDate &&
-        this.pageDate.status > 10 &&
-        this.tabsActive.search(/本月优秀/ > -1) &&
-        this.baseData &&
-        this.baseData.content[0] &&
-        this.baseData.content[0].type === 'RichText' &&
-        !this.baseData.content[0].value
-      ) {
-        return false
-      }
+      // if (
+      //   this.pageDate &&
+      //   this.pageDate.status > 10 &&
+      //   this.tabsActive.search(/本月优秀/ > -1) &&
+      //   this.baseData &&
+      //   this.baseData.content[0] &&
+      //   this.baseData.content[0].type === 'RichText' &&
+      //   !this.baseData.content[0].value
+      // ) {
+      //   return false
+      // }
       return true
+    },
+    baseDataShow() {
+      console.log(this.baseData)
     }
   }
 }

+ 133 - 36
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -2,6 +2,7 @@
   <div
     v-if="indexShow"
     ref="pageWrapper"
+    v-loading="loading"
     class="page-wrapper"
     @click.stop="$store.commit('monthlyReportEdit/INIT_EDIT_KEYS')"
   >
@@ -13,67 +14,106 @@
     >
       <template v-if="pageDate" slot="content">
         <el-button
-          v-if="pageDate && pageDate.status < 20 && (roleCode === 100 || roleCode === 50 || roleCode === 0)"
+          v-if="
+            pageDate &&
+              pageDate.status < 20 &&
+              (roleCode === 100 || roleCode === 50 || roleCode === 0)
+          "
           type="primary"
           size="small"
           @click="upDateReport('cb')"
           >保存
         </el-button>
         <el-button
-          v-if="pageDate && pageDate.status === 10 && (roleCode === 100 || roleCode === 50 || roleCode === 0)"
+          v-if="
+            pageDate &&
+              pageDate.status === 10 &&
+              (roleCode === 100 || roleCode === 50 || roleCode === 0)
+          "
           type="primary"
           size="small"
-          @click="confirmReport"
-          >月报确认
+          @click="dialogOpen('dialogConfirm')"
+          >月报确认<!-- @click="confirmReport" -->
         </el-button>
         <el-button
-          v-if="pageDate && pageDate.status < 10 && (roleCode === 100 || roleCode === 0)"
+          v-if="
+            pageDate &&
+              pageDate.status < 10 &&
+              (roleCode === 100 || roleCode === 0)
+          "
           plain
           size="small"
           @click="dialogOpen('dialogSend')"
           >发送确认
         </el-button>
         <el-button
-          v-if="$route.query.type === 'create' && pageDate && pageDate.status < 20 && (roleCode === 100 || roleCode === 0)"
+          v-if="
+            $route.query.type === 'create' &&
+              pageDate &&
+              pageDate.status < 20 &&
+              (roleCode === 100 || roleCode === 0)
+          "
           slot="reference"
           plain
           size="small"
-          @click="$store.dispatch('monthlyReportEdit/deleteReport', { isMsg: false, })"
+          @click="dialogOpen('dialogCancel')"
           >取消
         </el-button>
         <el-button
-          v-if="pageType.search(/All/) > -1 && pageDate && pageDate.status === 20 && (roleCode === 100 || roleCode === 0)"
+          v-if="
+            pageType.search(/All/) > -1 &&
+              pageDate &&
+              pageDate.status === 20 &&
+              (roleCode === 100 || roleCode === 0)
+          "
           slot="reference"
           plain
           size="small"
           @click="publishAllReport"
           >发布
         </el-button>
-        <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>
-          <el-dropdown
-            v-else
-            trigger="click"
-            @command="returnReport"
-          >
-            <span class="el-dropdown-link" style="cursor: pointer">
-              回退<i class="el-icon-arrow-down el-icon--right" />
-            </span>
+        <span
+          v-if="pageDate.status === 20 && (roleCode === 100 || roleCode === 0)"
+        >
+          <el-button
+            v-if="$route.query.pageType === 'read'"
+            slot="reference"
+            plain
+            size="small"
+            @click="returnReport('only')"
+            >回退
+          </el-button>
+          <el-dropdown v-else trigger="click" @command="returnReport">
+            <el-button
+              v-if="$route.query.pageType === 'read'"
+              slot="reference"
+              plain
+              size="small"
+              @click="returnReport('only')"
+            >
+              <span class="el-dropdown-link" style="cursor: pointer">
+                回退<i class="el-icon-arrow-down el-icon--right" />
+              </span>
+            </el-button>
             <el-dropdown-menu slot="dropdown">
               <el-dropdown-item command="all">全部</el-dropdown-item>
               <el-dropdown-item
                 v-for="item in subReportInfo"
                 :key="item.id"
                 :command="item.id"
-              >{{ item.reportName }}
+                >{{ item.reportName }}
               </el-dropdown-item>
             </el-dropdown-menu>
           </el-dropdown>
         </span>
         <el-button
-          v-if=" pageType.search(/All/) > -1 && (!$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"
@@ -117,10 +157,15 @@
             v-clickoutside="$refs.menu && $refs.menu.closeMenu"
             :listen-time="100"
             :offset-top="178"
-            :target="() => $refs && $refs.pageWrapper && $refs.pageWrapper.parentNode"
+            :target="
+              () => $refs && $refs.pageWrapper && $refs.pageWrapper.parentNode
+            "
             @change="userFun"
           >
-            <div class="set_scroll" style="max-height: 500px;overflow-y: scroll;">
+            <div
+              class="set_scroll"
+              style="max-height: 500px;overflow-y: scroll;"
+            >
               <Anchor
                 :list="tabPageData && tabPageData.children"
                 :active="anchorActive"
@@ -138,8 +183,8 @@
       ref="dialogDelete"
       is-succes
       :show-dialog="false"
-      :title="'删除'"
-      :width="'35%'"
+      :title="'删除月报'"
+      width="300px"
       @succes="deleteReport('删除')"
       @cancel="deleteReport('取消')"
     >
@@ -147,13 +192,28 @@
         确认删除当前月报 ?
       </div>
     </normal-dialog>
+    <!-- 月报取消 -->
+    <normal-dialog
+      ref="dialogCancel"
+      is-succes
+      :show-dialog="false"
+      :title="'取消月报'"
+      width="320px"
+      @succes="
+        $store.dispatch('monthlyReportEdit/deleteReport', { isMsg: false })
+      "
+    >
+      <div class="report-delete">
+        取消后填写的数据将不会保存,是否确认 ?
+      </div>
+    </normal-dialog>
     <!-- 月报发送确认 -->
     <normal-dialog
       ref="dialogSend"
       is-succes
       :show-dialog="false"
       :title="'发送确认'"
-      :width="'35%'"
+      width="300px"
       @succes="sendReport"
       @cancel="sendReport('取消')"
     >
@@ -161,6 +221,20 @@
         确认发送当前月报 ?
       </div>
     </normal-dialog>
+    <!-- 月报确认 -->
+    <normal-dialog
+      ref="dialogConfirm"
+      is-succes
+      :show-dialog="false"
+      :title="'确认月报'"
+      width="300px"
+      @succes="confirmReport"
+      @cancel="confirmReport('取消')"
+    >
+      <div class="report-delete">
+        确认数据已填写无误,进行月报确认吗 ?
+      </div>
+    </normal-dialog>
   </div>
 </template>
 
@@ -235,6 +309,9 @@ export default {
     },
     roleCode() {
       return this.$store.state.monthlyReportEdit.roleCode
+    },
+    loading() {
+      return this.$store.state.monthlyReportEdit.loading
     }
   },
   watch: {
@@ -261,7 +338,10 @@ export default {
       )
     }
     // 获取部门数据;只有查看但业务线时,才需要单独获取部门数据
-    if (this.$route.query.pageType === 'readAll' && this.$route.query.reportId) {
+    if (
+      this.$route.query.pageType === 'readAll' &&
+      this.$route.query.reportId
+    ) {
       this.$store.dispatch(
         'monthlyReportEdit/setSelectEnum',
         this.$route.query.reportId
@@ -367,12 +447,20 @@ export default {
     },
     // 月报更新
     upDateReport(key = 'cb', confirmReportBack) {
-      this.$store.dispatch(`monthlyReportEdit/${this.pageType.search(/All/) > -1 ? 'upDateReport' : 'upDateSubReport'}`, () => {
-        confirmReportBack && confirmReportBack()
-        if (key === 'cb') {
-          this.$router.push({ path: '/monthlyReport/index' })
+      this.$store.commit('monthlyReportEdit/SET_LOADING', true)
+      this.$store.dispatch(
+        `monthlyReportEdit/${
+          this.pageType.search(/All/) > -1 ? 'upDateReport' : 'upDateSubReport'
+        }`,
+        () => {
+          this.$store.commit('monthlyReportEdit/SET_LOADING', false)
+          confirmReportBack && confirmReportBack()
+          if (key === 'cb') {
+            this.$message.success('保存成功!')
+            // this.$router.push({ path: '/monthlyReport/index' })
+          }
         }
-      })
+      )
     },
     // 月报确认
     confirmReport() {
@@ -417,15 +505,17 @@ export default {
       this.$refs[key].visible = true
     },
     sendReport(key) {
-      this.$refs['dialogDelete'].visible = false
+      this.$refs['dialogSend'].visible = false
       if (key === '取消') {
         // this.$message('发送操作已取消!')
         return
       }
+      // this.$store.commit('monthlyReportEdit/SET_LOADING', true)
       this.upDateReport('nocb', () => {
         this.$store.dispatch('monthlyReportEdit/sendReport', {
           id: this.$route.query.reportId,
           callback: () => {
+            // this.$store.commit('monthlyReportEdit/SET_LOADING', false)
             this.$router.push({ path: '/monthlyReport/index' })
           }
         })
@@ -465,14 +555,21 @@ export default {
     width: 6px;
     //height: 8px;
   }
+
   &::-webkit-scrollbar-thumb {
     background-color: #c8cbcc;
     border-radius: 8px;
   }
+
   &::-webkit-scrollbar-track-piece {
     background: #d3d3d3;
   }
 }
+
+.report-delete {
+  text-align: center;
+}
+
 .content-wrapper {
   /deep/ .el-tabs__nav-wrap::after {
     height: 1px;
@@ -492,8 +589,8 @@ export default {
     }
 
     // .right-wrapper {
-      //flex: 1 1 0;
-      //display: contents;
+    //flex: 1 1 0;
+    //display: contents;
     // }
   }
 }