@@ -40,8 +40,8 @@
|
||||
type="primary"
|
||||
class="flex-1"
|
||||
plain
|
||||
:loading="submitting"
|
||||
:disabled="submitting"
|
||||
:loading="formLoading"
|
||||
:disabled="formLoading"
|
||||
@click="handleSubmit('before')"
|
||||
>
|
||||
向前加签
|
||||
@@ -49,8 +49,8 @@
|
||||
<wd-button
|
||||
type="primary"
|
||||
class="flex-1"
|
||||
:loading="submitting"
|
||||
:disabled="submitting"
|
||||
:loading="formLoading"
|
||||
:disabled="formLoading"
|
||||
@click="handleSubmit('after')"
|
||||
>
|
||||
向后加签
|
||||
@@ -84,7 +84,7 @@ definePage({
|
||||
const taskId = computed(() => props.taskId)
|
||||
const processInstanceId = computed(() => props.processInstanceId)
|
||||
const toast = useToast()
|
||||
const submitting = ref(false)
|
||||
const formLoading = ref(false)
|
||||
const formData = reactive({
|
||||
userIds: [] as number[],
|
||||
reason: '',
|
||||
@@ -104,48 +104,40 @@ function handleBack() {
|
||||
navigateBackPlus(`/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`)
|
||||
}
|
||||
|
||||
// TODO @jason:最好放在 onMounted 里?或者其他地方,有个入口方法。
|
||||
/** 初始化校验 */
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
|
||||
/** 提交操作 */
|
||||
async function handleSubmit(type: 'before' | 'after') {
|
||||
if (submitting.value) {
|
||||
if (formLoading.value) {
|
||||
return
|
||||
}
|
||||
const { valid } = await formRef.value!.validate()
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO @jason:submitting 改成 formLoading 哇?统一代码风格哈;
|
||||
submitting.value = true
|
||||
formLoading.value = true
|
||||
try {
|
||||
// TODO @jason:这里是不是不用判断 result 哈?
|
||||
const result = await signCreateTask({
|
||||
await signCreateTask({
|
||||
id: taskId.value as string,
|
||||
type,
|
||||
userIds: formData.userIds,
|
||||
reason: formData.reason,
|
||||
})
|
||||
if (result) {
|
||||
const actionText = type === 'before' ? '向前加签' : '向后加签'
|
||||
toast.success(`${actionText}成功`)
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (error) {
|
||||
// TODO @jason:可以不用这里的 catch 哈?
|
||||
const actionText = type === 'before' ? '向前加签' : '向后加签'
|
||||
console.error(`[add-sign] ${actionText}失败:`, error)
|
||||
toast.error(`${actionText}失败`)
|
||||
toast.success(`${actionText}成功`)
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 页面加载时 */
|
||||
onMounted(() => {
|
||||
/** 初始化校验 */
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -10,29 +10,29 @@
|
||||
|
||||
<!-- 审批表单 -->
|
||||
<view class="p-24rpx">
|
||||
<view class="overflow-hidden rounded-12rpx bg-white shadow-sm">
|
||||
<view class="p-24rpx">
|
||||
<view class="mb-16rpx text-32rpx text-[#333] font-semibold">
|
||||
审批意见
|
||||
</view>
|
||||
<wd-form ref="formRef" :model="formData" :rules="formRules">
|
||||
<wd-cell-group border>
|
||||
<!-- 审批意见 -->
|
||||
<wd-textarea
|
||||
v-model="formData.reason"
|
||||
prop="reason"
|
||||
label="审批意见:"
|
||||
label-width="180rpx"
|
||||
placeholder="请输入审批意见"
|
||||
:maxlength="500"
|
||||
show-word-limit
|
||||
clearable
|
||||
custom-class="border border-solid border-[#e5e5e5] rounded-8rpx"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</wd-cell-group>
|
||||
</wd-form>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="mt-48rpx">
|
||||
<wd-button
|
||||
:type="isApprove ? 'primary' : 'error'"
|
||||
block
|
||||
:loading="submitting"
|
||||
:disabled="submitting"
|
||||
:loading="formLoading"
|
||||
:disabled="formLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
{{ isApprove ? '同意' : '拒绝' }}
|
||||
@@ -43,14 +43,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, reactive, ref } from 'vue'
|
||||
import type { FormInstance } from 'wot-design-uni/components/wd-form/types'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { approveTask, rejectTask } from '@/api/bpm/task'
|
||||
import { navigateBackPlus } from '@/utils'
|
||||
|
||||
const props = defineProps<{
|
||||
id?: string | any
|
||||
pass?: string | any
|
||||
processInstanceId?: string
|
||||
taskId?: string
|
||||
pass?: string
|
||||
}>()
|
||||
|
||||
definePage({
|
||||
@@ -60,63 +62,66 @@ definePage({
|
||||
},
|
||||
})
|
||||
|
||||
const taskId = computed(() => props.id || '')
|
||||
const taskId = computed(() => props.taskId || '')
|
||||
const processInstanceId = computed(() => props.processInstanceId)
|
||||
const isPass = computed(() => props.pass !== 'false') // true: 同意, false: 拒绝
|
||||
const toast = useToast()
|
||||
const submitting = ref(false)
|
||||
const formLoading = ref(false)
|
||||
const formData = reactive({
|
||||
reason: '',
|
||||
})
|
||||
|
||||
const formRules = {
|
||||
reason: [
|
||||
{ required: true, message: '审批意见不能为空' },
|
||||
],
|
||||
}
|
||||
|
||||
const formRef = ref<FormInstance>()
|
||||
|
||||
/** 是否为同意操作 */
|
||||
const isApprove = computed(() => isPass.value)
|
||||
|
||||
/** 返回上一页 */
|
||||
function handleBack() {
|
||||
navigateBackPlus(`/pages-bpm/processInstance/detail/index?id=${taskId.value}`)
|
||||
}
|
||||
|
||||
/** 初始化校验 */
|
||||
if (!props.id) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
|
||||
/** 校验表单 */
|
||||
function validateForm() {
|
||||
if (!formData.reason.trim()) {
|
||||
toast.show('请输入审批意见')
|
||||
return false
|
||||
}
|
||||
return true
|
||||
navigateBackPlus(`/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`)
|
||||
}
|
||||
|
||||
/** 提交审批 */
|
||||
async function handleSubmit() {
|
||||
// TODO @jason:看看是不是要用原生的校验
|
||||
if (submitting.value) {
|
||||
return
|
||||
}
|
||||
if (!validateForm()) {
|
||||
if (formLoading.value) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO @jason:要不换成 formLoading?保持项目统一;
|
||||
submitting.value = true
|
||||
// 使用 wd-form 的校验方法
|
||||
const { valid } = await formRef.value!.validate()
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
|
||||
formLoading.value = true
|
||||
try {
|
||||
const api = isApprove.value ? approveTask : rejectTask
|
||||
// TODO @jason:这里看看不用 result
|
||||
const result = await api({
|
||||
await api({
|
||||
id: taskId.value as string,
|
||||
reason: formData.reason,
|
||||
})
|
||||
if (result) {
|
||||
toast.success('审批成功')
|
||||
setTimeout(() => {
|
||||
handleBack()
|
||||
}, 1500)
|
||||
}
|
||||
toast.success('审批成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 1000)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 页面加载时 */
|
||||
onMounted(() => {
|
||||
/** 初始化校验 */
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -52,7 +52,6 @@ import type { Action } from 'wot-design-uni/components/wd-action-sheet/types'
|
||||
import type { ButtonType } from 'wot-design-uni/components/wd-button/types'
|
||||
import type { ProcessInstance } from '@/api/bpm/processInstance'
|
||||
import type { Task } from '@/api/bpm/task'
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { useUserStore } from '@/store'
|
||||
import {
|
||||
BpmProcessInstanceStatus,
|
||||
@@ -198,10 +197,10 @@ function init(theProcessInstance: ProcessInstance, task: Task) {
|
||||
function handleOperation(operationType: number) {
|
||||
switch (operationType) {
|
||||
case BpmTaskOperationButtonTypeEnum.APPROVE:
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?id=${runningTask.value.id}&pass=true` })
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?processInstanceId=${processInstance.value.id}&taskId=${runningTask.value?.id}&pass=true` })
|
||||
break
|
||||
case BpmTaskOperationButtonTypeEnum.REJECT:
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?id=${runningTask.value.id}&pass=false` })
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?processInstanceId=${processInstance.value.id}&taskId=${runningTask.value?.id}&pass=false` })
|
||||
break
|
||||
case BpmTaskOperationButtonTypeEnum.DELEGATE:
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
<wd-button
|
||||
type="primary"
|
||||
block
|
||||
:loading="submitting"
|
||||
:disabled="submitting"
|
||||
:loading="formLoading"
|
||||
:disabled="formLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
减签
|
||||
@@ -75,7 +75,7 @@ definePage({
|
||||
const taskId = computed(() => props.taskId)
|
||||
const processInstanceId = computed(() => props.processInstanceId)
|
||||
const toast = useToast()
|
||||
const submitting = ref(false)
|
||||
const formLoading = ref(false)
|
||||
const taskOptions = ref<any[]>([])
|
||||
const formData = reactive({
|
||||
deleteSignTaskId: '',
|
||||
@@ -96,12 +96,6 @@ function handleBack() {
|
||||
navigateBackPlus(`/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`)
|
||||
}
|
||||
|
||||
/** 初始化校验 */
|
||||
// TODO @jason:最好放在 onMounted 里?或者其他地方,有个入口方法。
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
|
||||
/** 获取减签人员标签 */
|
||||
function getDeleteSignUserLabel(task: any): string {
|
||||
const deptName = task?.assigneeUser?.deptName || task?.ownerUser?.deptName
|
||||
@@ -111,37 +105,30 @@ function getDeleteSignUserLabel(task: any): string {
|
||||
|
||||
/** 获取可减签的任务列表 */
|
||||
async function loadDeleteSignTaskList() {
|
||||
try {
|
||||
let childTasks = []
|
||||
// TODO @jason:这里应该是从 props 里获取?
|
||||
// 从 URL 参数中获取子任务数据
|
||||
if (props.children) {
|
||||
try {
|
||||
childTasks = JSON.parse(decodeURIComponent(props.children))
|
||||
} catch (parseError) {
|
||||
console.error('[delete-sign] 解析子任务数据失败:', parseError)
|
||||
}
|
||||
let childTasks = []
|
||||
// 从 props 中获取子任务数据
|
||||
if (props.children) {
|
||||
try {
|
||||
childTasks = JSON.parse(decodeURIComponent(props.children))
|
||||
} catch (parseError) {
|
||||
console.error('[delete-sign] 解析子任务数据失败:', parseError)
|
||||
}
|
||||
// 提示没有子任务数据
|
||||
if (childTasks.length === 0) {
|
||||
toast.show('没有可减签的任务')
|
||||
return
|
||||
}
|
||||
|
||||
taskOptions.value = childTasks.map(task => ({
|
||||
id: task.id,
|
||||
label: getDeleteSignUserLabel(task),
|
||||
}))
|
||||
} catch (error) {
|
||||
// TODO @jason:这里不用 try catch 哈
|
||||
console.error('[delete-sign] 获取可减签任务失败:', error)
|
||||
toast.error('获取可减签任务失败')
|
||||
}
|
||||
// 提示没有子任务数据
|
||||
if (childTasks.length === 0) {
|
||||
toast.show('没有可减签的任务')
|
||||
return
|
||||
}
|
||||
|
||||
taskOptions.value = childTasks.map(task => ({
|
||||
id: task.id,
|
||||
label: getDeleteSignUserLabel(task),
|
||||
}))
|
||||
}
|
||||
|
||||
/** 提交操作 */
|
||||
async function handleSubmit() {
|
||||
if (submitting.value) {
|
||||
if (formLoading.value) {
|
||||
return
|
||||
}
|
||||
const { valid } = await formRef.value!.validate()
|
||||
@@ -149,33 +136,30 @@ async function handleSubmit() {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO @jason:submitting 改成 formLoading 哇?统一代码风格哈;
|
||||
submitting.value = true
|
||||
formLoading.value = true
|
||||
try {
|
||||
// TODO @jason:这里是不是不用判断 result 哈?
|
||||
const result = await signDeleteTask({
|
||||
await signDeleteTask({
|
||||
id: formData.deleteSignTaskId,
|
||||
reason: formData.reason,
|
||||
})
|
||||
if (result) {
|
||||
toast.success('减签成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (error) {
|
||||
// TODO @jason:可以不用这里的 catch 哈?
|
||||
console.error('[delete-sign] 减签失败:', error)
|
||||
toast.error('减签失败')
|
||||
toast.success('减签成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 页面加载时,获取可减签任务列表 */
|
||||
onMounted(() => {
|
||||
/** 初始化校验 */
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
return
|
||||
}
|
||||
loadDeleteSignTaskList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
<wd-button
|
||||
type="primary"
|
||||
block
|
||||
:loading="submitting"
|
||||
:disabled="submitting"
|
||||
:loading="formLoading"
|
||||
:disabled="formLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
确认取消
|
||||
@@ -71,7 +71,7 @@ definePage({
|
||||
const processInstanceId = computed(() => props.processInstanceId)
|
||||
const taskId = computed(() => props.taskId)
|
||||
const toast = useToast()
|
||||
const submitting = ref(false)
|
||||
const formLoading = ref(false)
|
||||
const formData = reactive({
|
||||
cancelReason: '',
|
||||
})
|
||||
@@ -90,43 +90,37 @@ function handleBack() {
|
||||
navigateBackPlus(backUrl)
|
||||
}
|
||||
|
||||
/** 初始化校验 */
|
||||
if (!props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
|
||||
/** 提交操作 */
|
||||
async function handleSubmit() {
|
||||
if (submitting.value) {
|
||||
if (formLoading.value) {
|
||||
return
|
||||
}
|
||||
const { valid } = await formRef.value!.validate()
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO @jason:最好放在 onMounted 里?或者其他地方,有个入口方法。
|
||||
submitting.value = true
|
||||
formLoading.value = true
|
||||
try {
|
||||
// TODO @jason:不判断 result 可以哇?
|
||||
const result = await cancelProcessInstanceByStartUser(
|
||||
await cancelProcessInstanceByStartUser(
|
||||
processInstanceId.value,
|
||||
formData.cancelReason,
|
||||
)
|
||||
if (result) {
|
||||
toast.success('流程取消成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (error) {
|
||||
// TODO @jason:错误处理,这里可以去掉哈。
|
||||
console.error('[process-cancel] 取消流程失败:', error)
|
||||
toast.error('取消流程失败')
|
||||
toast.success('流程取消成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 页面加载时 */
|
||||
onMounted(() => {
|
||||
/** 初始化校验 */
|
||||
if (!props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -95,12 +95,6 @@ function handleBack() {
|
||||
navigateBackPlus(`/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`)
|
||||
}
|
||||
|
||||
/** 初始化校验 */
|
||||
// TODO @jason:最好放在 onMounted 里?或者其他地方,有个入口方法。
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
|
||||
/** 提交操作 */
|
||||
async function handleSubmit() {
|
||||
if (submitting.value) {
|
||||
@@ -118,33 +112,33 @@ async function handleSubmit() {
|
||||
id: taskId.value as string,
|
||||
reason: formData.reason,
|
||||
}
|
||||
// todo @jason:这里是不是不用判断 result 哈?
|
||||
let result: boolean
|
||||
if (isDelegate.value) {
|
||||
result = await delegateTask({
|
||||
await delegateTask({
|
||||
...data,
|
||||
delegateUserId: String(formData.userId),
|
||||
})
|
||||
} else {
|
||||
result = await transferTask({
|
||||
await transferTask({
|
||||
...data,
|
||||
assigneeUserId: String(formData.userId),
|
||||
})
|
||||
}
|
||||
if (result) {
|
||||
toast.success(`${isDelegate.value ? '委派' : '转办'}成功`)
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (error) {
|
||||
// TODO @jason:可以不用这里的 catch 哈?
|
||||
console.error(`[reassign] ${isDelegate.value ? '委派' : '转办'}失败:`, error)
|
||||
toast.error(`${isDelegate.value ? '委派' : '转办'}失败`)
|
||||
toast.success(`${isDelegate.value ? '委派' : '转办'}成功`)
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 页面加载时 */
|
||||
onMounted(() => {
|
||||
/** 初始化校验 */
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -94,25 +94,10 @@ function handleBack() {
|
||||
navigateBackPlus(`/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`)
|
||||
}
|
||||
|
||||
/** 初始化校验 */
|
||||
// TODO @jason:最好放在 onMounted 里?或者其他地方,有个入口方法。
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
}
|
||||
|
||||
/** 获取可退回的节点列表 */
|
||||
async function loadReturnTaskList() {
|
||||
try {
|
||||
const result = await getTaskListByReturn(taskId.value)
|
||||
// TODO @jason:这个判断可以考虑去掉哈。
|
||||
if (result && Array.isArray(result)) {
|
||||
activityOptions.value = result
|
||||
}
|
||||
} catch (error) {
|
||||
// TODO @jason:错误处理,这里可以去掉哈。
|
||||
console.error('[return] 获取可退回节点失败:', error)
|
||||
toast.error('获取可退回节点失败')
|
||||
}
|
||||
const result = await getTaskListByReturn(taskId.value)
|
||||
activityOptions.value = result
|
||||
}
|
||||
|
||||
/** 提交操作 */
|
||||
@@ -124,28 +109,21 @@ async function handleSubmit() {
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
|
||||
// TODO @jason:submitting 改成 formLoading 哇?统一代码风格哈;
|
||||
submitting.value = true
|
||||
try {
|
||||
// TODO @jason:这里是不是不用判断 result 哈?
|
||||
const result = await returnTask({
|
||||
await returnTask({
|
||||
id: taskId.value as string,
|
||||
targetTaskDefinitionKey: formData.targetActivityId,
|
||||
reason: formData.reason,
|
||||
})
|
||||
if (result) {
|
||||
toast.success('退回成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
}
|
||||
} catch (error) {
|
||||
// TODO @jason:可以不用这里的 catch 哈?
|
||||
console.error('[return] 退回失败:', error)
|
||||
toast.error('退回失败')
|
||||
|
||||
toast.success('退回成功')
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages-bpm/processInstance/detail/index?id=${processInstanceId.value}&taskId=${taskId.value}`,
|
||||
})
|
||||
}, 500)
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
@@ -153,6 +131,11 @@ async function handleSubmit() {
|
||||
|
||||
/** 页面加载时获取可退回节点列表 */
|
||||
onMounted(() => {
|
||||
/** 初始化校验 */
|
||||
if (!props.taskId || !props.processInstanceId) {
|
||||
toast.show('参数错误')
|
||||
return
|
||||
}
|
||||
loadReturnTaskList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -123,12 +123,12 @@ function handleDetail(item: Task) {
|
||||
|
||||
/** 同意 */
|
||||
function handleApprove(item: Task) {
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?id=${item.id}&pass=true` })
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?processInstanceId=${item.processInstance.id}&taskId=${item.id}&pass=true` })
|
||||
}
|
||||
|
||||
/** 拒绝 */
|
||||
function handleReject(item: Task) {
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?id=${item.id}&pass=false` })
|
||||
uni.navigateTo({ url: `/pages-bpm/processInstance/detail/audit/index?processInstanceId=${item.processInstance.id}&taskId=${item.id}&pass=false` })
|
||||
}
|
||||
|
||||
/** 触底加载更多 */
|
||||
|
||||
Reference in New Issue
Block a user