Skip to content

Commit f32fdbf

Browse files
author
QM303176530
committed
增加自审批节点,修改待办查询bug,修改角色查询bug
1 parent 15d6ff0 commit f32fdbf

File tree

5 files changed

+33
-13
lines changed

5 files changed

+33
-13
lines changed

server/resource/template/web/workflowForm.vue.tpl

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<el-button v-if="this.wf.clazz == 'start'" @click="start" type="primary">启动</el-button>
3232
<!-- complete传入流转参数 决定下一步会流转到什么位置 此处可以设置多个按钮来做不同的流转 -->
3333
<el-button v-if="canShow" @click="complete('yes')" type="primary">提交</el-button>
34+
<el-button v-if="showSelfNode" @click="complete('')" type="primary">确认</el-button>
3435
<el-button @click="back" type="primary">返回</el-button>
3536
</el-form-item>
3637
</el-form>
@@ -56,8 +57,12 @@ export default {
5657
type:Object,
5758
default:function(){return{}}
5859
},
60+
move:{
61+
type:Object,
62+
default:function(){return{}}
63+
},
5964
workflowMoveID:{
60-
type:Number,
65+
type:[Number,String],
6166
default:0
6267
}
6368
},
@@ -91,6 +96,13 @@ export default {
9196
};
9297
},
9398
computed:{
99+
showSelfNode(){
100+
if(this.wf.assignType == "self" && this.move.promoterID == this.userInfo.ID){
101+
return true
102+
}else{
103+
return false
104+
}
105+
},
94106
canShow(){
95107
if(this.wf.assignType == "user"){
96108
if(this.wf.assignValue.indexOf(","+this.userInfo.ID+",")>-1 && this.wf.clazz == 'userTask'){
@@ -105,7 +117,6 @@ export default {
105117
return false
106118
}
107119
}
108-
return false
109120
},
110121
...mapGetters("user", ["userInfo"])
111122
},

server/service/sys_workflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ func GetMyStated(userID uint) (err error, wfms []model.WorkflowMove) {
406406
func GetMyNeed(userID uint, AuthorityID string) (err error, wfms []model.WorkflowMove) {
407407
user := "%," + strconv.Itoa(int(userID)) + ",%"
408408
auth := "%," + AuthorityID + ",%"
409-
err = global.GVA_DB.Preload("Promoter").Preload("Operator").Preload("WorkflowNode").Preload("WorkflowProcess").Joins("INNER JOIN workflow_nodes as node ON workflow_moves.workflow_node_id = node.id").Where("is_active = ? AND (node.assign_type = ? AND node.assign_value LIKE ? ) OR (node.assign_type = ? AND node.assign_value LIKE ? )", true, "user", user, "authority", auth).Find(&wfms).Error
409+
err = global.GVA_DB.Preload("Promoter").Preload("Operator").Preload("WorkflowNode").Preload("WorkflowProcess").Joins("INNER JOIN workflow_nodes as node ON workflow_moves.workflow_node_id = node.id").Where("is_active = ? AND ((node.assign_type = ? AND node.assign_value LIKE ? ) OR (node.assign_type = ? AND node.assign_value LIKE ? ) OR (node.assign_type = ? AND promoter_id = ? ))", true, "user", user, "authority", auth, "self", userID).Find(&wfms).Error
410410
return err, wfms
411411
}
412412

web/src/components/gva-wfd/components/DetailPanel/UserTaskDetail.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<div class="panelBody">
55
<DefaultDetail :model="model" :onChange="onChange" :readOnly="readOnly" />
66
<div class="panelRow">
7-
<div>选择角色:</div>
7+
<div>选择审批人类别:</div>
88
<el-select
99
style="width: 90%; font-size: 12px"
1010
placeholder="请选择角色(与用户互斥)"
@@ -19,6 +19,7 @@
1919
>
2020
<el-option key="user" value="user" :label="'用户'" />
2121
<el-option key="authority" value="authority" :label="'角色'" />
22+
<el-option key="self" value="self" :label="'发起人本人'" />
2223
</el-select>
2324
</div>
2425
<div v-if="model.assignType == 'user'" class="panelRow">

web/src/view/workflow/workflowCreate/workflowCreate.vue

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@ export default {
130130
},
131131
saveImg() {
132132
console.log(this.$refs["wfd"].graph.saveImg());
133+
},
134+
fmtAuthority(authorityList,list){
135+
authorityList.map(item => {
136+
list.push({
137+
id: item.authorityId,
138+
name: item.authorityName
139+
});
140+
if(item.children){
141+
this.fmtAuthority(item.children,list)
142+
}
143+
});
133144
}
134145
},
135146
async created() {
@@ -140,14 +151,8 @@ export default {
140151
});
141152
}
142153
const authorityRes = await getAuthorityList({ page: 1, pageSize: 9999999 });
143-
console.log(authorityRes)
144154
if (authorityRes.code == 0) {
145-
authorityRes.data.list.map(item => {
146-
this.authorities.push({
147-
id: item.authorityId,
148-
name: item.authorityName
149-
});
150-
});
155+
this.fmtAuthority(authorityRes.data.list,this.authorities)
151156
}
152157
if(this.$route.query.id){
153158
const res = await findWorkflowProcess({ id: this.$route.query.id });

web/src/view/workflow/workflowUse/workflowUse.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
</div>
1515
<WorkflowInfo
1616
v-if="done"
17-
:wf="this.node"
17+
:wf="node"
1818
:business="business"
19+
:move="move"
1920
:workflowMoveID="$route.query.workflowMoveID"
2021
/>
2122
</div>
@@ -29,7 +30,8 @@ export default {
2930
done:false,
3031
business:null,
3132
node:null,
32-
moves:[]
33+
moves:[],
34+
move:null
3335
}
3436
},
3537
computed:{
@@ -74,6 +76,7 @@ export default {
7476
this.business = res.data.business
7577
this.workflow = res.data.move.workflowProcess
7678
this.node = res.data.move.workflowNode
79+
this.move = res.data.move
7780
this.moves = res.data.moves
7881
this.createDone()
7982
}

0 commit comments

Comments
 (0)