Parcourir la source

月报设置:权限判断

洪海涛 il y a 4 ans
Parent
commit
b724a1c05b

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

@@ -109,3 +109,11 @@ export function getSubReport(params) {
     params
   })
 }
+// 月报发布
+export function publishReport(data) {
+  return request({
+    url: projectManagementUrl + '/monthlyReport/publish',
+    method: 'post',
+    data
+  })
+}

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

@@ -8,7 +8,8 @@ import {
   getReportDependence,
   sendConfirm,
   returnReport,
-  sendSubConfirm
+  sendSubConfirm,
+  publishReport
 } from '@/api/qualityMonthlyReport/edit'
 import { getAvaliableInfo } from '@/api/qualityMonthlyReport'
 
@@ -564,6 +565,16 @@ export default {
         cb()
       }
     },
+    // 月报发布
+    async publishAllReport({ commit, state, context }, { cb }) {
+      const res = await publishReport({
+        id: state.pageDate.id
+      })
+      if (res.code === 200) {
+        message.success('发布成功!')
+        cb()
+      }
+    },
     // 月报确认
     async confirmReport({ state }, cb) {
       const res = await sendSubConfirm({

+ 13 - 0
src/views/monthlyReport/childrenPage/editReport/index.vue

@@ -35,6 +35,14 @@
           @click="$router.push({ path: '/monthlyReport/index' })"
           >取消
         </el-button>
+        <el-button
+          v-if="pageType.search(/All/) > -1 && pageDate && pageDate.status === 20 && (roleCode === 100 || roleCode === 0)"
+          slot="reference"
+          plain
+          size="small"
+          @click="publishAllReport"
+        >发布
+        </el-button>
         <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" />
@@ -358,6 +366,11 @@ export default {
         // this.$message('删除操作已取消!')
       }
     },
+    publishAllReport(key) {
+      this.$store.dispatch('monthlyReportEdit/publishAllReport', () => {
+        this.$router.push({ path: '/monthlyReport/index' })
+      })
+    },
     tabClick(tab, event) {
       this.$store.dispatch('monthlyReportEdit/tabActiveChange', {
         ...this.$route.query,