提交代码

dev_xds
姜玉琦 2024-03-18 22:48:40 +08:00
parent 1b8fb5fac3
commit 509eb22d28
14 changed files with 2127 additions and 1648 deletions

View File

@ -113,7 +113,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 对于登录login 注册register 验证码captchaImage 允许匿名访问 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login","/wechat/**", "/common/**", "/register", "/captchaImage","/bgscreen/**","/publics/**","/system/dict/data/**").permitAll() .antMatchers("/login","/wechat/**", "/common/**", "/register", "/captchaImage","/bgscreen/**","/publics/**","/system/dict/data/**").permitAll()
// 静态资源,可匿名访问 // 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/**/img/**", "/profile/**").permitAll() .antMatchers(HttpMethod.GET, "/", "/*.txt", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/**/img/**", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证 // 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated() .anyRequest().authenticated()

View File

@ -8,7 +8,11 @@
size="80%" size="80%"
> >
<template slot="title"> <template slot="title">
<div>流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd"> - {{options.taskName}}</span></div> <div>
流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd">
- 当前节点{{ options.taskName }}</span
>
</div>
</template> </template>
<div class="drawer"> <div class="drawer">
<div class="drawerLeft"> <div class="drawerLeft">
@ -18,42 +22,73 @@
</div> </div>
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
v-for="(item,index ) in flowRecordList" v-for="(item, index) in flowRecordList"
:key="index" :key="index"
:icon="setIcon(item)" :icon="setIcon(item)"
:color="setColor(item)" :color="setColor(item)"
> >
<p style="font-weight: 700"> {{ getSort(index) }}{{item.taskName}}{{item.commentResult}}</p> <p style="font-weight: 700">
{{ getSort(index) }}{{ item.taskName }}{{ item.commentResult }}
</p>
<el-card :body-style="{ padding: '6px' }"> <el-card :body-style="{ padding: '6px' }">
<el-descriptions class="margin-top" :column="1" size="small" border> <el-descriptions class="margin-top" :column="1" size="small" border>
<el-descriptions-item v-if="item.assigneeName" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.assigneeName"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>办理人</template> <template slot="label"><i class="el-icon-user"></i>办理人</template>
{{item.assigneeName}} {{ item.assigneeName }}
<el-tag type="info" size="mini">{{item.deptName}}</el-tag> <el-tag type="info" size="mini">{{ item.deptName }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.candidate" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.candidate"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>候选办理</template> <template slot="label"><i class="el-icon-user"></i>候选办理</template>
{{item.candidate}} {{ item.candidate }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.deleteReason" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.deleteReason"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>驳回节点</template> <template slot="label"><i class="el-icon-user"></i>驳回节点</template>
{{getDeleteReason(item.deleteReason)}} {{ getDeleteReason(item.deleteReason) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>接收时间</template> <template slot="label"><i class="el-icon-date"></i>接收时间</template>
{{item.startTime}} {{ item.startTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.endTime" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.endTime"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>处理时间</template> <template slot="label"><i class="el-icon-date"></i>处理时间</template>
{{item.endTime}} {{ item.endTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.duration" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.duration"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-time"></i>处理耗时</template> <template slot="label"><i class="el-icon-time"></i>处理耗时</template>
{{getDurationDate(item.duration)}} {{ getDurationDate(item.duration) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.message" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
<template slot="label"><i class="el-icon-tickets"></i>处理意见</template> v-if="item.message"
{{item.message}} label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"
><i class="el-icon-tickets"></i>处理意见</template
>
{{ item.message }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
@ -61,9 +96,7 @@
</el-timeline> </el-timeline>
</div> </div>
<div class="drawerRight"> <div class="drawerRight">
<el-form <el-form label-width="100px">
label-width="100px"
>
<el-form-item label="所属项目"> <el-form-item label="所属项目">
{{ initData.projectName }} {{ initData.projectName }}
</el-form-item> </el-form-item>
@ -77,18 +110,18 @@
{{ title }} {{ title }}
</el-form-item> </el-form-item>
<el-form-item label="审批内容"> <el-form-item label="审批内容">
<div v-for="(file,index ) in initData.files" :key="index"> <div v-for="(file, index) in initData.files" :key="index">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-paperclip" icon="el-icon-paperclip"
@click="handledownload(file)" @click="handledownload(file)"
>{{file.substring(file.lastIndexOf('/')+1)}}</el-button >{{ file.substring(file.lastIndexOf("/") + 1) }}</el-button
> >
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="申请说明"> <el-form-item label="申请说明">
{{initData.remark}} {{ initData.remark }}
</el-form-item> </el-form-item>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="danger" @click="doCanel"> </el-button> <el-button type="danger" @click="doCanel"> </el-button>
@ -103,11 +136,13 @@
<script> <script>
import { flowXmlAndNode } from "@/api/flowable/definition"; import { flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn"; import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import {findCommentByProcInsId,findFormDatasByProcInsId} from "@/api/flowable/businessKey"; import {
findCommentByProcInsId,
findFormDatasByProcInsId,
} from "@/api/flowable/businessKey";
export default { export default {
components: {}, components: {},
props: { props: {},
},
data() { data() {
return { return {
// //
@ -116,7 +151,7 @@ export default {
loading: false, loading: false,
// //
title: "", title: "",
jdtitle:"", jdtitle: "",
// //
form: {}, form: {},
// //
@ -124,10 +159,10 @@ export default {
bpmnViewer: null, bpmnViewer: null,
options: {}, options: {},
flowRecordList: [], flowRecordList: [],
showjd:false, showjd: false,
//label //label
labelStyle: { width: "180px" }, labelStyle: { width: "180px" },
initData:{} initData: {},
}; };
}, },
computed: {}, computed: {},
@ -138,10 +173,9 @@ export default {
methods: { methods: {
setIcon(row) { setIcon(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "el-icon-close"; return "el-icon-close";
}else{ } else {
return "el-icon-check"; return "el-icon-check";
} }
} else { } else {
@ -150,10 +184,9 @@ export default {
}, },
setColor(row) { setColor(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "#f56c6c"; return "#f56c6c";
}else{ } else {
return "#2bc418"; return "#2bc418";
} }
} else { } else {
@ -178,19 +211,21 @@ export default {
this.onOpen = true; this.onOpen = true;
this.showjd = false; this.showjd = false;
if(options.finishTime==null){ if (options.finishTime == null) {
this.jdtitle="进行中"; this.jdtitle = "进行中";
this.showjd=true; this.showjd = true;
}else if(options.finishTime!=null && options.assigneeId==null){ } else if (options.finishTime != null && options.assigneeId == null) {
this.jdtitle="已终止"; this.jdtitle = "已终止";
}else{ } else {
this.jdtitle="已完成"; this.jdtitle = "已完成";
} }
this.getFlowRecordList(options.procInsId, options.deployId); this.getFlowRecordList(options.procInsId, options.deployId);
this.getFormDatasList(options.procInsId, options.deployId); this.getFormDatasList(options.procInsId, options.deployId);
flowXmlAndNode({ procInsId:options.procInsId, deployId: options.deployId }).then((res) => { flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
(res) => {
this.initFlowImage(res.data); this.initFlowImage(res.data);
}); }
);
}, },
async initFlowImage(data) { async initFlowImage(data) {
const self = this; const self = this;
@ -202,8 +237,8 @@ export default {
await self.bpmnViewer.importXML(data.xmlData); await self.bpmnViewer.importXML(data.xmlData);
// //
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto"); self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
if (data.nodeData !==undefined && data.nodeData.length > 0 ) { if (data.nodeData !== undefined && data.nodeData.length > 0) {
self.fillColor(data.nodeData) self.fillColor(data.nodeData);
} }
} catch (err) { } catch (err) {
console.error(err.message, err.warnings); console.error(err.message, err.warnings);
@ -218,13 +253,15 @@ export default {
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findCommentByProcInsId(params).then(res => { findCommentByProcInsId(params)
.then((res) => {
that.flowRecordList = res.data; that.flowRecordList = res.data;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
/** 流程表单数据 */ /** 流程表单数据 */
getFormDatasList(procInsId, deployId) { getFormDatasList(procInsId, deployId) {
@ -235,138 +272,177 @@ export default {
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findFormDatasByProcInsId(params).then(res => { findFormDatasByProcInsId(params)
.then((res) => {
this.initData = res.data; this.initData = res.data;
this.initData.files = res.data.files.split(','); this.initData.files = res.data.files.split(",");
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
// //
fillColor(nodeData) { fillColor(nodeData) {
const canvas = this.bpmnViewer.get('canvas') const canvas = this.bpmnViewer.get("canvas");
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach(n => { this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
const completeTask = nodeData.find(m => m.key === n.id) const completeTask = nodeData.find((m) => m.key === n.id);
const todoTask = nodeData.find(m => !m.completed) const todoTask = nodeData.find((m) => !m.completed);
const endTask = nodeData[nodeData.length - 1] const endTask = nodeData[nodeData.length - 1];
if (n.$type === 'bpmn:UserTask') { if (n.$type === "bpmn:UserTask") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){ if (
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') todoTask &&
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') completeTask.key === todoTask.key &&
}else { !todoTask.completed
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') ) {
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
nn.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
} else {
canvas.addMarker(
nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
} }
}) });
} }
} }
// //
else if (n.$type === 'bpmn:ExclusiveGateway') { else if (n.$type === "bpmn:ExclusiveGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
});
})
} }
} }
// //
else if (n.$type === 'bpmn:ParallelGateway') { else if (n.$type === "bpmn:ParallelGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
}) });
} }
} } else if (n.$type === "bpmn:StartEvent") {
else if (n.$type === 'bpmn:StartEvent') { n.outgoing.forEach((nn) => {
n.outgoing.forEach(nn => { const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
const completeTask = nodeData.find(m => m.key === nn.targetRef.id)
if (completeTask) { if (completeTask) {
canvas.addMarker(nn.id, 'highlight') canvas.addMarker(nn.id, "highlight");
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
}) });
} } else if (n.$type === "bpmn:EndEvent") {
else if (n.$type === 'bpmn:EndEvent') {
if (endTask.key === n.id && endTask.completed) { if (endTask.key === n.id && endTask.completed) {
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
} }
}) });
}, },
getDurationDate(val){ getDurationDate(val) {
// //
let days = Math.floor(val / (24 * 3600 * 1000)) let days = Math.floor(val / (24 * 3600 * 1000));
// //
let leave1 = val % (24 * 3600 * 1000) // let leave1 = val % (24 * 3600 * 1000); //
let hours = Math.floor(leave1 / (3600 * 1000)) let hours = Math.floor(leave1 / (3600 * 1000));
// //
let leave2 = leave1 % (3600 * 1000) // let leave2 = leave1 % (3600 * 1000); //
let minutes = Math.floor(leave2 / (60 * 1000)) let minutes = Math.floor(leave2 / (60 * 1000));
// //
let leave3 = leave2 % (60 * 1000) // let leave3 = leave2 % (60 * 1000); //
let seconds = Math.round(leave3 / 1000) let seconds = Math.round(leave3 / 1000);
if(days>0){ if (days > 0) {
if(days<10) days = "0"+days; if (days < 10) days = "0" + days;
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'; return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(hours>0){ if (hours > 0) {
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒'; return hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(minutes>0){ if (minutes > 0) {
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return minutes + '分钟' + seconds + '秒'; return minutes + "分钟" + seconds + "秒";
} }
if(seconds>0){ if (seconds > 0) {
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return seconds + '秒'; return seconds + "秒";
} }
}, },
handledownload(url){ handledownload(url) {
let fileType = url.split(".");
if (fileTypes.indexOf(fileType) > -1) {
window.open(process.env.VUE_APP_BASE_API + url);
} else {
this.$download.resource(url); this.$download.resource(url);
}
}, },
getDeleteReason(val){ getDeleteReason(val) {
val = val.replace("Change activity to ",""); val = val.replace("Change activity to ", "");
let flowRecordList = this.flowRecordList; let flowRecordList = this.flowRecordList;
for(let i=0;i<flowRecordList.length;i++){ for (let i = 0; i < flowRecordList.length; i++) {
if(flowRecordList[i].taskDefKey==val){ if (flowRecordList[i].taskDefKey == val) {
return "驳回至"+flowRecordList[i].taskName; return "驳回至" + flowRecordList[i].taskName;
}
} }
} }
}, },
},
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.app-detailDrawer{ .app-detailDrawer {
.drawer { .drawer {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -383,25 +459,24 @@ export default {
padding-right: 20px; padding-right: 20px;
.bjs-powered-by { .bjs-powered-by {
display: none !important; display: none !important;
}
} .maskLayer {
.maskLayer {
width: 100%; width: 100%;
height: 90px; height: 90px;
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
top: 77px; top: 77px;
} }
} }
.drawerRight { .drawerRight {
width: 40%; width: 40%;
min-width: 400px; min-width: 400px;
height: 100%; height: 100%;
float: left; float: left;
padding-left: 20px; padding-left: 20px;
} }
} }
.containers { .containers {
width: 100%; width: 100%;
height: 150px; height: 150px;
.canvas { .canvas {
@ -417,12 +492,12 @@ export default {
.load { .load {
margin-right: 10px; margin-right: 10px;
} }
.el-form-item__label{ .el-form-item__label {
font-size: 13px; font-size: 13px;
} }
.djs-palette{ .djs-palette {
left: 0px!important; left: 0px !important;
top: 0px; top: 0px;
border-top: none; border-top: none;
} }

View File

@ -8,7 +8,11 @@
size="80%" size="80%"
> >
<template slot="title"> <template slot="title">
<div>流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd"> - {{options.taskName}}</span></div> <div>
流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd">
- 当前节点{{ options.taskName }}</span
>
</div>
</template> </template>
<div class="drawer"> <div class="drawer">
<div class="drawerLeft"> <div class="drawerLeft">
@ -18,42 +22,73 @@
</div> </div>
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
v-for="(item,index ) in flowRecordList" v-for="(item, index) in flowRecordList"
:key="index" :key="index"
:icon="setIcon(item)" :icon="setIcon(item)"
:color="setColor(item)" :color="setColor(item)"
> >
<p style="font-weight: 700"> {{ getSort(index) }}{{item.taskName}}{{item.commentResult}}</p> <p style="font-weight: 700">
{{ getSort(index) }}{{ item.taskName }}{{ item.commentResult }}
</p>
<el-card :body-style="{ padding: '6px' }"> <el-card :body-style="{ padding: '6px' }">
<el-descriptions class="margin-top" :column="1" size="small" border> <el-descriptions class="margin-top" :column="1" size="small" border>
<el-descriptions-item v-if="item.assigneeName" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.assigneeName"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>办理人</template> <template slot="label"><i class="el-icon-user"></i>办理人</template>
{{item.assigneeName}} {{ item.assigneeName }}
<el-tag type="info" size="mini">{{item.deptName}}</el-tag> <el-tag type="info" size="mini">{{ item.deptName }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.candidate" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.candidate"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>候选办理</template> <template slot="label"><i class="el-icon-user"></i>候选办理</template>
{{item.candidate}} {{ item.candidate }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.deleteReason" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.deleteReason"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>驳回节点</template> <template slot="label"><i class="el-icon-user"></i>驳回节点</template>
{{getDeleteReason(item.deleteReason)}} {{ getDeleteReason(item.deleteReason) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>接收时间</template> <template slot="label"><i class="el-icon-date"></i>接收时间</template>
{{item.startTime}} {{ item.startTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.endTime" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.endTime"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>处理时间</template> <template slot="label"><i class="el-icon-date"></i>处理时间</template>
{{item.endTime}} {{ item.endTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.duration" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.duration"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-time"></i>处理耗时</template> <template slot="label"><i class="el-icon-time"></i>处理耗时</template>
{{getDurationDate(item.duration)}} {{ getDurationDate(item.duration) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.message" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
<template slot="label"><i class="el-icon-tickets"></i>处理意见</template> v-if="item.message"
{{item.message}} label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"
><i class="el-icon-tickets"></i>处理意见</template
>
{{ item.message }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
@ -62,7 +97,13 @@
</div> </div>
<div class="drawerRight"> <div class="drawerRight">
<el-card class="box-card"> <el-card class="box-card">
<el-descriptions class="margin-top" :title="title" :column="1" size="medium" border> <el-descriptions
class="margin-top"
:title="title"
:column="1"
size="medium"
border
>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle">
<template slot="label"> <template slot="label">
<i class="el-icon-map-location"></i> <i class="el-icon-map-location"></i>
@ -110,34 +151,36 @@
<i class="el-icon-tickets"></i> <i class="el-icon-tickets"></i>
请假时间 请假时间
</template> </template>
{{initData.day}} {{ initData.day }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle">
<template slot="label"> <template slot="label">
<i class="el-icon-chat-dot-square"></i> <i class="el-icon-chat-dot-square"></i>
请假事由 请假事由
</template> </template>
{{initData.remark}} {{ initData.remark }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<div style="text-align: center;margin-top: 30px;"> <div style="text-align: center; margin-top: 30px">
<el-button type="danger" @click="doCanel"> </el-button> <el-button type="danger" @click="doCanel"> </el-button>
</div> </div>
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
</div> </div>
</template> </template>
<script> <script>
import { flowXmlAndNode } from "@/api/flowable/definition"; import { flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn"; import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import {findCommentByProcInsId,findFormDatasByProcInsId} from "@/api/flowable/businessKey"; import {
export default { findCommentByProcInsId,
findFormDatasByProcInsId,
} from "@/api/flowable/businessKey";
export default {
components: {}, components: {},
props: { props: {},
},
data() { data() {
return { return {
// //
@ -146,7 +189,7 @@
loading: false, loading: false,
// //
title: "", title: "",
jdtitle:"", jdtitle: "",
// //
form: {}, form: {},
// //
@ -154,10 +197,10 @@
bpmnViewer: null, bpmnViewer: null,
options: {}, options: {},
flowRecordList: [], flowRecordList: [],
showjd:false, showjd: false,
//label //label
labelStyle: { width: "180px" }, labelStyle: { width: "180px" },
initData:{} initData: {},
}; };
}, },
computed: {}, computed: {},
@ -168,10 +211,9 @@
methods: { methods: {
setIcon(row) { setIcon(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "el-icon-close"; return "el-icon-close";
}else{ } else {
return "el-icon-check"; return "el-icon-check";
} }
} else { } else {
@ -180,10 +222,9 @@
}, },
setColor(row) { setColor(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "#f56c6c"; return "#f56c6c";
}else{ } else {
return "#2bc418"; return "#2bc418";
} }
} else { } else {
@ -208,19 +249,21 @@
this.onOpen = true; this.onOpen = true;
this.showjd = false; this.showjd = false;
if(options.finishTime==null){ if (options.finishTime == null) {
this.jdtitle="进行中"; this.jdtitle = "进行中";
this.showjd=true; this.showjd = true;
}else if(options.finishTime!=null && options.assigneeId==null){ } else if (options.finishTime != null && options.assigneeId == null) {
this.jdtitle="已终止"; this.jdtitle = "已终止";
}else{ } else {
this.jdtitle="已完成"; this.jdtitle = "已完成";
} }
this.getFlowRecordList(options.procInsId, options.deployId); this.getFlowRecordList(options.procInsId, options.deployId);
this.getFormDatasList(options.procInsId, options.deployId); this.getFormDatasList(options.procInsId, options.deployId);
flowXmlAndNode({ procInsId:options.procInsId, deployId: options.deployId }).then((res) => { flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
(res) => {
this.initFlowImage(res.data); this.initFlowImage(res.data);
}); }
);
}, },
async initFlowImage(data) { async initFlowImage(data) {
const self = this; const self = this;
@ -232,8 +275,8 @@
await self.bpmnViewer.importXML(data.xmlData); await self.bpmnViewer.importXML(data.xmlData);
// //
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto"); self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
if (data.nodeData !==undefined && data.nodeData.length > 0 ) { if (data.nodeData !== undefined && data.nodeData.length > 0) {
self.fillColor(data.nodeData) self.fillColor(data.nodeData);
} }
} catch (err) { } catch (err) {
console.error(err.message, err.warnings); console.error(err.message, err.warnings);
@ -248,13 +291,15 @@
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findCommentByProcInsId(params).then(res => { findCommentByProcInsId(params)
.then((res) => {
that.flowRecordList = res.data; that.flowRecordList = res.data;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
/** 流程表单数据 */ /** 流程表单数据 */
getFormDatasList(procInsId, deployId) { getFormDatasList(procInsId, deployId) {
@ -265,137 +310,171 @@
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findFormDatasByProcInsId(params).then(res => { findFormDatasByProcInsId(params)
.then((res) => {
this.initData = res.data; this.initData = res.data;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
// //
fillColor(nodeData) { fillColor(nodeData) {
const canvas = this.bpmnViewer.get('canvas') const canvas = this.bpmnViewer.get("canvas");
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach(n => { this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
const completeTask = nodeData.find(m => m.key === n.id) const completeTask = nodeData.find((m) => m.key === n.id);
const todoTask = nodeData.find(m => !m.completed) const todoTask = nodeData.find((m) => !m.completed);
const endTask = nodeData[nodeData.length - 1] const endTask = nodeData[nodeData.length - 1];
if (n.$type === 'bpmn:UserTask') { if (n.$type === "bpmn:UserTask") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){ if (
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') todoTask &&
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') completeTask.key === todoTask.key &&
}else { !todoTask.completed
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') ) {
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
nn.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
} else {
canvas.addMarker(
nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
} }
}) });
} }
} }
// //
else if (n.$type === 'bpmn:ExclusiveGateway') { else if (n.$type === "bpmn:ExclusiveGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
});
})
} }
} }
// //
else if (n.$type === 'bpmn:ParallelGateway') { else if (n.$type === "bpmn:ParallelGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
}) });
} }
} } else if (n.$type === "bpmn:StartEvent") {
else if (n.$type === 'bpmn:StartEvent') { n.outgoing.forEach((nn) => {
n.outgoing.forEach(nn => { const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
const completeTask = nodeData.find(m => m.key === nn.targetRef.id)
if (completeTask) { if (completeTask) {
canvas.addMarker(nn.id, 'highlight') canvas.addMarker(nn.id, "highlight");
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
}) });
} } else if (n.$type === "bpmn:EndEvent") {
else if (n.$type === 'bpmn:EndEvent') {
if (endTask.key === n.id && endTask.completed) { if (endTask.key === n.id && endTask.completed) {
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
} }
}) });
}, },
getDurationDate(val){ getDurationDate(val) {
// //
let days = Math.floor(val / (24 * 3600 * 1000)) let days = Math.floor(val / (24 * 3600 * 1000));
// //
let leave1 = val % (24 * 3600 * 1000) // let leave1 = val % (24 * 3600 * 1000); //
let hours = Math.floor(leave1 / (3600 * 1000)) let hours = Math.floor(leave1 / (3600 * 1000));
// //
let leave2 = leave1 % (3600 * 1000) // let leave2 = leave1 % (3600 * 1000); //
let minutes = Math.floor(leave2 / (60 * 1000)) let minutes = Math.floor(leave2 / (60 * 1000));
// //
let leave3 = leave2 % (60 * 1000) // let leave3 = leave2 % (60 * 1000); //
let seconds = Math.round(leave3 / 1000) let seconds = Math.round(leave3 / 1000);
if(days>0){ if (days > 0) {
if(days<10) days = "0"+days; if (days < 10) days = "0" + days;
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'; return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(hours>0){ if (hours > 0) {
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒'; return hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(minutes>0){ if (minutes > 0) {
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return minutes + '分钟' + seconds + '秒'; return minutes + "分钟" + seconds + "秒";
} }
if(seconds>0){ if (seconds > 0) {
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return seconds + '秒'; return seconds + "秒";
} }
}, },
handledownload(url){ handledownload(url) {
this.$download.resource(url); this.$download.resource(url);
}, },
getDeleteReason(val){ getDeleteReason(val) {
val = val.replace("Change activity to ",""); val = val.replace("Change activity to ", "");
let flowRecordList = this.flowRecordList; let flowRecordList = this.flowRecordList;
for(let i=0;i<flowRecordList.length;i++){ for (let i = 0; i < flowRecordList.length; i++) {
if(flowRecordList[i].taskDefKey==val){ if (flowRecordList[i].taskDefKey == val) {
return "驳回至"+flowRecordList[i].taskName; return "驳回至" + flowRecordList[i].taskName;
}
} }
} }
}, },
}; },
</script> };
<style lang="scss"> </script>
.app-detailDrawer{ <style lang="scss">
.app-detailDrawer {
.drawer { .drawer {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -412,7 +491,6 @@
padding-right: 20px; padding-right: 20px;
.bjs-powered-by { .bjs-powered-by {
display: none !important; display: none !important;
} }
.maskLayer { .maskLayer {
width: 100%; width: 100%;
@ -446,12 +524,12 @@
.load { .load {
margin-right: 10px; margin-right: 10px;
} }
.el-form-item__label{ .el-form-item__label {
font-size: 13px; font-size: 13px;
} }
.djs-palette{ .djs-palette {
left: 0px!important; left: 0px !important;
top: 0px; top: 0px;
border-top: none; border-top: none;
} }
@ -494,6 +572,5 @@
top: -20px !important; top: -20px !important;
} }
} }
} }
</style> </style>

View File

@ -33,7 +33,7 @@
@change="projectChage" @change="projectChage"
> >
<el-option <el-option
v-for="(item,index) in projectOptions" v-for="(item, index) in projectOptions"
:key="index" :key="index"
:label="item.projectName" :label="item.projectName"
:value="item.id" :value="item.id"
@ -55,7 +55,7 @@
@input="fileInput" @input="fileInput"
:limit="9" :limit="9"
v-model="form.files" v-model="form.files"
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']" :fileType="['pdf', 'png', 'jpg', 'jpeg']"
/> />
</el-form-item> </el-form-item>
<el-form-item label="申请说明" prop="remark"> <el-form-item label="申请说明" prop="remark">
@ -73,16 +73,16 @@
</el-form> </el-form>
</el-drawer> </el-drawer>
</div> </div>
</template> </template>
<script> <script>
import store from "@/store"; import store from "@/store";
import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition"; import { definitionStart, flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn"; import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import { findFormDatasByProcInsId } from "@/api/flowable/businessKey"; import { findFormDatasByProcInsId } from "@/api/flowable/businessKey";
import { complete, getNextFlowNodeByStart } from "@/api/flowable/todo"; import { complete, getNextFlowNodeByStart } from "@/api/flowable/todo";
export default { export default {
components: {}, components: {},
props: { props: {
closeCallBack: { closeCallBack: {
@ -153,9 +153,11 @@
this.onOpen = true; this.onOpen = true;
this.title = options.procDefName; this.title = options.procDefName;
this.initFormDate(options.procInsId); this.initFormDate(options.procInsId);
flowXmlAndNode({ procInsId:options.procInsId, deployId: options.deployId }).then((res) => { flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
(res) => {
this.initFlowImage(res.data); this.initFlowImage(res.data);
}); }
);
}, },
async initFlowImage(data) { async initFlowImage(data) {
const self = this; const self = this;
@ -167,8 +169,8 @@
await self.bpmnViewer.importXML(data.xmlData); await self.bpmnViewer.importXML(data.xmlData);
// //
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto"); self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
if (data.nodeData !==undefined && data.nodeData.length > 0 ) { if (data.nodeData !== undefined && data.nodeData.length > 0) {
self.fillColor(data.nodeData) self.fillColor(data.nodeData);
} }
} catch (err) { } catch (err) {
console.error(err.message, err.warnings); console.error(err.message, err.warnings);
@ -176,9 +178,12 @@
}, },
/** 流程表单数据 */ /** 流程表单数据 */
initFormDate(procInsId, deployId) { initFormDate(procInsId, deployId) {
this.projectOptions=[{id:this.options.businessKey,projectName:this.options.businessKeyName}]; this.projectOptions = [
const params = {procInsId: procInsId} { id: this.options.businessKey, projectName: this.options.businessKeyName },
findFormDatasByProcInsId(params).then(res => { ];
const params = { procInsId: procInsId };
findFormDatasByProcInsId(params)
.then((res) => {
this.form = res.data; this.form = res.data;
this.deptName = this.options.startDeptName; this.deptName = this.options.startDeptName;
this.nickName = this.options.startUserName; this.nickName = this.options.startUserName;
@ -188,9 +193,10 @@
this.form.assignee = store.getters.name; this.form.assignee = store.getters.name;
this.form.procInsId = this.options.procInsId; this.form.procInsId = this.options.procInsId;
this.form.instanceId = this.options.procInsId; this.form.instanceId = this.options.procInsId;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
fileInput(files) { fileInput(files) {
let fileUrls = ""; let fileUrls = "";
@ -207,15 +213,15 @@
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.loading = true; this.loading = true;
this.form.variables={ this.form.variables = {
businessKey:this.form.businessKey, businessKey: this.form.businessKey,
projectName:this.form.projectName, projectName: this.form.projectName,
files:this.form.files, files: this.form.files,
remark:this.form.remark, remark: this.form.remark,
INITIATOR:this.form.INITIATOR INITIATOR: this.form.INITIATOR,
} };
complete(this.form).then(res => { complete(this.form).then((res) => {
this.$store.dispatch('settingAwaitNum'); this.$store.dispatch("settingAwaitNum");
this.$modal.msgSuccess("任务提交成功"); this.$modal.msgSuccess("任务提交成功");
this.loading = false; this.loading = false;
// //
@ -226,90 +232,122 @@
}, },
// //
fillColor(nodeData) { fillColor(nodeData) {
const canvas = this.bpmnViewer.get('canvas') const canvas = this.bpmnViewer.get("canvas");
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach(n => { this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
const completeTask = nodeData.find(m => m.key === n.id) const completeTask = nodeData.find((m) => m.key === n.id);
const todoTask = nodeData.find(m => !m.completed) const todoTask = nodeData.find((m) => !m.completed);
const endTask = nodeData[nodeData.length - 1] const endTask = nodeData[nodeData.length - 1];
if (n.$type === 'bpmn:UserTask') { if (n.$type === "bpmn:UserTask") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){ if (
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') todoTask &&
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') completeTask.key === todoTask.key &&
}else { !todoTask.completed
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') ) {
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
nn.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
} else {
canvas.addMarker(
nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
} }
}) });
} }
} }
// //
else if (n.$type === 'bpmn:ExclusiveGateway') { else if (n.$type === "bpmn:ExclusiveGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
});
})
} }
} }
// //
else if (n.$type === 'bpmn:ParallelGateway') { else if (n.$type === "bpmn:ParallelGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
}) });
} }
} } else if (n.$type === "bpmn:StartEvent") {
else if (n.$type === 'bpmn:StartEvent') { n.outgoing.forEach((nn) => {
n.outgoing.forEach(nn => { const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
const completeTask = nodeData.find(m => m.key === nn.targetRef.id)
if (completeTask) { if (completeTask) {
canvas.addMarker(nn.id, 'highlight') canvas.addMarker(nn.id, "highlight");
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
}) });
} } else if (n.$type === "bpmn:EndEvent") {
else if (n.$type === 'bpmn:EndEvent') {
if (endTask.key === n.id && endTask.completed) { if (endTask.key === n.id && endTask.completed) {
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
} }
}) });
}, },
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.bjs-powered-by { .bjs-powered-by {
display: none !important; display: none !important;
} }
.maskLayer { .maskLayer {
width: 100%; width: 100%;
height: 150px; height: 150px;
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
top: 66px; top: 66px;
} }
.app-container{ .app-container {
.containers { .containers {
width: 100%; width: 100%;
height: 150px; height: 150px;
@ -326,12 +364,12 @@
.load { .load {
margin-right: 10px; margin-right: 10px;
} }
.el-form-item__label{ .el-form-item__label {
font-size: 13px; font-size: 13px;
} }
.djs-palette{ .djs-palette {
left: 0px!important; left: 0px !important;
top: 0px; top: 0px;
border-top: none; border-top: none;
} }
@ -374,6 +412,5 @@
top: -20px !important; top: -20px !important;
} }
} }
} }
</style> </style>

View File

@ -49,14 +49,26 @@
<el-form-item label="审批事项"> <el-form-item label="审批事项">
{{ title }} {{ title }}
</el-form-item> </el-form-item>
<el-form-item label="审批内容" prop="files" v-if="options.flowKey!='flow_xmglzdl_qjsp' && options.flowKey!='flow_aql_sxkj'"> <el-form-item
label="审批内容"
prop="files"
v-if="
options.flowKey != 'flow_xmglzdl_qjsp' && options.flowKey != 'flow_aql_sxkj'
"
>
<FileUpload <FileUpload
@input="fileInput" @input="fileInput"
:limit="9" :limit="9"
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']" :fileType="['pdf', 'png', 'jpg', 'jpeg']"
/> />
</el-form-item> </el-form-item>
<el-form-item label="申请说明" prop="remark" v-if="options.flowKey!='flow_xmglzdl_qjsp' && options.flowKey!='flow_aql_sxkj'"> <el-form-item
label="申请说明"
prop="remark"
v-if="
options.flowKey != 'flow_xmglzdl_qjsp' && options.flowKey != 'flow_aql_sxkj'
"
>
<el-input <el-input
type="textarea" type="textarea"
v-model="form.remark" v-model="form.remark"

View File

@ -33,7 +33,7 @@
@change="projectChage" @change="projectChage"
> >
<el-option <el-option
v-for="(item,index) in projectOptions" v-for="(item, index) in projectOptions"
:key="index" :key="index"
:label="item.projectName" :label="item.projectName"
:value="item.id" :value="item.id"
@ -54,7 +54,7 @@
<FileUpload <FileUpload
@input="fileInput" @input="fileInput"
:limit="9" :limit="9"
:fileType="['pdf', 'png', 'jpg', 'jpeg', 'doc', 'docx', 'xls', 'xlsx']" :fileType="['pdf', 'png', 'jpg', 'jpeg']"
/> />
</el-form-item> </el-form-item>
<el-form-item label="申请说明" prop="remark"> <el-form-item label="申请说明" prop="remark">

View File

@ -9,7 +9,11 @@
size="80%" size="80%"
> >
<template slot="title"> <template slot="title">
<div>流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd"> - {{options.taskName}}</span></div> <div>
流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd">
- 当前节点{{ options.taskName }}</span
>
</div>
</template> </template>
<div class="drawer"> <div class="drawer">
<div class="drawerLeft block containers"> <div class="drawerLeft block containers">
@ -17,42 +21,73 @@
<div class="maskLayer" /> <div class="maskLayer" />
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
v-for="(item,index ) in flowRecordList" v-for="(item, index) in flowRecordList"
:key="index" :key="index"
:icon="setIcon(item)" :icon="setIcon(item)"
:color="setColor(item)" :color="setColor(item)"
> >
<p style="font-weight: 700"> {{ getSort(index) }}{{item.taskName}}{{item.commentResult}}</p> <p style="font-weight: 700">
{{ getSort(index) }}{{ item.taskName }}{{ item.commentResult }}
</p>
<el-card :body-style="{ padding: '6px' }"> <el-card :body-style="{ padding: '6px' }">
<el-descriptions class="margin-top" :column="1" size="small" border> <el-descriptions class="margin-top" :column="1" size="small" border>
<el-descriptions-item v-if="item.assigneeName" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.assigneeName"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>办理人</template> <template slot="label"><i class="el-icon-user"></i>办理人</template>
{{item.assigneeName}} {{ item.assigneeName }}
<el-tag type="info" size="mini">{{item.deptName}}</el-tag> <el-tag type="info" size="mini">{{ item.deptName }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.candidate" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.candidate"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>候选办理</template> <template slot="label"><i class="el-icon-user"></i>候选办理</template>
{{item.candidate}} {{ item.candidate }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.deleteReason" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.deleteReason"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>驳回节点</template> <template slot="label"><i class="el-icon-user"></i>驳回节点</template>
{{getDeleteReason(item.deleteReason)}} {{ getDeleteReason(item.deleteReason) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>接收时间</template> <template slot="label"><i class="el-icon-date"></i>接收时间</template>
{{item.startTime}} {{ item.startTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.endTime" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.endTime"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>处理时间</template> <template slot="label"><i class="el-icon-date"></i>处理时间</template>
{{item.endTime}} {{ item.endTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.duration" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.duration"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-time"></i>处理耗时</template> <template slot="label"><i class="el-icon-time"></i>处理耗时</template>
{{getDurationDate(item.duration)}} {{ getDurationDate(item.duration) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.message" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
<template slot="label"><i class="el-icon-tickets"></i>处理意见</template> v-if="item.message"
{{item.message}} label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"
><i class="el-icon-tickets"></i>处理意见</template
>
{{ item.message }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
@ -61,7 +96,12 @@
</div> </div>
<div class="drawerRight"> <div class="drawerRight">
<el-form <el-form
ref="form" :model="form" :rules="rules" label-width="100px" v-loading="loading"> ref="form"
:model="form"
:rules="rules"
label-width="100px"
v-loading="loading"
>
<el-form-item label="所属项目"> <el-form-item label="所属项目">
{{ initData.projectName }} {{ initData.projectName }}
</el-form-item> </el-form-item>
@ -75,18 +115,18 @@
{{ title }} {{ title }}
</el-form-item> </el-form-item>
<el-form-item label="审批内容"> <el-form-item label="审批内容">
<div v-for="(file,index ) in initData.files" :key="index"> <div v-for="(file, index) in initData.files" :key="index">
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-paperclip" icon="el-icon-paperclip"
@click="handledownload(file)" @click="handledownload(file)"
>{{file.substring(file.lastIndexOf('/')+1)}}</el-button >{{ file.substring(file.lastIndexOf("/") + 1) }}</el-button
> >
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="申请说明"> <el-form-item label="申请说明">
{{initData.remark}} {{ initData.remark }}
</el-form-item> </el-form-item>
<el-form-item label="审批意见" prop="comment"> <el-form-item label="审批意见" prop="comment">
<el-input <el-input
@ -112,16 +152,50 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<div style="text-align: center"> <div style="text-align: center">
<el-button icon="el-icon-s-custom" v-if="false" type="primary" plain size="mini"></el-button> <el-button
<el-button icon="el-icon-check" type="success" size="mini" @click="handlePass"></el-button> icon="el-icon-s-custom"
<el-button icon="el-icon-back" type="warning" size="mini" @click="handleBack">退</el-button> v-if="false"
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject"></el-button> type="primary"
plain
size="mini"
>任务转办</el-button
>
<el-button
icon="el-icon-check"
type="success"
size="mini"
@click="handlePass"
>审批通过</el-button
>
<el-button
icon="el-icon-back"
type="warning"
size="mini"
@click="handleBack"
>退回任务</el-button
>
<el-button
icon="el-icon-circle-close"
type="danger"
size="mini"
@click="handleReject"
>驳回上级</el-button
>
</div> </div>
</el-form> </el-form>
<div class="page-warning"> <div class="page-warning">
<p><strong style="color: #67C23A;">审批通过</strong> 操作后代表您对当前任务满意任务进入下一阶段</p> <p>
<p><strong style="color: #E6A23C;">退回任务</strong> 操作后代表您对当前任务不满意任务进入您选择的阶段或者直接退回给申请人重新申请</p> <strong style="color: #67c23a">审批通过</strong>
<p><strong style="color: #F56C6C;">驳回上级</strong> 操作后代表您对当前任务不满意任务退回到上一阶段继续处理</p> 操作后代表您对当前任务满意任务进入下一阶段
</p>
<p>
<strong style="color: #e6a23c">退回任务</strong>
操作后代表您对当前任务不满意任务进入您选择的阶段或者直接退回给申请人重新申请
</p>
<p>
<strong style="color: #f56c6c">驳回上级</strong>
操作后代表您对当前任务不满意任务退回到上一阶段继续处理
</p>
</div> </div>
</div> </div>
</div> </div>
@ -134,7 +208,10 @@ import store from "@/store";
import { flowXmlAndNode } from "@/api/flowable/definition"; import { flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn"; import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import { complete, rejectTask, returnTask, returnList } from "@/api/flowable/todo"; import { complete, rejectTask, returnTask, returnList } from "@/api/flowable/todo";
import {findCommentByProcInsId,findFormDatasByProcInsId} from "@/api/flowable/businessKey"; import {
findCommentByProcInsId,
findFormDatasByProcInsId,
} from "@/api/flowable/businessKey";
export default { export default {
components: {}, components: {},
props: { props: {
@ -150,7 +227,7 @@ export default {
loading: false, loading: false,
// //
title: "", title: "",
jdtitle:"", jdtitle: "",
// //
form: {}, form: {},
// //
@ -164,20 +241,21 @@ export default {
}, },
], ],
}, },
queryParams:{ queryParams: {
nickName:null, nickName: null,
phonenumber:null, phonenumber: null,
}, },
bpmnViewer: null, bpmnViewer: null,
options: {}, options: {},
flowRecordList: [], flowRecordList: [],
showjd:false, showjd: false,
//label //label
labelStyle: { width: "180px" }, labelStyle: { width: "180px" },
initData:{}, initData: {},
returnTaskList: [], // 退 returnTaskList: [], // 退
returnTask:false, returnTask: false,
returnTaskBtn:false returnTaskBtn: false,
fileTypes:['pdf','png','jpg','jpeg'],
}; };
}, },
computed: {}, computed: {},
@ -190,19 +268,21 @@ export default {
handlePass() { handlePass() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.$confirm('是否确认审批通过当前流程申请?', '提示', { this.$confirm("是否确认审批通过当前流程申请?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.loading=true; .then(() => {
complete(this.form).then(res => { this.loading = true;
complete(this.form).then((res) => {
this.$modal.msgSuccess("任务审批成功"); this.$modal.msgSuccess("任务审批成功");
this.loading = false; this.loading = false;
// //
this.$refs.drawer.closeDrawer(); this.$refs.drawer.closeDrawer();
}); });
}).catch(() => { })
.catch(() => {
console.log("取消操作"); console.log("取消操作");
}); });
} }
@ -212,65 +292,69 @@ export default {
handleReject() { handleReject() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.$confirm('是否确认审批驳回当前流程申请?', '提示', { this.$confirm("是否确认审批驳回当前流程申请?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.loading=true; .then(() => {
rejectTask(this.form).then(res => { this.loading = true;
rejectTask(this.form).then((res) => {
this.$modal.msgSuccess("任务驳回成功"); this.$modal.msgSuccess("任务驳回成功");
this.loading = false; this.loading = false;
// //
this.$refs.drawer.closeDrawer(); this.$refs.drawer.closeDrawer();
}); });
}).catch(() => { })
.catch(() => {
console.log("取消操作"); console.log("取消操作");
}); });
} }
}); });
}, },
/** 退回任务 */ /** 退回任务 */
handleBack(){ handleBack() {
if(!this.returnTask){ if (!this.returnTask) {
this.returnTask=true; this.returnTask = true;
this.$modal.msgWarning("请选择退回节点"); this.$modal.msgWarning("请选择退回节点");
return; return;
} }
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if(!this.form.targetKey){ if (!this.form.targetKey) {
this.$modal.msgWarning("请选择退回节点"); this.$modal.msgWarning("请选择退回节点");
return; return;
} }
this.$confirm('是否确认退回当前流程申请?', '提示', { this.$confirm("是否确认退回当前流程申请?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.loading=true; .then(() => {
returnTask(this.form).then(res => { this.loading = true;
returnTask(this.form).then((res) => {
this.$modal.msgSuccess("任务退回成功"); this.$modal.msgSuccess("任务退回成功");
this.loading = false; this.loading = false;
// //
this.$refs.drawer.closeDrawer(); this.$refs.drawer.closeDrawer();
}); });
}).catch(() => { })
.catch(() => {
console.log("取消操作"); console.log("取消操作");
}); });
} }
}); });
}, },
initReturnList(){ initReturnList() {
returnList(this.form).then(res => { returnList(this.form).then((res) => {
this.returnTaskList = res.data; this.returnTaskList = res.data;
//退>1退 //退>1退
if(res.data.length>1){ if (res.data.length > 1) {
this.returnTaskBtn=true; this.returnTaskBtn = true;
} }
}) });
}, },
initFormDate(){ initFormDate() {
this.form.taskId = this.options.taskId; this.form.taskId = this.options.taskId;
this.form.taskName = this.options.taskName; this.form.taskName = this.options.taskName;
this.form.userId = store.getters.userId; this.form.userId = store.getters.userId;
@ -278,16 +362,15 @@ export default {
this.form.procInsId = this.options.procInsId; this.form.procInsId = this.options.procInsId;
this.form.instanceId = this.options.procInsId; this.form.instanceId = this.options.procInsId;
this.form.executionId = this.options.procInsId; this.form.executionId = this.options.procInsId;
this.returnTask=false; this.returnTask = false;
this.returnTaskBtn=false; this.returnTaskBtn = false;
this.initReturnList(); this.initReturnList();
}, },
setIcon(row) { setIcon(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "el-icon-close"; return "el-icon-close";
}else{ } else {
return "el-icon-check"; return "el-icon-check";
} }
} else { } else {
@ -296,10 +379,9 @@ export default {
}, },
setColor(row) { setColor(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "#f56c6c"; return "#f56c6c";
}else{ } else {
return "#2bc418"; return "#2bc418";
} }
} else { } else {
@ -325,19 +407,21 @@ export default {
this.showjd = false; this.showjd = false;
this.form = {}; this.form = {};
this.initFormDate(); this.initFormDate();
if(options.finishTime==null){ if (options.finishTime == null) {
this.jdtitle="进行中"; this.jdtitle = "进行中";
this.showjd=true; this.showjd = true;
}else if(options.finishTime!=null && options.assigneeId==null){ } else if (options.finishTime != null && options.assigneeId == null) {
this.jdtitle="已撤销"; this.jdtitle = "已撤销";
}else{ } else {
this.jdtitle="已完成"; this.jdtitle = "已完成";
} }
this.getFlowRecordList(options.procInsId, options.deployId); this.getFlowRecordList(options.procInsId, options.deployId);
this.getFormDatasList(options.procInsId, options.deployId); this.getFormDatasList(options.procInsId, options.deployId);
flowXmlAndNode({ procInsId:options.procInsId, deployId: options.deployId }).then((res) => { flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
(res) => {
this.initFlowImage(res.data); this.initFlowImage(res.data);
}); }
);
}, },
async initFlowImage(data) { async initFlowImage(data) {
const self = this; const self = this;
@ -349,8 +433,8 @@ export default {
await self.bpmnViewer.importXML(data.xmlData); await self.bpmnViewer.importXML(data.xmlData);
// //
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto"); self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
if (data.nodeData !==undefined && data.nodeData.length > 0 ) { if (data.nodeData !== undefined && data.nodeData.length > 0) {
self.fillColor(data.nodeData) self.fillColor(data.nodeData);
} }
} catch (err) { } catch (err) {
console.error(err.message, err.warnings); console.error(err.message, err.warnings);
@ -365,13 +449,15 @@ export default {
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findCommentByProcInsId(params).then(res => { findCommentByProcInsId(params)
.then((res) => {
that.flowRecordList = res.data; that.flowRecordList = res.data;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
/** 流程表单数据 */ /** 流程表单数据 */
getFormDatasList(procInsId, deployId) { getFormDatasList(procInsId, deployId) {
@ -382,131 +468,170 @@ export default {
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findFormDatasByProcInsId(params).then(res => { findFormDatasByProcInsId(params)
.then((res) => {
this.initData = res.data; this.initData = res.data;
this.initData.files = res.data.files.split(','); this.initData.files = res.data.files.split(",");
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
// //
fillColor(nodeData) { fillColor(nodeData) {
const canvas = this.bpmnViewer.get('canvas') const canvas = this.bpmnViewer.get("canvas");
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach(n => { this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
const completeTask = nodeData.find(m => m.key === n.id) const completeTask = nodeData.find((m) => m.key === n.id);
const todoTask = nodeData.find(m => !m.completed) const todoTask = nodeData.find((m) => !m.completed);
const endTask = nodeData[nodeData.length - 1] const endTask = nodeData[nodeData.length - 1];
if (n.$type === 'bpmn:UserTask') { if (n.$type === "bpmn:UserTask") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){ if (
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') todoTask &&
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') completeTask.key === todoTask.key &&
}else { !todoTask.completed
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') ) {
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
nn.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
} else {
canvas.addMarker(
nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
} }
}) });
} }
} }
// //
else if (n.$type === 'bpmn:ExclusiveGateway') { else if (n.$type === "bpmn:ExclusiveGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
});
})
} }
} }
// //
else if (n.$type === 'bpmn:ParallelGateway') { else if (n.$type === "bpmn:ParallelGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
}) });
} }
} } else if (n.$type === "bpmn:StartEvent") {
else if (n.$type === 'bpmn:StartEvent') { n.outgoing.forEach((nn) => {
n.outgoing.forEach(nn => { const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
const completeTask = nodeData.find(m => m.key === nn.targetRef.id)
if (completeTask) { if (completeTask) {
canvas.addMarker(nn.id, 'highlight') canvas.addMarker(nn.id, "highlight");
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
}) });
} } else if (n.$type === "bpmn:EndEvent") {
else if (n.$type === 'bpmn:EndEvent') {
if (endTask.key === n.id && endTask.completed) { if (endTask.key === n.id && endTask.completed) {
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
} }
}) });
}, },
getDurationDate(val){ getDurationDate(val) {
// //
let days = Math.floor(val / (24 * 3600 * 1000)) let days = Math.floor(val / (24 * 3600 * 1000));
// //
let leave1 = val % (24 * 3600 * 1000) // let leave1 = val % (24 * 3600 * 1000); //
let hours = Math.floor(leave1 / (3600 * 1000)) let hours = Math.floor(leave1 / (3600 * 1000));
// //
let leave2 = leave1 % (3600 * 1000) // let leave2 = leave1 % (3600 * 1000); //
let minutes = Math.floor(leave2 / (60 * 1000)) let minutes = Math.floor(leave2 / (60 * 1000));
// //
let leave3 = leave2 % (60 * 1000) // let leave3 = leave2 % (60 * 1000); //
let seconds = Math.round(leave3 / 1000) let seconds = Math.round(leave3 / 1000);
if(days>0){ if (days > 0) {
if(days<10) days = "0"+days; if (days < 10) days = "0" + days;
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'; return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(hours>0){ if (hours > 0) {
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒'; return hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(minutes>0){ if (minutes > 0) {
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return minutes + '分钟' + seconds + '秒'; return minutes + "分钟" + seconds + "秒";
} }
if(seconds>0){ if (seconds > 0) {
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return seconds + '秒'; return seconds + "秒";
} }
}, },
handledownload(url){ handledownload(url) {
let fileType = url.split(".");
if(fileTypes.indexOf(fileType)>-1){
window.open(process.env.VUE_APP_BASE_API+url);
}else{
this.$download.resource(url); this.$download.resource(url);
}
}, },
getDeleteReason(val){ getDeleteReason(val) {
val = val.replace("Change activity to ",""); val = val.replace("Change activity to ", "");
let flowRecordList = this.flowRecordList; let flowRecordList = this.flowRecordList;
for(let i=0;i<flowRecordList.length;i++){ for (let i = 0; i < flowRecordList.length; i++) {
if(flowRecordList[i].taskDefKey==val){ if (flowRecordList[i].taskDefKey == val) {
console.log(i); console.log(i);
return "驳回至"+flowRecordList[i].taskName; return "驳回至" + flowRecordList[i].taskName;
} }
} }
}, },
@ -514,7 +639,7 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.app-approveDrawer{ .app-approveDrawer {
.drawer { .drawer {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -531,25 +656,24 @@ export default {
padding-right: 20px; padding-right: 20px;
.bjs-powered-by { .bjs-powered-by {
display: none !important; display: none !important;
}
} .maskLayer {
.maskLayer {
width: 100%; width: 100%;
height: 90px; height: 90px;
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
top: 77px; top: 77px;
} }
} }
.drawerRight { .drawerRight {
width: 40%; width: 40%;
min-width: 400px; min-width: 400px;
height: 100%; height: 100%;
float: left; float: left;
padding-left: 20px; padding-left: 20px;
} }
} }
.containers { .containers {
width: 100%; width: 100%;
height: 150px; height: 150px;
.canvas { .canvas {
@ -565,12 +689,12 @@ export default {
.load { .load {
margin-right: 10px; margin-right: 10px;
} }
.el-form-item__label{ .el-form-item__label {
font-size: 13px; font-size: 13px;
} }
.djs-palette{ .djs-palette {
left: 0px!important; left: 0px !important;
top: 0px; top: 0px;
border-top: none; border-top: none;
} }
@ -618,7 +742,7 @@ export default {
padding: 8px 16px; padding: 8px 16px;
background-color: #f0f9eb; background-color: #f0f9eb;
border-radius: 4px; border-radius: 4px;
border-left: 5px solid #67C23A; border-left: 5px solid #67c23a;
margin: 20px 0; margin: 20px 0;
font-size: 13px; font-size: 13px;
margin-top: 30px; margin-top: 30px;

View File

@ -9,7 +9,11 @@
size="80%" size="80%"
> >
<template slot="title"> <template slot="title">
<div>流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd"> - {{options.taskName}}</span></div> <div>
流程详情 {{ title }} - 当前进度{{ jdtitle }}<span v-if="showjd">
- 当前节点{{ options.taskName }}</span
>
</div>
</template> </template>
<div class="drawer"> <div class="drawer">
<div class="drawerLeft block containers"> <div class="drawerLeft block containers">
@ -17,42 +21,73 @@
<div class="maskLayer" /> <div class="maskLayer" />
<el-timeline> <el-timeline>
<el-timeline-item <el-timeline-item
v-for="(item,index ) in flowRecordList" v-for="(item, index) in flowRecordList"
:key="index" :key="index"
:icon="setIcon(item)" :icon="setIcon(item)"
:color="setColor(item)" :color="setColor(item)"
> >
<p style="font-weight: 700"> {{ getSort(index) }}{{item.taskName}}{{item.commentResult}}</p> <p style="font-weight: 700">
{{ getSort(index) }}{{ item.taskName }}{{ item.commentResult }}
</p>
<el-card :body-style="{ padding: '6px' }"> <el-card :body-style="{ padding: '6px' }">
<el-descriptions class="margin-top" :column="1" size="small" border> <el-descriptions class="margin-top" :column="1" size="small" border>
<el-descriptions-item v-if="item.assigneeName" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.assigneeName"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>办理人</template> <template slot="label"><i class="el-icon-user"></i>办理人</template>
{{item.assigneeName}} {{ item.assigneeName }}
<el-tag type="info" size="mini">{{item.deptName}}</el-tag> <el-tag type="info" size="mini">{{ item.deptName }}</el-tag>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.candidate" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.candidate"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>候选办理</template> <template slot="label"><i class="el-icon-user"></i>候选办理</template>
{{item.candidate}} {{ item.candidate }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.deleteReason" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.deleteReason"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-user"></i>驳回节点</template> <template slot="label"><i class="el-icon-user"></i>驳回节点</template>
{{getDeleteReason(item.deleteReason)}} {{ getDeleteReason(item.deleteReason) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>接收时间</template> <template slot="label"><i class="el-icon-date"></i>接收时间</template>
{{item.startTime}} {{ item.startTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.endTime" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.endTime"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-date"></i>处理时间</template> <template slot="label"><i class="el-icon-date"></i>处理时间</template>
{{item.endTime}} {{ item.endTime }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.duration" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
v-if="item.duration"
label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"><i class="el-icon-time"></i>处理耗时</template> <template slot="label"><i class="el-icon-time"></i>处理耗时</template>
{{getDurationDate(item.duration)}} {{ getDurationDate(item.duration) }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item v-if="item.message" label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item
<template slot="label"><i class="el-icon-tickets"></i>处理意见</template> v-if="item.message"
{{item.message}} label-class-name="my-label"
:labelStyle="labelStyle"
>
<template slot="label"
><i class="el-icon-tickets"></i>处理意见</template
>
{{ item.message }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
@ -61,7 +96,13 @@
</div> </div>
<div class="drawerRight"> <div class="drawerRight">
<el-card class="box-card"> <el-card class="box-card">
<el-descriptions class="margin-top" :title="title" :column="1" size="medium" border> <el-descriptions
class="margin-top"
:title="title"
:column="1"
size="medium"
border
>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle">
<template slot="label"> <template slot="label">
<i class="el-icon-map-location"></i> <i class="el-icon-map-location"></i>
@ -109,18 +150,25 @@
<i class="el-icon-tickets"></i> <i class="el-icon-tickets"></i>
请假时间 请假时间
</template> </template>
{{initData.day}} {{ initData.day }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle"> <el-descriptions-item label-class-name="my-label" :labelStyle="labelStyle">
<template slot="label"> <template slot="label">
<i class="el-icon-chat-dot-square"></i> <i class="el-icon-chat-dot-square"></i>
请假事由 请假事由
</template> </template>
{{initData.remark}} {{ initData.remark }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-card> </el-card>
<el-form ref="form" :model="form" :rules="rules" label-width="100px" v-loading="loading" style="margin-top: 30px;"> <el-form
ref="form"
:model="form"
:rules="rules"
label-width="100px"
v-loading="loading"
style="margin-top: 30px"
>
<el-form-item label="审批意见" prop="comment"> <el-form-item label="审批意见" prop="comment">
<el-input <el-input
type="textarea" type="textarea"
@ -145,16 +193,52 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<div style="text-align: center"> <div style="text-align: center">
<el-button icon="el-icon-s-custom" v-if="false" type="primary" plain size="mini" @click="handleAssign"></el-button> <el-button
<el-button icon="el-icon-check" type="success" size="mini" @click="handlePass"></el-button> icon="el-icon-s-custom"
<el-button icon="el-icon-back" v-if="returnTaskBtn" type="warning" size="mini" @click="handleBack">退</el-button> v-if="false"
<el-button icon="el-icon-circle-close" type="danger" size="mini" @click="handleReject"></el-button> type="primary"
plain
size="mini"
@click="handleAssign"
>任务转办</el-button
>
<el-button
icon="el-icon-check"
type="success"
size="mini"
@click="handlePass"
>审批通过</el-button
>
<el-button
icon="el-icon-back"
v-if="returnTaskBtn"
type="warning"
size="mini"
@click="handleBack"
>退回任务</el-button
>
<el-button
icon="el-icon-circle-close"
type="danger"
size="mini"
@click="handleReject"
>驳回上级</el-button
>
</div> </div>
</el-form> </el-form>
<div class="page-warning"> <div class="page-warning">
<p><strong style="color: #67C23A;">审批通过</strong> 操作后代表您对当前任务满意任务进入下一阶段</p> <p>
<p><strong style="color: #E6A23C;">退回任务</strong> 操作后代表您对当前任务不满意任务进入您选择的阶段或者直接退回给申请人重新申请</p> <strong style="color: #67c23a">审批通过</strong>
<p><strong style="color: #F56C6C;">驳回上级</strong> 操作后代表您对当前任务不满意任务退回到上一阶段继续处理</p> 操作后代表您对当前任务满意任务进入下一阶段
</p>
<p>
<strong style="color: #e6a23c">退回任务</strong>
操作后代表您对当前任务不满意任务进入您选择的阶段或者直接退回给申请人重新申请
</p>
<p>
<strong style="color: #f56c6c">驳回上级</strong>
操作后代表您对当前任务不满意任务退回到上一阶段继续处理
</p>
</div> </div>
</div> </div>
</div> </div>
@ -167,7 +251,10 @@ import store from "@/store";
import { flowXmlAndNode } from "@/api/flowable/definition"; import { flowXmlAndNode } from "@/api/flowable/definition";
import { CustomViewer as BpmnViewer } from "@/components/customBpmn"; import { CustomViewer as BpmnViewer } from "@/components/customBpmn";
import { complete, rejectTask, returnTask, returnList } from "@/api/flowable/todo"; import { complete, rejectTask, returnTask, returnList } from "@/api/flowable/todo";
import {findCommentByProcInsId,findFormDatasByProcInsId} from "@/api/flowable/businessKey"; import {
findCommentByProcInsId,
findFormDatasByProcInsId,
} from "@/api/flowable/businessKey";
export default { export default {
components: {}, components: {},
props: { props: {
@ -183,7 +270,7 @@ export default {
loading: false, loading: false,
// //
title: "", title: "",
jdtitle:"", jdtitle: "",
// //
form: {}, form: {},
// //
@ -197,20 +284,20 @@ export default {
}, },
], ],
}, },
queryParams:{ queryParams: {
nickName:null, nickName: null,
phonenumber:null, phonenumber: null,
}, },
bpmnViewer: null, bpmnViewer: null,
options: {}, options: {},
flowRecordList: [], flowRecordList: [],
showjd:false, showjd: false,
//label //label
labelStyle: { width: "180px" }, labelStyle: { width: "180px" },
initData:{}, initData: {},
returnTaskList: [], // 退 returnTaskList: [], // 退
returnTask:false, returnTask: false,
returnTaskBtn:false returnTaskBtn: false,
}; };
}, },
computed: {}, computed: {},
@ -223,19 +310,21 @@ export default {
handlePass() { handlePass() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.$confirm('是否确认审批通过当前流程申请?', '提示', { this.$confirm("是否确认审批通过当前流程申请?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.loading=true; .then(() => {
complete(this.form).then(res => { this.loading = true;
complete(this.form).then((res) => {
this.$modal.msgSuccess("任务审批成功"); this.$modal.msgSuccess("任务审批成功");
this.loading = false; this.loading = false;
// //
this.$refs.drawer.closeDrawer(); this.$refs.drawer.closeDrawer();
}); });
}).catch(() => { })
.catch(() => {
console.log("取消操作"); console.log("取消操作");
}); });
} }
@ -245,65 +334,69 @@ export default {
handleReject() { handleReject() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.$confirm('是否确认审批驳回当前流程申请?', '提示', { this.$confirm("是否确认审批驳回当前流程申请?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.loading=true; .then(() => {
rejectTask(this.form).then(res => { this.loading = true;
rejectTask(this.form).then((res) => {
this.$modal.msgSuccess("任务驳回成功"); this.$modal.msgSuccess("任务驳回成功");
this.loading = false; this.loading = false;
// //
this.$refs.drawer.closeDrawer(); this.$refs.drawer.closeDrawer();
}); });
}).catch(() => { })
.catch(() => {
console.log("取消操作"); console.log("取消操作");
}); });
} }
}); });
}, },
/** 退回任务 */ /** 退回任务 */
handleBack(){ handleBack() {
if(!this.returnTask){ if (!this.returnTask) {
this.returnTask=true; this.returnTask = true;
this.$modal.msgWarning("请选择退回节点"); this.$modal.msgWarning("请选择退回节点");
return; return;
} }
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
if(!this.form.targetKey){ if (!this.form.targetKey) {
this.$modal.msgWarning("请选择退回节点"); this.$modal.msgWarning("请选择退回节点");
return; return;
} }
this.$confirm('是否确认退回当前流程申请?', '提示', { this.$confirm("是否确认退回当前流程申请?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { })
this.loading=true; .then(() => {
returnTask(this.form).then(res => { this.loading = true;
returnTask(this.form).then((res) => {
this.$modal.msgSuccess("任务退回成功"); this.$modal.msgSuccess("任务退回成功");
this.loading = false; this.loading = false;
// //
this.$refs.drawer.closeDrawer(); this.$refs.drawer.closeDrawer();
}); });
}).catch(() => { })
.catch(() => {
console.log("取消操作"); console.log("取消操作");
}); });
} }
}); });
}, },
initReturnList(){ initReturnList() {
returnList(this.form).then(res => { returnList(this.form).then((res) => {
this.returnTaskList = res.data; this.returnTaskList = res.data;
//退>1退 //退>1退
if(res.data.length>1){ if (res.data.length > 1) {
this.returnTaskBtn=true; this.returnTaskBtn = true;
} }
}) });
}, },
initFormDate(){ initFormDate() {
this.form.taskId = this.options.taskId; this.form.taskId = this.options.taskId;
this.form.taskName = this.options.taskName; this.form.taskName = this.options.taskName;
this.form.userId = store.getters.userId; this.form.userId = store.getters.userId;
@ -311,16 +404,15 @@ export default {
this.form.procInsId = this.options.procInsId; this.form.procInsId = this.options.procInsId;
this.form.instanceId = this.options.procInsId; this.form.instanceId = this.options.procInsId;
this.form.executionId = this.options.procInsId; this.form.executionId = this.options.procInsId;
this.returnTask=false; this.returnTask = false;
this.returnTaskBtn=false; this.returnTaskBtn = false;
this.initReturnList(); this.initReturnList();
}, },
setIcon(row) { setIcon(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "el-icon-close"; return "el-icon-close";
}else{ } else {
return "el-icon-check"; return "el-icon-check";
} }
} else { } else {
@ -329,10 +421,9 @@ export default {
}, },
setColor(row) { setColor(row) {
if (row.endTime) { if (row.endTime) {
if(row.commentResult=="驳回") if (row.commentResult == "驳回") {
{
return "#f56c6c"; return "#f56c6c";
}else{ } else {
return "#2bc418"; return "#2bc418";
} }
} else { } else {
@ -358,19 +449,21 @@ export default {
this.showjd = false; this.showjd = false;
this.form = {}; this.form = {};
this.initFormDate(); this.initFormDate();
if(options.finishTime==null){ if (options.finishTime == null) {
this.jdtitle="进行中"; this.jdtitle = "进行中";
this.showjd=true; this.showjd = true;
}else if(options.finishTime!=null && options.assigneeId==null){ } else if (options.finishTime != null && options.assigneeId == null) {
this.jdtitle="已撤销"; this.jdtitle = "已撤销";
}else{ } else {
this.jdtitle="已完成"; this.jdtitle = "已完成";
} }
this.getFlowRecordList(options.procInsId, options.deployId); this.getFlowRecordList(options.procInsId, options.deployId);
this.getFormDatasList(options.procInsId, options.deployId); this.getFormDatasList(options.procInsId, options.deployId);
flowXmlAndNode({ procInsId:options.procInsId, deployId: options.deployId }).then((res) => { flowXmlAndNode({ procInsId: options.procInsId, deployId: options.deployId }).then(
(res) => {
this.initFlowImage(res.data); this.initFlowImage(res.data);
}); }
);
}, },
async initFlowImage(data) { async initFlowImage(data) {
const self = this; const self = this;
@ -382,8 +475,8 @@ export default {
await self.bpmnViewer.importXML(data.xmlData); await self.bpmnViewer.importXML(data.xmlData);
// //
self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto"); self.bpmnViewer.get("canvas").zoom("fit-viewport", "auto");
if (data.nodeData !==undefined && data.nodeData.length > 0 ) { if (data.nodeData !== undefined && data.nodeData.length > 0) {
self.fillColor(data.nodeData) self.fillColor(data.nodeData);
} }
} catch (err) { } catch (err) {
console.error(err.message, err.warnings); console.error(err.message, err.warnings);
@ -398,13 +491,15 @@ export default {
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findCommentByProcInsId(params).then(res => { findCommentByProcInsId(params)
.then((res) => {
that.flowRecordList = res.data; that.flowRecordList = res.data;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
/** 流程表单数据 */ /** 流程表单数据 */
getFormDatasList(procInsId, deployId) { getFormDatasList(procInsId, deployId) {
@ -415,130 +510,164 @@ export default {
// }).catch(res => { // }).catch(res => {
// this.$message.error("..."); // this.$message.error("...");
// }) // })
const that = this const that = this;
const params = {procInsId: procInsId} const params = { procInsId: procInsId };
findFormDatasByProcInsId(params).then(res => { findFormDatasByProcInsId(params)
.then((res) => {
this.initData = res.data; this.initData = res.data;
}).catch(res => {
this.$message.error("数据异常,请联系管理员...");
}) })
.catch((res) => {
this.$message.error("数据异常,请联系管理员...");
});
}, },
// //
fillColor(nodeData) { fillColor(nodeData) {
const canvas = this.bpmnViewer.get('canvas') const canvas = this.bpmnViewer.get("canvas");
this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach(n => { this.bpmnViewer.getDefinitions().rootElements[0].flowElements.forEach((n) => {
const completeTask = nodeData.find(m => m.key === n.id) const completeTask = nodeData.find((m) => m.key === n.id);
const todoTask = nodeData.find(m => !m.completed) const todoTask = nodeData.find((m) => !m.completed);
const endTask = nodeData[nodeData.length - 1] const endTask = nodeData[nodeData.length - 1];
if (n.$type === 'bpmn:UserTask') { if (n.$type === "bpmn:UserTask") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
if (todoTask && completeTask.key === todoTask.key && !todoTask.completed){ if (
canvas.addMarker(nn.id, todoTask.completed ? 'highlight' : 'highlight-todo') todoTask &&
canvas.addMarker(nn.targetRef.id, todoTask.completed ? 'highlight' : 'highlight-todo') completeTask.key === todoTask.key &&
}else { !todoTask.completed
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') ) {
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
nn.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
todoTask.completed ? "highlight" : "highlight-todo"
);
} else {
canvas.addMarker(
nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
} }
}) });
} }
} }
// //
else if (n.$type === 'bpmn:ExclusiveGateway') { else if (n.$type === "bpmn:ExclusiveGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
});
})
} }
} }
// //
else if (n.$type === 'bpmn:ParallelGateway') { else if (n.$type === "bpmn:ParallelGateway") {
if (completeTask) { if (completeTask) {
canvas.addMarker(n.id, completeTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
n.outgoing?.forEach(nn => { n.id,
const targetTask = nodeData.find(m => m.key === nn.targetRef.id) completeTask.completed ? "highlight" : "highlight-todo"
);
n.outgoing?.forEach((nn) => {
const targetTask = nodeData.find((m) => m.key === nn.targetRef.id);
if (targetTask) { if (targetTask) {
canvas.addMarker(nn.id, targetTask.completed ? 'highlight' : 'highlight-todo') canvas.addMarker(
canvas.addMarker(nn.targetRef.id, targetTask.completed ? 'highlight' : 'highlight-todo') nn.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
canvas.addMarker(
nn.targetRef.id,
targetTask.completed ? "highlight" : "highlight-todo"
);
} }
}) });
} }
} } else if (n.$type === "bpmn:StartEvent") {
else if (n.$type === 'bpmn:StartEvent') { n.outgoing.forEach((nn) => {
n.outgoing.forEach(nn => { const completeTask = nodeData.find((m) => m.key === nn.targetRef.id);
const completeTask = nodeData.find(m => m.key === nn.targetRef.id)
if (completeTask) { if (completeTask) {
canvas.addMarker(nn.id, 'highlight') canvas.addMarker(nn.id, "highlight");
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
}) });
} } else if (n.$type === "bpmn:EndEvent") {
else if (n.$type === 'bpmn:EndEvent') {
if (endTask.key === n.id && endTask.completed) { if (endTask.key === n.id && endTask.completed) {
canvas.addMarker(n.id, 'highlight') canvas.addMarker(n.id, "highlight");
return return;
} }
} }
}) });
}, },
getDurationDate(val){ getDurationDate(val) {
// //
let days = Math.floor(val / (24 * 3600 * 1000)) let days = Math.floor(val / (24 * 3600 * 1000));
// //
let leave1 = val % (24 * 3600 * 1000) // let leave1 = val % (24 * 3600 * 1000); //
let hours = Math.floor(leave1 / (3600 * 1000)) let hours = Math.floor(leave1 / (3600 * 1000));
// //
let leave2 = leave1 % (3600 * 1000) // let leave2 = leave1 % (3600 * 1000); //
let minutes = Math.floor(leave2 / (60 * 1000)) let minutes = Math.floor(leave2 / (60 * 1000));
// //
let leave3 = leave2 % (60 * 1000) // let leave3 = leave2 % (60 * 1000); //
let seconds = Math.round(leave3 / 1000) let seconds = Math.round(leave3 / 1000);
if(days>0){ if (days > 0) {
if(days<10) days = "0"+days; if (days < 10) days = "0" + days;
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return days + '天' + hours + '小时' + minutes + '分钟' + seconds + '秒'; return days + "天" + hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(hours>0){ if (hours > 0) {
if(hours<10) hours = "0"+hours; if (hours < 10) hours = "0" + hours;
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return hours + '小时' + minutes + '分钟' + seconds + '秒'; return hours + "小时" + minutes + "分钟" + seconds + "秒";
} }
if(minutes>0){ if (minutes > 0) {
if(minutes<10) minutes = "0"+minutes; if (minutes < 10) minutes = "0" + minutes;
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return minutes + '分钟' + seconds + '秒'; return minutes + "分钟" + seconds + "秒";
} }
if(seconds>0){ if (seconds > 0) {
if(seconds<10) seconds = "0"+seconds; if (seconds < 10) seconds = "0" + seconds;
return seconds + '秒'; return seconds + "秒";
} }
}, },
handledownload(url){ handledownload(url) {
this.$download.resource(url); this.$download.resource(url);
}, },
getDeleteReason(val){ getDeleteReason(val) {
val = val.replace("Change activity to ",""); val = val.replace("Change activity to ", "");
let flowRecordList = this.flowRecordList; let flowRecordList = this.flowRecordList;
for(let i=0;i<flowRecordList.length;i++){ for (let i = 0; i < flowRecordList.length; i++) {
if(flowRecordList[i].taskDefKey==val){ if (flowRecordList[i].taskDefKey == val) {
console.log(i); console.log(i);
return "驳回至"+flowRecordList[i].taskName; return "驳回至" + flowRecordList[i].taskName;
} }
} }
}, },
@ -546,7 +675,7 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.app-approveDrawer{ .app-approveDrawer {
.drawer { .drawer {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -563,25 +692,24 @@ export default {
padding-right: 20px; padding-right: 20px;
.bjs-powered-by { .bjs-powered-by {
display: none !important; display: none !important;
}
} .maskLayer {
.maskLayer {
width: 100%; width: 100%;
height: 90px; height: 90px;
position: absolute; position: absolute;
z-index: 9999; z-index: 9999;
top: 77px; top: 77px;
} }
} }
.drawerRight { .drawerRight {
width: 40%; width: 40%;
min-width: 400px; min-width: 400px;
height: 100%; height: 100%;
float: left; float: left;
padding-left: 20px; padding-left: 20px;
} }
} }
.containers { .containers {
width: 100%; width: 100%;
height: 150px; height: 150px;
.canvas { .canvas {
@ -597,12 +725,12 @@ export default {
.load { .load {
margin-right: 10px; margin-right: 10px;
} }
.el-form-item__label{ .el-form-item__label {
font-size: 13px; font-size: 13px;
} }
.djs-palette{ .djs-palette {
left: 0px!important; left: 0px !important;
top: 0px; top: 0px;
border-top: none; border-top: none;
} }
@ -650,7 +778,7 @@ export default {
padding: 8px 16px; padding: 8px 16px;
background-color: #f0f9eb; background-color: #f0f9eb;
border-radius: 4px; border-radius: 4px;
border-left: 5px solid #67C23A; border-left: 5px solid #67c23a;
margin: 20px 0; margin: 20px 0;
font-size: 13px; font-size: 13px;
margin-top: 30px; margin-top: 30px;

View File

@ -128,7 +128,8 @@
<el-table <el-table
v-loading="loading" v-loading="loading"
:data="surProjectSpecialList" :data="surProjectSpecialList"
@selection-change="handleSelectionChange" stripe @selection-change="handleSelectionChange"
stripe
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column <el-table-column
@ -259,7 +260,14 @@
/> />
</el-tabs> </el-tabs>
<!-- 添加或修改项目特种人员对话框 --> <!-- 添加或修改项目特种人员对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog
:title="title"
:visible.sync="open"
width="500px"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="项目名称" prop="projectName"> <el-form-item label="项目名称" prop="projectName">
<el-input v-model="form.projectName" placeholder="请输入项目名称" disabled /> <el-input v-model="form.projectName" placeholder="请输入项目名称" disabled />
@ -622,7 +630,8 @@ export default {
}, },
/** 下载证书 */ /** 下载证书 */
handledownload(row) { handledownload(row) {
this.$download.resource(row.credentialFile); window.open(process.env.VUE_APP_BASE_API + row.credentialFile);
//this.$download.resource(row.credentialFile);
}, },
}, },
}; };

View File

@ -585,7 +585,8 @@ export default {
}, },
/** 下载证书 */ /** 下载证书 */
handledownload(row) { handledownload(row) {
this.$download.resource(row.credentialFile); window.open(process.env.VUE_APP_BASE_API+row.credentialFile);
//this.$download.resource(row.credentialFile);
}, },
}, },
}; };

View File

@ -4,6 +4,7 @@ import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.DeptTypeEnum; import com.ruoyi.common.enums.DeptTypeEnum;
import com.ruoyi.common.enums.SysRoleEnum; import com.ruoyi.common.enums.SysRoleEnum;
@ -25,6 +26,7 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit;
/** /**
* @version : V1.0 * @version : V1.0
@ -45,6 +47,9 @@ public class WechatUserLoginServiceImpl implements IWechatUserLoginService {
appInfo.put("wx9997d071b4996f23","5bcc9ca17b31133d93a025871fc5021d"); appInfo.put("wx9997d071b4996f23","5bcc9ca17b31133d93a025871fc5021d");
} }
@Autowired
private RedisCache redisCache;
@Autowired @Autowired
private ISysUserService userService; private ISysUserService userService;
@ -125,6 +130,7 @@ public class WechatUserLoginServiceImpl implements IWechatUserLoginService {
map.put("userId", Convert.toStr(userData.get("user_id"))); map.put("userId", Convert.toStr(userData.get("user_id")));
map.put("nickname",userData.get("nick_name")); map.put("nickname",userData.get("nick_name"));
map.put("openId",openId); map.put("openId",openId);
map.put("unionid",redisCache.getCacheObject("openid-unionid"+openId));
//验证手机号码是否绑定 //验证手机号码是否绑定
int count = wechatUserLoginMapper.checkBindByOpenId(openId); int count = wechatUserLoginMapper.checkBindByOpenId(openId);
if(count > 0){ if(count > 0){
@ -176,7 +182,10 @@ public class WechatUserLoginServiceImpl implements IWechatUserLoginService {
String resultStr = HttpUtil.get(url); String resultStr = HttpUtil.get(url);
JSONObject json = JSONObject.parseObject(resultStr); JSONObject json = JSONObject.parseObject(resultStr);
//删除参数session_key否则小程序检测关键参数暴露提示整改 //删除参数session_key否则小程序检测关键参数暴露提示整改
String key = "openid-unionid"+json.get("openid");
redisCache.setCacheObject(key,json.get("unionid"),24, TimeUnit.HOURS);
json.remove("session_key"); json.remove("session_key");
return json; return json;
} }

View File

@ -15,12 +15,16 @@ user:
# Spring配置 # Spring配置
spring: spring:
# 微信资源验证访问
web:
resources:
static-locations: classpath:/wxstatic/
# 资源信息 # 资源信息
messages: messages:
# 国际化资源文件路径 # 国际化资源文件路径
basename: i18n/messages basename: i18n/messages
profiles: profiles:
active: druid active: prod
# 文件上传 # 文件上传
servlet: servlet:
multipart: multipart:

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''">userId,</if> <if test="userId != null and userId != ''">userId,</if>
<if test="loginName != null and loginName != ''">loginName,</if> <if test="loginName != null and loginName != ''">loginName,</if>
<if test="nickname != null and nickname != ''">nickname,</if> <if test="nickname != null and nickname != ''">nickname,</if>
<if test="unionid != null and unionid != ''">unionid,</if>
creatTime creatTime
) values ) values
( (
@ -42,13 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
<if test="loginName != null and loginName != ''">#{loginName},</if> <if test="loginName != null and loginName != ''">#{loginName},</if>
<if test="nickname != null and nickname != ''">#{nickname},</if> <if test="nickname != null and nickname != ''">#{nickname},</if>
<if test="unionid != null and unionid != ''">#{unionid},</if>
now() now()
) )
</insert> </insert>
<!--更新用户openid--> <!--更新用户openid-->
<update id="updateUserOpenId" parameterType="String"> <update id="updateUserOpenId" parameterType="String">
update sys_user_openid set userId=#{userId},loginName=#{loginName},nickname=#{nickname} where openId =#{openId} and isDel = 0 update sys_user_openid set userId=#{userId},loginName=#{loginName},nickname=#{nickname},unionid=#{unionid} where openId =#{openId} and isDel = 0
</update> </update>
<!--根据电话查询用户id--> <!--根据电话查询用户id-->

View File

@ -0,0 +1 @@
29aef62cd1316f1635063c5b86a3ffee