洪海涛 преди 4 години
родител
ревизия
1554c7665c

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

@@ -83,6 +83,14 @@ export function sendConfirm(data) {
     data
   })
 }
+// 子月报发送确认
+export function sendSubConfirm(data) {
+  return request({
+    url: projectManagementUrl + '/monthlyReport/confirm',
+    method: 'post',
+    data
+  })
+}
 
 // 月报回退  /monthlyReport/returnReport  subReportIds
 export function returnReport(data) {

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

@@ -7,7 +7,8 @@ import {
   getSubReport,
   getReportDependence,
   sendConfirm,
-  returnReport
+  returnReport,
+  sendSubConfirm
 } from '@/api/qualityMonthlyReport/edit'
 import { getAvaliableInfo } from '@/api/qualityMonthlyReport'
 
@@ -45,6 +46,7 @@ export default {
     subTitle: '新建月报',
     offsetList: [],
     /**
+     * 用户身份权限编号
      * 100        月报发起人
      * 50         确认人
      * 30         用户
@@ -562,6 +564,15 @@ export default {
         cb()
       }
     },
+    // 月报确认
+    async confirmReport({ state }, cb) {
+      const res = await sendSubConfirm({
+        subReportId: state.pageDate.id
+      })
+      if (res.code === 200) {
+        cb()
+      }
+    },
     // 月报回退
     async returnReport({ commit, state, context }, { data, cb }) {
       const res = await returnReport(data)

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

@@ -66,7 +66,7 @@
             v-else
             class="edit-wrapper"
             :style="{
-              cursor: pageDate.status === 0 ? 'pointer' : 'auto'
+              cursor: pageDate.status < 20 ? 'pointer' : 'auto'
             }"
           >
             <!--  <div v-if="editKeys.indexOf(`${scope.row.rowKey}_${index}`) > -1">  -->
@@ -205,7 +205,7 @@
       </el-table-column>
     </el-table>
     <div class="plus-table-data" :style="{ marginBottom: plusTableDataBottom }">
-      <el-button v-if="pageDate.status === 0" type="text" @click="addTableData">
+      <el-button v-if="pageDate.status < 20" type="text" @click="addTableData">
         <svg-icon icon-class="data-plus" class="icon" />
         新增
       </el-button>
@@ -324,7 +324,7 @@ export default {
     editLine(row, index) {
       // console.log(this.pageDate.status, this.domKey, this.editKeys)
       console.log(typeof this.pageDate.status)
-      if (this.pageDate.status === 0) {
+      if (this.pageDate.status < 20) {
         this.$store.commit('monthlyReportEdit/ADD_EDIT_KEYS', this.domKey)
       }
       this.$forceUpdate()
@@ -379,7 +379,7 @@ export default {
     setColumns(columns) {
       let newColumns = _.cloneDeep(columns)
       if (
-        this.pageDate.status &&
+        this.pageDate.status > 10 &&
         this.tabsActive.indexOf('本月重点问题') > -1
       ) {
         newColumns = [
@@ -403,7 +403,7 @@ export default {
           elm.align = 'center'
         }
       })
-      if (this.pageDate.status && this.tabsActive.indexOf('本月重点问题') < 0) {
+      if (this.pageDate.status > 10&& this.tabsActive.indexOf('本月重点问题') < 0) {
         newColumns.splice(newColumns.length - 1, 1)
       }
       return newColumns
@@ -470,7 +470,7 @@ export default {
      * @returns {boolean}
      */
     isShowButton(row) {
-      if (this.pageType.search(/edit/) > -1 && this.pageDate.status === 0) {
+      if (this.pageType.search(/edit/) > -1 && this.pageDate.status < 20) {
         return true
       }
       if (row.analyticFeedback && row.analyticFeedback.isCommitted) {

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

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div v-if="pageDate.status" v-html="item.value || '暂无数据!'" />
+    <div v-if="pageDate.status > 10" v-html="item.value || '暂无数据!'" />
     <normal-area
       v-else-if="editKeys.indexOf(item.domKey) > -1"
       :id="item.domKey"
@@ -41,7 +41,7 @@ export default {
   },
   methods: {
     editDom() {
-      if (this.pageDate.status === 0) {
+      if (this.pageDate.status < 20) {
         this.$store.commit(
           'monthlyReportEdit/ADD_EDIT_KEYS',
           // `${row.rowKey}_${index}`

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

@@ -8,7 +8,7 @@
       <div class="title">{{ name }}:</div>
       <div class="value">
         <el-input
-          v-if="pageDate.status === 0"
+          v-if="pageDate.status < 20"
           v-model="textValue"
           type="textarea"
           placeholder="请输入"

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

@@ -15,7 +15,7 @@
       />
       <span v-else :style="{color: baseData.depth === 3? '#333' : '#666'}" v-html="headerTitle" />
       <el-button
-        v-if="headerTitle.indexOf('线下缺陷') > -1 && pageDate.status === 0"
+        v-if="headerTitle.indexOf('线下缺陷') > -1 && pageDate.status < 20"
         type="text"
         style="margin-left: 5px"
         @click="marking"

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

@@ -7,7 +7,7 @@
       :style="menuStyle"
       :class="{ hide: show }"
     >
-      <el-dropdown-item v-if="pageDate.status === 0">
+      <el-dropdown-item v-if="pageDate.status < 20">
         <div @click.stop="hideDom">
           <!--
           menuData.item.isVisible === true
@@ -26,10 +26,10 @@
           }}
         </div>
       </el-dropdown-item>
-      <el-dropdown-item v-if="pageDate.status === 0">
+      <el-dropdown-item v-if="pageDate.status < 20">
         <div @click="addItem('添加同级子项')">添加同级子项</div>
       </el-dropdown-item>
-      <el-dropdown-item v-if="menuData.item.depth < 4 && pageDate.status === 0">
+      <el-dropdown-item v-if="menuData.item.depth < 4 && pageDate.status < 20">
         <div @click="addItem('添加子项')">添加下级子项</div>
       </el-dropdown-item>
     </div>

+ 19 - 6
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -5,30 +5,37 @@
       :sub-title="subTitle"
       address="/monthlyReport/index"
     >
-      <template v-if="pageDate && pageDate.status === 0" slot="content">
+      <template slot="content">
         <el-button
-          v-if="pageDate && pageDate.status === 0"
+          v-if="pageDate && pageDate.status < 20 && (roleCode === 100 || roleCode === 50 || roleCode === 0)"
           type="primary"
           size="small"
           @click="upDateReport"
           >保存
         </el-button>
         <el-button
-          v-if="pageDate && pageDate.status < 20"
+          v-if="pageDate && pageDate.status === 10 && (roleCode === 100 || roleCode === 50 || roleCode === 0)"
+          type="primary"
+          size="small"
+          @click="confirmReport"
+        >确认
+        </el-button>
+        <el-button
+          v-if="pageDate && pageDate.status < 10 && (roleCode === 100 || roleCode === 0)"
           plain
           size="small"
           @click="dialogOpen('dialogSend')"
           >发送确认
         </el-button>
         <el-button
-          v-if="pageDate && pageDate.status === 0"
+          v-if="pageDate && pageDate.status < 20 && (roleCode === 100 || roleCode === 0)"
           slot="reference"
           plain
           size="small"
           @click="$router.push({ path: '/monthlyReport/index' })"
           >取消
         </el-button>
-        <el-dropdown v-if="pageDate.status === 10" trigger="click" @command="returnReport">
+        <el-dropdown v-if="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>
@@ -43,7 +50,7 @@
           </el-dropdown-menu>
         </el-dropdown>
         <el-button
-          v-if="pageDate && pageDate.status > 0 && pageDate.status < 30"
+          v-if="roleCode === 100 || roleCode === 0"
           slot="reference"
           plain
           size="small"
@@ -332,6 +339,12 @@ export default {
         this.$router.push({ path: '/monthlyReport/index' })
       })
     },
+    // 月报确认
+    confirmReport() {
+      this.$store.dispatch('monthlyReportEdit/confirmReport', () => {
+        this.$router.push({ path: '/monthlyReport/index' })
+      })
+    },
     deleteReport(key) {
       this.$refs['dialogDelete'].visible = false
       if (key === '删除') {