update 路由跳转
This commit is contained in:
		| @ -175,18 +175,36 @@ const handleSelectionChange = (selection: LeaveVO[]) => { | ||||
| const handleAdd = () => { | ||||
|   proxy.$tab.closePage(proxy.$route); | ||||
|   proxy.$router.push(`/demo/leaveEdit/index/add/add`); | ||||
|   proxy.$router.push({ | ||||
|       path: `/demo/leaveEdit/index`, | ||||
|       query: { | ||||
|         type: 'add' | ||||
|       } | ||||
|   }) | ||||
| }; | ||||
|  | ||||
| /** 修改按钮操作 */ | ||||
| const handleUpdate = (row?: LeaveVO) => { | ||||
|   proxy.$tab.closePage(proxy.$route); | ||||
|   proxy.$router.push(`/demo/leaveEdit/index/${row.id}/update`);; | ||||
|   proxy.$router.push({ | ||||
|       path: `/demo/leaveEdit/index`, | ||||
|       query: { | ||||
|         id: row.id, | ||||
|         type: 'update' | ||||
|       } | ||||
|   }) | ||||
| }; | ||||
|  | ||||
| /** 查看按钮操作 */ | ||||
| const handleView = (row?: LeaveVO) => { | ||||
|   proxy.$tab.closePage(proxy.$route); | ||||
|   proxy.$router.push(`/demo/leaveEdit/index/${row.id}/view`); | ||||
|   proxy.$router.push({ | ||||
|       path: `/demo/leaveEdit/index`, | ||||
|       query: { | ||||
|         id: row.id, | ||||
|         type: 'view' | ||||
|       } | ||||
|   }) | ||||
| }; | ||||
|  | ||||
| /** 删除按钮操作 */ | ||||
|  | ||||
| @ -1,25 +1,23 @@ | ||||
| <template> | ||||
|   <div class="p-2"> | ||||
|     <el-affix target=".p-2" :offset="80"> | ||||
|       <el-card shadow="never"> | ||||
|           <div style="display: flex;justify-content: space-between;"> | ||||
|             <div> | ||||
|               <el-button :loading="buttonLoading"  | ||||
|               v-if="routeParams.type === 'add' || (routeParams.type === 'update' && form.processInstanceVo && form.processInstanceVo.businessStatus && (form.processInstanceVo.businessStatus === 'draft' || form.processInstanceVo.businessStatus === 'cancel' || form.processInstanceVo.businessStatus === 'back'))" | ||||
|               type="info" @click="submitForm('draft')">暂存</el-button> | ||||
|               <el-button :loading="buttonLoading" v-if="routeParams.type === 'add' || (routeParams.type === 'update' && form.processInstanceVo && (form.processInstanceVo.businessStatus === 'draft' || form.processInstanceVo.businessStatus === 'cancel' || form.processInstanceVo.businessStatus === 'back'))" | ||||
|               type="primary" @click="submitForm('submit')">提 交</el-button> | ||||
|               <el-button :loading="buttonLoading" v-if="routeParams.type === 'approval' && form.processInstanceVo && form.processInstanceVo.businessStatus === 'waiting'" | ||||
|               type="primary" @click="approvalVerifyOpen">审批</el-button> | ||||
|               <el-button @click="handleApprovalRecord" type="primary" v-if="processInstanceId">流程进度</el-button> | ||||
|             </div> | ||||
|             <div> | ||||
|               <el-button style="float: right" @click="goBack()">返回</el-button> | ||||
|             </div> | ||||
|           </div> | ||||
|       </el-card> | ||||
|     </el-affix> | ||||
|     <el-card shadow="never"> | ||||
|         <div style="display: flex;justify-content: space-between;"> | ||||
|           <div> | ||||
|             <el-button :loading="buttonLoading"  | ||||
|             v-if="routeParams.type === 'add' || (routeParams.type === 'update' && form.processInstanceVo && form.processInstanceVo.businessStatus && (form.processInstanceVo.businessStatus === 'draft' || form.processInstanceVo.businessStatus === 'cancel' || form.processInstanceVo.businessStatus === 'back'))" | ||||
|             type="info" @click="submitForm('draft')">暂存</el-button> | ||||
|             <el-button :loading="buttonLoading" v-if="routeParams.type === 'add' || (routeParams.type === 'update' && form.processInstanceVo && (form.processInstanceVo.businessStatus === 'draft' || form.processInstanceVo.businessStatus === 'cancel' || form.processInstanceVo.businessStatus === 'back'))" | ||||
|             type="primary" @click="submitForm('submit')">提 交</el-button> | ||||
|             <el-button :loading="buttonLoading" v-if="routeParams.type === 'approval' && form.processInstanceVo && form.processInstanceVo.businessStatus === 'waiting'" | ||||
|             type="primary" @click="approvalVerifyOpen">审批</el-button> | ||||
|             <el-button @click="handleApprovalRecord" type="primary" v-if="processInstanceId">流程进度</el-button> | ||||
|           </div> | ||||
|           <div> | ||||
|             <el-button style="float: right" @click="goBack()">返回</el-button> | ||||
|           </div> | ||||
|         </div> | ||||
|     </el-card> | ||||
|     <el-card shadow="never" style="height: 78vh;overflow-y: auto;"> | ||||
|       <el-form ref="leaveFormRef" :disabled="routeParams.type ==='view'" v-loading="loading" :model="form" :rules="rules" label-width="80px"> | ||||
|         <el-form-item label="请假类型" prop="leaveType"> | ||||
|           <el-select v-model="form.leaveType" placeholder="请选择请假类型" style="width: 100%"> | ||||
| @ -225,12 +223,13 @@ const goBack = () => { | ||||
| } | ||||
| //审批 | ||||
| const approvalVerifyOpen = async () => { | ||||
|   submitVerifyRef.value.openDialog(proxy.$route.query.taskId); | ||||
|   submitVerifyRef.value.openDialog(routeParams.value.taskId); | ||||
| }; | ||||
| onMounted(() => { | ||||
|   nextTick(async () => { | ||||
|       routeParams.value = proxy?.$route.params | ||||
|       routeParams.value = proxy.$route.query | ||||
|       reset(); | ||||
|       loading.value = false | ||||
|       if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') { | ||||
|         getInfo() | ||||
|       } | ||||
|  | ||||
| @ -350,7 +350,11 @@ const handleView = (row) => { | ||||
|   if(row.wfFormDefinitionVo){ | ||||
|     proxy.$tab.closePage(proxy.$route); | ||||
|     proxy.$router.push({ | ||||
|       path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view` | ||||
|       path: `${row.wfFormDefinitionVo.path}`, | ||||
|       query: { | ||||
|         id: row.businessKey, | ||||
|         type: 'view' | ||||
|       } | ||||
|     }) | ||||
|   }else{ | ||||
|     proxy?.$modal.msgError('请到流程定义菜单配置路由!'); | ||||
|  | ||||
| @ -263,7 +263,11 @@ const handleView = (row) => { | ||||
|   if(row.wfFormDefinitionVo){ | ||||
|     proxy.$tab.closePage(proxy.$route); | ||||
|     proxy.$router.push({ | ||||
|       path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view` | ||||
|       path: `${row.wfFormDefinitionVo.path}`, | ||||
|       query: { | ||||
|         id: row.businessKey, | ||||
|         type: 'view' | ||||
|       } | ||||
|     }) | ||||
|   }else{ | ||||
|     proxy?.$modal.msgError('请到流程定义菜单配置路由!'); | ||||
|  | ||||
| @ -253,7 +253,11 @@ const handleOpen = async (row,type) => { | ||||
|   if(row.wfFormDefinitionVo){ | ||||
|     proxy.$tab.closePage(proxy.$route); | ||||
|     proxy.$router.push({ | ||||
|       path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/${type}` | ||||
|       path: `${row.wfFormDefinitionVo.path}`, | ||||
|       query: { | ||||
|         id: row.businessKey, | ||||
|         type: type | ||||
|       } | ||||
|     }) | ||||
|   }else{ | ||||
|     proxy?.$modal.msgError('请到流程定义菜单配置路由!'); | ||||
|  | ||||
| @ -130,7 +130,11 @@ const handleView = (row) => { | ||||
|   if(row.wfFormDefinitionVo){ | ||||
|     proxy.$tab.closePage(proxy.$route); | ||||
|     proxy.$router.push({ | ||||
|       path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view` | ||||
|       path: `${row.wfFormDefinitionVo.path}`, | ||||
|       query: { | ||||
|         id: row.businessKey, | ||||
|         type: 'view' | ||||
|       } | ||||
|     }) | ||||
|   }else{ | ||||
|     proxy?.$modal.msgError('请到流程定义菜单配置路由!'); | ||||
|  | ||||
| @ -117,7 +117,11 @@ const handleView = (row) => { | ||||
|   if(row.wfFormDefinitionVo){ | ||||
|     proxy.$tab.closePage(proxy.$route); | ||||
|     proxy.$router.push({ | ||||
|       path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/view` | ||||
|       path: `${row.wfFormDefinitionVo.path}`, | ||||
|       query: { | ||||
|         id: row.businessKey, | ||||
|         type: 'view' | ||||
|       } | ||||
|     }) | ||||
|   }else{ | ||||
|     proxy?.$modal.msgError('请到流程定义菜单配置路由!'); | ||||
|  | ||||
| @ -138,8 +138,10 @@ const handleOpen = async (row: TaskVO) => { | ||||
|   if(row.wfFormDefinitionVo){ | ||||
|     proxy.$tab.closePage(proxy.$route); | ||||
|     proxy.$router.push({ | ||||
|       path: `${row.wfFormDefinitionVo.path}/${row.businessKey}/approval`, | ||||
|       path: `${row.wfFormDefinitionVo.path}`, | ||||
|       query: { | ||||
|         id: row.businessKey, | ||||
|         type: 'approval', | ||||
|         taskId: row.id | ||||
|       } | ||||
|     }) | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 gssong
					gssong