Merge branch 'wxd' into hebing
# Conflicts: # src/components/workbench/TaskManagement.vue
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="task-management">
|
||||
<div class="task-header">
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
||||
<el-tab-pane :label="t('workbench.task.pendingReview') + ` (${pendingCount})`" name="pending"
|
||||
<el-tab-pane :label="t('workbench.task.pendingReview') + ` (${pendingTotal})`" name="pending"
|
||||
class="task-tab-pane">
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="t('workbench.task.saved')" name="saved"></el-tab-pane>
|
||||
@@ -49,6 +49,28 @@ const activeTab = ref('pending');
|
||||
const tableData = ref<any[]>([]);
|
||||
const loading = ref(false);
|
||||
|
||||
const pendingTotal = ref(0);
|
||||
/**
|
||||
* 根据任务名称判断类型
|
||||
* @param name 任务名称
|
||||
* @returns 任务类型
|
||||
*/
|
||||
const getTaskType = (name: string): string => {
|
||||
if (name.includes('投资申报') || name.includes('项目投资')) {
|
||||
return 'investment';
|
||||
}
|
||||
if (name.includes('专家') || name.includes('专家登记')) {
|
||||
return 'expert';
|
||||
}
|
||||
if (name.includes('投资储备') || name.includes('储备')) {
|
||||
return 'reserve';
|
||||
}
|
||||
if (name.includes('合作单位') || name.includes('合作')) {
|
||||
return 'cooperation';
|
||||
}
|
||||
// 默认类型
|
||||
return 'default';
|
||||
};
|
||||
|
||||
/**
|
||||
* 根据类型获取审批页面路由
|
||||
@@ -59,7 +81,7 @@ const loading = ref(false);
|
||||
const getApprovalRoute = (type: string, taskId: string): string => {
|
||||
const routeMap: Record<string, string> = {
|
||||
investment: '/invMid/planApplyExamine/index', // 投资申报审批
|
||||
expert: '/workbench/expertApproval/index', // 专家登记审批
|
||||
expert: '/investment/expertApplyExamine/index', // 专家信息登记审批
|
||||
reserve: '/workbench/reserveApproval/index', // 投资储备审批
|
||||
cooperation: '/workbench/cooperationApproval/index', // 合作单位审批
|
||||
default: '/workbench/approvalDetail', // 默认审批详情页
|
||||
@@ -73,41 +95,32 @@ const getApprovalRoute = (type: string, taskId: string): string => {
|
||||
* @param row 行数据
|
||||
*/
|
||||
const handleRowClick = (row: any) => {
|
||||
console.log(row);
|
||||
const taskType = row.type || getTaskType(row.name);
|
||||
const taskId = row.taskId || row.id;
|
||||
const route = getApprovalRoute(row.flowType, taskId);
|
||||
const routePath = examineDict[row.flowType]
|
||||
if (!routePath){
|
||||
useMessage().error('未定义的审批类型!')
|
||||
return
|
||||
}
|
||||
console.log(routePath)
|
||||
const route = getApprovalRoute(taskType, taskId);
|
||||
|
||||
// 跳转到对应的审批页面
|
||||
router.push({
|
||||
path: routePath,
|
||||
path: route.split('?')[0],
|
||||
query: {
|
||||
processInstanceId: row.processInstanceId,
|
||||
id: taskId,
|
||||
type: taskType,
|
||||
tab: activeTab.value, // 传递当前标签页信息,用于返回时定位
|
||||
},
|
||||
});
|
||||
};
|
||||
// request('admin/sys/code/list',{
|
||||
// method:'get',
|
||||
// }).then(res=>{
|
||||
// console.log('test',res)
|
||||
// })
|
||||
const getQueryMineTask = () =>{
|
||||
return new Promise((resolve, reject) =>{
|
||||
const getQueryMineTask = (): Promise<any> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
queryMineTask({
|
||||
title: '',
|
||||
processName: '',
|
||||
taskTime: undefined,
|
||||
flowType: '',
|
||||
size:5,
|
||||
size: 5,
|
||||
current: 1
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
resolve(res)
|
||||
}).catch(err=>{
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
@@ -133,8 +146,9 @@ const loadData = async (tab: string) => {
|
||||
let res;
|
||||
loading.value = true;
|
||||
if (tab === 'pending') {
|
||||
const response = await getQueryMineTask()
|
||||
const response = await getQueryMineTask()
|
||||
res = response?.data?.records
|
||||
pendingTotal.value = response?.data?.total || 0
|
||||
}
|
||||
if (tab === 'myInitiated') {
|
||||
const response = await getQueryMineStarted()
|
||||
|
||||
Reference in New Issue
Block a user