|
@@ -1,6 +1,11 @@
|
|
|
<template>
|
|
|
<!-- 审批管理列表页 -->
|
|
|
- <div class="approve-list-wrap approve-page-wrap" v-if="isETAApprove">
|
|
|
+ <div class="approve-list-wrap approve-page-wrap" v-if="isETAApprove || IsBIApprove">
|
|
|
+ <div class="head-tab">
|
|
|
+ <el-radio-group v-model="activeMainTab" style="margin-bottom: 10px;" @input="handleMainClick">
|
|
|
+ <el-radio-button v-for="item in mainTabs" :key="item.name" :label="item.name">{{ item.label }}</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
<div class="head-tab">
|
|
|
<el-tabs v-model="activeTab" @tab-click="handleClick">
|
|
|
<el-tab-pane :label="$t('AprrovalPage.be_processed_tab')" name="pending"></el-tab-pane>
|
|
@@ -11,9 +16,9 @@
|
|
|
<div class="approve-list">
|
|
|
<div class="select-box">
|
|
|
<el-cascader v-model="classify"
|
|
|
- :placeholder="$t('AprrovalPage.associated_report_ipt')" clearable
|
|
|
- :options="classifyTree"
|
|
|
- :props="{value:'ClassifyId',label:'ClassifyName',children:'Children'}"
|
|
|
+ :placeholder="activeMainTab == 'report' ? $t('AprrovalPage.associated_report_ipt') : $t('AprrovalPage.select_associated_Kanban_tip')" clearable
|
|
|
+ :options="activeMainTab == 'report' ? classifyTree : biClassifyTree"
|
|
|
+ :props="activeMainTab == 'report' ? {value:'ClassifyId',label:'ClassifyName',children:'Children'} : {value:'BiDashboardClassifyId',label:'BiDashboardClassifyName',children:'Children'}"
|
|
|
@change="handleCurrentChange(1)">
|
|
|
</el-cascader>
|
|
|
<div class="select-time-box">
|
|
@@ -51,7 +56,7 @@
|
|
|
</el-select>
|
|
|
|
|
|
<el-input v-model="keyword" prefix-icon="el-icon-search" clearable @input="handleCurrentChange(1)"
|
|
|
- :placeholder="$t('AprrovalPage.report_title_ipt')" style="width:260px;margin-left: auto;"></el-input>
|
|
|
+ :placeholder="activeMainTab == 'report'?$t('AprrovalPage.report_title_ipt'):$t('AprrovalPage.enter_Kanban_name_tip')" style="width:260px;margin-left: auto;"></el-input>
|
|
|
</div>
|
|
|
<div class="list-box">
|
|
|
<el-table
|
|
@@ -80,7 +85,7 @@
|
|
|
<el-table-column :label="$t('Table.column_operations')" align="center">
|
|
|
<template slot-scope="{row}">
|
|
|
<template v-if="activeTab==='pending'">
|
|
|
- <el-button type="text" style="padding:0;" @click="toApproveDetail(row,'approve')"
|
|
|
+ <el-button type="text" style="padding:0;" @click="toApproveDetail(row,'approve')"
|
|
|
v-if="permissionBtn.isShowBtn('approvePermission','reportApprove_approve')">{{$t('AprrovalPage.approve_table')}}</el-button>
|
|
|
</template>
|
|
|
<template v-if="activeTab==='processed'">
|
|
@@ -136,11 +141,18 @@ import {
|
|
|
approve_pending_columns,
|
|
|
approve_processed_columns,
|
|
|
approve_originate_columns,
|
|
|
+ biapprove_pending_columns,
|
|
|
+ biapprove_processed_columns,
|
|
|
+ biapprove_originate_columns,
|
|
|
+
|
|
|
} from './config/tableConfig'
|
|
|
const columnsMap = {
|
|
|
- 'pending':approve_pending_columns,
|
|
|
- 'processed':approve_processed_columns,
|
|
|
- 'originate':approve_originate_columns
|
|
|
+ 'pending_report':approve_pending_columns,
|
|
|
+ 'processed_report':approve_processed_columns,
|
|
|
+ 'originate_report':approve_originate_columns,
|
|
|
+ 'pending_bi':biapprove_pending_columns,
|
|
|
+ 'processed_bi':biapprove_processed_columns,
|
|
|
+ 'originate_bi':biapprove_originate_columns,
|
|
|
}
|
|
|
const tabMap = {
|
|
|
'pending':1,
|
|
@@ -151,6 +163,8 @@ export default {
|
|
|
mixins:[approveMixins,reportApproveConfig],
|
|
|
data() {
|
|
|
return {
|
|
|
+ mainTabs:[],
|
|
|
+ activeMainTab:'',
|
|
|
activeTab: 'pending',
|
|
|
/* 筛选项 */
|
|
|
timeType:1,
|
|
@@ -170,11 +184,11 @@ export default {
|
|
|
total: 0,
|
|
|
|
|
|
currentData: {},
|
|
|
- isDetailDialogShow: false
|
|
|
+ isDetailDialogShow: false,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- getTableData(){
|
|
|
+ getTableData(){
|
|
|
this.tableLoading = true
|
|
|
this.tableData=[]
|
|
|
const baseParams = {
|
|
@@ -198,53 +212,92 @@ export default {
|
|
|
//处理状态
|
|
|
ApproveState:this.ApproveState,
|
|
|
}
|
|
|
- approveInterence.getApproveList({
|
|
|
- ...baseParams,
|
|
|
- ...selectParams
|
|
|
- }).then(res=>{
|
|
|
- this.tableLoading=false
|
|
|
- if(res.Ret!==200) return
|
|
|
- const {List=[],Paging={}} = res.Data||{}
|
|
|
- this.tableData = List||[]
|
|
|
- this.total = Paging.Totals||0
|
|
|
- })
|
|
|
+ const biApproveParams = {
|
|
|
+ ClassifyId:this.classify[0] || 0,
|
|
|
+ TimeType:this.timeType,
|
|
|
+ StartTime:this.timeDate?this.timeDate[0]||'':'',
|
|
|
+ EndTime:this.timeDate?this.timeDate[1]||'':'',
|
|
|
+ SortRule:this.SortRule,
|
|
|
+ SortField:this.SortField,
|
|
|
+ ApproveState:this.ApproveState,
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.activeMainTab == 'report'){
|
|
|
+ approveInterence.getApproveList({
|
|
|
+ ...baseParams,
|
|
|
+ ...selectParams
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableLoading=false
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ const {List=[],Paging={}} = res.Data||{}
|
|
|
+ this.tableData = List||[]
|
|
|
+ this.total = Paging.Totals||0
|
|
|
+ }).catch(err=>{this.tableLoading=false})
|
|
|
+ } else {
|
|
|
+ approveInterence.getBiApproveList({
|
|
|
+ ...baseParams,
|
|
|
+ ...biApproveParams,
|
|
|
+ }).then(res=>{
|
|
|
+ this.tableLoading=false
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ const {List=[],Paging={}} = res.Data||{}
|
|
|
+ this.tableData = List||[]
|
|
|
+ this.total = Paging.Totals||0
|
|
|
+ }).catch(err=>{this.tableLoading=false})
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
handleCurrentChange(page) {
|
|
|
this.page = page;
|
|
|
this.getTableData()
|
|
|
},
|
|
|
sortChange({ prop, order }) {
|
|
|
+ if(!order){
|
|
|
+ this.SortRule = 0;
|
|
|
+ this.SortField = 0;
|
|
|
+ this.handleCurrentChange(1)
|
|
|
+ return
|
|
|
+ }
|
|
|
this.SortRule = order==='ascending'?1:2
|
|
|
this.SortField= prop==='CreateTime'?1
|
|
|
:prop==='HandleTime'?2:3
|
|
|
this.handleCurrentChange(1)
|
|
|
},
|
|
|
+ handleMainClick(tabName){
|
|
|
+ this.activeMainTab = tabName;
|
|
|
+ this.classify = '';
|
|
|
+ this.keyword = '';
|
|
|
+ this.activeTab = 'pending';
|
|
|
+ this.handleClick()
|
|
|
+ },
|
|
|
handleClick() {
|
|
|
this.timeType = 1
|
|
|
this.timeDate=''
|
|
|
+ this.SortRule=0
|
|
|
this.SortField=0
|
|
|
- this.SortField=0
|
|
|
- this.tableColumns = columnsMap[this.activeTab];
|
|
|
+ this.ApproveState = '';
|
|
|
+ this.tableColumns = columnsMap[`${this.activeTab}_${this.activeMainTab}`];
|
|
|
this.$refs.reftable&&this.$refs.reftable.clearSort()
|
|
|
this.handleCurrentChange(1)
|
|
|
},
|
|
|
- handleShowDetail(data) {
|
|
|
+ handleShowDetail(data) {
|
|
|
this.currentData = data;
|
|
|
this.isDetailDialogShow = true;
|
|
|
},
|
|
|
- toApproveDetail(data,type){
|
|
|
+ toApproveDetail(data,type){
|
|
|
this.$router.push({
|
|
|
path:'/approveDetail',
|
|
|
query:{
|
|
|
+ mainType:this.activeMainTab,
|
|
|
type,
|
|
|
- approveId:data.ReportApproveId
|
|
|
+ approveId:this.activeMainTab == 'report' ? data.ReportApproveId : data.BiApproveId,
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- cancelApprove(item){
|
|
|
- approveInterence.cancelApprove({
|
|
|
- ReportApproveId:Number(item.ReportApproveId)
|
|
|
- }).then(res=>{
|
|
|
+ cancelApprove(item){
|
|
|
+ let req = this.activeMainTab == 'report' ? approveInterence.cancelApprove({ReportApproveId:Number(item.ReportApproveId)})
|
|
|
+ : approveInterence.cancelBiApprove({BiApproveId:Number(item.BiApproveId)});
|
|
|
+ req.then(res=>{
|
|
|
if(res.Ret!==200) return
|
|
|
this.$message.success(this.$t('AprrovalPage.revoke_success') )
|
|
|
this.handleCurrentChange(1)
|
|
@@ -260,6 +313,10 @@ export default {
|
|
|
if(e==='处理时间') return this.$t('AprrovalPage.processing_time_lable')
|
|
|
if(e==='处理结果') return this.$t('AprrovalPage.processing_result_lable')
|
|
|
if(e==='审批时间') return this.$t('AprrovalPage.approval_time')
|
|
|
+ if(e==='看板名称') return this.$t('AprrovalPage.kanban_name')
|
|
|
+ if(e==='关联分类') return this.$t('AprrovalPage.associative_classification')
|
|
|
+ if(e==='关联看板') return this.$t('AprrovalPage.association_kanban')
|
|
|
+ if(e==='处理状态') return this.$t('AprrovalPage.processing_state')
|
|
|
if(e==='已通过') return this.$t('AprrovalPage.approved_option')
|
|
|
if(e==='已驳回') return this.$t('AprrovalPage.rejected_option')
|
|
|
if(e==='已撤销') return this.$t('AprrovalPage.revoked_option')
|
|
@@ -273,18 +330,41 @@ export default {
|
|
|
}else{
|
|
|
row.DetailImgUrl&&this.handleDownloadResource(row.DetailImgUrl,`${row.ReportTitle}`)
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+ afterGetBaseConfig(){ //执行完reportApproveConfig中getBaseConfig之后执行 mounted之后执行
|
|
|
+ if(this.isETAApprove)
|
|
|
+ this.mainTabs.push({
|
|
|
+ label:this.$t('AprrovalPage.research_approval_btn'),
|
|
|
+ name:'report'
|
|
|
+ });
|
|
|
+ if(this.IsBIApprove)
|
|
|
+ this.mainTabs.push({
|
|
|
+ label:this.$t('SystemManage.BaseConfig.board_approval'),
|
|
|
+ name:'bi'
|
|
|
+ });
|
|
|
+ this.activeMainTab = this.mainTabs.length > 0 ? this.mainTabs[0].name : '';
|
|
|
+ if(!this.mainTabs.length) return;
|
|
|
+ const {formType='approve',mainType='report'} = this.$route.query
|
|
|
+
|
|
|
+ if(mainType) {
|
|
|
+ let valid = this.mainTabs.find(_ => mainType == _.name);
|
|
|
+ this.activeMainTab = valid ? valid.name : this.mainTabs[0].name;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ const formTypeMap = {
|
|
|
+ 'approve':'pending',
|
|
|
+ 'detail':'processed',
|
|
|
+ 'myself':'originate'
|
|
|
+ }
|
|
|
+ this.activeTab = formTypeMap[formType]||'pending'
|
|
|
+ this.tableColumns = columnsMap[`${this.activeTab}_${this.activeMainTab}`] || approve_pending_columns;
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
},
|
|
|
mounted(){
|
|
|
- this.getClassifyTree()
|
|
|
- const {formType='approve'} = this.$route.query
|
|
|
- const formTypeMap = {
|
|
|
- 'approve':'pending',
|
|
|
- 'detail':'processed',
|
|
|
- 'myself':'originate'
|
|
|
- }
|
|
|
- this.activeTab = formTypeMap[formType]||'pending'
|
|
|
- this.getTableData()
|
|
|
+ this.getClassifyTree();
|
|
|
+ this.getBIClassifyTree();
|
|
|
},
|
|
|
components: { RejectDialog }
|
|
|
};
|