数据动态查找以及动态赋值方法变更

This commit is contained in:
pixel
2020-11-19 17:24:05 +08:00
parent 0286d56e9c
commit a487266f5b
9 changed files with 67 additions and 26 deletions
+16
View File
@@ -161,4 +161,20 @@ export const getMyNeed = () => {
url: "/workflowProcess/getMyNeed",
method: 'get',
})
}
// @Tags WorkflowProcess
// @Summary 根据id获取当前节点详情和历史
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "根据id获取当前节点详情和过往"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getWorkflowMoveByID [get]
export const getWorkflowMoveByID = (params) => {
return service({
url: "/workflowProcess/getWorkflowMoveByID",
method: 'get',
params
})
}
+10 -2
View File
@@ -44,6 +44,10 @@ export default {
name: "ExaWfLeave",
mixins: [infoList],
props:{
business:{
type:Object,
default:function(){return null}
},
wf:{
type:Object,
default:function(){return{}}
@@ -51,7 +55,8 @@ export default {
},
data() {
return {
type: "",formData: {
type: "",
formData: {
cause:"",
startTime:new Date(),
endTime:new Date(),
@@ -72,6 +77,7 @@ export default {
workflowProcessID:this.wf.workflowProcessID,
workflowNodeID:this.wf.id,
promoterID:this.userInfo.ID,
operatorID:this.userInfo.ID,
action:"create",
param:""
}
@@ -89,7 +95,9 @@ export default {
},
async created() {
// 建议通过url传参获取目标数据ID 调用 find方法进行查询数据操作 从而决定本页面是create还是update 以下为id作为url参数示例
if(this.business){
this.formData = this.business
}
}
};
</script>
@@ -164,8 +164,7 @@ export default {
this.$router.push({
name: "workflowUse",
query: {
workflowId: row.id,
activeId:0,
workflowId: row.id
}
});
},
@@ -1,22 +1,22 @@
<template>
<div class="workflow-use">
<WorkflowInfo v-if="done" :wf="this.node"/>
<WorkflowInfo v-if="done" :wf="this.node" :business="business"/>
</div>
</template>
<script>
import {findWorkflowStep} from "@/api/workflowProcess.js"
import {findWorkflowStep,getWorkflowMoveByID} from "@/api/workflowProcess.js"
export default {
name:"WorklowUse",
data(){
return{
done:false
done:false,
business:null,
node:null
}
},
async created(){
const workflowId = this.$route.query.workflowId
const actionId = this.$route.query.actionId
const businessId = this.$route.query.businessId
const wfmId = this.$route.query.wfmId
if(workflowId){
const res = await findWorkflowStep({id:workflowId})
if(res.code == 0){
@@ -24,6 +24,13 @@ export default {
this.node = res.data.workflow.nodes[0]
this.done = true
}
}else if(wfmId){
const res = await getWorkflowMoveByID({id:wfmId})
if(res.code == 0){
this.business = res.data.business
this.node = res.data.move.workflowNode
this.done = true
}
}
},
beforeCreate(){