clay : 流程发起时校验和重新发起时校验 #45
|
|
@ -6,6 +6,7 @@ doc
|
|||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
.package-lock.json
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<el-dialog title="请使用手机扫码预览" :visible.sync="viewCode" width="300px" :close-on-click-modal="false" center>
|
||||
<img src="../../assets/image/code.png" width="250" height="250">
|
||||
</el-dialog>
|
||||
<!-- <el-dialog title="请使用手机扫码预览" :visible.sync="viewCode" width="300px" :close-on-click-modal="false" center>-->
|
||||
<!-- <img src="../../assets/image/code.png" width="250" height="250">-->
|
||||
<!-- </el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,6 @@ export default {
|
|||
this.showError = true
|
||||
} else if (this.viewer) {
|
||||
this.showError = !this.validate_ASSIGN_USER(err)
|
||||
console.log(this.showError)
|
||||
}
|
||||
return this.showError
|
||||
} catch (e) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table :data="tableData"
|
||||
@row-click="clickRow"
|
||||
@cell-click="showDetails"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
prop="deploymentName"
|
||||
|
|
@ -39,8 +39,16 @@
|
|||
<el-table-column
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<template v-if="scope.row.isSelf">
|
||||
<template v-if="scope.row.state === '4'">
|
||||
<el-button size="min" type="text" icon="el-icon-thumb">再次提交</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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-drawer
|
||||
|
|
@ -81,6 +89,8 @@
|
|||
</div>
|
||||
</el-drawer>
|
||||
|
||||
<re-process :code="selectInstanceId" v-if="openItemDl" @success="getList"/>
|
||||
|
||||
<el-dialog title="流程详情" :visible.sync="processDiagramViewer" :close-on-click-modal="true">
|
||||
<process-diagram-viewer v-if="processDiagramViewer"/>
|
||||
<div style="height: 70px;"></div>
|
||||
|
|
@ -91,18 +101,21 @@
|
|||
<script>
|
||||
import FormRenderView from '@/views/common/form/FormRenderView'
|
||||
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
|
||||
import ReProcess from "./ReProcess";
|
||||
import {getAboutInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance";
|
||||
import {timeLength} from '@/utils/date'
|
||||
import OperationRender from "../common/operation/OperationRender";
|
||||
export default {
|
||||
name: "AboutInstance",
|
||||
components: {OperationRender, FormRenderView, ProcessDiagramViewer},
|
||||
components: {OperationRender, FormRenderView, ProcessDiagramViewer, ReProcess},
|
||||
data() {
|
||||
return {
|
||||
approveOpen: false,
|
||||
processDiagramViewer: false,
|
||||
selectProcessInstance: {},
|
||||
tableData: [],
|
||||
openItemDl:false,
|
||||
selectInstanceId:null,
|
||||
loading: false,
|
||||
processInstanceData: {
|
||||
userInfo: {},
|
||||
|
|
@ -117,10 +130,12 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
clickRow(row) {
|
||||
showDetails(row, column) {
|
||||
if (column.label !== '操作') {
|
||||
this.approveOpen = true;
|
||||
this.loadProcessInstance(row.processInstanceId)
|
||||
this.selectProcessInstance = row
|
||||
}
|
||||
},
|
||||
|
||||
loadProcessInstance(processInstanceId) {
|
||||
|
|
@ -136,10 +151,8 @@ export default {
|
|||
that.$store.state.refuseList = data.refuseList;
|
||||
that.$store.state.passList = data.passList;
|
||||
this.loading = false;
|
||||
console.log(data, "获取到的结果数据")
|
||||
})
|
||||
},
|
||||
|
||||
init() {
|
||||
this.processInstanceData = {
|
||||
userInfo: {},
|
||||
|
|
@ -147,7 +160,6 @@ export default {
|
|||
formItems: [],
|
||||
processList: [],
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.state.design = this.taskData;
|
||||
this.$store.state.runningList = [];
|
||||
|
|
@ -158,7 +170,13 @@ export default {
|
|||
this.$store.state.diagramMode = "viewer";
|
||||
this.$store.state.preview = false;
|
||||
},
|
||||
|
||||
resubmitHander(instanceId) {
|
||||
this.selectInstanceId = instanceId;
|
||||
this.openItemDl = false
|
||||
this.$nextTick(() => {
|
||||
this.openItemDl = true
|
||||
})
|
||||
},
|
||||
getList() {
|
||||
getAboutInstanceList().then(res => {
|
||||
let data = res.data
|
||||
|
|
|
|||
|
|
@ -74,8 +74,12 @@ export default {
|
|||
});
|
||||
},
|
||||
validate(call) {
|
||||
this.$refs.initiateForm.validate(call);
|
||||
this.$refs.processDiagramViewer.validate(call);
|
||||
let formValidate = this.$refs.initiateForm.validate(call)
|
||||
let proValidate = this.$refs.processDiagramViewer.validate(call)
|
||||
if (!(Array.isArray(formValidate) && formValidate.length === 0)){
|
||||
return false;
|
||||
}
|
||||
return !(Array.isArray(proValidate) && proValidate.length === 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -39,11 +39,14 @@
|
|||
<el-table-column
|
||||
label="操作">
|
||||
<template slot-scope="scope">
|
||||
<template v-if="scope.row.isSelf">
|
||||
<template v-if="scope.row.state === '4'">
|
||||
<el-button size="min" type="text" icon="el-icon-thumb">再次提交</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>
|
||||
<el-button size="min" type="text" icon="el-icon-thumb" @click="resubmitHander(scope.row.taskId)">重新提交
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -57,17 +60,22 @@
|
|||
<div class="top">
|
||||
<div class="top_left">
|
||||
<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 class="top_right">
|
||||
<div style="margin-bottom: 12px">
|
||||
<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 === '4'" size="mini" type="success">审批通过</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 === '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 === '3'" size="mini" type="danger">审批驳回
|
||||
</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-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>
|
||||
</div>
|
||||
<div>
|
||||
|
|
@ -91,14 +99,7 @@
|
|||
<div style="height: 70px;"></div>
|
||||
</el-dialog>
|
||||
|
||||
<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>-->
|
||||
<re-process :code="selectInstanceId" v-if="openItemDl" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
@ -109,6 +110,7 @@ import ReProcess from "./ReProcess";
|
|||
import {getInitiatedInstanceList, getInitiatedInstanceInfo} from "@/api/processInstance";
|
||||
import {timeLength} from '@/utils/date'
|
||||
import OperationRender from "../common/operation/OperationRender";
|
||||
|
||||
export default {
|
||||
name: "InitiatedInstance",
|
||||
components: {ReProcess, OperationRender, FormRenderView, ProcessDiagramViewer},
|
||||
|
|
@ -119,8 +121,8 @@ export default {
|
|||
selectProcessInstance: {},
|
||||
tableData: [],
|
||||
loading: false,
|
||||
openItemDl:false,
|
||||
selectInstanceId:null,
|
||||
openItemDl: false,
|
||||
selectInstanceId: null,
|
||||
processInstanceData: {
|
||||
userInfo: {},
|
||||
formData: {},
|
||||
|
|
@ -134,8 +136,8 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
showDetails(row,column) {
|
||||
if (column.label !== '操作'){
|
||||
showDetails(row, column) {
|
||||
if (column.label !== '操作') {
|
||||
this.approveOpen = true;
|
||||
this.loadProcessInstance(row.processInstanceId)
|
||||
this.selectProcessInstance = row
|
||||
|
|
@ -156,8 +158,6 @@ export default {
|
|||
this.loading = false;
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
init() {
|
||||
this.processInstanceData = {
|
||||
userInfo: {},
|
||||
|
|
@ -175,15 +175,12 @@ export default {
|
|||
this.$store.state.diagramMode = "viewer";
|
||||
this.$store.state.preview = false;
|
||||
},
|
||||
resubmitHander(instanceId){
|
||||
resubmitHander(instanceId) {
|
||||
this.selectInstanceId = instanceId;
|
||||
this.openItemDl = false
|
||||
// 在组件移除后,重新渲染组件
|
||||
// this.$nextTick可实现在DOM 状态更新后,执行传入的方法。
|
||||
this.$nextTick(() => {
|
||||
this.openItemDl = true
|
||||
})
|
||||
console.log("书剑")
|
||||
},
|
||||
getList() {
|
||||
getInitiatedInstanceList().then(res => {
|
||||
|
|
@ -194,7 +191,7 @@ export default {
|
|||
getTimeConsuming(instance) {
|
||||
if (instance.state != 1) {
|
||||
//dateFormat(开始时间,结束时间)
|
||||
return timeLength(instance.submitTime,instance.endTime);
|
||||
return timeLength(instance.submitTime, instance.endTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -206,24 +203,24 @@ export default {
|
|||
padding: 0 10px 10px 10px;
|
||||
display: flex;
|
||||
|
||||
.top_left {
|
||||
.top_left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 50px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.top_right {
|
||||
.top_right {
|
||||
width: 85%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
//justify-content: space-between;
|
||||
//justify-content: space-between;
|
||||
font-size: 13px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.state_tag{
|
||||
.state_tag {
|
||||
font-size: 12px;
|
||||
//margin-right: 15px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<script>
|
||||
import FormRender from "@/views/common/form/FormRender";
|
||||
import ProcessDiagramViewer from "../admin/layout/ProcessDiagramViewer";
|
||||
import {getInitiatedInstanceReInfo,restartProcessInstance} from "@/api/processInstance";
|
||||
import {getInitiatedInstanceReInfo, restartProcessInstance} from "@/api/processInstance";
|
||||
|
||||
export default {
|
||||
name: "ReProcess",
|
||||
|
|
@ -81,28 +81,35 @@ export default {
|
|||
});
|
||||
},
|
||||
|
||||
resubmitForm(){
|
||||
resubmitForm() {
|
||||
let selectUserMap = {}
|
||||
this.$store.state.selectUserMap.forEach(((value, key) => {selectUserMap[key]=value}))
|
||||
this.$store.state.selectUserMap.forEach(((value, key) => {
|
||||
selectUserMap[key] = value
|
||||
}))
|
||||
let paramsData = {
|
||||
processDefinitionId: this.code,
|
||||
formData: JSON.stringify(this.formData),
|
||||
optionalUser: selectUserMap
|
||||
}
|
||||
this.validate(valid => {
|
||||
let valid = this.validate(() => {
|
||||
})
|
||||
if (valid) {
|
||||
restartProcessInstance(paramsData).then(res=>{
|
||||
restartProcessInstance(paramsData).then(res => {
|
||||
this.openItemDl = false
|
||||
this.$message.success(res.msg)
|
||||
this.$emit("success")
|
||||
})
|
||||
} else {
|
||||
this.$message.warning("请完善表单😥")
|
||||
}
|
||||
})
|
||||
},
|
||||
validate(call) {
|
||||
this.$refs.initiateForm.validate(call);
|
||||
this.$refs.processDiagramViewer.validate(call);
|
||||
let formValidate = this.$refs.initiateForm.validate(call)
|
||||
let proValidate = this.$refs.processDiagramViewer.validate(call)
|
||||
if (!(Array.isArray(formValidate) && formValidate.length === 0)) {
|
||||
return false;
|
||||
}
|
||||
return !(Array.isArray(proValidate) && proValidate.length === 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -127,8 +127,9 @@ export default {
|
|||
formData: JSON.stringify(processInstance.formData),
|
||||
optionalUser: selectUserMap
|
||||
}
|
||||
processInstance.validate(valid => {
|
||||
if (valid) {
|
||||
let start = processInstance.validate(valid => {})
|
||||
console.log(start,"valid")
|
||||
if (start) {
|
||||
startProcessInstance(paramsData).then(res=>{
|
||||
this.openItemDl = false
|
||||
this.$message.success(res.msg)
|
||||
|
|
@ -137,7 +138,6 @@ export default {
|
|||
} else {
|
||||
this.$message.warning("请完善表单😥")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue