clay : 流程加外层业务 #43

Merged
clay merged 4 commits from master into pro 2023-03-22 14:52:49 +00:00
9 changed files with 150 additions and 97 deletions
Showing only changes of commit 5334ea30e3 - Show all commits

View File

@ -10,8 +10,8 @@ Vue.prototype.$axios = axios;
// 字体图标 // 字体图标
export function getBaseUrl(){ export function getBaseUrl(){
return "http://gateway.mytwins.top" // return "http://gateway.mytwins.top"
// return "http://192.168.101.7:8000" return "http://192.168.101.7:8000"
// return "http://localhost:8000" // return "http://localhost:8000"
} }
@ -51,7 +51,7 @@ service.interceptors.response.use(
console.log("请求", err); console.log("请求", err);
switch (err.response.status) { switch (err.response.status) {
case 401: case 401:
MessageBox.alert("登陆已过期,请关闭当前窗口重新进入-能臣工作台"); MessageBox.alert("登陆已过期,请关闭当前窗口重新进入");
break; break;
case 403: case 403:
//Message.warning("抱歉,您无权访问!") //Message.warning("抱歉,您无权访问!")

View File

@ -63,8 +63,6 @@ export default {
}, },
methods: { methods: {
validate(call) { validate(call) {
console.log("我被执行了")
let success = true let success = true
this.$refs.formView.validate(valid => { this.$refs.formView.validate(valid => {
success = valid success = valid

View File

@ -1,5 +1,5 @@
<template> <template>
<node :title="config.name" :show-error="showError" :content="content" <node :title="config.name" :show-error="showError" :content="content" :node-id="config.id"
:show-avatar="config.props.assignedType === 'ASSIGN_USER'" :user-info="assignedUser" :show-avatar="config.props.assignedType === 'ASSIGN_USER'" :user-info="assignedUser"
:error-info="errorInfo" :error-info="errorInfo"
:select-user="selectUser" :select-user="selectUser"

View File

@ -1,5 +1,5 @@
<template> <template>
<node :title="config.name" :show-error="showError" :select-user="selectUser" :content="content" <node :title="config.name" :show-error="showError" :select-user="selectUser" :content="content" :node-id="config.id"
:error-info="errorInfo" :show-avatar="true" :user-info="config.props.assignedUser" :error-info="errorInfo" :show-avatar="true" :user-info="config.props.assignedUser"
@selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)" @selected="$emit('selected')" @delNode="$emit('delNode')" @insertNode="type => $emit('insertNode', type)"
placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/> placeholder="请设置抄送人" :header-bgc="headerBgc" header-icon="el-icon-s-promotion"/>

View File

@ -61,6 +61,12 @@ export default {
type: Boolean, type: Boolean,
default: false default: false
}, },
nodeId:{
type:String,
default:()=>{
return "";
}
},
// //
show: { show: {
type: Boolean, type: Boolean,
@ -133,6 +139,22 @@ export default {
data() { data() {
return {} return {}
}, },
created() {
let userInfo = this.$store.state.selectUserMap.get(this.nodeId);
console.log(this.nodeId,"sadasdasd",userInfo,this._userInfo)
if (userInfo){
let userInfoList = []
for (let val of userInfo) {
let userInfo = {
id: val.id,
name: val.name,
avatar: val.avatar,
}
userInfoList.push(userInfo)
}
this._userInfo = userInfoList
}
},
computed: { computed: {
viewer() { viewer() {
return this.$store.state.diagramMode === 'viewer' return this.$store.state.diagramMode === 'viewer'

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-table :data="tableData" <el-table :data="tableData"
@row-click="clickRow" @cell-click="showDetails"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="deploymentName" prop="deploymentName"
@ -39,7 +39,15 @@
<el-table-column <el-table-column
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="min" type="text" icon="el-icon-thumb">再次提交</el-button> <template v-if="scope.row.isSelf">
<template v-if="scope.row.state === '4'">
<el-button size="min" type="text" icon="el-icon-thumb" @click="resubmitHander(scope.row.taskId)">再次提交</el-button>
</template>
<template v-if="scope.row.state === '2' || scope.row.state === '3'">
<el-button size="min" type="text" icon="el-icon-thumb" @click="resubmitHander(scope.row.taskId)">重新提交
</el-button>
</template>
</template>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -52,17 +60,20 @@
<div class="top"> <div class="top">
<div class="top_left"> <div class="top_left">
<el-avatar size="large" :src="processInstanceData.userInfo.avatar"></el-avatar> <el-avatar size="large" :src="processInstanceData.userInfo.avatar"></el-avatar>
<span style="text-align: center;color: #19191a;font-size: 14px;">{{ processInstanceData.userInfo.name }}</span> <span style="text-align: center;color: #19191a;font-size: 14px;">{{processInstanceData.userInfo.name}}</span>
</div> </div>
<div class="top_right"> <div class="top_right">
<div style="margin-bottom: 12px"> <div style="margin-bottom: 12px">
<span style="font-size: 15px;">{{ selectProcessInstance.deploymentName }}</span> <span style="font-size: 15px;">{{ selectProcessInstance.deploymentName }}</span>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '1'" size="mini" >进行中</el-tag> <el-tag class="state_tag" v-if="selectProcessInstance.state === '1'" size="mini">进行中</el-tag>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '4'" size="mini" type="success">审批通过</el-tag> <el-tag class="state_tag" v-if="selectProcessInstance.state === '4'" size="mini" type="success">审批通过
<el-tag class="state_tag" v-if="selectProcessInstance.state === '3'" size="mini" type="danger">审批驳回</el-tag> </el-tag>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '3'" size="mini" type="danger">审批驳回
</el-tag>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '2'" size="mini" type="info">已撤销</el-tag> <el-tag class="state_tag" v-if="selectProcessInstance.state === '2'" size="mini" type="info">已撤销</el-tag>
<el-tooltip class="item" effect="dark" content="查看详细流程" placement="top-start"> <el-tooltip class="item" effect="dark" content="查看详细流程" placement="top-start">
<el-icon class="el-icon-view" style="float: right;font-size: 20px;cursor: pointer" @click.native="processDiagramViewer = true"></el-icon> <el-icon class="el-icon-view" style="float: right;font-size: 20px;cursor: pointer"
@click.native="processDiagramViewer = true"></el-icon>
</el-tooltip> </el-tooltip>
</div> </div>
<div> <div>
@ -85,25 +96,32 @@
<process-diagram-viewer v-if="processDiagramViewer"/> <process-diagram-viewer v-if="processDiagramViewer"/>
<div style="height: 70px;"></div> <div style="height: 70px;"></div>
</el-dialog> </el-dialog>
<re-process :code="selectInstanceId" v-if="openItemDl" @submit="resubmit"/>
</div> </div>
</template> </template>
<script> <script>
import FormRenderView from '@/views/common/form/FormRenderView' import FormRenderView from '@/views/common/form/FormRenderView'
import ReProcess from "./ReProcess";
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer"; import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
import {getAboutInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance"; import {getAboutInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance";
import {timeLength} from '@/utils/date' import {timeLength} from '@/utils/date'
import OperationRender from "../common/operation/OperationRender"; import OperationRender from "../common/operation/OperationRender";
export default { export default {
name: "AboutInstance", name: "AboutInstance",
components: {OperationRender, FormRenderView, ProcessDiagramViewer}, components: {ReProcess, OperationRender, FormRenderView, ProcessDiagramViewer},
data() { data() {
return { return {
approveOpen: false, approveOpen: false,
processDiagramViewer: false, processDiagramViewer: false,
selectProcessInstance: {}, selectProcessInstance: {},
selectInstanceId: null,
tableData: [], tableData: [],
loading: false, loading: false,
openItemDl: false,
processInstanceData: { processInstanceData: {
userInfo: {}, userInfo: {},
formData: {}, formData: {},
@ -117,12 +135,20 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
clickRow(row) { showDetails(row, column) {
this.approveOpen = true; if (column.label !== '操作') {
this.loadProcessInstance(row.processInstanceId) this.approveOpen = true;
this.selectProcessInstance = row this.loadProcessInstance(row.processInstanceId)
this.selectProcessInstance = row
}
},
resubmitHander(instanceId) {
this.selectInstanceId = instanceId;
this.openItemDl = false
this.$nextTick(() => {
this.openItemDl = true
})
}, },
loadProcessInstance(processInstanceId) { loadProcessInstance(processInstanceId) {
let that = this; let that = this;
this.init(); this.init();
@ -158,7 +184,11 @@ export default {
this.$store.state.diagramMode = "viewer"; this.$store.state.diagramMode = "viewer";
this.$store.state.preview = false; this.$store.state.preview = false;
}, },
resubmit(flag) {
if (flag) {
this.getList();
}
},
getList() { getList() {
getAboutInstanceList().then(res => { getAboutInstanceList().then(res => {
let data = res.data let data = res.data
@ -168,7 +198,7 @@ export default {
getTimeConsuming(instance) { getTimeConsuming(instance) {
if (instance.state != 1) { if (instance.state != 1) {
//dateFormat(,) //dateFormat(,)
return timeLength(instance.submitTime,instance.endTime); return timeLength(instance.submitTime, instance.endTime);
} }
} }
} }
@ -180,24 +210,24 @@ export default {
padding: 0 10px 10px 10px; padding: 0 10px 10px 10px;
display: flex; display: flex;
.top_left { .top_left {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 50px; width: 50px;
align-items: center; align-items: center;
}
.top_right {
width: 85%;
display: flex;
flex-direction: column;
//justify-content: space-between;
font-size: 13px;
margin-left: 10px;
}
} }
.top_right { .state_tag {
width: 85%;
display: flex;
flex-direction: column;
//justify-content: space-between;
font-size: 13px;
margin-left: 10px;
}
}
.state_tag{
font-size: 12px; font-size: 12px;
//margin-right: 15px; //margin-right: 15px;
} }

View File

@ -2,17 +2,12 @@
<div v-loading="loading" class="initiate_process"> <div v-loading="loading" class="initiate_process">
<div v-if="!loading" style="min-width: 338px;"> <div v-if="!loading" style="min-width: 338px;">
<!--渲染表单--> <!--渲染表单-->
<form-render class="process-form" ref="initiateForm" :form-items="processDefinition.formItems" v-model="formData"/> <form-render class="process-form" ref="initiateForm" :form-items="processDefinition.formItems"
v-model="formData"/>
</div> </div>
<div style="display: flex;justify-content: center;flex-direction: column;min-width: 1036px;"> <div style="display: flex;justify-content: center;flex-direction: column;min-width: 1036px;">
<span style="font-size: 18px;text-align: center;padding-top: 20px;">审批流程</span> <span style="font-size: 18px;text-align: center;padding-top: 20px;">审批流程</span>
<process-diagram-viewer ref="processDiagramViewer"/> <process-diagram-viewer ref="processDiagramViewer"/>
<!--渲染流程执行过程-->
<el-timeline :reverse="false">
<!-- <el-timeline-item v-for="(activity, index) in activities" :key="index">-->
<!-- </el-timeline-item>-->
</el-timeline>
</div> </div>
</div> </div>
</template> </template>

View File

@ -39,11 +39,14 @@
<el-table-column <el-table-column
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.state === '4'"> <template v-if="scope.row.isSelf">
<el-button size="min" type="text" icon="el-icon-thumb">再次提交</el-button> <template v-if="scope.row.state === '4'">
</template> <el-button size="min" type="text" icon="el-icon-thumb" @click="resubmitHander(scope.row.taskId)">再次提交</el-button>
<template v-if="scope.row.state === '2' || scope.row.state === '3'"> </template>
<el-button size="min" type="text" icon="el-icon-thumb" @click="resubmitHander(scope.row.taskId)">重新提交</el-button> <template v-if="scope.row.state === '2' || scope.row.state === '3'">
<el-button size="min" type="text" icon="el-icon-thumb" @click="resubmitHander(scope.row.taskId)">重新提交
</el-button>
</template>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
@ -57,17 +60,20 @@
<div class="top"> <div class="top">
<div class="top_left"> <div class="top_left">
<el-avatar size="large" :src="processInstanceData.userInfo.avatar"></el-avatar> <el-avatar size="large" :src="processInstanceData.userInfo.avatar"></el-avatar>
<span style="text-align: center;color: #19191a;font-size: 14px;">{{ processInstanceData.userInfo.name }}</span> <span style="text-align: center;color: #19191a;font-size: 14px;">{{processInstanceData.userInfo.name}}</span>
</div> </div>
<div class="top_right"> <div class="top_right">
<div style="margin-bottom: 12px"> <div style="margin-bottom: 12px">
<span style="font-size: 15px;margin-right: 15px">{{ selectProcessInstance.deploymentName }}</span> <span style="font-size: 15px;margin-right: 15px">{{ selectProcessInstance.deploymentName }}</span>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '1'" size="mini" >进行中</el-tag> <el-tag class="state_tag" v-if="selectProcessInstance.state === '1'" size="mini">进行中</el-tag>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '4'" size="mini" type="success">审批通过</el-tag> <el-tag class="state_tag" v-if="selectProcessInstance.state === '4'" size="mini" type="success">审批通过
<el-tag class="state_tag" v-if="selectProcessInstance.state === '3'" size="mini" type="danger">审批驳回</el-tag> </el-tag>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '3'" size="mini" type="danger">审批驳回
</el-tag>
<el-tag class="state_tag" v-if="selectProcessInstance.state === '2'" size="mini" type="info">已撤销</el-tag> <el-tag class="state_tag" v-if="selectProcessInstance.state === '2'" size="mini" type="info">已撤销</el-tag>
<el-tooltip class="item" effect="dark" content="查看详细流程" placement="top-start"> <el-tooltip class="item" effect="dark" content="查看详细流程" placement="top-start">
<el-icon class="el-icon-view" style="float: right;font-size: 20px;cursor: pointer" @click.native="processDiagramViewer = true"></el-icon> <el-icon class="el-icon-view" style="float: right;font-size: 20px;cursor: pointer"
@click.native="processDiagramViewer = true"></el-icon>
</el-tooltip> </el-tooltip>
</div> </div>
<div> <div>
@ -90,15 +96,7 @@
<process-diagram-viewer v-if="processDiagramViewer"/> <process-diagram-viewer v-if="processDiagramViewer"/>
<div style="height: 70px;"></div> <div style="height: 70px;"></div>
</el-dialog> </el-dialog>
<re-process :code="selectInstanceId" v-if="openItemDl" @submit="resubmit"/>
<re-process :code="selectInstanceId" v-if="openItemDl"/>
<!-- <el-dialog title="发起审批" :visible.sync="openItemDl" :close-on-click-modal="true">-->
<!-- <re-initiate-process ref="processInstance" :code="selectInstanceId" v-if="openItemDl"></re-initiate-process>-->
<!-- <span slot="footer" class="dialog-footer">-->
<!-- <el-button size="mini" @click="openItemDl = false"> </el-button>-->
<!-- <el-button size="mini" type="primary" @click="submitForm"> </el-button>-->
<!-- </span>-->
<!-- </el-dialog>-->
</div> </div>
</template> </template>
@ -109,6 +107,7 @@ import ReProcess from "./ReProcess";
import {getInitiatedInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance"; import {getInitiatedInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance";
import {timeLength} from '@/utils/date' import {timeLength} from '@/utils/date'
import OperationRender from "../common/operation/OperationRender"; import OperationRender from "../common/operation/OperationRender";
export default { export default {
name: "InitiatedInstance", name: "InitiatedInstance",
components: {ReProcess, OperationRender, FormRenderView, ProcessDiagramViewer}, components: {ReProcess, OperationRender, FormRenderView, ProcessDiagramViewer},
@ -119,8 +118,8 @@ export default {
selectProcessInstance: {}, selectProcessInstance: {},
tableData: [], tableData: [],
loading: false, loading: false,
openItemDl:false, openItemDl: false,
selectInstanceId:null, selectInstanceId: null,
processInstanceData: { processInstanceData: {
userInfo: {}, userInfo: {},
formData: {}, formData: {},
@ -134,8 +133,8 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
showDetails(row,column) { showDetails(row, column) {
if (column.label !== '操作'){ if (column.label !== '操作') {
this.approveOpen = true; this.approveOpen = true;
this.loadProcessInstance(row.processInstanceId) this.loadProcessInstance(row.processInstanceId)
this.selectProcessInstance = row this.selectProcessInstance = row
@ -156,8 +155,11 @@ export default {
this.loading = false; this.loading = false;
}) })
}, },
resubmit(flag) {
if (flag) {
this.getList();
}
},
init() { init() {
this.processInstanceData = { this.processInstanceData = {
userInfo: {}, userInfo: {},
@ -175,15 +177,12 @@ export default {
this.$store.state.diagramMode = "viewer"; this.$store.state.diagramMode = "viewer";
this.$store.state.preview = false; this.$store.state.preview = false;
}, },
resubmitHander(instanceId){ resubmitHander(instanceId) {
this.selectInstanceId = instanceId; this.selectInstanceId = instanceId;
this.openItemDl = false this.openItemDl = false
//
// this.$nextTickDOM
this.$nextTick(() => { this.$nextTick(() => {
this.openItemDl = true this.openItemDl = true
}) })
console.log("书剑")
}, },
getList() { getList() {
getInitiatedInstanceList().then(res => { getInitiatedInstanceList().then(res => {
@ -194,7 +193,7 @@ export default {
getTimeConsuming(instance) { getTimeConsuming(instance) {
if (instance.state != 1) { if (instance.state != 1) {
//dateFormat(,) //dateFormat(,)
return timeLength(instance.submitTime,instance.endTime); return timeLength(instance.submitTime, instance.endTime);
} }
} }
} }
@ -206,24 +205,24 @@ export default {
padding: 0 10px 10px 10px; padding: 0 10px 10px 10px;
display: flex; display: flex;
.top_left { .top_left {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 50px; width: 50px;
align-items: center; align-items: center;
}
.top_right {
width: 85%;
display: flex;
flex-direction: column;
//justify-content: space-between;
font-size: 13px;
margin-left: 10px;
}
} }
.top_right { .state_tag {
width: 85%;
display: flex;
flex-direction: column;
//justify-content: space-between;
font-size: 13px;
margin-left: 10px;
}
}
.state_tag{
font-size: 12px; font-size: 12px;
//margin-right: 15px; //margin-right: 15px;
} }

View File

@ -24,7 +24,7 @@
<script> <script>
import FormRender from "@/views/common/form/FormRender"; import FormRender from "@/views/common/form/FormRender";
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer"; import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
import {getInitiatedInstanceReInfo,restartProcessInstance} from "@/api/processInstance"; import {getInitiatedInstanceReInfo, restartProcessInstance} from "@/api/processInstance";
export default { export default {
name: "ReProcess", name: "ReProcess",
@ -69,10 +69,16 @@ export default {
methods: { methods: {
loadProcessDefinitionReInfo(instanceId) { loadProcessDefinitionReInfo(instanceId) {
this.openItemDl = true; this.openItemDl = true;
getInitiatedInstanceReInfo(instanceId).then(res => { getInitiatedInstanceReInfo(instanceId).then(res => {
let processDefinition = res.data; let processDefinition = res.data;
this.processDefinition = processDefinition; this.processDefinition = processDefinition;
this.formData = processDefinition.formData this.formData = processDefinition.formData
if (processDefinition.optionalUser){
this.$store.state.selectUserMap = new Map();
for (let key in processDefinition.optionalUser) {
this.$store.state.selectUserMap.set(key,processDefinition.optionalUser[key])
}
}
// //
this.$store.state.design = processDefinition; this.$store.state.design = processDefinition;
this.loading = false; this.loading = false;
@ -81,9 +87,11 @@ export default {
}); });
}, },
resubmitForm(){ resubmitForm() {
let selectUserMap = {} let selectUserMap = {}
this.$store.state.selectUserMap.forEach(((value, key) => {selectUserMap[key]=value})) this.$store.state.selectUserMap.forEach(((value, key) => {
selectUserMap[key] = value
}))
let paramsData = { let paramsData = {
processDefinitionId: this.code, processDefinitionId: this.code,
formData: JSON.stringify(this.formData), formData: JSON.stringify(this.formData),
@ -91,7 +99,8 @@ export default {
} }
this.validate(valid => { this.validate(valid => {
if (valid) { if (valid) {
restartProcessInstance(paramsData).then(res=>{ restartProcessInstance(paramsData).then(res => {
this.$emit("submit", true)
this.openItemDl = false this.openItemDl = false
this.$message.success(res.msg) this.$message.success(res.msg)
}) })