|
@@ -1,28 +1,18 @@
|
|
|
<template>
|
|
|
<!-- 审批详情:查看、进行审批操作 -->
|
|
|
<div class="approve-detail-wrap" v-if="isETAApprove || IsBIApprove">
|
|
|
-
|
|
|
- <!-- bi审批 -->
|
|
|
- <template v-if="mainType==='bi'">
|
|
|
+ <template v-if="['bi','standpoint'].includes(mainType)">
|
|
|
<div class="approve-detail">
|
|
|
<div class="approve-info">
|
|
|
- <span>{{ mainType == 'report'?$t('AprrovalDetailPage.report_name_info'):$t('AprrovalPage.kanban_name')}}:{{reportInfo.title||''}}</span>
|
|
|
- <span v-if="mainType == 'report'" style="margin-left: 60px;">{{$t('AprrovalDetailPage.classification_info')}}:{{reportInfo.classify||''}}</span>
|
|
|
+ <span>{{ mainType == 'bi'?$t('AprrovalPage.kanban_name'):'观点标题'}}:{{reportInfo.title||''}}</span>
|
|
|
<span style="min-width: 100px;margin-left: 60px;">{{$t('AprrovalPage.submitter_lable')}}:{{reportInfo.approver||''}}</span>
|
|
|
</div>
|
|
|
- <div v-if="mainType == 'report'" class="approve-content"
|
|
|
+ <div v-if="mainType == 'standpoint'" class="approve-content"
|
|
|
+ style="padding: 20px;"
|
|
|
v-loading="isLoading"
|
|
|
- element-loading-text="研报加载中...">
|
|
|
- <component v-if="reportInfo.reportId&&!isError"
|
|
|
- :is="reportInfo.componentName"
|
|
|
- :reportId="reportInfo.reportId"
|
|
|
- :isPreview="true"
|
|
|
- :isEn="reportInfo.type===2"
|
|
|
- @reportStartLoading="isLoading=true"
|
|
|
- @reportEndLoading="isLoading=false"
|
|
|
- @reportError="isError=true"
|
|
|
- ></component>
|
|
|
- <tableNoData v-if="isError" text="无法获取到报告内容,该报告可能已被删除!"></tableNoData>
|
|
|
+ element-loading-text="观点加载中...">
|
|
|
+ <div v-if="standpointContent" v-html="standpointContent"></div>
|
|
|
+ <tableNoData v-else text="暂无观点数据"></tableNoData>
|
|
|
</div>
|
|
|
<div v-else class="approve-content"
|
|
|
v-loading="isLoading"
|
|
@@ -34,11 +24,11 @@
|
|
|
<div class="tool-btn">
|
|
|
<!-- 根据审批的状态决定显示 -->
|
|
|
<el-button type="danger" @click="changeApprove('reject')"
|
|
|
- v-if="formType==='approve'&&approveInfo.isCurrentApprover&&permissionBtn.isShowBtn('approvePermission','reportApprove_reject')">{{$t('AprrovalDetailPage.rejected_btn')}}</el-button>
|
|
|
+ v-if="isShowReject">{{$t('AprrovalDetailPage.rejected_btn')}}</el-button>
|
|
|
<el-button type="primary" @click="changeApprove('pass')"
|
|
|
- v-if="formType==='approve'&&approveInfo.isCurrentApprover&&permissionBtn.isShowBtn('approvePermission','reportApprove_agree')">{{$t('AprrovalDetailPage.agree_btn')}}</el-button>
|
|
|
+ v-if="isShowAgree">{{$t('AprrovalDetailPage.agree_btn')}}</el-button>
|
|
|
<el-button type="primary" @click="changeApprove('return')"
|
|
|
- v-if="formType==='myself'&&approveInfo.state!==4&&permissionBtn.isShowBtn('approvePermission','reportApprove_repeal')">{{$t('AprrovalDetailPage.cancel_btn')}}</el-button>
|
|
|
+ v-if="isShowCancel">{{$t('AprrovalDetailPage.cancel_btn')}}</el-button>
|
|
|
<el-button type="primary" plain @click="$router.replace(`/approveList?formType=${formType}&mainType=${mainType}`)">{{$t('AprrovalDetailPage.back_btn')}}</el-button>
|
|
|
</div>
|
|
|
<div class="approve-timeline-wrap">
|
|
@@ -83,6 +73,7 @@ import TimeLine from './components/timeLine.vue';
|
|
|
import RejectDialog from './components/rejectDialog.vue';
|
|
|
import {approveInterence} from '@/api/modules/approve.js';
|
|
|
import {departInterence} from '@/api/api.js'
|
|
|
+import { eventInterface } from '@/api/modules/knowledge';
|
|
|
import reportApproveConfig from "@/mixins/reportApproveConfig.js"
|
|
|
import apiBiBoard from '@/api/modules/BIBoard.js'
|
|
|
import BIBoardContent from '@/views/BI_manage/components/BoardContent.vue';
|
|
@@ -99,7 +90,7 @@ export default {
|
|
|
isDetailDialogShow:false,
|
|
|
TimeLineData:[],
|
|
|
formType:'detail',//进入审批详情的方式:approve(待处理)/detail(已处理)/myself(我发起的)
|
|
|
- mainType:'report', //report(研报) bi(bi看板)
|
|
|
+ mainType:'bi', //report(研报) bi(bi看板)
|
|
|
reportInfo:{ //报告相关信息
|
|
|
reportId:0,//研报or智能研报的报告id
|
|
|
title:'',
|
|
@@ -117,13 +108,26 @@ export default {
|
|
|
boardDataList:[],
|
|
|
knowledgeList:[],//知识资源模块列表的全部数据
|
|
|
|
|
|
- setPublicDetailInfo: null
|
|
|
+ setPublicDetailInfo: null,
|
|
|
+ standpointContent:'',
|
|
|
};
|
|
|
},
|
|
|
computed:{
|
|
|
UserId(){
|
|
|
return Number(localStorage.getItem("AdminId"));
|
|
|
},
|
|
|
+ isShowReject(){
|
|
|
+ return this.formType==='approve' && this.approveInfo.isCurrentApprover &&
|
|
|
+ (this.mainType == 'standpoint' ? this.isShowBtn('standpointApprove_reject') : this.isShowBtn('reportApprove_reject'))
|
|
|
+ },
|
|
|
+ isShowAgree(){
|
|
|
+ return this.formType==='approve' && this.approveInfo.isCurrentApprover &&
|
|
|
+ (this.mainType == 'standpoint' ? this.isShowBtn('standpointApprove_agree') : this.isShowBtn('reportApprove_agree'))
|
|
|
+ },
|
|
|
+ isShowCancel(){
|
|
|
+ return this.formType==='myself' && this.approveInfo.state!==4 &&
|
|
|
+ (this.mainType == 'standpoint' ? this.isShowBtn('standpointApprove_cancel') : this.isShowBtn('reportApprove_repeal'))
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
getApproveDetail(){
|
|
@@ -150,6 +154,38 @@ export default {
|
|
|
this.approveInfo.stateText=['','pending','passed','reject','return'][Approve.State]
|
|
|
})
|
|
|
},
|
|
|
+ getStandPointApproveDetail(){
|
|
|
+ const {type,approveId} = this.$route.query
|
|
|
+ if(!approveId) return
|
|
|
+ approveInterence.getKnowledgeApproveDetail({
|
|
|
+ KnowledgeResourceApproveId:+approveId
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ //格式化时间线数据
|
|
|
+ this.formatTimeLineData(res.Data)
|
|
|
+ const {Knowledge={},Approve={}} = res.Data||{}
|
|
|
+ this.reportInfo = {
|
|
|
+ KnowledgeResourceId:Knowledge.KnowledgeResourceId||0,
|
|
|
+ title:Knowledge.KnowledgeResourceTitle||'',
|
|
|
+ classify:Knowledge.KnowledgeClassify||'',
|
|
|
+ approver:Approve.ApplyUserName||'',
|
|
|
+ }
|
|
|
+ this.formType = type||'detail'
|
|
|
+ this.approveInfo.state=Approve.State
|
|
|
+ this.approveInfo.stateText=['','pending','passed','reject','return'][Approve.State]
|
|
|
+ this.getStandPointDetail();
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getStandPointDetail(){
|
|
|
+ this.isLoading = true;
|
|
|
+ let res = await eventInterface.getEventDetail({
|
|
|
+ ResourceType:4,
|
|
|
+ KnowledgeResourceId:this.reportInfo.KnowledgeResourceId
|
|
|
+ });
|
|
|
+ this.isLoading = false;
|
|
|
+ if(res.Ret != 200) return;
|
|
|
+ this.standpointContent = res.Data.Content;
|
|
|
+ },
|
|
|
getBiApproveDetail(){
|
|
|
const {type,approveId} = this.$route.query
|
|
|
if(!approveId) return
|
|
@@ -211,8 +247,8 @@ export default {
|
|
|
//排序过的审批节点,遍历
|
|
|
let currentIndex = 0
|
|
|
let Nodes = ApproveFlowNodes.map((i,index)=>{
|
|
|
- //找到当前节点的index
|
|
|
- if((i.ReportApproveNodeId===Approve.CurrNodeId && this.mainType == 'report') || (i.BiApproveNodeId===Approve.CurrNodeId && this.mainType == 'bi')){
|
|
|
+ //找到当前节点的index
|
|
|
+ if((i.BiApproveNodeId===Approve.CurrNodeId && this.mainType == 'bi') || (i.KnowledgeResourceApproveNodeId===Approve.CurrNodeId && this.mainType == 'standpoint')){
|
|
|
currentIndex = index
|
|
|
}
|
|
|
//审批节点只有一个人时不显示是什么审批流
|
|
@@ -220,7 +256,7 @@ export default {
|
|
|
const node = {
|
|
|
nodeType:2,
|
|
|
nodeText:`${this.$t('AprrovalDetailPage.approval_by',{num:i.Users.length}) }`+(i.Users.length>1?strApproveType:''),
|
|
|
- nodeStatus:(i.ReportApproveNodeId===Approve.CurrNodeId && this.mainType == 'report') || (i.BiApproveNodeId===Approve.CurrNodeId && this.mainType == 'bi')?'process':'future',
|
|
|
+ nodeStatus:(i.BiApproveNodeId===Approve.CurrNodeId && this.mainType == 'bi') || (i.KnowledgeResourceApproveNodeId===Approve.CurrNodeId && this.mainType == 'standpoint')?'process':'future',
|
|
|
approveType:ApproveType[i.ApproveType]
|
|
|
}
|
|
|
const approveList = i.Users.map(u=>{
|
|
@@ -232,8 +268,8 @@ export default {
|
|
|
approveReason:ApproveRemark
|
|
|
}
|
|
|
})
|
|
|
- //检测当前节点的User与当前用户是否匹配 且审批需要是待审批状态
|
|
|
- if((i.ReportApproveNodeId===Approve.CurrNodeId&&Approve.State===1&&this.mainType == 'report') || (i.BiApproveNodeId===Approve.CurrNodeId&&this.mainType=='bi'&&Approve.State===1)){
|
|
|
+ //检测当前节点的User与当前用户是否匹配 且审批需要是待审批状态
|
|
|
+ if((i.BiApproveNodeId===Approve.CurrNodeId&&this.mainType=='bi'&&Approve.State===1) || (i.KnowledgeResourceApproveNodeId===Approve.CurrNodeId&&this.mainType=='standpoint'&&Approve.State===1)){
|
|
|
//当前节点的User中,有没有当前用户
|
|
|
const hasUser = i.Users.findIndex(u=>u.UserId===this.UserId)
|
|
|
if(hasUser!==-1){
|
|
@@ -341,45 +377,43 @@ export default {
|
|
|
}
|
|
|
let res = null
|
|
|
if(type==='return'){
|
|
|
- res = this.mainType === 'bi'
|
|
|
- ? await approveInterence.cancelBiApprove({BiApproveId:Number(approveId)})
|
|
|
- : await approveInterence.cancelPublicApprove({DataApproveId: Number(approveId)})
|
|
|
+ const reqs = {
|
|
|
+ bi : { fn: approveInterence.cancelBiApprove , params: {BiApproveId:Number(approveId)}},
|
|
|
+ standpoint: { fn: approveInterence.cancelKnowledgeApprove , params: {KnowledgeResourceApproveId:Number(approveId)}},
|
|
|
+ }
|
|
|
+ res = Object.keys(reqs).includes(this.mainType) ? await reqs[this.mainType].fn(reqs[this.mainType].params)
|
|
|
+ : await approveInterence.cancelPublicApprove({DataApproveId: Number(approveId)});
|
|
|
}
|
|
|
- if(type==='pass'){
|
|
|
- res = this.mainType === 'bi'
|
|
|
- ? await approveInterence.passBiApprove({
|
|
|
- BiApproveId:Number(approveId),
|
|
|
- })
|
|
|
- : await approveInterence.passPublicApprove({DataApproveId: Number(approveId)})
|
|
|
+ if(type==='pass'){
|
|
|
+ const reqs = {
|
|
|
+ bi : { fn: approveInterence.passBiApprove , params: {BiApproveId:Number(approveId)}},
|
|
|
+ standpoint: { fn: approveInterence.passKnowledgeApprove , params: {KnowledgeResourceApproveId:Number(approveId)}},
|
|
|
+ }
|
|
|
+ res = Object.keys(reqs).includes(this.mainType) ? await reqs[this.mainType].fn(reqs[this.mainType].params)
|
|
|
+ : await approveInterence.passPublicApprove({DataApproveId: Number(approveId)})
|
|
|
}
|
|
|
if(res.Ret!==200) return
|
|
|
this.$message.success( type==='return'?this.$t('AprrovalPage.revoke_success') :this.$t('AprrovalDetailPage.passed_success'));
|
|
|
type!=='reject'&&(this.$router.replace(`/approveList?mainType=${this.mainType}`))
|
|
|
},
|
|
|
- generatePdfLinks(code,type){
|
|
|
- if(type == 1){
|
|
|
- const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
|
|
|
- return `${baseUrl}/reportshare_pdf?code=${code}&flag=${this.waterMarkStr}`
|
|
|
- }else if(type == 2){
|
|
|
- const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
|
|
|
- return `${baseUrl}/reportshare_pdf_en?code=${code}&flag=${this.waterMarkStr}`
|
|
|
- }else if(type==3){
|
|
|
- const baseUrl= localStorage.getItem('dynamicOutLinks') ? JSON.parse(localStorage.getItem('dynamicOutLinks')).ReportViewUrl : '';
|
|
|
- return `${baseUrl}/reportshare_smart_pdf?code=${code}`
|
|
|
- }
|
|
|
- },
|
|
|
rejectApprove(reason){
|
|
|
- this.isDetailDialogShow = false;
|
|
|
- let req = this.mainType === 'bi'
|
|
|
- ? approveInterence.rejectBiApprove({
|
|
|
- BiApproveId:Number(this.$route.query.approveId),
|
|
|
- ApproveRemark:reason||''
|
|
|
- })
|
|
|
- : approveInterence.refusePublicApprove({
|
|
|
- DataApproveId: Number(this.$route.query.approveId),
|
|
|
- ApproveRemark:reason||''
|
|
|
- });
|
|
|
-
|
|
|
+ this.isDetailDialogShow = false
|
|
|
+ const reqs = {
|
|
|
+ bi : {
|
|
|
+ fn: approveInterence.rejectBiApprove,
|
|
|
+ params: { BiApproveId:Number(this.$route.query.approveId), ApproveRemark:reason||''}
|
|
|
+ },
|
|
|
+ standpoint: {
|
|
|
+ fn: approveInterence.rejectKnowledgeApprove,
|
|
|
+ params: { KnowledgeResourceApproveId:Number(this.$route.query.approveId), ApproveRemark:reason||''}
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ let req = Object.keys(reqs).includes(this.mainType) ? reqs[this.mainType].fn(reqs[this.mainType].params)
|
|
|
+ : approveInterence.refusePublicApprove({
|
|
|
+ DataApproveId: Number(this.$route.query.approveId),
|
|
|
+ ApproveRemark:reason||''
|
|
|
+ });
|
|
|
req.then(res=>{
|
|
|
if(res.Ret!==200) return
|
|
|
this.$message.success(this.$t('AprrovalDetailPage.rejected_success') )
|
|
@@ -387,19 +421,9 @@ export default {
|
|
|
})
|
|
|
|
|
|
},
|
|
|
- getSystemUserInfo(){
|
|
|
- departInterence.systemUserInfo().then(res=>{
|
|
|
- if(res.Ret===200){
|
|
|
- const systemUserInfo=res.Data
|
|
|
- // 设置水印文案
|
|
|
- let waterMarkString=''
|
|
|
- if(systemUserInfo){
|
|
|
- waterMarkString=`${systemUserInfo.RealName}${systemUserInfo.Mobile?systemUserInfo.Mobile:systemUserInfo.Email}`
|
|
|
- waterMarkString=encodeURIComponent(waterMarkString)
|
|
|
- this.waterMarkStr=Base64.encode(waterMarkString)
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ isShowBtn(code){
|
|
|
+ const {approvePermission,checkPermissionBtn}=this.permissionBtn;
|
|
|
+ return checkPermissionBtn(approvePermission[code])
|
|
|
},
|
|
|
|
|
|
|
|
@@ -426,13 +450,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.mainType = this.$route.query.mainType || 'report';
|
|
|
- if(this.mainType == 'report') {
|
|
|
- this.getApproveDetail();
|
|
|
- this.getSystemUserInfo();
|
|
|
- }
|
|
|
+ this.mainType = this.$route.query.mainType || 'bi';
|
|
|
if(this.mainType == 'bi') this.getBiApproveDetail();
|
|
|
-
|
|
|
+ if(this.mainType == 'standpoint') this.getStandPointApproveDetail();
|
|
|
['edb','chart'].includes(this.mainType) && this.getPublicApproveDetail()
|
|
|
},
|
|
|
components: { TimeLine, ReportDetail, Reportdtl, RejectDialog, BIBoardContent,EdbChartApproveWrapper }
|