-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: 【bpm】bpmn设计器: 业务表单流程添加重新发起功能 #209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,7 @@ defineOptions({ name: 'BpmOALeaveCreate' }) | |
| const message = useMessage() // 消息弹窗 | ||
| const { delView } = useTagsViewStore() // 视图操作 | ||
| const { push, currentRoute } = useRouter() // 路由 | ||
| const { query } = useRoute() // 查询参数 | ||
| const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 | ||
| const formData = ref({ | ||
|
|
@@ -190,6 +191,25 @@ const daysDifference = () => { | |
| return Math.floor(diffTime / oneDay) | ||
| } | ||
| /** 获取请假数据,用于重新发起时自动填充 */ | ||
| const getLeaveData = async (id: number) => { | ||
| formLoading.value = true | ||
| const data = await LeaveApi.getLeave(id) | ||
| if(!data){ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if (!data) { 代码排版注意下哈。 |
||
| message.error('重新发起请假失败,原因:请假数据不存在') | ||
| return | ||
| } | ||
| if (data) { | ||
| formData.value = { | ||
| type: data.type, | ||
| reason: data.reason, | ||
| startTime: data.startTime, | ||
| endTime: data.endTime | ||
| } | ||
| } | ||
| formLoading.value = false | ||
| } | ||
| /** 初始化 */ | ||
| onMounted(async () => { | ||
| // TODO @小北:这里可以简化,统一通过 getApprovalDetail 处理么? | ||
|
|
@@ -205,6 +225,11 @@ onMounted(async () => { | |
| processDefinitionId.value = processDefinitionDetail.id | ||
| startUserSelectTasks.value = processDefinitionDetail.startUserSelectTasks | ||
| // 如果有业务编号,说明是重新发起,需要加载原有数据 | ||
| if (query.id) { | ||
| await getLeaveData(Number(query.id)) | ||
| } | ||
| // 审批相关:加载最新的审批详情,主要用于节点预测 | ||
| await getApprovalDetail() | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,6 +140,15 @@ | |
| > | ||
| 取消 | ||
| </el-button> | ||
| <el-button | ||
| v-if="scope.row.status !== 1" | ||
| v-hasPermi="['bpm:oa-leave:create']" | ||
| link | ||
| type="primary" | ||
| @click="handleReInitiate(scope.row)" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 单词用 recreate 更好哈。 |
||
| > | ||
| 重新发起 | ||
| </el-button> | ||
| </template> | ||
| </el-table-column> | ||
| </el-table> | ||
|
|
@@ -206,6 +215,17 @@ const handleCreate = () => { | |
| router.push({ name: 'OALeaveCreate' }) | ||
| } | ||
| /** 重新发起操作 */ | ||
| const handleReInitiate = (row: LeaveApi.LeaveVO) => { | ||
| router.push({ | ||
| name: 'OALeaveCreate', | ||
| query: { | ||
| id: row.id, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 就传递 oldId 噶。 然后,processInstanceId 不传递。因为 oldId 可以查询到流程编号噶。 |
||
| processInstanceId: row.processInstanceId | ||
| } | ||
| }) | ||
| } | ||
| /** 详情操作 */ | ||
| const handleDetail = (row: LeaveApi.LeaveVO) => { | ||
| router.push({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
另外:流程审批界面那,应该也有个重新发起。可以也加下哈。