Browse Source

增加自审批节点,修改待办查询bug,修改角色查询bug

main
QM303176530 4 years ago
parent
commit
c425fedeb7
  1. 15
      server/resource/template/web/workflowForm.vue.tpl
  2. 2
      server/service/sys_workflow.go
  3. 3
      web/src/components/gva-wfd/components/DetailPanel/UserTaskDetail.vue
  4. 19
      web/src/view/workflow/workflowCreate/workflowCreate.vue
  5. 7
      web/src/view/workflow/workflowUse/workflowUse.vue

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

@ -31,6 +31,7 @@
<el-button v-if="this.wf.clazz == 'start'" @click="start" type="primary">启动</el-button> <el-button v-if="this.wf.clazz == 'start'" @click="start" type="primary">启动</el-button>
<!-- complete传入流转参数 决定下一步会流转到什么位置 此处可以设置多个按钮来做不同的流转 --> <!-- complete传入流转参数 决定下一步会流转到什么位置 此处可以设置多个按钮来做不同的流转 -->
<el-button v-if="canShow" @click="complete('yes')" type="primary">提交</el-button> <el-button v-if="canShow" @click="complete('yes')" type="primary">提交</el-button>
<el-button v-if="showSelfNode" @click="complete('')" type="primary">确认</el-button>
<el-button @click="back" type="primary">返回</el-button> <el-button @click="back" type="primary">返回</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -56,8 +57,12 @@ export default {
type:Object, type:Object,
default:function(){return{}} default:function(){return{}}
}, },
move:{
type:Object,
default:function(){return{}}
},
workflowMoveID:{ workflowMoveID:{
type:Number,
type:[Number,String],
default:0 default:0
} }
}, },
@ -91,6 +96,13 @@ export default {
}; };
}, },
computed:{ computed:{
showSelfNode(){
if(this.wf.assignType == "self" && this.move.promoterID == this.userInfo.ID){
return true
}else{
return false
}
},
canShow(){ canShow(){
if(this.wf.assignType == "user"){ if(this.wf.assignType == "user"){
if(this.wf.assignValue.indexOf(","+this.userInfo.ID+",")>-1 && this.wf.clazz == 'userTask'){ if(this.wf.assignValue.indexOf(","+this.userInfo.ID+",")>-1 && this.wf.clazz == 'userTask'){
@ -105,7 +117,6 @@ export default {
return false return false
} }
} }
return false
}, },
...mapGetters("user", ["userInfo"]) ...mapGetters("user", ["userInfo"])
}, },

2
server/service/sys_workflow.go

@ -406,7 +406,7 @@ func GetMyStated(userID uint) (err error, wfms []model.WorkflowMove) {
func GetMyNeed(userID uint, AuthorityID string) (err error, wfms []model.WorkflowMove) { func GetMyNeed(userID uint, AuthorityID string) (err error, wfms []model.WorkflowMove) {
user := "%," + strconv.Itoa(int(userID)) + ",%" user := "%," + strconv.Itoa(int(userID)) + ",%"
auth := "%," + AuthorityID + ",%" auth := "%," + AuthorityID + ",%"
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
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
return err, wfms return err, wfms
} }

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

@ -4,7 +4,7 @@
<div class="panelBody"> <div class="panelBody">
<DefaultDetail :model="model" :onChange="onChange" :readOnly="readOnly" /> <DefaultDetail :model="model" :onChange="onChange" :readOnly="readOnly" />
<div class="panelRow"> <div class="panelRow">
<div>选择角色</div>
<div>选择审批人类别</div>
<el-select <el-select
style="width: 90%; font-size: 12px" style="width: 90%; font-size: 12px"
placeholder="请选择角色(与用户互斥)" placeholder="请选择角色(与用户互斥)"
@ -19,6 +19,7 @@
> >
<el-option key="user" value="user" :label="'用户'" /> <el-option key="user" value="user" :label="'用户'" />
<el-option key="authority" value="authority" :label="'角色'" /> <el-option key="authority" value="authority" :label="'角色'" />
<el-option key="self" value="self" :label="'发起人本人'" />
</el-select> </el-select>
</div> </div>
<div v-if="model.assignType == 'user'" class="panelRow"> <div v-if="model.assignType == 'user'" class="panelRow">

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

@ -130,6 +130,17 @@ export default {
}, },
saveImg() { saveImg() {
console.log(this.$refs["wfd"].graph.saveImg()); console.log(this.$refs["wfd"].graph.saveImg());
},
fmtAuthority(authorityList,list){
authorityList.map(item => {
list.push({
id: item.authorityId,
name: item.authorityName
});
if(item.children){
this.fmtAuthority(item.children,list)
}
});
} }
}, },
async created() { async created() {
@ -140,14 +151,8 @@ export default {
}); });
} }
const authorityRes = await getAuthorityList({ page: 1, pageSize: 9999999 }); const authorityRes = await getAuthorityList({ page: 1, pageSize: 9999999 });
console.log(authorityRes)
if (authorityRes.code == 0) { if (authorityRes.code == 0) {
authorityRes.data.list.map(item => {
this.authorities.push({
id: item.authorityId,
name: item.authorityName
});
});
this.fmtAuthority(authorityRes.data.list,this.authorities)
} }
if(this.$route.query.id){ if(this.$route.query.id){
const res = await findWorkflowProcess({ id: this.$route.query.id }); const res = await findWorkflowProcess({ id: this.$route.query.id });

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

@ -14,8 +14,9 @@
</div> </div>
<WorkflowInfo <WorkflowInfo
v-if="done" v-if="done"
:wf="this.node"
:wf="node"
:business="business" :business="business"
:move="move"
:workflowMoveID="$route.query.workflowMoveID" :workflowMoveID="$route.query.workflowMoveID"
/> />
</div> </div>
@ -29,7 +30,8 @@ export default {
done:false, done:false,
business:null, business:null,
node:null, node:null,
moves:[]
moves:[],
move:null
} }
}, },
computed:{ computed:{
@ -74,6 +76,7 @@ export default {
this.business = res.data.business this.business = res.data.business
this.workflow = res.data.move.workflowProcess this.workflow = res.data.move.workflowProcess
this.node = res.data.move.workflowNode this.node = res.data.move.workflowNode
this.move = res.data.move
this.moves = res.data.moves this.moves = res.data.moves
this.createDone() this.createDone()
} }

Loading…
Cancel
Save