Compare commits
No commits in common. "c135996e8dea91d5c9cfc5ff1010ec64e481caf9" and "bb9a4715662975bf6af35936528e50f55a560a65" have entirely different histories.
c135996e8d
...
bb9a471566
|
@ -39,7 +39,7 @@ logging:
|
||||||
com.ruoyi: debug
|
com.ruoyi: debug
|
||||||
com.yanzhu.jh: debug
|
com.yanzhu.jh: debug
|
||||||
org.springframework: warn
|
org.springframework: warn
|
||||||
org.flowable: debug
|
|
||||||
# 用户配置
|
# 用户配置
|
||||||
user:
|
user:
|
||||||
password:
|
password:
|
||||||
|
|
|
@ -560,17 +560,15 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
|
List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
|
||||||
if(CollectionUtils.isNotEmpty(historicTaskInstance)){
|
flowTask.setTaskId(historicTaskInstance.get(0).getId());
|
||||||
flowTask.setTaskId(historicTaskInstance.get(0).getId());
|
flowTask.setTaskName(historicTaskInstance.get(0).getName());
|
||||||
flowTask.setTaskName(historicTaskInstance.get(0).getName());
|
if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
|
||||||
if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
|
// 当前任务节点办理人信息
|
||||||
// 当前任务节点办理人信息
|
SysUser sysUser = sysUserService.selectUserById(Long.parseLong(historicTaskInstance.get(0).getAssignee()));
|
||||||
SysUser sysUser = sysUserService.selectUserById(Long.parseLong(historicTaskInstance.get(0).getAssignee()));
|
if (Objects.nonNull(sysUser)) {
|
||||||
if (Objects.nonNull(sysUser)) {
|
flowTask.setAssigneeId(sysUser.getUserId());
|
||||||
flowTask.setAssigneeId(sysUser.getUserId());
|
flowTask.setAssigneeName(sysUser.getNickName());
|
||||||
flowTask.setAssigneeName(sysUser.getNickName());
|
flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
|
||||||
flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,238 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-drawer
|
|
||||||
v-if="onOpen"
|
|
||||||
:visible.sync="onOpen"
|
|
||||||
ref="drawer"
|
|
||||||
direction="rtl"
|
|
||||||
size="60%"
|
|
||||||
@close="closeCallBack"
|
|
||||||
style="padding-left: 20px; padding-right: 20px"
|
|
||||||
>
|
|
||||||
<template slot="title">
|
|
||||||
<div>工程管理 【{{ title }}】</div>
|
|
||||||
</template>
|
|
||||||
<el-form
|
|
||||||
ref="form"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
v-loading="loading"
|
|
||||||
label-width="120px"
|
|
||||||
style="padding-right: 35px"
|
|
||||||
>
|
|
||||||
<div class="canvas" ref="flowCanvas"></div>
|
|
||||||
<div class="maskLayer" />
|
|
||||||
<el-form-item label="所属项目" prop="businessKey">
|
|
||||||
<el-select
|
|
||||||
v-model="form.businessKey"
|
|
||||||
placeholder="请选择所属项目"
|
|
||||||
style="width: 100%"
|
|
||||||
filterable
|
|
||||||
:disabled="disPro"
|
|
||||||
@change="projectChage"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in projectOptions"
|
|
||||||
:key="index"
|
|
||||||
:label="item.projectName"
|
|
||||||
:value="item.id"
|
|
||||||
>
|
|
||||||
</el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发起单位">
|
|
||||||
{{ deptName }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="发起人">
|
|
||||||
{{ nickName }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="审批事项">
|
|
||||||
{{ title }}
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="审批内容" prop="files">
|
|
||||||
<FileUpload
|
|
||||||
@input="fileInput"
|
|
||||||
:limit="9"
|
|
||||||
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="申请说明" prop="remark">
|
|
||||||
<el-input
|
|
||||||
type="textarea"
|
|
||||||
v-model="form.remark"
|
|
||||||
placeholder="请输入申请说明"
|
|
||||||
rows="5"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div style="text-align: center">
|
|
||||||
<el-button type="primary" @click="submitForm">提交流程</el-button>
|
|
||||||
<el-button @click="doCanel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</el-drawer>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import store from "@/store";
|
|
||||||
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
|
|
||||||
import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
|
|
||||||
import { getNextFlowNodeByStart } from "@/api/flowable/todo";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
closeCallBack: {
|
|
||||||
type: Function,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 抽屉层
|
|
||||||
onOpen: false,
|
|
||||||
// 遮罩层
|
|
||||||
loading: false,
|
|
||||||
// 标题
|
|
||||||
title: "",
|
|
||||||
// 表单参数
|
|
||||||
form: {
|
|
||||||
businessKey: "",
|
|
||||||
projectName: "",
|
|
||||||
files: "",
|
|
||||||
remark: "",
|
|
||||||
},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
businessKey: [{ required: true, message: "请选择所属项目", trigger: "blur" }],
|
|
||||||
files: [{ required: true, message: "请上传申请内容", trigger: "blur" }],
|
|
||||||
remark: [
|
|
||||||
{ required: false, message: "请输入申请说明", trigger: "blur" },
|
|
||||||
{
|
|
||||||
max: 500,
|
|
||||||
message: "申请说明最多输入500字",
|
|
||||||
trigger: "blur",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
projectOptions: null,
|
|
||||||
deptName: null,
|
|
||||||
nickName: null,
|
|
||||||
disPro: false,
|
|
||||||
bpmnViewer: null,
|
|
||||||
options: null,
|
|
||||||
taskTitle: null,
|
|
||||||
taskOpen: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {},
|
|
||||||
watch: {},
|
|
||||||
created() {},
|
|
||||||
mounted() {},
|
|
||||||
beforeDestroy() {},
|
|
||||||
methods: {
|
|
||||||
// 查询和我相关的项目信息
|
|
||||||
initMyProject() {
|
|
||||||
// 获取项目列表的接口
|
|
||||||
this.$api.publics.getMyProjectList({}).then((response) => {
|
|
||||||
this.projectOptions = response.rows;
|
|
||||||
if (response.rows.length == 0) {
|
|
||||||
this.$message.error("未查询到和您关联项目,请联系子公司或管理员...");
|
|
||||||
} else if (response.rows.length == 1) {
|
|
||||||
// 这里只有一个项目,默认选中并只读
|
|
||||||
this.form.businessKey = response.rows[0].id;
|
|
||||||
this.form.projectName = response.rows[0].projectName;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 项目选择
|
|
||||||
projectChage(val) {
|
|
||||||
let projectName = "";
|
|
||||||
this.projectOptions.forEach((item) => {
|
|
||||||
if ((item.id = val)) {
|
|
||||||
projectName = item.projectName;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.form.projectName = projectName;
|
|
||||||
},
|
|
||||||
doCanel() {
|
|
||||||
this.onOpen = false;
|
|
||||||
},
|
|
||||||
show(options) {
|
|
||||||
console.log(options);
|
|
||||||
this.options = options;
|
|
||||||
this.initMyProject();
|
|
||||||
this.title = options.name;
|
|
||||||
this.deptName = store.getters.dept.deptName;
|
|
||||||
this.nickName = store.getters.name;
|
|
||||||
const self = this;
|
|
||||||
this.onOpen = true;
|
|
||||||
flowXmlAndNode({ deployId: options.deploymentId }).then((res) => {
|
|
||||||
this.initFlowImage(res.data.xmlData);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async initFlowImage(data) {
|
|
||||||
try {
|
|
||||||
self.bpmnViewer = new BpmnViewer({
|
|
||||||
container: this.$refs.flowCanvas,
|
|
||||||
height: "150px",
|
|
||||||
});
|
|
||||||
await self.bpmnViewer.importXML(data);
|
|
||||||
// 自适应
|
|
||||||
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err.message, err.warnings);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fileInput(files) {
|
|
||||||
let fileUrls = "";
|
|
||||||
if (files.length > 0) {
|
|
||||||
fileUrls = "";
|
|
||||||
files.forEach((item) => {
|
|
||||||
fileUrls += "," + item.url;
|
|
||||||
});
|
|
||||||
fileUrls = fileUrls.substring(1);
|
|
||||||
}
|
|
||||||
this.form.files = fileUrls;
|
|
||||||
},
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
this.loading = true;
|
|
||||||
// 根据当前任务或者流程设计配置的下一步节点 todo 暂时未涉及到考虑网关、表达式和多节点情况
|
|
||||||
// getNextFlowNodeByStart({
|
|
||||||
// deploymentId: this.options.deploymentId,
|
|
||||||
// variables: this.form,
|
|
||||||
// }).then((res) => {
|
|
||||||
// const data = res.data;
|
|
||||||
// if (data) {
|
|
||||||
// console.log(data);
|
|
||||||
// this.loading = false;
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// 启动流程并将表单数据加入流程变量
|
|
||||||
|
|
||||||
definitionStart(this.options.id, JSON.stringify(this.form)).then((res) => {
|
|
||||||
this.$modal.msgSuccess(res.msg);
|
|
||||||
this.loading = false;
|
|
||||||
//关闭并刷新列表
|
|
||||||
this.$refs.drawer.closeDrawer();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.bjs-powered-by {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
.maskLayer {
|
|
||||||
width: 100%;
|
|
||||||
height: 150px;
|
|
||||||
position: absolute;
|
|
||||||
z-index: 9999;
|
|
||||||
top: 66px;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue