我的审批展示逻辑
This commit is contained in:
1 parent
c44365e44f
commit
d2cfd28e41
5 files changed
+39
-20
No files matched your search
+26
-3
@@ -73,11 +73,12 @@ class TaskService extends Service {
|
||||
var editedUserList = taskEditedUserList && taskEditedUserList.split(',') || []
|
||||
|
||||
// 判断该节点是否已完成
|
||||
if ((approvalType == "会签" || approvalType == "依次审批") && editUserList.length + 1 < editedUserList.length) {
|
||||
if ((approvalType == "会签" || approvalType == "依次审批") && editUserList.length > 1) {
|
||||
// 未完成
|
||||
editedUserList.push(userId)
|
||||
updateTaskData = {
|
||||
taskEditUserList: editUserList.filter(u => u != userId),
|
||||
taskEditedUserList: editedUserList.push(userId).join(','),
|
||||
taskEditUserList: editUserList.filter(u => u != userId).join(','),
|
||||
taskEditedUserList: editedUserList.join(','),
|
||||
}
|
||||
|
||||
historyInsertData.push(await this.createTaskHistory({ taskData, taskStatus, type }))
|
||||
@@ -265,6 +266,28 @@ class TaskService extends Service {
|
||||
return workflowHistory
|
||||
|
||||
}
|
||||
|
||||
async getTaskList() {
|
||||
const { jianghuKnex } = this.app;
|
||||
const { userId } = this.ctx.userInfo;
|
||||
|
||||
const task = await jianghuKnex('task').where({ taskStatus: 'running' }).where('taskEditUserList', 'like', '%' + userId + '%').select();
|
||||
|
||||
// 判断是否到该人审批
|
||||
const result = task.filter(item => {
|
||||
const { taskWorkflow, taskConfigId, taskEditUserList } = item
|
||||
// 查看当前节点是否是"依次审批"
|
||||
var isApproval = true,
|
||||
type = JSON.parse(taskWorkflow).nodeList.find(node => node.id === taskConfigId)?.properties.approvalType
|
||||
|
||||
if (type === '依次审批' && !taskEditUserList.startsWith(userId)) {
|
||||
isApproval = false
|
||||
}
|
||||
|
||||
return isApproval
|
||||
})
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TaskService;
|
||||
@@ -3,7 +3,7 @@
|
||||
<v-navigation-drawer v-model="isDrawerShown" v-if="isDrawerShown" :permanent="isDrawerShown" fixed temporary right width="90%" class="elevation-24">
|
||||
<!-- 抽屉标题 -->
|
||||
<v-row no-gutters>
|
||||
<span class="text-h7 font-weight-bold pa-4">【{{taskData.workflowName}}】创建审批</span>
|
||||
<span class="text-h7 font-weight-bold pa-4">【{{taskData.taskTemplateGroup}}——{{taskData.workflowName}}】创建审批</span>
|
||||
</v-row>
|
||||
<!-- {{taskData.workflowForm}} -->
|
||||
<!-- 表单 -->
|
||||
@@ -481,9 +481,9 @@ Vue.component("create-task-drawer", {
|
||||
break;
|
||||
case 'number':
|
||||
if(condition.express != 'between'){
|
||||
isMatch[index] = eval(answer + condition.express + condition.option)
|
||||
isMatch[index] = eval(Number(answer) + condition.express + condition.option)
|
||||
}else{
|
||||
if(condition.option.begin <= answer && answer <= condition.option.end){
|
||||
if(condition.option.begin <= Number(answer) && Number(answer) <= condition.option.end){
|
||||
isMatch[index] = true
|
||||
}
|
||||
}
|
||||
@@ -543,8 +543,7 @@ Vue.component("create-task-drawer", {
|
||||
}
|
||||
},
|
||||
prepareDoWorkItem() {
|
||||
const { workflowInfo, workflowForm, workflowConfig, } = this.taskData
|
||||
const { workflowName, taskTemplateGroup } = workflowInfo
|
||||
const { workflowInfo, workflowForm, workflowConfig, workflowName, taskTemplateGroup, } = this.taskData
|
||||
var curNode = this.curWorkflow[0]
|
||||
var taskLineType = this.taskData.workflowConfig.lineList.filter(line => line.sourceNodeId == curNode.id)[0]?.properties.type
|
||||
var taskViewUserList = this.curWorkflow.reduce((acc, cur) => acc.concat(cur.properties.userIdList), [] )
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<div class="jh-page-second-bar px-8">
|
||||
<v-row class="align-center">
|
||||
<v-col cols="12" xs="12" sm="12" md="4" xl="3">
|
||||
<div class="py-4 text-body-1 font-weight-bold">我的任务
|
||||
<div class="py-4 text-body-1 font-weight-bold">我的审批
|
||||
<!-- 帮助页按钮 -->
|
||||
<span role="button" class="success--text font-weight-regular jh-font-size-13 ml-2" @click="isHelpPageDrawerShown = true">
|
||||
<v-icon size="13" class="success--text">mdi-help-circle-outline</v-icon>帮助
|
||||
@@ -288,16 +288,10 @@
|
||||
pageId: 'todo',
|
||||
actionId: 'selectItemList',
|
||||
actionData: {},
|
||||
where: { taskStatus: 'running' },
|
||||
whereLike: { taskEditUserList: this.userId },
|
||||
orderBy: [{ column: 'operationAt', order: 'desc' }]
|
||||
}
|
||||
}
|
||||
});
|
||||
const rows = result.data.appData.resultData.rows;
|
||||
|
||||
this.tableData = rows.filter(item => !item.taskEditedUserList || !item.taskEditedUserList.includes(this.userId));
|
||||
|
||||
this.tableData = result.data.appData.resultData;
|
||||
this.isTableLoading = false;
|
||||
},
|
||||
async getHistoryData() {
|
||||
@@ -309,12 +303,14 @@
|
||||
actionId: 'selectHistoryList',
|
||||
actionData: {},
|
||||
whereLike: { taskEditUserList: '<$ ctx.userInfo.userId $>', taskConfigId: 'approvalTask-' },
|
||||
orderBy: [{ column: 'id', order: 'desc' }]
|
||||
orderBy: [{ column: 'operationAt', order: 'desc' }]
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const rows = result.data.appData.resultData.rows;
|
||||
var rows = result.data.appData.resultData.rows;
|
||||
// 根据taskId去重
|
||||
rows = _.uniqBy(rows, 'taskId')
|
||||
rows.forEach(row => {
|
||||
row.operationAt = dayjs(row.operationAt).format('YYYY-MM-DD HH:mm:ss');
|
||||
});
|
||||
@@ -130,7 +130,8 @@
|
||||
return {
|
||||
workflowId, workflowName,
|
||||
taskTemplateIcon: info.taskTemplateIcon,
|
||||
taskTemplateGroup: info.taskTemplateGroup || '未命名',
|
||||
taskTemplateGroup: info.taskTemplateGroup || '未分类',
|
||||
workflowInfo: info,
|
||||
workflowForm: JSON.parse(workflowForm),
|
||||
workflowConfig: JSON.parse(workflowConfig),
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@
|
||||
isTableLoading: true,
|
||||
tableData: [],
|
||||
headers: [
|
||||
{ text: "审批项", value: "taskTitle", width: 150 },
|
||||
{ text: "审批项", value: "taskTitle", width: 350 },
|
||||
{ text: "审核状态", value: "taskStatus" },
|
||||
{ text: "操作者", value: "operationByUser", width: 120 },
|
||||
{ text: "操作时间", value: "operationAt", width: 250 },
|
||||
Reference in new issue
Block a user