批量审批
This commit is contained in:
1 parent
32d60d2f62
commit
70847847d5
3 files changed
+88
-12
No files matched your search
@@ -198,6 +198,9 @@
|
||||
|
||||
<!-- 审批抽屉 -->
|
||||
<process-drawer ref="processDrawerRef" @task-submit-event="taskSubmitEvent" />
|
||||
|
||||
<!-- 批量审批对话框 -->
|
||||
<batch-deal ref="batchDealRef" @task-submit-event="taskSubmitEvent" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -214,6 +217,7 @@ import ProcessDrawer from "/@/components/processDrawer/index.vue"
|
||||
const UserForm = defineAsyncComponent(() => import("./form.vue"))
|
||||
const FaceManage = defineAsyncComponent(() => import("./face-manage.vue"))
|
||||
const PopoverInput = defineAsyncComponent(() => import("/@/components/PopoverInput/index.vue"))
|
||||
const BatchDeal = defineAsyncComponent(() => import("./batchDeal.vue"))
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -227,6 +231,7 @@ const draggableDepTreeRef = ref() // 树组件ref引用
|
||||
const activeName = ref("2")
|
||||
const tabItems = ref<any>([{}])
|
||||
const processDrawerRef = ref()
|
||||
const batchDealRef = ref()
|
||||
|
||||
// 多选rows
|
||||
const selectObjs = ref([]) as any
|
||||
@@ -284,16 +289,8 @@ const deal = (row: any) => {
|
||||
// 批量开始处理
|
||||
const doBatchDeal = () => {
|
||||
if (!selectObjs.value.length) return useMessage().warning("流程id不存在")
|
||||
const processIds = []
|
||||
for (const i of selectObjs.value) {
|
||||
for (const j of state.dataList!) {
|
||||
if (i == j.id) {
|
||||
processIds.push(j.processId)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!processIds.length) return useMessage().warning("流程id不存在")
|
||||
const processIds = selectObjs.value.filter((item: any) => item.processId).map((item: any) => item.processId)
|
||||
batchDealRef.value.openDialog(processIds)
|
||||
}
|
||||
|
||||
// 审批提交事件
|
||||
@@ -312,8 +309,8 @@ const handleSelectable = (row: any) => {
|
||||
}
|
||||
|
||||
// 多选事件
|
||||
const handleSelectionChange = (objs: { userId: string }[]) => {
|
||||
selectObjs.value = objs.map(({ userId }) => userId)
|
||||
const handleSelectionChange = (objs: { userId: string; processId: string | null }[]) => {
|
||||
selectObjs.value = objs.map(({ userId, processId }) => ({ userId, processId }))
|
||||
multiple.value = !objs.length
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user