|
@@ -1,195 +1,78 @@
|
|
|
<template>
|
|
|
- <ContentWrap>
|
|
|
- <!-- 搜索工作栏 -->
|
|
|
+ <ContentWrap v-if="id">
|
|
|
<CardTitle fontSize="16" :title="jobFairInfo.title?.replace(/<\/?p[^>]*>/gi, '')" />
|
|
|
- <el-form
|
|
|
- class="-mb-15px m-t-20px"
|
|
|
- :model="queryParams"
|
|
|
- ref="queryFormRef"
|
|
|
- :inline="true"
|
|
|
- label-width="68px"
|
|
|
- @submit.prevent
|
|
|
- >
|
|
|
- <el-form-item label="企业名称" prop="name">
|
|
|
- <el-input v-model="queryParams.name" 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="primary" :loading="exportLoading" plain @click="handleExport"><Icon icon="ep:download" class="mr-5px" /> 参加招聘会职位列表导出</el-button>
|
|
|
- <el-button type="primary" :loading="exportDeliveryLoading" plain @click="handleExportDelivery"><Icon icon="ep:download" class="mr-5px" /> 招聘会职位投递情况导出</el-button>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ <div class="mt-20px text-right">
|
|
|
+ <el-button type="primary" :loading="exportLoading" plain @click="handleExport"><Icon icon="ep:download" class="mr-5px" /> 参加招聘会职位列表导出</el-button>
|
|
|
+ <el-button type="primary" :loading="exportDeliveryLoading" plain @click="handleExportDelivery"><Icon icon="ep:download" class="mr-5px" /> 招聘会职位投递情况导出</el-button>
|
|
|
+ </div>
|
|
|
</ContentWrap>
|
|
|
|
|
|
- <!-- 列表 -->
|
|
|
- <ContentWrap>
|
|
|
- <el-tabs v-model="activeName" @tab-change="handleClick">
|
|
|
- <el-tab-pane label="白名单" name="whiteList">
|
|
|
- <div class="text-right">
|
|
|
- <el-button type="primary" plain @click="handleAdd"><Icon icon="ep:plus" class="mr-5px" /> 新增</el-button>
|
|
|
- </div>
|
|
|
- <el-table v-loading="loading" :data="list" :stripe="true">
|
|
|
- <el-table-column label="企业全称" align="center" prop="name">
|
|
|
- <template #default="scope">{{ formatName(scope.row.enterprise.name) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="企业别称" align="center" prop="anotherName">
|
|
|
- <template #default="scope">{{ formatName(scope.row.enterprise.anotherName) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-button
|
|
|
- link
|
|
|
- type="primary"
|
|
|
- @click="handleRemoveWhiteList(formatName(scope.row.enterprise.anotherName || scope.row.enterprise.name), scope.row.enterpriseId)"
|
|
|
- >
|
|
|
- 移出白名单
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <ContentWrap v-if="!id || (jobFairInfo && Object.keys(jobFairInfo).length > 0)">
|
|
|
+ <el-tabs v-model="activeName" @tab-change="handleTabChange">
|
|
|
+ <el-tab-pane label="招聘会信息" name="infoSettings">
|
|
|
+ <InfoSettings :info="jobFairInfo" :formType="id ? 'update' : 'create'" @close="handleClose" />
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="购买门票企业" name="ticketEntList">
|
|
|
- <el-table v-loading="loading" :data="list" :stripe="true">
|
|
|
- <el-table-column label="企业全称" align="center" prop="name">
|
|
|
- <template #default="scope">{{ formatName(scope.row.enterprise.name) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="企业别称" align="center" prop="anotherName">
|
|
|
- <template #default="scope">{{ formatName(scope.row.enterprise.anotherName) }}</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="权益" align="center" prop="status">
|
|
|
- <template #default="scope">
|
|
|
- <span :style="{'color': scope.row.status === '1' ? '#f56c6c' : '#67c23a' }">{{ scope.row.status === '1' ? '已禁用' : '已开启' }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
- <template #default="scope">
|
|
|
- <el-button v-if="scope.row.status === '1'" link type="primary" @click="handleEnableRights(formatName(scope.row.enterprise.anotherName || scope.row.enterprise.name), scope.row.id)">
|
|
|
- 开启权益
|
|
|
- </el-button>
|
|
|
- <el-button v-if="scope.row.status === '0'" link type="danger" @click="handleDisableRights(formatName(scope.row.enterprise.anotherName || scope.row.enterprise.name), scope.row.id)">禁用权益</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
+ <el-tab-pane v-if="id" label="类别设置" name="categorySettings">
|
|
|
+ <Category :info="jobFairInfo" :enterpriseList="enterpriseList" @close="handleClose" />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane v-if="id" label="白名单" name="whiteList">
|
|
|
+ <WhiteList ref="whiteListRef" :info="jobFairInfo" :enterpriseList="enterpriseList" />
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane v-if="id" label="门票设置" name="ticketSettings">
|
|
|
+ <TicketSettings :info="jobFairInfo" @close="handleClose" @refresh="getJobFairDetail" />
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
-
|
|
|
- <Pagination
|
|
|
- :total="total"
|
|
|
- v-model:page="queryParams.pageNo"
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
</ContentWrap>
|
|
|
-
|
|
|
- <!-- 表单弹窗:添加/修改 -->
|
|
|
- <JobFairForm ref="formRef" @success="getList" />
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { JobFairWhiteApi } from '@/api/menduner/system/jobFair/white'
|
|
|
-import JobFairForm from './jobFairForm.vue'
|
|
|
+/** 招聘会 详情 */
|
|
|
+defineOptions({ name: 'JobFairDetails' })
|
|
|
import download from '@/utils/download'
|
|
|
-import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
-import { ElMessage } from 'element-plus'
|
|
|
-import { formatName } from '@/utils'
|
|
|
import { JobFairManageApi } from '@/api/menduner/system/jobFair/manage'
|
|
|
-
|
|
|
-/** 招聘会 列表 */
|
|
|
-defineOptions({ name: 'JobFairDetails' })
|
|
|
+import { JobFairWhiteApi } from '@/api/menduner/system/jobFair/white'
|
|
|
+import { EnterpriseUserBindApi } from '@/api/menduner/system/enterprise/userBind'
|
|
|
+import TicketSettings from './components/TicketSettings.vue'
|
|
|
+import WhiteList from './components/WhiteList.vue'
|
|
|
+import InfoSettings from './components/InfoSettings.vue'
|
|
|
+import Category from './components/Category.vue'
|
|
|
+import { useTagsViewStore } from '@/store/modules/tagsView'
|
|
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
-
|
|
|
-const activeName = ref('whiteList')
|
|
|
-const loading = ref(true) // 列表的加载中
|
|
|
-const list = ref([]) // 列表的数据
|
|
|
-const total = ref(0)
|
|
|
-const queryParams = ref({
|
|
|
- pageNo: 1,
|
|
|
- pageSize: 10,
|
|
|
- name: undefined,
|
|
|
- jobFairId: ''
|
|
|
-})
|
|
|
-
|
|
|
-/** 查询列表 */
|
|
|
-const getList = async () => {
|
|
|
- loading.value = true
|
|
|
- const api = activeName.value === 'whiteList' ? JobFairWhiteApi.getJobFairWhiteList : JobFairManageApi.getBuyTicketEnterprise
|
|
|
- try {
|
|
|
- const data = await api(queryParams.value)
|
|
|
- total.value = data.total
|
|
|
- list.value = data.list
|
|
|
- } finally {
|
|
|
- loading.value = false
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const handleClick = () => {
|
|
|
- total.value = 0
|
|
|
- list.value = []
|
|
|
- queryParams.value.pageNo = 1
|
|
|
- getList()
|
|
|
-}
|
|
|
+const activeName = ref('infoSettings') // 当前激活的tab
|
|
|
|
|
|
/* 查询招聘会详情 */
|
|
|
const jobFairInfo = ref({})
|
|
|
-const getJobFairDetail = async () => {
|
|
|
+const getJobFairDetail = async (id) => {
|
|
|
try {
|
|
|
- const data = await JobFairManageApi.getJobFair(queryParams.value.jobFairId)
|
|
|
+ const data = await JobFairManageApi.getJobFair(id)
|
|
|
jobFairInfo.value = data
|
|
|
} catch {}
|
|
|
}
|
|
|
|
|
|
-const handleQuery = () => {
|
|
|
- total.value = 0
|
|
|
- list.value = []
|
|
|
- queryParams.value.pageNo = 1
|
|
|
- getList()
|
|
|
+const whiteListRef = ref(null)
|
|
|
+const handleTabChange = () => {
|
|
|
+ if (activeName.value === 'whiteList') {
|
|
|
+ whiteListRef.value?.getList()
|
|
|
+ } else getJobFairDetail(route.params.id)
|
|
|
}
|
|
|
|
|
|
-/** 重置按钮操作 */
|
|
|
-const queryFormRef = ref()
|
|
|
-const resetQuery = () => {
|
|
|
- queryFormRef.value.resetFields()
|
|
|
- handleQuery()
|
|
|
+// 企业列表
|
|
|
+const enterpriseList = ref([])
|
|
|
+const getEnterpriseListData = () => {
|
|
|
+ EnterpriseUserBindApi.getEnterpriseList().then(res => {
|
|
|
+ enterpriseList.value = res || []
|
|
|
+ })
|
|
|
}
|
|
|
+getEnterpriseListData()
|
|
|
|
|
|
-const formRef = ref()
|
|
|
-const handleAdd = () => {
|
|
|
- formRef.value.open(queryParams.value.jobFairId)
|
|
|
-}
|
|
|
-
|
|
|
-// 移出白名单
|
|
|
-const handleRemoveWhiteList = async (enterpriseName: string, enterpriseId: string) => {
|
|
|
- if (!enterpriseId) return message.warning('操作失败,请刷新页面重试')
|
|
|
- try {
|
|
|
- await message.confirm(`确定要将【${enterpriseName}】移出白名单吗?`)
|
|
|
- await JobFairWhiteApi.removeJobFairWhiteList({ enterpriseIds: enterpriseId, jobFairId: queryParams.value.jobFairId })
|
|
|
- message.success('移出成功')
|
|
|
- getList()
|
|
|
- } catch (err) {}
|
|
|
-}
|
|
|
+const { push, currentRoute } = useRouter() // 路由
|
|
|
+const { delView } = useTagsViewStore() // 视图操作
|
|
|
|
|
|
-// 开启权益
|
|
|
-const handleEnableRights = async (enterpriseName: string, id: string) => {
|
|
|
- if (!id) return message.warning('操作失败,请刷新页面重试')
|
|
|
- try {
|
|
|
- await message.confirm(`是否确定开启【${formatName(enterpriseName)}】的招聘会权益?`)
|
|
|
- await JobFairManageApi.enableTicketRights(id)
|
|
|
- message.success('开启成功')
|
|
|
- getList()
|
|
|
- } catch (err) {}
|
|
|
-}
|
|
|
-
|
|
|
-// 关闭权益
|
|
|
-const handleDisableRights = async (enterpriseName: string, id: string) => {
|
|
|
- if (!id) return message.warning('操作失败,请刷新页面重试')
|
|
|
- try {
|
|
|
- await message.confirm(`是否确定禁用【${formatName(enterpriseName)}】的招聘会权益?`)
|
|
|
- await JobFairManageApi.disableTicketRights(id)
|
|
|
- message.success('禁用成功')
|
|
|
- getList()
|
|
|
- } catch (err) {}
|
|
|
+/** 关闭按钮 */
|
|
|
+const handleClose = () => {
|
|
|
+ delView(unref(currentRoute))
|
|
|
+ push({ path: '/job-fair/manage' })
|
|
|
}
|
|
|
|
|
|
const exportLoading = ref(false)
|
|
@@ -200,7 +83,7 @@ const handleExport = async () => {
|
|
|
await message.exportConfirm()
|
|
|
// 发起导出
|
|
|
exportLoading.value = true
|
|
|
- const data = await JobFairWhiteApi.exportJobFairWhiteList(queryParams.value.jobFairId)
|
|
|
+ const data = await JobFairWhiteApi.exportJobFairWhiteList(id)
|
|
|
download.excel(data, '招聘会职位列表.xls')
|
|
|
} catch {
|
|
|
} finally {
|
|
@@ -216,7 +99,7 @@ const handleExportDelivery = async () => {
|
|
|
await message.exportConfirm()
|
|
|
// 发起导出
|
|
|
exportDeliveryLoading.value = true
|
|
|
- const data = await JobFairWhiteApi.exportJobFairApplyData(queryParams.value.jobFairId)
|
|
|
+ const data = await JobFairWhiteApi.exportJobFairApplyData(id)
|
|
|
download.excel(data, '招聘会职位投递情况.xls')
|
|
|
} catch {
|
|
|
} finally {
|
|
@@ -225,18 +108,9 @@ const handleExportDelivery = async () => {
|
|
|
}
|
|
|
|
|
|
/** 初始化 */
|
|
|
-const { currentRoute } = useRouter() // 路由
|
|
|
-const { delView } = useTagsViewStore() // 视图操作
|
|
|
const route = useRoute()
|
|
|
const { id } = route.params
|
|
|
onMounted(() => {
|
|
|
- if (!id) {
|
|
|
- ElMessage.warning('参数错误,招聘会编号不能为空!')
|
|
|
- delView(unref(currentRoute))
|
|
|
- return
|
|
|
- }
|
|
|
- queryParams.value.jobFairId = id
|
|
|
- getList()
|
|
|
- getJobFairDetail()
|
|
|
+ if (id) getJobFairDetail(id)
|
|
|
})
|
|
|
</script>
|