Bläddra i källkod

月报编辑页:功能优化

洪海涛 4 år sedan
förälder
incheckning
2eadef3b1e

+ 10 - 0
src/api/qualityMonthlyReport/edit.js

@@ -82,3 +82,13 @@ export function getReportDependence(params) {
     params
   })
 }
+
+// 月报发送确认
+
+export function sendConfirm(data) {
+  return request({
+    url: projectManagementUrl + '/monthlyReport/sendConfirm',
+    method: 'post',
+    data
+  })
+}

+ 80 - 11
src/store/modules/monthlyReport/edit/index.js

@@ -5,7 +5,8 @@ import {
   delMonthlyReport,
   getAllSubReportCatalog,
   getSubReport,
-  getReportDependence
+  getReportDependence,
+  sendConfirm
 } from '@/api/qualityMonthlyReport/edit'
 import {
   reportDataBack,
@@ -60,6 +61,7 @@ export default {
       }
       state.pageDate = { ...params }
       delete state.pageDate.subReports
+      state.subTitle = state.pageDate.reportName
       const subReports = [...params.subReports]
       // 设置部门数据
       state.selectEnum = [...params.dependence.deptArch.children]
@@ -117,7 +119,7 @@ export default {
           `${elm.id}` === setTabActive('tab_', tabsActive || state.tabsActive)
         )
       })
-      console.log(tabPageData)
+      // console.log(tabPageData)
       if (tabsActive) {
         state.tabsActive = `tab_${tabsActive}`
       }
@@ -214,11 +216,9 @@ export default {
       //       })
     },
     // 切换tabs之后,重新生成左侧树
-    CREATE_TREE_DATA(state) {
-    },
+    CREATE_TREE_DATA(state) {},
     // 菜单添加子项setInit
