Merge branch 'main' of github.com:jianghujs/jianghujs-workflow into main
This commit is contained in:
commit
b518f082b6
3 files changed
+49
-49
No files matched your search
+16
-16
@@ -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
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<v-list-item>
|
||||
|
||||
<v-list-item-content v-if="formItem.component.type === 'singleSelect'">
|
||||
<v-radio-group :disabled="true" :label="(index+1) + formItem.component.outline">
|
||||
<v-radio-group :disabled="true" :label="(index+1) + '. ' + formItem.component.outline">
|
||||
<v-radio hide-details v-for="(option, optionIndex) in formItem.component.property.selectOptionList"
|
||||
:key="optionIndex" :label="option.value" :value="option.value"></v-radio>
|
||||
</v-radio-group>
|
||||
|
||||
@@ -25,19 +25,23 @@
|
||||
|
||||
<!-- 页面主要内容 -->
|
||||
<v-card :class="{'px-2': isMobile}">
|
||||
<v-list three-line subheader>
|
||||
<v-subheader>流程列表</v-subheader>
|
||||
<v-list-item v-for="(item, index) in tableDataFromBackend" :key="index">
|
||||
<v-subheader>{{getConstantCollectionItemText('categoryList', index)}}</v-subheader>
|
||||
<v-row :class="{'px-10': !isMobile, 'px-3': isMobile, 'pb-7': isMobile}">
|
||||
<v-col cols="12" sm="12" md="6" xl="6" class=" pb-3" v-for="(it, index) in item">
|
||||
<v-btn class="elevation-0 mr-10" color="success" dark @click="doUiAction('startCreateItem', {item: it})">
|
||||
{{it.workflowName}}
|
||||
</v-btn>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<v-data-table :headers="headers"
|
||||
:items="tableData"
|
||||
:search="searchInput"
|
||||
:footer-props="{ itemsPerPageOptions: [20, 40, 60, 100, -1] }"
|
||||
:items-per-page="20"
|
||||
mobile-breakpoint="0"
|
||||
:loading="isTableLoading"
|
||||
checkbox-color="success"
|
||||
:class="{'mx-2': isMobile}"
|
||||
color="success"
|
||||
class="elevation-0 mt-0 flex-fill d-flex flex-column">
|
||||
<template v-slot:item.action="{ item }">
|
||||
<v-btn small color="success" class="mr-2" @click="doUiAction('startCreateItem', {item: item})">
|
||||
申请
|
||||
</v-btn>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
|
||||
<!-- 编辑抽屉 -->
|
||||
@@ -60,17 +64,15 @@
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" class=" pb-3" v-for="(formItem, index) in editItem.workflowForm" :key="index">
|
||||
<span class="inputLabel">{{formItem.component.outline}}</span>
|
||||
<span class="inputLabel">{{ index+1 }}、 {{ formItem.component.outline }}</span>
|
||||
<v-list-item-content v-if="formItem.component.type === 'singleSelect'">
|
||||
<v-list-item-title class="formItem-title">{{ index+1 }}、 {{ formItem.component.outline }}</v-list-item-title>
|
||||
<v-radio-group :rules="requireRules" v-model="editItem.workflowFormData[formItem.id]" hide-details>
|
||||
<v-radio-group row :rules="requireRules" v-model="editItem.workflowFormData[formItem.id]" hide-details>
|
||||
<v-radio v-for="(option, optionIndex) in formItem.component.property.selectOptionList"
|
||||
:key="optionIndex" :label="option.value"></v-radio>
|
||||
</v-radio-group>
|
||||
</v-list-item-content>
|
||||
|
||||
<v-list-item-content v-if="formItem.component.type === 'multipleSelect'">
|
||||
<v-list-item-title class="formItem-title">{{ index+1 }}、 {{ formItem.component.outline }}</v-list-item-title>
|
||||
<div v-for="(option, optionIndex) in formItem.component.property.selectOptionList" :key="optionIndex">
|
||||
<v-checkbox :rules="requireRules" style="margin-top: 0px;" :label="option.value" v-model="editItem.workflowFormData[formItem.id]" hide-details color="red"></v-checkbox>
|
||||
</div>
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user