Bladeren bron

智能研报配置审批流

cxmo 1 jaar geleden
bovenliggende
commit
2f024c0844

+ 1 - 1
src/utils/buttonConfig.js

@@ -645,7 +645,7 @@ export const approvePermission = {
 
 //创建了新的ManageBtn记得添加到这里
 const btnMap  = {
-    reportManageBtn,enReportManageBtn,
+    reportManageBtn,enReportManageBtn,smartReportManageBtn,
     classifyBtn,enClassifyBtn,authorManage,
     enChartPermission,cloudDisk,
     pptPermission,enPPTPermission,

+ 1 - 1
src/views/report_manage/reportEn/reportEditor.vue

@@ -777,7 +777,7 @@ export default {
 			// }
 		},
 		submitReport(){
-			approveInterence.reportSmartSubmit({
+			approveInterence.reportEnSubmit({
 				ReportId:Number(this.report_id)
 			}).then(res=>{
 				if(res.Ret!==200) return

+ 21 - 6
src/views/report_manage/reportEn/reportlist.vue

@@ -156,6 +156,9 @@
                 <i class="el-icon-warning"/>
               </el-tooltip>
             </span>
+            <span v-else-if="item.key==='PublishTime'">
+                {{isApprove?'审批时间':'发布时间'}}
+            </span>
             <span v-else>{{ item.label }}</span>
           </template>	
 					<template slot-scope="{row}">
@@ -168,7 +171,12 @@
                 <!-- <span v-if="row.ClassifyNameSecond">/ {{row.ClassifyNameSecond}}</span> -->
               </span>
               <span v-else-if="item.key==='State'" :style="row.State===2 && 'color:#46C371;'">
-                {{row.State===2 ? '已发布' : '未发布'}}
+                <span v-if="row.State == '1'">未发布</span>
+                <span v-if="row.State == '2'">已发布</span>
+                <span v-if="row.State == '3'">待提交</span>
+                <span v-if="row.State == '4'">待审批</span>
+                <span v-if="row.State == '5'">已驳回</span>
+                <span v-if="row.State == '6'">已通过</span>
               </span>
               <span v-else-if="item.key==='Stage'">第{{row.Stage}}期</span>
               <span v-else-if="item.key==='Pv'" style="cursor:pointer; color:#4099ef;" >
@@ -177,10 +185,17 @@
                 <span v-if="row.Pv" style="color:#333">{{row.Pv}}</span>
               </span>
               <span v-else-if="item.key==='PublishTime'">
-                <span>{{row.PrePublishTime?row.PrePublishTime:row.PublishTime}}</span>
-                <svg v-if="row.PrePublishTime&&row.State===1" width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
-                  <path d="M15.2002 8C15.2002 4.13401 12.0662 1 8.20019 1C4.3342 1 1.20019 4.13401 1.2002 8C1.2002 11.866 4.3342 15 8.2002 15C12.0662 15 15.2002 11.866 15.2002 8ZM5.2002 10L5.2002 9L8.17491 9L11.2002 4.5L11.9073 5.20711L8.58912 10L5.2002 10Z" fill="#0052D9"/>
-                </svg>
+                <template v-if="!isApprove">
+                    <span>{{row.PrePublishTime?row.PrePublishTime:row.PublishTime}}</span>
+                    <svg v-if="row.PrePublishTime&&row.State===1" width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+                        <path d="M15.2002 8C15.2002 4.13401 12.0662 1 8.20019 1C4.3342 1 1.20019 4.13401 1.2002 8C1.2002 11.866 4.3342 15 8.2002 15C12.0662 15 15.2002 11.866 15.2002 8ZM5.2002 10L5.2002 9L8.17491 9L11.2002 4.5L11.9073 5.20711L8.58912 10L5.2002 10Z" fill="#0052D9"/>
+                    </svg>
+                </template>
+                <template v-if="isApprove">
+                    <span>{{row.ApproveTime}}</span>
+                </template>
+                
+                
               </span>
 
               <span v-else-if="item.key==='handle'">
@@ -518,7 +533,7 @@ export default {
             minwidthsty: 100
         },
         {
-            label: '发布状态',
+            label: '报告状态',
             key: 'State',
         },
         {

+ 16 - 11
src/views/smartReport/editReport.vue

@@ -31,7 +31,7 @@
                     </li>
                 </template>
                 <template v-if="isApprove">
-                    <li class="action-item" @click="handlePublishOpt('fb')">
+                    <li class="action-item" @click="handlePublishOpt('submit')">
                         <img src="~@/assets/img/smartReport/icon01.png" alt="">
                         <span>提交</span>
                     </li>
@@ -220,13 +220,16 @@ import ETASheet from './components/ETASheet.vue'
 import { getPublicSettingsApi } from '@/api/modules/oldApi';
 import { dataBaseInterface } from "@/api/api.js";
 import {apiSmartReport}  from '@/api/modules/smartReport'
+import {approveInterence} from '@/api/modules/approve.js';
 import BaseInfo from './components/BaseInfo.vue'
 import StatisticAnalysis from './components/StatisticAnalysis.vue'
 import ETAPriceChart from './components/ETAPriceChart.vue'
 import ETASandBox from './components/ETASandBox.vue'
 import SemanticAnalysis from './components/SemanticAnalysis.vue'
 import { getUrlParams } from '@/utils/common'
+import reportApproveConfig from "@/mixins/reportApproveConfig.js"
 export default {
+    mixins:[reportApproveConfig],
     name:"smartReportEdit",
     components: {
         draggable,
@@ -268,15 +271,6 @@ export default {
             deep:true
         }
     },
-    computed:{
-        //是否开启审批流,若开启,发布相关按钮,筛选项改变
-        isApprove(){
-            const type = this.$setting.dynamicOutLinks.ApprovalFlow ||
-                        this.$store.state.dynamicOutLinks.ApprovalFlow ||
-                        JSON.parse(localStorage.getItem('dynamicOutLinks')).ApprovalFlow||''
-            return ['2','3'].includes(type)
-        }
-    },
     data() {
         return {
             reportInfo:null,
@@ -883,9 +877,10 @@ export default {
             }
             // 发布
             if(this.isApprove){
-                this.reportPublish({sendMsg:false})
+                this.submitReport()
                 return
             }
+            //截止至ETA1.3.8 智能研报无推送模板消息,所有的reportInfo.MsgIsSend都为1
             if(this.reportInfo.MsgIsSend==1){//该报告已经推送过模板消息
                 this.reportPublish({sendMsg:false})
             }else{
@@ -918,6 +913,16 @@ export default {
                 )
             }
         },
+        //提交报告
+        submitReport(){
+            approveInterence.reportSmartSubmit({
+                ReportId:Number(this.$route.query.id)
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success("提交成功")
+                this.$router.replace({ path: '/smartReportList' });
+            })
+        },
 
         // 定时发布报告
         async handleSetReportPrepublish(){

+ 77 - 141
src/views/smartReport/reportList.vue

@@ -84,10 +84,12 @@
                                     style="width:100%;"
                                     @change="search"
                                 >
-                                    <el-option label="待提交" :value="1"></el-option>
-                                    <el-option label="待审批" :value="2"></el-option>
-                                    <el-option label="已审批" :value="4"></el-option>
-                                    <el-option label="已驳回" :value="3"></el-option>
+                                    <el-option label="未发布" :value="1"></el-option>
+                                    <el-option label="已发布" :value="2"></el-option>
+                                    <el-option label="待提交" :value="3"></el-option>
+                                    <el-option label="待审批" :value="4"></el-option>
+                                    <el-option label="已驳回" :value="5"></el-option>
+                                    <el-option label="已通过" :value="6"></el-option>
                                 </el-select>
                             </div>
                         </div>
@@ -112,20 +114,6 @@
                         style="width: 280px"
                     />
                 </el-form-item>
-                <!-- <el-form-item label="">
-                    <el-select
-                        v-permission="permissionBtn.smartReportManageBtn.reportManage_reportList_sendTime"
-                        @change="search"
-                        v-model.number="searchform.msgIsSend"
-                        placeholder="推送消息状态"
-                        size="medium"
-                        clearable
-                        style="width: 140px"
-                    >
-                        <el-option label="未推送消息" :value="1"></el-option>
-                        <el-option label="已推送消息" :value="2"></el-option>
-                    </el-select>
-                </el-form-item> -->
                 <el-form-item style="flex:1;text-align:right;">
                     <el-input
                         @input="search"
@@ -217,10 +205,12 @@
                 </el-table-column>
                 <el-table-column label="状态" align="center" v-if="isApprove">
                     <template slot-scope="scope">
-                        <span v-if="scope.row.State == '1'">待提交</span>
-                        <span v-if="scope.row.State == '2'">待审批</span>
-                        <span v-if="scope.row.State == '4'">已审批</span>
-                        <span v-if="scope.row.State == '3'">已驳回</span>
+                        <span v-if="scope.row.State == '1'">未发布</span>
+                        <span v-if="scope.row.State == '2'">已发布</span>
+                        <span v-if="scope.row.State == '3'">待提交</span>
+                        <span v-if="scope.row.State == '4'">待审批</span>
+                        <span v-if="scope.row.State == '5'">已驳回</span>
+                        <span v-if="scope.row.State == '6'">已通过</span>
                     </template>
                 </el-table-column>
                 <el-table-column v-if="!isApprove"
@@ -239,26 +229,16 @@
                 </el-table-column>
                 <el-table-column
                     v-if="isApprove"
-                    prop="PublishTime"
+                    prop="ApproveTime"
                     label="审批时间"
                     min-width="124"
                     align="center"
                     :formatter="formatterColumn"
                 >
                     <template slot-scope="scope">
-                        <span>{{scope.row.PrePublishTime?scope.row.PrePublishTime:scope.row.PublishTime|formatTime}}</span>
+                        <span>{{scope.row.ApproveTime|formatTime}}</span>
                     </template>
                 </el-table-column>
-                <!-- <el-table-column v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_reportList_sendTime)"
-                    prop="MsgSendTime"
-                    label="报告推送时间"
-                    min-width="124"
-                    align="center"
-                >
-                    <template slot-scope="scope">{{
-                    scope.row.MsgSendTime | formatTime
-                    }}</template>
-                </el-table-column> -->
                 <el-table-column
                     prop="ContentModifyTime"
                     label="更新时间"
@@ -285,108 +265,49 @@
                 <el-table-column label="操作" align="center" min-width="130" fixed="right">
                     <template slot-scope="scope">
                     <div class="opt-btns">
-                        <!-- 不走审批流的按钮 -->
-                        <template v-if="!isApprove">
-                            <template v-if="scope.row.State == 1">
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
-                                    class="editsty" @click="handlePublishReportOpt(scope.row)"
-                                    v-if="scope.row.CanEdit">发布</span>
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
-                                    class="editsty" @click="editreport(scope.row, 'edit')"
-                                    v-if="scope.row.CanEdit">编辑</span>
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
-                                    class="editsty" @click="editreport(scope.row, 'editing')"
-                                    v-else>{{ scope.row.Editor || "" }}编辑中...</span>
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
-                                    class="deletesty" @click="handleDelReport(scope.row)"
-                                    v-if="scope.row.CanEdit">删除</span>
-                            </template>
-                            <template v-if="scope.row.State == 2">
-                                <span
-                                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_cancelPublish)"
-                                    @click="handleReportPublishCancel(scope.row)"
-                                    style="color: red; cursor: pointer"
-                                >取消发布</span>
-                                <span
-                                    v-if="scope.row.DetailImgUrl"
-                                    v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg"
-                                    @click="handleDownReportImg(scope.row.DetailImgUrl,scope.row.Title)"
-                                    style="cursor: pointer; color: #4099ef;display:inline-block"
-                                >图片下载</span>
-                                <!-- <span
-                            v-if="scope.row.MsgIsSend == 0 && permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_sendMsg)"
-                            style="color: #4099ef; cursor: pointer"
-                            @click="handleSendMsg(scope.row)"
-                            >推送消息</span
-                        >
-                        <span v-else-if="scope.row.MsgIsSend != 0&&permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_sendMsg)"
-                            style="color: red">已推送消息</span> -->
-                            </template>
-                            <span style="color: #46c371; cursor: pointer;display:inline-block"
-                                v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_audioUpload)"
-                                @click="openupload(scope.row.SmartReportId)">音频上传</span>
-                            <span style="cursor: pointer; color: #4099ef;display:inline-block"
-                                v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
-                                v-if="scope.row.VideoUrl" @click="handleDownloadVoice(scope.row)">
-                                音频下载
-                            </span>
-                            <!-- <a
-                                v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
-                                :href="scope.row.VideoUrl"
-                                v-if="scope.row.VideoUrl"
-                                :download="scope.row.VideoName"
-                                style="cursor: pointer; color: #4099ef"
-                                >音频下载</a
-                                > -->
+                        <!-- 操作:
+                            已发布——取消发布、下载图片
+                            未发布——发布、编辑、删除
+                            待提交——提交、编辑、删除
+                            待审批——撤销
+                            已通过——撤销、下载图片
+                            已驳回——撤销 -->
+                        <!-- 未发布,待提交 -->
+                        <template v-if="[1,3].includes(scope.row.State)">
+                            <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
+                                class="editsty" @click="handlePublishReportOpt(scope.row)"
+                                v-if="scope.row.CanEdit&&scope.row.State===1">发布</span>
+                            <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
+                                class="editsty" @click="handleSubmitReport(scope.row)"
+                                v-if="scope.row.CanEdit&&scope.row.State===3">提交</span>
+                            <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
+                                class="editsty" @click="editreport(scope.row, 'edit')"
+                                v-if="scope.row.CanEdit">编辑</span>
+                            <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
+                                class="editsty" @click="editreport(scope.row, 'editing')"
+                                v-else>{{ scope.row.Editor || "" }}编辑中...</span>
+                            <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
+                                class="deletesty" @click="handleDelReport(scope.row)"
+                                v-if="scope.row.CanEdit">删除</span>
                         </template>
-                        <!-- 走审批流的按钮 -->
-                        <template v-if="isApprove">
-                            <!-- 待提交 -->
-                            <template v-if="scope.row.State == 1">
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
-                                    class="editsty" @click="handlePublishReportOpt(scope.row)"
-                                    v-if="scope.row.CanEdit">提交</span>
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
-                                    class="editsty" @click="editreport(scope.row, 'edit')"
-                                    v-if="scope.row.CanEdit">编辑</span>
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportEdit"
-                                    class="editsty" @click="editreport(scope.row, 'editing')"
-                                    v-else>{{ scope.row.Editor || "" }}编辑中...</span>
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_reportDel"
-                                    class="deletesty" @click="handleDelReport(scope.row)"
-                                    v-if="scope.row.CanEdit">删除</span>
-                            </template>
-                            <!--已提交(待审批,已审批)-->
-                            <template v-if="[2,4].includes(scope.row.State)">
-                                <span
-                                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_cancelPublish)"
-                                    @click="handleReportPublishCancel(scope.row)"
-                                    style="color: red; cursor: pointer">撤销
-                                </span>
-                                <span
-                                    v-if="scope.row.DetailImgUrl&&scope.row.State===4"
-                                    v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg"
-                                    @click="handleDownReportImg(scope.row.DetailImgUrl,scope.row.Title)"
-                                    style="cursor: pointer; color: #4099ef;display:inline-block"
-                                >图片下载</span>
-                            </template>
-                             <!--已驳回则只显示撤销按钮-->
-                            <template v-if="scope.row.State===3">
-                                <span v-permission="permissionBtn.smartReportManageBtn.reportManage_publish"
+                        <!-- 已发布,已通过 -->
+                        <template v-if="[2,6].includes(scope.row.State)">
+                            <span v-if="permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish')&&scope.row.State===2"
                                 @click="handleReportPublishCancel(scope.row)"
-                                    class="editsty">撤销</span>
-                            </template>
-                            <!--音频上传/下载 按原先逻辑-->
-                            <template v-if="scope.row.State!==3">
-                                <span style="color: #46c371; cursor: pointer;display:inline-block"
-                                    v-if="permissionBtn.checkPermissionBtn(permissionBtn.smartReportManageBtn.reportManage_audioUpload)"
-                                    @click="openupload(scope.row.SmartReportId)">音频上传</span>
-                                <span style="cursor: pointer; color: #4099ef;display:inline-block"
-                                    v-permission="permissionBtn.smartReportManageBtn.reportManage_audioDownload"
-                                    v-if="scope.row.VideoUrl" @click="handleDownloadVoice(scope.row)">
-                                    音频下载
-                                </span>
-                            </template>
+                                style="color: red; cursor: pointer">取消发布</span>
+                            <span v-if="permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish')&&scope.row.State===6"
+                                @click="cancelReport(scope.row)"
+                                style="color: red; cursor: pointer">撤销</span>
+                            <span v-if="scope.row.DetailImgUrl"
+                                v-permission="permissionBtn.smartReportManageBtn.reportManage_reportView_exportImg"
+                                @click="handleDownReportImg(scope.row.DetailImgUrl,scope.row.Title)"
+                                style="cursor: pointer; color: #4099ef;display:inline-block">图片下载</span>
+                        </template>
+                        <!-- 待审批,已驳回 -->
+                        <template v-if="[4,5].includes(scope.row.State)">
+                            <span v-if="permissionBtn.isShowBtn('smartReportManageBtn','reportManage_cancelPublish')"
+                                @click="cancelReport(scope.row)"
+                                style="color: red; cursor: pointer">撤销</span>
                         </template>
                     </div>
                     </template>
@@ -522,8 +443,11 @@
 <script>
 import { voiceupload } from "api/api.js";
 import {apiSmartReport}  from '@/api/modules/smartReport'
+import {approveInterence} from '@/api/modules/approve.js';
+import reportApproveConfig from "@/mixins/reportApproveConfig.js"
 import BaseInfo from './components/BaseInfo.vue'
 export default {
+    mixins:[reportApproveConfig],
     components:{BaseInfo},
     computed:{
         Role() {
@@ -534,13 +458,6 @@ export default {
         hasUV(){
             return this.permissionBtn.checkPermissionBtn(this.permissionBtn.smartReportManageBtn.reportManage_reportList_uv)
         },
-        //是否开启审批流,若开启,发布相关按钮,筛选项改变
-        isApprove(){
-            const type = this.$setting.dynamicOutLinks.ApprovalFlow ||
-                        this.$store.state.dynamicOutLinks.ApprovalFlow ||
-                        JSON.parse(localStorage.getItem('dynamicOutLinks')).ApprovalFlow||''
-            return ['2','3'].includes(type)
-        }
     },
     data() {
         return {
@@ -685,6 +602,25 @@ export default {
             this.isDSFB=false
             this.showPublish=false
         },
+        //提交报告
+        handleSubmitReport(item){
+            approveInterence.reportSmartSubmit({
+                ReportId:Number(item.SmartReportId)
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success("提交成功")
+                this.getReportList()
+            })
+        },
+        cancelReport(item){
+            approveInterence.reportSmartCancel({
+                ReportId:Number(item.SmartReportId)
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success("撤销成功")
+                this.getReportList()
+            })
+        },
 
         //编辑报告
         async editreport(item, type){