会议草稿内容
This commit is contained in:
parent
c67d05f72b
commit
56336a7b8c
@ -63,4 +63,12 @@ export const HyglApi = {
|
||||
exportHygl: async (params) => {
|
||||
return await request.download({ url: `/home/hygl/export-excel`, params })
|
||||
},
|
||||
// 保存为草稿
|
||||
saveDraft: async (data: HyglVO) => {
|
||||
return await request.post({ url: `/home/hygl/saveDraft`, data })
|
||||
},
|
||||
// 查询草稿
|
||||
getDraft: async (params: any) => {
|
||||
return await request.get({ url: `/home/hygl/draft`, params })
|
||||
},
|
||||
}
|
||||
|
265
src/views/Home/hynr/draft/indexDraftHygl.vue
Normal file
265
src/views/Home/hynr/draft/indexDraftHygl.vue
Normal file
@ -0,0 +1,265 @@
|
||||
<template>
|
||||
<ContentWrap>
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
class="-mb-15px"
|
||||
:model="queryParams"
|
||||
ref="queryFormRef"
|
||||
:inline="true"
|
||||
label-width="100px"
|
||||
>
|
||||
<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.HYGL_TYPE)"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="会议主题" prop="theme">
|
||||
<el-input
|
||||
v-model="queryParams.theme"
|
||||
placeholder="请输入会议主题"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="持续时间" prop="duration">
|
||||
<el-input
|
||||
v-model="queryParams.duration"
|
||||
placeholder="请输入持续时间"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会议室名字" prop="roomName">
|
||||
<el-input
|
||||
v-model="queryParams.roomName"
|
||||
placeholder="请输入会议室名字"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="组织者" prop="organizer">
|
||||
<el-input
|
||||
v-model="queryParams.organizer"
|
||||
placeholder="请输入组织者"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
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="success"
|
||||
plain
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['home:hygl: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="序号" align="center" type="index" width="70" />
|
||||
<el-table-column label="会议标题" align="center" prop="title" />
|
||||
<el-table-column
|
||||
label="申请时间"
|
||||
align="center"
|
||||
prop="time"
|
||||
:formatter="dateFormatter2"
|
||||
width="180px"
|
||||
/>
|
||||
<el-table-column label="会议类型" align="center" prop="type">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.HYGL_TYPE" :value="scope.row.type" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="开始时间"
|
||||
align="center"
|
||||
prop="startDate"
|
||||
:formatter="dateFormatter2"
|
||||
width="100px"
|
||||
/>
|
||||
<el-table-column
|
||||
label="结束时间"
|
||||
align="center"
|
||||
prop="endDate"
|
||||
:formatter="dateFormatter2"
|
||||
width="100px"
|
||||
/>
|
||||
<el-table-column label="组织者" align="center" prop="organizer" />
|
||||
<el-table-column label="参会人数" align="center" prop="number" />
|
||||
<el-table-column label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPermi="['home:clgl:update']"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNo"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</ContentWrap>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter2} from '@/utils/formatTime'
|
||||
import download from '@/utils/download'
|
||||
import { HyglApi, HyglVO } from '@/api/home/hygl'
|
||||
import * as LeaveApi from '@/api/bpm/leave'
|
||||
|
||||
/** 会议管理 列表 */
|
||||
defineOptions({ name: 'Hygl' })
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
|
||||
const loading = ref(true) // 列表的加载中
|
||||
const list = ref<HyglVO[]>([]) // 列表的数据
|
||||
const total = ref(0) // 列表的总页数
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
title: undefined,
|
||||
userName: undefined,
|
||||
userId: undefined,
|
||||
deptName: undefined,
|
||||
deptId: undefined,
|
||||
time: [],
|
||||
depict: undefined,
|
||||
type: undefined,
|
||||
theme: undefined,
|
||||
target: undefined,
|
||||
startDate: [],
|
||||
endDate: [],
|
||||
duration: undefined,
|
||||
roomId: undefined,
|
||||
roomName: undefined,
|
||||
roomAddress: undefined,
|
||||
organizer: undefined,
|
||||
speaker: undefined,
|
||||
meetingTaker: undefined,
|
||||
number: undefined,
|
||||
equipmentList: undefined,
|
||||
network: undefined,
|
||||
status: undefined,
|
||||
processInstanceId: undefined,
|
||||
createTime: [],
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
||||
/** 详情操作 */
|
||||
const handleDetail = (row: LeaveApi.LeaveVO) => {
|
||||
router.push({
|
||||
name: 'HyglCreate',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const router = useRouter() // 路由
|
||||
|
||||
// fix: 列表不刷新的问题。
|
||||
watch(
|
||||
() => router.currentRoute.value,
|
||||
() => {
|
||||
getList()
|
||||
}
|
||||
)
|
||||
|
||||
/** 查询列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await HyglApi.getDraft(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
} 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 HyglApi.deleteHygl(id)
|
||||
// message.success(t('common.delSuccess'))
|
||||
// // 刷新列表
|
||||
// await getList()
|
||||
// } catch {}
|
||||
// }
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = async () => {
|
||||
try {
|
||||
// 导出的二次确认
|
||||
await message.exportConfirm()
|
||||
// 发起导出
|
||||
exportLoading.value = true
|
||||
const data = await HyglApi.exportHygl(queryParams)
|
||||
download.excel(data, '会议管理.xls')
|
||||
} catch {
|
||||
} finally {
|
||||
exportLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 初始化 **/
|
||||
onMounted(() => {
|
||||
getList()
|
||||
})
|
||||
</script>
|
@ -153,6 +153,7 @@
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="submitForm" type="primary" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="saveDraft" type="warning" :disabled="draftButton">存为草稿</el-button>
|
||||
</template>
|
||||
</el-card>
|
||||
</template>
|
||||
@ -260,6 +261,24 @@
|
||||
userInfo.value = formData.value.userName ?? '';
|
||||
};
|
||||
|
||||
const draftButton = ref(false)
|
||||
const saveDraft = async () => {
|
||||
// 校验表单
|
||||
await formRef.value.validate()
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const data = formData.value as unknown as HyglVO
|
||||
await HyglApi.saveDraft(data)
|
||||
message.success(t('存为草稿成功!'))
|
||||
// 关闭当前 Tab
|
||||
delView(unref(currentRoute))
|
||||
await push({ name: 'Hygl' })
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
@ -279,11 +298,14 @@
|
||||
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
|
||||
@ -329,8 +351,18 @@
|
||||
await getUserInfo()
|
||||
await getList()
|
||||
|
||||
const curFullPath = currentRoute.value.fullPath
|
||||
|
||||
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];
|
||||
if ( id != "") {
|
||||
formData.value = await HyglApi.getHygl(Number( id) )
|
||||
draftButton.value= true
|
||||
}
|
||||
}
|
||||
const processKey = await FormProcessMappingApi.selectProcessKey( curFullPath )
|
||||
|
||||
if ( !processKey ) {
|
||||
|
Loading…
Reference in New Issue
Block a user