diff --git a/app/service/task.js b/app/service/task.js index 9239e2b..38eb5e9 100644 --- a/app/service/task.js +++ b/app/service/task.js @@ -104,9 +104,9 @@ class TaskService extends Service { taskCostDuration: 0 } const insert = await jianghuKnex(tableEnum.task_history, this.ctx).insert(history); - + } else { - throw new BizError(errorInfoEnum.article_not_found); + throw new BizError(errorInfoEnum.line_not_found); } } @@ -151,7 +151,7 @@ class TaskService extends Service { } /** * 工单历史信息 - * @returns + * @returns */ async getTaskHistoryInfo() { const { actionData } = this.ctx.request.body.appData; @@ -177,8 +177,8 @@ class TaskService extends Service { } /** * 制作节点步骤list - * @param {*} processInfo - * @returns + * @param {*} processInfo + * @returns */ makeStepper(workflowStructure, taskHistory) { const { jianghuKnex } = this.app; @@ -206,10 +206,10 @@ class TaskService extends Service { } /** * 获取下一个步骤节点 - * @param {*} nodeAllList - * @param {*} lineAllList - * @param {*} nodeSortList - * @returns + * @param {*} nodeAllList + * @param {*} lineAllList + * @param {*} nodeSortList + * @returns */ getNextNodeSetup(nodeAllList, lineAllList, nodeSortList) { const lastNode = nodeSortList[nodeSortList.length - 1]; @@ -221,12 +221,12 @@ class TaskService extends Service { return nodeAllList.find(e => lineIds.includes(e.id) && !(nodeSortList.find(s => s.id === e.id))); } async submitNode() { - + const { actionData } = this.ctx.request.body.appData; const { jianghuKnex, config } = this.app; const { type, taskId, taskRemark, taskTpl, taskComment } = actionData; const { userId, username } = this.ctx.userInfo; - + const taskInfo = await jianghuKnex(tableEnum.task).where({taskId}).first(); delete taskInfo.id; const {nodeList = [], lineList = []} = JSON.parse(taskInfo.workflowConfig || '{}'); @@ -271,11 +271,11 @@ class TaskService extends Service { await jianghuKnex(tableEnum.task_history, this.ctx).insert(endHistory); } await jianghuKnex(tableEnum.task, this.ctx).where({taskId}).update({ - taskFormInput, - taskRemark, - taskNextConfigList: JSON.stringify(nextLineList), - taskEditUserList, - taskConfigId: nextNode.id, + taskFormInput, + taskRemark, + taskNextConfigList: JSON.stringify(nextLineList), + taskEditUserList, + taskConfigId: nextNode.id, taskStatus: (nextLineList.length === 0 || currentNode.id.includes('end-')) ? 'end' : type === 'deny' ? 'deny' : 'running', taskComment }); diff --git a/app/view/component/tpl/formItemListGenerator.html b/app/view/component/tpl/formItemListGenerator.html index 6de36ff..8d655e7 100644 --- a/app/view/component/tpl/formItemListGenerator.html +++ b/app/view/component/tpl/formItemListGenerator.html @@ -43,7 +43,7 @@ - + diff --git a/app/view/page/taskCreateManagement.html b/app/view/page/taskCreateManagement.html index c4e1140..2c17a78 100644 --- a/app/view/page/taskCreateManagement.html +++ b/app/view/page/taskCreateManagement.html @@ -25,19 +25,23 @@ - - 流程列表 - - {{getConstantCollectionItemText('categoryList', index)}} - - - - {{it.workflowName}} - - - - - + + + @@ -60,17 +64,15 @@ - {{formItem.component.outline}} + {{ index+1 }}、 {{ formItem.component.outline }} - {{ index+1 }}、 {{ formItem.component.outline }} - + - {{ index+1 }}、 {{ formItem.component.outline }}
@@ -126,17 +128,11 @@ tableDataFromBackend: [], headers: [ { text: "ID", value: "id", width: 120, class: 'fixed', cellClass: 'fixed' }, - - { text: "任务ID", value: "taskId", width: 120 }, - { text: "流程节点版本ID", value: "processVersionId", width: 120 }, - { text: "任务名称", value: "taskTitle", width: 120 }, - { text: "任务状态:running 执行中;deny 拒绝;end 结束", value: "taskStatus", width: 120 }, - { text: "当前执行中节点", value: "taskCurrentNode", width: 120 }, - { text: "申请人", value: "taskApplier", width: 120 }, - { text: "当前执行的处理人员,用逗号分隔", value: "taskProcessorList", width: 120 }, - { text: "所有相关人员,用逗号分隔", value: "taskRelatedPersonList", width: 120 }, - { text: "催单次数", value: "taskUrgeCount", width: 120 }, - { text: "最后催单时间", value: "taskUrgeLastTime", width: 120 }, + { text: "任务ID", value: "workflowId", width: 120 }, + { text: "任务名称", value: "workflowName", width: 120 }, + { text: "任务分类ID", value: "workflowCategory", width: 120 }, + { text: "任务节点", value: "workflowConfig", width: 120 }, + { text: "备注", value: "workflowRemark", width: 120 }, { text: "操作者", value: "operationByUser", width: 120 }, { text: "操作时间", value: "operationAt", width: 250 }, { text: '操作', value: 'action', align: 'center', sortable: false, width: 200, class: 'fixed', cellClass: 'fixed' }, @@ -189,10 +185,14 @@ } } }); - for(const item of rows) { - item.workflowForm = JSON.parse(item.workflowForm || '[]'); - } - this.tableDataFromBackend = _.groupBy(rows, 'workflowCategory'); + rows.forEach(row => { + if(row.workflowConfig) { + row.workflowConfig = JSON.parse(row.workflowConfig).nodeList.map(item => [item.label, item.lineTypeList]); + row.workflowForm = JSON.parse(row.workflowForm || '[]'); + } + }) + this.tableDataFromBackend = rows; + console.log(this.tableDataFromBackend); this.isTableLoading = false; },