删除审批流
This commit is contained in:
1 parent
4570db06ac
commit
a41ced621b
3 files changed
+53
-25
No files matched your search
+13
-23
@@ -32,8 +32,8 @@ appDataSchema.createWorkflowTask = Object.freeze({
|
||||
additionalProperties: true
|
||||
}
|
||||
},
|
||||
workflowId: {type: 'string', minLength: 1, maxLength: 100},
|
||||
workflowConfigCustom: {type: 'string', minLength: 1, maxLength: 10000},
|
||||
workflowId: { type: 'string', minLength: 1, maxLength: 100 },
|
||||
workflowConfigCustom: { type: 'string', minLength: 1, maxLength: 10000 },
|
||||
},
|
||||
additionalProperties: true
|
||||
});
|
||||
@@ -56,16 +56,6 @@ class WorkflowService extends Service {
|
||||
columnName: "formId"
|
||||
});
|
||||
}
|
||||
async createWorkflowId() {
|
||||
const { actionData } = this.ctx.request.body.appData;
|
||||
const { jianghuKnex } = this.app;
|
||||
actionData.workflowId = await idGenerateUtil.idPlus({
|
||||
knex: jianghuKnex,
|
||||
startValue: 1000,
|
||||
tableName: 'workflow',
|
||||
columnName: "workflowId"
|
||||
});
|
||||
}
|
||||
|
||||
async assignTplData() {
|
||||
const { actionData } = this.ctx.request.body.appData;
|
||||
@@ -76,13 +66,13 @@ class WorkflowService extends Service {
|
||||
const tplList = await jianghuKnex('form').whereIn('formId', tplIds).select();
|
||||
let formList = [];
|
||||
const formData = {};
|
||||
for( const item of tplList) {
|
||||
for (const item of tplList) {
|
||||
const cache = JSON.parse(item.formStructure);
|
||||
for(const i of cache) {
|
||||
for (const i of cache) {
|
||||
i.tplId = item.tplId
|
||||
}
|
||||
formList = [...formList, ...cache];
|
||||
for(const it of cache) {
|
||||
for (const it of cache) {
|
||||
formData[it.id] = '';
|
||||
}
|
||||
}
|
||||
@@ -92,18 +82,18 @@ class WorkflowService extends Service {
|
||||
}
|
||||
console.log(actionData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建流程审批
|
||||
*/
|
||||
async createWorkflowTask() {
|
||||
const { actionData } = this.ctx.request.body.appData;
|
||||
validateUtil.validate(appDataSchema.createWorkflowTask , actionData);
|
||||
validateUtil.validate(appDataSchema.createWorkflowTask, actionData);
|
||||
const { jianghuKnex } = this.app;
|
||||
const { formItemList, workflowConfigCustom, workflowId } = actionData;
|
||||
|
||||
let workflow = await jianghuKnex('workflow', this.ctx).where({workflowId}).first();
|
||||
if(!workflow) {
|
||||
let workflow = await jianghuKnex('workflow', this.ctx).where({ workflowId }).first();
|
||||
if (!workflow) {
|
||||
throw new BizError(errorInfoEnum.workflow_not_found);
|
||||
}
|
||||
|
||||
@@ -124,16 +114,16 @@ class WorkflowService extends Service {
|
||||
*/
|
||||
async getTaskHistory() {
|
||||
const { taskId } = this.ctx.request.body.appData.actionData;
|
||||
validateUtil.validate(appDataSchema.getTaskHistory , taskId);
|
||||
validateUtil.validate(appDataSchema.getTaskHistory, taskId);
|
||||
const { jianghuKnex } = this.app;
|
||||
|
||||
const taskInfo = await jianghuKnex('task', this.ctx).where({taskId}).first();
|
||||
const taskHistoryList = await jianghuKnex('task_history').where({taskId: taskInfo.taskId}).orderBy('id', 'asc').select();
|
||||
const taskInfo = await jianghuKnex('task', this.ctx).where({ taskId }).first();
|
||||
const taskHistoryList = await jianghuKnex('task_history').where({ taskId: taskInfo.taskId }).orderBy('id', 'asc').select();
|
||||
// const userList = await jianghuKnex('_view01_user').whereIn('userId', taskInfo.taskViewUserList.split(',')).select();
|
||||
// taskInfo.workflowConfig = JSON.parse(taskInfo.workflowConfig);
|
||||
// return this.ctx.service.task.getTaskHistoryConfigList(taskInfo.workflowConfig, taskHistoryList, userList);
|
||||
const lineTypeList = taskInfo.taskLineTypeList;
|
||||
return {taskHistoryList, lineTypeList};
|
||||
return { taskHistoryList, lineTypeList };
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user