Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1e19b78512
@ -48,6 +48,13 @@ export const QjglApi = {
|
||||
deleteQjgl: async (id: number) => {
|
||||
return await request.delete({ url: `/home/qjgl/delete?id=` + id })
|
||||
},
|
||||
saveDraft: async (data: QjglVO) => {
|
||||
return await request.post({ url: `/home/qjgl/saveDraft`, data })
|
||||
},
|
||||
// 查询草稿
|
||||
getQjglDraft: async (params: any) => {
|
||||
return await request.get({ url: `/home/qjgl/draft`, params })
|
||||
},
|
||||
|
||||
// 导出请假管理 Excel
|
||||
exportQjgl: async (params) => {
|
||||
|
@ -93,18 +93,10 @@
|
||||
<el-input v-model="formData.reason" type="textarea" placeholder="请输入请假原因" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!-- <el-form>-->
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <template #footer>-->
|
||||
<!-- <el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>-->
|
||||
<!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </Dialog>-->
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">提交审批</el-button>
|
||||
<el-button @click="saveDraft" type="warning" :disabled="draftButton">存为草稿</el-button>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
@ -116,7 +108,6 @@ import * as DefinitionApi from '@/api/bpm/definition'
|
||||
import * as UserApi from '@/api/system/user'
|
||||
import {useTagsViewStore} from "@/store/modules/tagsView";
|
||||
import {getUserProfile, ProfileVO} from "@/api/system/user/profile";
|
||||
import {DeptVO, getDept} from "@/api/system/dept";
|
||||
import {FormProcessMappingApi} from "@/api/bpm/formprocessmapping";
|
||||
import {CalendarApi, CalendarVO} from "@/api/home/calendar";
|
||||
import {NjglApi, NjglVO} from "@/api/home/njgl";
|
||||
@ -130,6 +121,7 @@ const { push, currentRoute } = useRouter() // 路由
|
||||
// const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
// const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const draftButton = ref(false)
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
id: undefined,
|
||||
@ -214,23 +206,7 @@ const formRef = ref() // 表单 Ref
|
||||
const userInfo = ref('')
|
||||
// const deptInfo = ref({} as DeptVO )
|
||||
const deptInfo = ref('')
|
||||
/** 打开弹窗 */
|
||||
// const open = async (type: string, id?: number) => {
|
||||
// dialogVisible.value = true
|
||||
// dialogTitle.value = t('action.' + type)
|
||||
// formType.value = type
|
||||
// resetForm()
|
||||
// // 修改时,设置数据
|
||||
// if (id) {
|
||||
// formLoading.value = true
|
||||
// try {
|
||||
// formData.value = await QjglApi.getQjgl(id)
|
||||
// } finally {
|
||||
// formLoading.value = false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
const getUserInfo = async () => {
|
||||
const users = await getUserProfile()
|
||||
if (formData.value.deptId == ''||formData.value.deptId == undefined){
|
||||
@ -287,6 +263,25 @@ const queryParamsNjgl = reactive({
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const saveDraft = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as QjglVO
|
||||
|
||||
await QjglApi.saveDraft(data)
|
||||
message.success(t('存为草稿成功!'))
|
||||
// 关闭当前 Tab
|
||||
delView(unref(currentRoute))
|
||||
await push({ name: 'Qjglindex' })
|
||||
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
|
||||
}
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
@ -327,10 +322,14 @@ const submitForm = async () => {
|
||||
data.startUserSelectAssignees = startUserSelectAssignees.value
|
||||
}
|
||||
|
||||
const curFullPath = currentRoute.value.fullPath
|
||||
let curFullPath = currentRoute.value.fullPath
|
||||
if( curFullPath ) {
|
||||
data.curfullpath = curFullPath
|
||||
}
|
||||
|
||||
if (curFullPath.includes("?")) {
|
||||
curFullPath = curFullPath.split("?")[0];
|
||||
}
|
||||
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
|
||||
if ( processKey) {
|
||||
data.processDefinitionKey = processKey
|
||||
@ -387,9 +386,22 @@ const resetForm = () => {
|
||||
}
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getUserInfo()
|
||||
// await getKnowtypeTree()
|
||||
const curFullPath = currentRoute.value.fullPath
|
||||
await getUserInfo()
|
||||
let curFullPath = currentRoute.value.fullPath
|
||||
|
||||
if (curFullPath.includes("?")) {
|
||||
// 使用 URLSearchParams 提取查询参数
|
||||
const params = new URLSearchParams(curFullPath.split("?")[1]);
|
||||
const id = params.get("id") ;
|
||||
// 获取路径部分
|
||||
curFullPath = curFullPath.split("?")[0];
|
||||
//console.log("Path:", curFullPath);
|
||||
//console.log("id:", id);
|
||||
if ( id != "") {
|
||||
formData.value = await QjglApi.getQjgl(Number( id) )
|
||||
draftButton.value= true
|
||||
}
|
||||
}
|
||||
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
|
||||
|
||||
if ( !processKey ) {
|
||||
|
@ -1,70 +1,88 @@
|
||||
<template>
|
||||
<el-card shadow="never" >
|
||||
<template #header>
|
||||
<span style="font-size: 16px">创建请假管理流程</span>
|
||||
</template>
|
||||
<!-- <Dialog :title="dialogTitle" v-model="dialogVisible">-->
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
ref="formRef"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="100px"
|
||||
v-loading="formLoading"
|
||||
>
|
||||
<el-form-item label="请假标题" prop="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入请假标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假原因" prop="reason">
|
||||
<el-input v-model="formData.reason" placeholder="请输入请假原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="请假类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择请假类型">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
type="date"
|
||||
value-format="x"
|
||||
placeholder="选择结束时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="请假天数" prop="day">
|
||||
<el-input v-model="formData.day" placeholder="请输入请假天数" />
|
||||
</el-form-item>
|
||||
<el-form-item label="文件路径" prop="filePath">
|
||||
<el-input v-model="formData.filePath" placeholder="请输入文件路径" />
|
||||
</el-form-item>
|
||||
<el-form-item label="作者" prop="userName">
|
||||
<el-input v-model="formData.userName" placeholder="请输入作者" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部门id" prop="deptId">
|
||||
<el-input v-model="formData.deptId" placeholder="请输入部门id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程实例的编号" prop="processInstanceId">
|
||||
<el-input v-model="formData.processInstanceId" placeholder="请输入流程实例的编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人的用户编号" prop="userId">
|
||||
<el-input v-model="formData.userId" placeholder="请输入申请人的用户编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="审批状态" prop="status">
|
||||
<el-input v-model="formData.status" placeholder="请输入审批状态" />
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="请假标题" prop="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入请假标题" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="起草人" prop="userName">
|
||||
<el-input v-model="formData.userName" placeholder="请输入起草人" readonly/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<el-input v-model="formData.deptId" placeholder="请输入部门信息" v-show="false" />
|
||||
<!-- <div class="pull-left" v-show="true" v-if="userInfo?.dept">{{ userInfo?.dept.name }} </div>-->
|
||||
<!-- <div class="pull-left" v-show="true" v-if="deptInfo">{{ deptInfo }} </div>-->
|
||||
<el-input v-model="formData.deptName" placeholder="请输入部门信息" readonly/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开始时间" prop="startTime">
|
||||
<el-date-picker
|
||||
v-model="formData.startTime"
|
||||
type="datetime"
|
||||
value-format="x"
|
||||
placeholder="选择开始时间"
|
||||
@change="getDay()"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结束时间" prop="endTime">
|
||||
<el-date-picker
|
||||
v-model="formData.endTime"
|
||||
type="datetime"
|
||||
value-format="x"
|
||||
placeholder="选择结束时间"
|
||||
@change="getDay()"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="请假类型" prop="type">
|
||||
<el-select v-model="formData.type" placeholder="请选择请假类型">
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="请假天数" prop="day">
|
||||
<el-input v-model="formData.day" placeholder="请输入请假天数" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="请假原因" prop="reason">
|
||||
<el-input v-model="formData.reason" type="textarea" placeholder="请输入请假原因" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<!-- <template #footer>-->
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </Dialog>-->
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">提交审批</el-button>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
@ -109,23 +127,6 @@ const formRules = reactive({
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
// const open = async (type: string, id?: number) => {
|
||||
// dialogVisible.value = true
|
||||
// dialogTitle.value = t('action.' + type)
|
||||
// formType.value = type
|
||||
// resetForm()
|
||||
// // 修改时,设置数据
|
||||
// if (id) {
|
||||
// formLoading.value = true
|
||||
// try {
|
||||
// formData.value = await QjglApi.getQjgl(id)
|
||||
// } finally {
|
||||
// formLoading.value = false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
//flow begin++++++++++++++++++++
|
||||
// 指定审批人
|
@ -177,6 +177,7 @@
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<!-- <el-table-column label="id" align="center" prop="id" />-->
|
||||
<el-table-column label="序号" align="center" type="index" width="55" />
|
||||
<el-table-column label="请假标题" align="center" prop="title" />
|
||||
<!-- <el-table-column label="请假原因" align="center" prop="reason" />-->
|
||||
<el-table-column label="请假类型" align="center" prop="type">
|
||||
@ -313,7 +314,7 @@ const getList = async () => {
|
||||
total.value = data.total
|
||||
|
||||
// 加载部门树
|
||||
deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
//deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
|
322
src/views/Home/qjgl/indexDraft.vue
Normal file
322
src/views/Home/qjgl/indexDraft.vue
Normal file
@ -0,0 +1,322 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="请假标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入请假标题"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="请假类型" prop="type">
|
||||
<el-select
|
||||
v-model="queryParams.type"
|
||||
placeholder="请选择请假类型"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_OA_LEAVE_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="起草人" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入起草人"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="归属部门" prop="deptId">
|
||||
<el-tree-select
|
||||
v-model="queryParams.deptId"
|
||||
:data="deptList"
|
||||
:props="defaultProps"
|
||||
check-strictly
|
||||
node-key="id"
|
||||
class="!w-240px"
|
||||
placeholder="请选择归属部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.createTime"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="primary"-->
|
||||
<!-- plain-->
|
||||
<!-- @click="handleCreate()"-->
|
||||
<!-- v-hasPermi="['home:qjgl:create']"-->
|
||||
<!-- >-->
|
||||
<!-- <Icon icon="ep:plus" class="mr-5px" /> 发起请假-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['home:qjgl:export']"
|
||||
>
|
||||
<Icon icon="ep:download" class="mr-5px" /> 导出
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap>
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<!-- <el-table-column label="id" align="center" prop="id" />-->
|
||||
<el-table-column label="序号" align="center" type="index" width="55" />
|
||||
<el-table-column label="请假标题" align="center" prop="title" />
|
||||
<!-- <el-table-column label="请假原因" align="center" prop="reason" />-->
|
||||
<el-table-column label="请假类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_OA_LEAVE_TYPE" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="开始时间"-->
|
||||
<!-- align="center"-->
|
||||
<!-- prop="startTime"-->
|
||||
<!-- :formatter="dateFormatter"-->
|
||||
<!-- width="180px"-->
|
||||
<!-- />-->
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="结束时间"-->
|
||||
<!-- align="center"-->
|
||||
<!-- prop="endTime"-->
|
||||
<!-- :formatter="dateFormatter"-->
|
||||
<!-- width="180px"-->
|
||||
<!-- />-->
|
||||
<el-table-column label="请假天数" align="center" prop="day" />
|
||||
<!-- <el-table-column label="文件路径" align="center" prop="filePath" />-->
|
||||
<el-table-column label="起草人" align="center" prop="userName" />
|
||||
<el-table-column label="部门" align="center" prop="deptName" />
|
||||
<!-- <el-table-column-->
|
||||
<!-- label="创建时间"-->
|
||||
<!-- align="center"-->
|
||||
<!-- prop="createTime"-->
|
||||
<!-- :formatter="dateFormatter"-->
|
||||
<!-- width="180px"-->
|
||||
<!-- />-->
|
||||
<!-- <el-table-column label="流程实例的编号" align="center" prop="processInstanceId" />-->
|
||||
<!-- <el-table-column label="申请人的用户编号" align="center" prop="userId" />-->
|
||||
<!-- <el-table-column label="审批状态" align="center" prop="status" />-->
|
||||
<el-table-column align="center" label="审批状态" prop="status" width="120">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.BPM_TASK_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['home:qjgl:export']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- link-->
|
||||
<!-- type="danger"-->
|
||||
<!-- @click="handleProcessDetail(scope.row)"-->
|
||||
<!-- v-hasPermi="['home:qjgl:export']"-->
|
||||
<!-- >-->
|
||||
<!-- 进度-->
|
||||
<!-- </el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- link-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="openForm('update', scope.row.id)"-->
|
||||
<!-- v-hasPermi="['home:qjgl:update']"-->
|
||||
<!-- >-->
|
||||
<!-- 编辑-->
|
||||
<!-- </el-button>-->
|
||||
<el-button
|
||||
link
|
||||
type="danger"
|
||||
@click="handleDelete(scope.row.id)"
|
||||
v-hasPermi="['home:qjgl:delete']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
<!-- <QjglForm ref="formRef" @success="getList" />-->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import download from '@/utils/download'
|
||||
import { QjglApi, QjglVO } from '@/api/home/qjgl'
|
||||
import * as DeptApi from "@/api/system/dept";
|
||||
import {defaultProps, handleTree} from "@/utils/tree";
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
/** 请假管理 列表 */
|
||||
defineOptions({ name: 'Qjglindex' })
|
||||
const router = useRouter() // 路由
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<QjglVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
title: undefined,
|
||||
reason: undefined,
|
||||
type: undefined,
|
||||
startTime: [],
|
||||
endTime: [],
|
||||
day: undefined,
|
||||
filePath: undefined,
|
||||
userName: undefined,
|
||||
deptId: undefined,
|
||||
deptName: undefined,
|
||||
createTime: [],
|
||||
processInstanceId: undefined,
|
||||
userId: undefined,
|
||||
status: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await QjglApi.getQjglDraft(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
|
||||
// 加载部门树
|
||||
//deptList.value = handleTree(await DeptApi.getSimpleDeptList())
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value.resetFields()
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
/** 添加/修改操作 */
|
||||
const formRef = ref()
|
||||
const openForm = (type: string, id?: number) => {
|
||||
formRef.value.open(type, id)
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: number) => {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await QjglApi.deleteQjgl(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
// flowBegin++++++++++++++++++
|
||||
/** 添加操作 */
|
||||
const handleCreate = () => {
|
||||
router.push({ name: 'QjglCreate' })
|
||||
}
|
||||
|
||||
/** 详情操作 */
|
||||
const handleDetail = (row: QjglApi.QjglVO) => {
|
||||
router.push({
|
||||
name: 'QjglCreate',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
})
|
||||
}
|
||||
/** 审批进度 */
|
||||
const handleProcessDetail = (row) => {
|
||||
router.push({
|
||||
name: 'BpmProcessInstanceDetail',
|
||||
query: {
|
||||
id: row.processInstanceId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// fix: 列表不刷新的问题。
|
||||
watch(
|
||||
() => router.currentRoute.value,
|
||||
() => {
|
||||
getList()
|
||||
}
|
||||
)
|
||||
// flowOver++++++++++++++++++
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await QjglApi.exportQjgl(queryParams)
|
||||
download.excel(data, '请假管理.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user