This commit is contained in:
dzc committed 2025-04-08 19:07:00 +08:00
commit a7ffb58e75
7 files changed
+157 -21

No files matched your search

+9
View File
@@ -107,6 +107,15 @@ export function completeTask(param: Object) {
})
}
// 批量完成任务
export function batchCompleteTask(param: Object) {
return request({
url: "/task/task/batchCompleteTask",
method: "post",
data: param,
})
}
// 完成任务
export function transferTask(param: Object) {
return request({
+70
View File
@@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="批量审批" :width="400">
<el-input v-model="submitDesc" type="textarea" maxlength="100" :rows="5" placeholder="请输入审核意见..." show-word-limit />
<template #footer>
<el-button size="large" type="danger" icon="Close" @click="submit(0)">拒绝</el-button>
<el-button size="large" type="primary" icon="Check" @click="submit(1)">提交</el-button>
<el-button size="large" @click="visible = false">取消</el-button>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { ref } from "vue"
import { ElLoading } from "element-plus"
import { useMessage } from "/@/hooks/message"
import { batchCompleteTask } from "/@/api/flow/task"
const emit = defineEmits<{
(e: "taskSubmitEvent"): void
}>()
const visible = ref(false)
const submitDesc = ref("")
const processIds = ref<string[]>([])
const loading = ref<any>()
const openDialog = (ids: string[]) => {
submitDesc.value = ""
visible.value = true
processIds.value = ids
}
// 全屏loading
const loadingStart = () => {
loading.value = ElLoading.service({
lock: true,
text: "提交中...",
background: "rgba(0, 0, 0, 0.7)",
})
}
const submit = async (isSuccess: number) => {
const param = {
isSuccess,
processInstances: processIds.value,
taskLocalParamMap: {
approveDesc: submitDesc.value,
},
}
console.log(param)
try {
loadingStart()
const res = await batchCompleteTask(param).finally(() => loading.value.close())
if (res.code == 0) {
visible.value = false
emit("taskSubmitEvent")
useMessage().success("通过成功")
return
}
useMessage().error("通过失败")
} catch (error) {
useMessage().error("错误")
} finally {
loading.value.close()
}
}
defineExpose({ openDialog })
</script>
+9 -12
View File
@@ -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
}
@@ -75,12 +75,20 @@
<dict-tag :options="check_status" :value="row.checkStatus" />
</template>
</el-table-column>
<el-table-column prop="supplierId" label="货商" show-overflow-tooltip />
<el-table-column prop="supplierName" label="货商" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<!-- <el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />-->
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button
v-else
icon="edit-pen"
@@ -100,7 +108,14 @@
>
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
@@ -80,7 +80,15 @@
<el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button
v-else
icon="edit-pen"
@@ -100,7 +108,14 @@
>
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
@@ -80,7 +80,15 @@
<el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip />
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button
v-else
icon="edit-pen"
@@ -100,7 +108,14 @@
>
删除
</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>
+17 -2
View File
@@ -68,10 +68,25 @@
<!-- <el-table-column prop="totalAmount" label="入库总金额" show-overflow-tooltip /> -->
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button v-if="scope.row.checkStatus == '2'" icon="MessageBox" text type="success" @click="edit(scope.row)">详情</el-button>
<el-button
v-if="scope.row.checkStatus == '2' || scope.row.checkStatus == '3'"
icon="MessageBox"
text
type="success"
@click="edit(scope.row)"
>
详情
</el-button>
<el-button v-else icon="edit-pen" text type="primary" @click="edit(scope.row)">编辑</el-button>
<el-button icon="delete" text type="primary" @click="handleDelete([scope.row.id])">删除</el-button>
<el-button type="primary" size="small" v-if="scope.row.checkStatus != '2'" link icon="VideoPlay" @click="deal(scope.row)">
<el-button
type="primary"
size="small"
v-if="scope.row.checkStatus == '1' && scope.row.taskId"
link
icon="VideoPlay"
@click="deal(scope.row)"
>
开始处理
</el-button>
</template>