-    ADD_MENU_CHILDREN(state, params) {
-    },
+    ADD_MENU_CHILDREN(state, params) {},
     // 获取子页面所有距离顶部的集合基础信息
     GET_ALL_OFFSETTOP(state) {
       const getOffsetTop = (id) => {
@@ -357,6 +357,67 @@ export default {
     SET_SELECT_ENUM(state, params) {
       state.selectEnum = params
       setDeptArch(state.selectEnum)
+    },
+    // 标记为本月重点问题
+    MARK_ISSUES(state, { cascaderValue, normalAreaName, multiplePeople }) {
+      let isAdd = true
+      const run = (arr) => {
+        arr.forEach((elm) => {
+          if (
+            isAdd &&
+            elm.title === '本月重点问题' &&
+            elm.content &&
+            elm.content.length
+          ) {
+            elm.content.forEach((item) => {
+              if (item.type === 'Table') {
+                const row = { analyticFeedback: null }
+                item.tableHeaders.forEach((subItem) => {
+                  if (subItem.name === '团队') {
+                    row[subItem.headerKey] = cascaderValue
+                  }
+                  if (subItem.name === '问题') {
+                    row[subItem.headerKey] = normalAreaName
+                  }
+                  if (subItem.name === '责任人') {
+                    row[subItem.headerKey] = multiplePeople
+                  }
+                })
+                if (!item.tableRows) {
+                  item.tableRows = []
+                }
+                item.tableRows.push(row)
+                isAdd = false
+              }
+            })
+          }
+          if (isAdd && elm.children && elm.children.length) {
+            run(elm.children)
+          }
+        })
+      }
+      run(state.tabPageData.children)
+    },
+    // 设置右侧树的提示内容
+    SET_HEADER_TITLE(state, { domKey, headerTitle }) {
+      // console.log(domKey, headerTitle)
+      let isAdd = true
+      const run = (arr) => {
+        arr.forEach((elm) => {
+          if (isAdd && elm.domKey === domKey) {
+            elm.headerTitle = headerTitle
+            // console.log(elm)
+            isAdd = false
+          }
+          if (isAdd && elm.content && elm.content.length) {
+            run(elm.content)
+          }
+          if (isAdd && elm.children && elm.children.length) {
+            run(elm.children)
+          }
+        })
+      }
+      run(state.tabPageData.children)
     }
   },
   actions: {
@@ -365,7 +426,6 @@ export default {
       { commit, state, dispatch },
       { id, subReportId, subActive }
     ) {
-      console.log()
       const { pageType } = state
       if (pageType === 'readAll' || pageType === 'read') {
         commit('INIT_PAGE_DATA')
@@ -424,7 +484,7 @@ export default {
       }
     },
     // 月报提交
-    async upDateReport({ commit, state }, id) {
+    async upDateReport({ commit, state }, cb) {
       const params = _.cloneDeep(state.pageDate)
       const tabPageData = _.cloneDeep(state.tabPageData)
       const tabsActive = setTabActive('tab_', state.tabsActive)
@@ -439,10 +499,10 @@ export default {
         return elm
       })
       // 转换数据结构
-      console.log(params)
+      // console.log(params)
       const res = await updateMonthlyReport(params)
       if (res.code === 200) {
-        this.$router.push({ path: '/monthlyReport/index' })
+        cb()
       }
     },
     // 获取部门数据
@@ -457,7 +517,16 @@ export default {
     async deleteReport({ commit, state, context }, { key, cb }) {
       const res = await delMonthlyReport(state.pageDate.id)
       if (res.code === 200) {
-        message.success(`${key === 'cancel' ? '取消' : '删除'}成功!`)
+        message.success('删除成功!')
+        cb()
+      }
+    },
+    async sendReport({ commit, state, context }, { cb }) {
+      const res = await sendConfirm({
+        id: state.pageDate.id
+      })
+      if (res.code === 200) {
+        message.success('发送成功!')
         cb()
       }
     }

+ 58 - 0
src/views/monthlyReport/childrenPage/editReport/components/Hold.vue

@@ -0,0 +1,58 @@
+<template>
+  <normal-dialog
+    ref="normalDialog"
+    :show-dialog="false"
+    is-succes
+    title="Hold"
+    width="400px"
+    @succes="updateModule"
+  >
+    <div class="box-wrapper">
+      <el-input
+        v-model="holdReason"
+        class="detail"
+        type="textarea"
+        :rows="2"
+        placeholder="请输入Hold原因(选填)"
+      />
+    </div>
+  </normal-dialog>
+</template>
+
+<script>
+// import _ from 'lodash'
+import normalDialog from '@/components/dialog/normalDialog'
+
+export default {
+  name: 'Analysis',
+  components: { normalDialog },
+  data() {
+    return {
+      index: '',
+      subIndex: '',
+      holdReason: ''
+    }
+  },
+  methods: {
+    open(index, subIndex, holdReason) {
+      this.index = index
+      this.subIndex = subIndex
+      this.holdReason = holdReason
+      this.$refs.normalDialog.visible = true
+    },
+    updateModule() {
+      this.$emit('upData', {
+        index: this.index,
+        subIndex: this.subIndex,
+        holdReason: this.holdReason
+      })
+      this.$refs.normalDialog.visible = false
+    }
+  }
+}
+</script>
+
+<style scoped lang="less">
+.box-wrapper {
+}
+</style>

+ 71 - 41
src/views/monthlyReport/childrenPage/editReport/components/MrTable.vue

@@ -32,7 +32,10 @@
         <template slot-scope="scope">
           <!--    展开    -->
           <div v-if="item.type === 'expand'">
-            <TableExpandRow :analytic-feedback="scope.row.analyticFeedback" @upAnalyticFeedback="setAnalyticFeedback" />
+            <TableExpandRow
+              :analytic-feedback="scope.row.analyticFeedback"
+              @upAnalyticFeedback="setAnalyticFeedback"
+            />
           </div>
           <!--    操作列    -->
           <div v-else-if="item.name === '操作'">
@@ -41,10 +44,7 @@
               :key="btnIndex"
             >
               <el-button
-                v-if="
-                  scope.row.analyticFeedback &&
-                    !scope.row.analyticFeedback.isCommitted
-                "
+                v-if="isShowButton(scope.row)"
                 size="mini"
                 type="text"
                 @click="btnFun(btnItem, scope)"
@@ -109,8 +109,8 @@
                     :key="optionItem"
                     :label="optionItem"
                     :value="optionItem"
-                    >{{ optionItem }}</el-option
-                  >
+                    >{{ optionItem }}
+                  </el-option>
                 </el-select>
               </div>
               <el-input
@@ -199,6 +199,7 @@
       </el-button>
     </div>
     <slot name="fixedText" />
+    <markingIssues ref="markingIssues" />
     <Analysis ref="Analysis" @upData="upDataAnalysis" />
   </div>
 </template>
@@ -210,6 +211,7 @@ import Analysis from './Analysis'
 import CascaderInfo from './CascaderInfo'
 import MultiplePeopleInfo from './MultiplePeopleInfo'
 import TableExpandRow from './TableExpandRow'
+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'
@@ -221,7 +223,8 @@ export default {
     CascaderInfo,
     searchPeople,
     MultiplePeopleInfo,
-    TableExpandRow
+    TableExpandRow,
+    markingIssues
   },
   props: {
     plusTableDataBottom: {
@@ -313,7 +316,14 @@ export default {
         this.tableData.splice(scope.$index, 1)
       }
       if (btnItem.value === '标记') {
-        this.tableData.splice(scope.$index, 1)
+        this.$refs.markingIssues.modalShow = true
+        this.$nextTick(() => {
+          this.$refs.markingIssues.openModal({
+            title: '标记为重点问题',
+            scope,
+            columns: this.columns
+          })
+        })
       }
       if (btnItem.value === '分析反馈') {
         console.log(293, btnItem, scope)
@@ -322,9 +332,13 @@ export default {
     },
     // 分析反馈问题更新
     upDataAnalysis({ rowIndex, analyticFeedback }) {
-      console.log(rowIndex, analyticFeedback)
-      this.tableData[rowIndex].analyticFeedback = _.cloneDeep(analyticFeedback)
-      this.setAnalyticFeedback()
+      if (this.pageType !== 'edit') {
+        console.log(rowIndex, analyticFeedback)
+        this.tableData[rowIndex].analyticFeedback = _.cloneDeep(
+          analyticFeedback
+        )
+        this.setAnalyticFeedback()
+      }
     },
     addTableData() {
       const item = {
@@ -391,36 +405,45 @@ export default {
     },
     // 查看页面数据分析
     setAnalyticFeedback() {
-      // this.$refs.Analysis.open()
-      console.log(this.domKey)
-      const tabPageData = reportDataBack(_.cloneDeep(this.tabPageData))
-      let obj = null
-      const run = (arr) => {
-        arr.forEach((elm) => {
-          if (elm.content.length) {
-            elm.content.forEach((item) => {
-              if (item.domKey === this.domKey) {
-                console.log(elm)
-                obj = _.cloneDeep(elm)
-              }
-            })
+      if (this.pageType !== 'edit') {
+        // this.$refs.Analysis.open()
+        console.log(this.domKey)
+        const tabPageData = reportDataBack(_.cloneDeep(this.tabPageData))
+        let obj = null
+        const run = (arr) => {
+          arr.forEach((elm) => {
+            if (elm.content.length) {
+              elm.content.forEach((item) => {
+                if (item.domKey === this.domKey) {
+                  console.log(elm)
+                  obj = _.cloneDeep(elm)
+                }
+              })
+            }
+          })
+        }
+        run(tabPageData.children)
+        console.log(obj)
+        // 提交数据
+        updateAnalyticFeedback({
+          reportId: this.$route.query.reportId,
+          reportCatalog: obj
+        }).then((res) => {
+          if (res.code === 200) {
+            console.log(res.data)
           }
         })
+        // console.log(this.domKey)
+        // console.log(this.title)
       }
-      run(tabPageData.children)
-      console.log(obj)
-      // 提交数据
-      updateAnalyticFeedback({
-        reportId: this.$route.query.reportId,
-        reportCatalog: obj
-
-      }).then((res) => {
-        if (res.code === 200) {
-          console.log(res.data)
-        }
-      })
-      // console.log(this.domKey)
-      // console.log(this.title)
+    },
+    // 操作按钮是否显示隐藏
+    isShowButton(row) {
+      if (this.pageType === 'edit') return true
+      if (row.analyticFeedback && row.analyticFeedback.isCommitted) {
+        return false
+      }
+      return true
     }
   }
 }
@@ -437,14 +460,17 @@ export default {
 .plus-table-data {
   margin-top: 2px;
 }
-/deep/.el-table__expand-column {
+
+/deep/ .el-table__expand-column {
   border-right: 0;
+
   .el-icon-arrow-right:before {
     // 这是展开图标
     border: 1px solid rgba(0, 0, 0, 0.14901960784313725);
   }
 }
-/deep/.el-table__expand-column .cell {
+
+/deep/ .el-table__expand-column .cell {
   .el-table__expand-icon {
     .el-icon-arrow-right:before {
       // 这是展开图标
@@ -452,10 +478,12 @@ export default {
       //content: "\e6d8";
     }
   }
+
   .el-table__expand-icon--expanded {
     // 这是点击后的旋转角度
     //transform: rotate(180deg);
     transform: rotate(0deg);
+
     .el-icon-arrow-right:before {
       // 这是展开图标
       //content: "\e6d9";
@@ -463,9 +491,11 @@ export default {
     }
   }
 }
+
 .red {
   color: red;
 }
+
 .yellow {
   color: yellow;
 }

+ 40 - 4
src/views/monthlyReport/childrenPage/editReport/components/anchor.vue

@@ -40,17 +40,22 @@
           class="item"
           effect="dark"
           :enterable="true"
-          :content="item.title"
+          :disabled="tooltip[`anchor_${index}`] && tooltip[`anchor_${index}`].isTooltip"
+          :content="item.headerTitle || item.title"
           placement="top-start"
         >
           <div
+            :ref="`anchor_${index}`"
             class="mi"
-            :class="{hide: !item.isVisible}"
+            :class="{ hide: !item.isVisible }"
             @contextmenu.prevent="openMenu($event, item)"
             @click="change(item)"
             @mousemove="mouseMoveItem({ event: $event, item })"
           >
-            <span class="title" :class="{ active: active === item.domKey, hide: !item.isVisible}">
+            <span
+              class="title"
+              :class="{ active: active === item.domKey, hide: !item.isVisible }"
+            >
               {{ item.title }}</span
             >
           </div>
@@ -154,6 +159,7 @@ export default {
   },
   data() {
     return {
+      tooltip: {},
       tooltipValue: false
     }
   },
@@ -162,6 +168,11 @@ export default {
       return this.$store.state.monthlyReportEdit.subTabsActive
     }
   },
+  mounted() {
+    setTimeout(() => {
+      this.tooltipShow()
+    }, 1500)
+  },
   methods: {
     mouseMoveItem(event, item) {
       // console.log(event, item, 66)
@@ -191,6 +202,31 @@ export default {
       this.tooltipValue = false
       this.hide = false
       this.$emit('openMenu', { event, item })
+    },
+    tooltipShow() {
+      this.$nextTick && this.$nextTick(() => {
+        this.$refs && Object.keys(this.$refs).forEach((key, index) => {
+          // if (this.$refs[key] && this.$refs[key][0]) {
+          //   const { scrollWidth, offsetWidth } = this.$refs[key][0]
+          //   this.tooltip[key] = {
+          //     isTooltip: true
+          //   }
+          //   if (scrollWidth > offsetWidth) {
+          //     console.log(this.list[index].isTooltip)
+          //     this.tooltip[key].isTooltip = false
+          //   }
+          // }
+          const { scrollWidth, offsetWidth } = this.$refs[key][0]
+          this.tooltip[key] = {
+            isTooltip: true
+          }
+          if (scrollWidth > offsetWidth) {
+            console.log(this.list[index].isTooltip)
+            this.tooltip[key].isTooltip = false
+          }
+        })
+        this.$forceUpdate()
+      })
     }
   }
 }
@@ -222,7 +258,7 @@ export default {
         color: #999999;
       }
 
-      &.visible{
+      &.visible {
         color: #999999;
       }
     }

+ 56 - 25
src/views/monthlyReport/childrenPage/editReport/components/core.vue

@@ -1,19 +1,28 @@
 <template>
   <div v-show="baseData.isVisible">
-
-    <div v-if="baseData.type === 'Head1'" :id="baseData.domKey"><headTitle
-        :title="baseData.title"
-      />
+    <div v-if="baseData.type === 'Head1'" :id="baseData.domKey">
+      <headTitle :title="baseData.title" />
     </div>
     <div
       v-if="baseData.type.search(/Head2|Head3/) > -1"
       :id="baseData.domKey"
       style="margin-top: 10px;"
     >
-       {{ headerIndex }}{{ headerTitle }}
+      {{ headerIndex }}{{ headerTitle }}
+      <el-button
+        v-if="headerTitle.indexOf('线下缺陷') > -1"
+        size="mini"
+        type="text"
+        style="margin-left: 5px"
+        @click="marking"
+        >标记
+      </el-button>
     </div>
-    <div v-if="baseData.content && baseData.content.length" style="margin-bottom: 10px">
-      <contentDom :base-data="baseData.content" :title='baseData.title' />
+    <div
+      v-if="baseData.content && baseData.content.length"
+      style="margin-bottom: 10px"
+    >
+      <contentDom :base-data="baseData.content" :title="baseData.title" />
     </div>
     <div v-if="baseData.children && baseData.children.length">
       <div v-if="baseData.children[0].type === 'Tag'">
@@ -24,10 +33,9 @@
             :label="item.title"
             :name="item.domKey"
             :dom-index="index"
-            ><Core
-:key="item.domKey"
-:base-data="item"
-          /></el-tab-pane>
+          >
+            <Core :key="item.domKey" :dom-index="index" :base-data="item" />
+          </el-tab-pane>
         </el-tabs>
       </div>
       <div v-else>
@@ -39,6 +47,7 @@
         />
       </div>
     </div>
+    <markingIssues ref="markingIssues" />
   </div>
 </template>
 
@@ -46,12 +55,14 @@
 import headTitle from '@/components/headTitle'
 import contentDom from './content'
 import { toChinesNum } from '@/utils'
+import markingIssues from '@/views/monthlyReport/childrenPage/editReport/components/markingIssues'
 
 export default {
   name: 'Core',
   components: {
     headTitle,
-    contentDom
+    contentDom,
+    markingIssues
   },
   props: {
     baseData: {
@@ -74,9 +85,9 @@ export default {
   computed: {
     headerIndex() {
       if (this.baseData.depth === 3) {
-        return this.domIndex ? `${toChinesNum(this.domIndex)}、` : ''
+        return `${toChinesNum(this.domIndex + 1)}、`
       }
-      return this.domIndex ? `${this.domIndex}、` : ''
+      return `${this.domIndex + 1}、`
     }
   },
   watch: {
@@ -120,6 +131,10 @@ export default {
       const title = `${this.baseData.title}`
       if (title.search(/\{param\}/) > -1) {
         this.headerTitle = this.generalDelayTitle(title)
+        this.$store.commit('monthlyReportEdit/SET_HEADER_TITLE', {
+          domKey: this.baseData.domKey,
+          headerTitle: `${this.headerTitle}`
+        })
         return
       }
       this.headerTitle = title
@@ -131,17 +146,32 @@ export default {
       const { headerKey, selectEnum } = tableHeaders[0]
       let test1 = 0
       let test2 = 0
-      tableRows && tableRows.length && tableRows.forEach(elm => {
-        if (elm[headerKey] && elm[headerKey] === selectEnum[0]) {
-          test1++
-        }
-        if (elm[headerKey] && elm[headerKey] === selectEnum[1]) {
-          test2++
-        }
-      })
+      tableRows &&
+        tableRows.length &&
+        tableRows.forEach((elm) => {
+          if (elm[headerKey] && elm[headerKey] === selectEnum[0]) {
+            test1++
+          }
+          if (elm[headerKey] && elm[headerKey] === selectEnum[1]) {
+            test2++
+          }
+        })
       newTitle = newTitle.replace('{param}', test1)
       newTitle = newTitle.replace('{param}', test2)
       return newTitle
+    },
+    // 标记为重点问题
+    marking() {
+      this.$refs.markingIssues.modalShow = true
+      const params = {
+        title: '标记为重点问题'
+      }
+      if (this.baseData.content.length) {
+        params.normalAreaName = this.baseData.content[0].value
+      }
+      this.$nextTick(() => {
+        this.$refs.markingIssues.openModal(params)
+      })
     }
   }
 }
@@ -149,11 +179,12 @@ export default {
 
 <style scoped lang="less">
 /*elm-tabs 默认样式处理*/
-/deep/.el-tabs__active-bar,
-/deep/.el-tabs__nav-wrap::after {
+/deep/ .el-tabs__active-bar,
+/deep/ .el-tabs__nav-wrap::after {
   display: none;
 }
-/deep/.el-tabs__header {
+
+/deep/ .el-tabs__header {
   margin-bottom: 0;
 }
 </style>

+ 70 - 67
src/views/monthlyReport/childrenPage/editReport/components/markingIssues.vue

@@ -1,44 +1,59 @@
 <template>
-  <div v-clickoutside="()=> modalShow = false">
-    <modal
-:visible="modalShow"
-:bg="false"
-:title="titleName"
-:box-styles="{
-      height:'calc(60vh - 118px)'
-    }"
-@close="modalClose">
-      <el-form label-width="50px">
+  <div>
+    <normal-dialog
+      v-if="modalShow"
+      ref="normalDialog"
+      :show-dialog="false"
+      is-succes
+      :title="titleName"
+      width="40%"
+      @succes="updateModule"
+    >
+      <el-form label-width="100px" style="padding-right: 30px">
         <el-form-item label="问题">
-          <el-input v-model="normalAreaName" autocomplete="off" placeholder="请输入问题" />
+          <el-input
+            v-model="normalAreaName"
+            autocomplete="off"
+            size="mini"
+            maxlength="100"
+            show-word-limit
+            placeholder="请输入问题"
+          />
         </el-form-item>
-        <el-form-item label="内容">
+        <el-form-item label="责任团队">
           <el-cascader
             v-model="cascaderValue"
+            style="width: 100%"
             :options="selectEnum"
             size="mini"
             collapse-tags
             :props="{ multiple: true }"
-            clearable />
+            clearable
+          />
+        </el-form-item>
+        <el-form-item label="责任人">
+          <searchPeople
+            style="width: 100%"
+            :value.sync="multiplePeople"
+            :multiple="true"
+          />
         </el-form-item>
       </el-form>
-      <div slot="footer">
-        <el-button @click="modalShow = false">取 消</el-button>
-        <el-button type="primary" @click="addItem">确 定</el-button>
-      </div>
-    </modal>
+    </normal-dialog>
   </div>
 </template>
 <script>
-import modal from '@/components/modal'
-import normalArea from '@/components/input/normalArea'
 import { uuid10 } from '@/utils'
+import normalDialog from '@/components/dialog/normalDialog'
 import Clickoutside from 'element-ui/src/utils/clickoutside'
+import searchPeople from '@/components/select/searchPeople'
+// import _ from 'lodash' // 人员select
+
 export default {
   name: 'CreatedItem',
   components: {
-    normalArea,
-    modal
+    normalDialog,
+    searchPeople
   },
   directives: { Clickoutside },
   data() {
@@ -47,68 +62,56 @@ export default {
       titleName: '标记为重点问题',
       normalAreaName: '',
       menuData: '',
-      cascaderValue: ''
+      callBack: null,
+      columns: null,
+      cascaderValue: null,
+      multiplePeople: null
     }
   },
   computed: {
+    tabPageData() {
+      return this.$store.state.monthlyReportEdit.tabPageData
+    },
     selectEnum() {
       return this.$store.state.monthlyReportEdit.selectEnum
     }
   },
   methods: {
     uuid10,
-    openModal(title, menuData) {
+    openModal({ title, scope, columns, normalAreaName }) {
+      console.log({ title, scope, columns, normalAreaName })
       this.titleName = title
-      this.menuData = menuData
+      if (scope) this.menuData = scope.row
+      if (columns) this.columns = columns
+      this.$refs.normalDialog.visible = true
       this.modalShow = true
+      if (normalAreaName) this.normalAreaName = normalAreaName
+      this.setDefaultValues()
     },
-    addItem() {
-      const params = {
-        'children': [],
-        'content': [
-          {
-            'name': null,
-            'tableHeaders': [],
-            'tableRows': [],
-            'type': 'RichText',
-            domKey: uuid10(4),
-            'value': `${this.normalAreaValue}`
+    // 设置默认值
+    setDefaultValues() {
+      this.columns &&
+        this.columns.forEach((elm) => {
+          if (elm.name === '问题') {
+            this.normalAreaName = this.menuData[elm.headerKey]
+          }
+          if (elm.name === '团队') {
+            this.cascaderValue = this.menuData[elm.headerKey]
+          }
+          if (elm.name === '负责人') {
+            this.multiplePeople = [this.menuData[elm.headerKey]]
           }
-        ],
-        'depth': this.menuData.depth + 1,
-        'fromUser': true,
-        'hiddenAncestor': null,
-        'isVisible': true,
-        domKey: uuid10(4),
-        'title': `${this.normalAreaName}`,
-        'type': 'Head2'
-      }
-
-      // 添加同级子项
-      // 添加子项
-      if (this.titleName === '添加同级子项') {
-        params.depth = this.menuData.depth
-        if (this.menuData.depth === 0) {
-          params.type = 'Head1'
-        }
-        this.$store.commit('monthlyReportEdit/ADD_ITEM', {
-          domKey: this.menuData.domKey, params: { ...params }
-        })
-      }
-      if (this.titleName === '添加子项') {
-        this.$store.commit('monthlyReportEdit/ADD_ITEM', {
-          domKey: this.menuData.domKey, params: { ...params }, isSub: true
         })
-      }
-      this.modalClose()
     },
-    modalClose() {
-      this.normalAreaName = ''
-      this.menuData = ''
-      this.normalAreaValue = ''
+    updateModule() {
+      this.$store.commit('monthlyReportEdit/MARK_ISSUES', {
+        cascaderValue: this.cascaderValue,
+        normalAreaName: this.normalAreaName,
+        multiplePeople: this.multiplePeople
+      })
       this.modalShow = false
+      this.$refs.normalDialog.visible = false
     }
   }
-
 }
 </script>

+ 85 - 30
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -2,14 +2,18 @@
   <div ref="pageWrapper" class="page-wrapper" @click="setInit">
     <headerCom title="月报" :sub-title="subTitle">
       <template v-if="pageType === 'edit'" slot="content">
-        {{ tabsActive }}
         <el-button
 type="primary"
 size="small"
 @click="upDateReport"
           >保存
         </el-button>
-        <el-button plain size="small">发送确认</el-button>
+        <el-button
+plain
+size="small"
+@click="dialogOpen('dialogSend')"
+          >发送确认
+        </el-button>
         <el-button
           slot="reference"
           plain
@@ -17,17 +21,18 @@ size="small"
           @click="$router.push({ path: '/monthlyReport/index' })"
           >取消
         </el-button>
-        <el-popconfirm
-          title="确认删除当前月报吗?"
-          @confirm="delectReport('delete')"
-        >
-          <el-button slot="reference" plain size="small">删除</el-button>
-        </el-popconfirm>
+        <el-button
+          slot="reference"
+          plain
+          size="small"
+          @click="dialogOpen('dialogDelete')"
+          >删除
+        </el-button>
       </template>
     </headerCom>
-<!--     <div style="position: fixed;z-index: 99; top: 20px">
-      <el-button type="primary" @click="test">test</el-button>
-    </div> -->
+    <!--     <div style="position: fixed;z-index: 99; top: 20px">
+          <el-button type="primary" @click="test">test</el-button>
+        </div> -->
     <!--  content  -->
     <div class="content-wrapper">
       <el-tabs
@@ -45,9 +50,10 @@ size="small"
       <div class="body-wrapper">
         <div class="left-wrapper">
           <div v-if="tabPageShow">
-            <Croe
-              v-for="item in tabPageData.children"
+            <Core
+              v-for="(item, index) in tabPageData.children"
               :key="item.domKey"
+              :dom-index="index"
               :base-data="item"
             />
           </div>
@@ -72,6 +78,34 @@ size="small"
         </div>
       </div>
     </div>
+    <!-- 月报发送确认 -->
+    <normal-dialog
+      ref="dialogDelete"
+      is-succes
+      :show-dialog="false"
+      :title="'删除'"
+      :width="'35%'"
+      @succes="deleteReport('删除')"
+      @cancel="deleteReport('取消')"
+    >
+      <div class="report-delete">
+        确认删除当前月报 ?
+      </div>
+    </normal-dialog>
+    <!-- 月报发送确认 -->
+    <normal-dialog
+      ref="dialogSend"
+      is-succes
+      :show-dialog="false"
+      :title="'发送确认'"
+      :width="'35%'"
+      @succes="sendReport"
+      @cancel="sendReport('取消')"
+    >
+      <div class="report-delete">
+        确认发送当前月报 ?
+      </div>
+    </normal-dialog>
   </div>
 </template>
 
@@ -80,8 +114,10 @@ import headerCom from '../../components/header'
 import Affix from '@/components/affix/affix'
 import Anchor from './components/anchor'
 import Menu from './components/menu'
-import Croe from './components/core'
+import Core from './components/core'
 import Clickoutside from 'element-ui/src/utils/clickoutside'
+import normalDialog from '@/components/dialog/normalDialog'
+import { sendConfirm } from '@/api/qualityMonthlyReport/edit'
 
 // import {
 //   getMonthlyReport,
@@ -96,7 +132,8 @@ export default {
     Affix,
     Anchor,
     Menu,
-    Croe
+    Core,
+    normalDialog
   },
   directives: { Clickoutside },
   data() {
@@ -150,7 +187,10 @@ export default {
   },
   mounted() {
     if (this.$route.query.pageType === 'read' && this.$route.query.reportId) {
-      this.$store.dispatch('monthlyReportEdit/setSelectEnum', this.$route.query.reportId)
+      this.$store.dispatch(
+        'monthlyReportEdit/setSelectEnum',
+        this.$route.query.reportId
+      )
     }
     if (this.$route.query.pageType === 'readAll') {
       this.$store.commit('monthlyReportEdit/SET_SUB_TITLE', '查看完整月报')
@@ -250,22 +290,22 @@ export default {
     },
     // 月报更新
     upDateReport() {
-      this.$store.dispatch('monthlyReportEdit/upDateReport')
-    },
-    delectReport(key) {
-      this.$store.dispatch('monthlyReportEdit/deleteReport', {
-        key,
-        cb: () => {
-          this.$router.push({ path: '/monthlyReport/index' })
-        }
+      this.$store.dispatch('monthlyReportEdit/upDateReport', () => {
+        this.$router.push({ path: '/monthlyReport/index' })
       })
     },
-    test() {
-      console.log(this.$store.state.monthlyReportEdit)
-      // console.log(this.$store.state.monthlyReportEdit.reportData[0].children[0].content[0].tableRows[0])
-      // console.log(this.subTabsActive)
-      // console.log(JSON.stringify(this.offsetList, null, 2))
-      // console.log(JSON.stringify(this.$store.state.monthlyReportEdit.reportData[0].children[0].content[0].tableRows[0], null, 2))
+    deleteReport(key) {
+      this.$refs['dialogDelete'].visible = false
+      if (key === '删除') {
+        this.$store.dispatch('monthlyReportEdit/deleteReport', {
+          key,
+          cb: () => {
+            this.$router.push({ path: '/monthlyReport/index' })
+          }
+        })
+      } else {
+        // this.$message('删除操作已取消!')
+      }
     },
     tabClick(tab, event) {
       this.$store.dispatch('monthlyReportEdit/tabActiveChange', {
@@ -277,6 +317,21 @@ export default {
       // this.$nextTick(() => {
       //   this.$store.commit('monthlyReportEdit/GET_ALL_OFFSETTOP')
       // })
+    },
+    dialogOpen(key) {
+      this.$refs[key].visible = true
+    },
+    sendReport(key) {
+      this.$refs['dialogDelete'].visible = false
+      if (key === '取消') {
+        // this.$message('发送操作已取消!')
+        return
+      }
+      this.$store.dispatch('monthlyReportEdit/sendReport', {
+        cb: () => {
+          this.$router.push({ path: '/monthlyReport/index' })
+        }
+      })
     }
   }
 }