|
@@ -99,25 +99,9 @@
|
|
|
</div>
|
|
|
<div class="content">
|
|
|
<fs-crud ref="crudRef" v-bind="crudBinding">
|
|
|
- <template #actionbar-right>
|
|
|
- <div class="action-button-wrapper">
|
|
|
- <el-upload
|
|
|
- class="upload-demo"
|
|
|
- :action="uploadUrl"
|
|
|
- :headers="{
|
|
|
- Authorization: `Bearer ${Session.get('token')}`
|
|
|
- }"
|
|
|
- :on-success="handleImportSuccess"
|
|
|
- :on-error="handleImportError"
|
|
|
- accept=".xlsx,.xls"
|
|
|
- >
|
|
|
- <el-button type="primary" size="small">
|
|
|
- <el-icon><Download /></el-icon>
|
|
|
- 导入
|
|
|
- </el-button>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <!-- <template #actionbar-right>
|
|
|
+
|
|
|
+ </template> -->
|
|
|
</fs-crud>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -146,34 +130,6 @@
|
|
|
style="width: 200px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="职位">
|
|
|
- <el-select
|
|
|
- v-model="notificationSearchForm.position"
|
|
|
- placeholder="请选择职位"
|
|
|
- clearable
|
|
|
- style="width: 200px"
|
|
|
- >
|
|
|
- <el-option label="全部" value="" />
|
|
|
- <el-option
|
|
|
- v-for="position in positions"
|
|
|
- :key="position.id"
|
|
|
- :label="position.title"
|
|
|
- :value="position.title"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="申请时间">
|
|
|
- <el-date-picker
|
|
|
- v-model="notificationSearchForm.dateRange"
|
|
|
- type="daterange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- format="YYYY-MM-DD"
|
|
|
- value-format="YYYY-MM-DD"
|
|
|
- style="width: 300px"
|
|
|
- />
|
|
|
- </el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" @click="handleNotificationSearch">
|
|
|
<el-icon><Search /></el-icon>
|
|
@@ -190,14 +146,31 @@
|
|
|
<!-- 操作按钮 -->
|
|
|
<div class="action-bar">
|
|
|
<div class="left-actions">
|
|
|
- <el-button type="primary" @click="handleBatchNotify" :disabled="!selectedNotificationRows.length">
|
|
|
+ <el-button type="primary" @click="handleBatchNotify" size="small" :disabled="!selectedNotificationRows.length">
|
|
|
<el-icon><Message /></el-icon>
|
|
|
批量通知
|
|
|
</el-button>
|
|
|
- <!-- <el-button type="success" @click="handleBatchInterview" :disabled="!selectedNotificationRows.length">
|
|
|
- <el-icon><Clock /></el-icon>
|
|
|
- 安排面试
|
|
|
- </el-button> -->
|
|
|
+ <div class="action-button-wrapper">
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ :action="uploadUrl"
|
|
|
+ :headers="{
|
|
|
+ Authorization: `JWT ${Session.get('token')}`
|
|
|
+ }"
|
|
|
+ :on-success="handleImportSuccess"
|
|
|
+ :on-error="handleImportError"
|
|
|
+ accept=".xlsx,.xls"
|
|
|
+ >
|
|
|
+ <el-button type="primary" size="small">
|
|
|
+ <el-icon><Download /></el-icon>
|
|
|
+ 导入
|
|
|
+ </el-button>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ <el-button type="primary" @click="handleBatchInterview" size="small" >
|
|
|
+ <!-- <el-icon><Clock /></el-icon> -->
|
|
|
+ 下载导入模板
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<!-- <div class="right-actions">
|
|
|
<el-button @click="handleNotificationRefresh">
|
|
@@ -219,8 +192,6 @@
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column prop="name" label="姓名" width="120" />
|
|
|
<el-table-column prop="phone" label="手机号" width="130" />
|
|
|
- <el-table-column prop="position_title" label="应聘职位" width="150" />
|
|
|
- <el-table-column prop="apply_time" label="申请时间" width="120" />
|
|
|
<el-table-column prop="status" label="状态" width="100">
|
|
|
<template #default="scope">
|
|
|
<el-tag type="warning">待通知</el-tag>
|
|
@@ -290,7 +261,8 @@ import { Grid, Clock, ArrowRight, Check, RefreshRight, Briefcase, Message, Uploa
|
|
|
import BatchTagsDialog from './components/index.vue';
|
|
|
import BatchStatusDialog from './components/BatchStatusDialog.vue';
|
|
|
import smSnotification from './components/smSnotification.vue';
|
|
|
-import { getApplicationStatusSummary } from './api';
|
|
|
+import { getApplicationStatusSummary,downloadImportTemplate } from './api';
|
|
|
+import axios from 'axios';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { ElMessage } from 'element-plus';
|
|
|
import { Session } from '/@/utils/storage';
|
|
@@ -328,7 +300,7 @@ const notificationPagination = reactive({
|
|
|
});
|
|
|
|
|
|
// 定义上传地址
|
|
|
-const uploadUrl = `${import.meta.env.VITE_API_URL}/api/job/application/import`;
|
|
|
+const uploadUrl = `${import.meta.env.VITE_API_URL}/api/system/sms_notifications/import_data/`;
|
|
|
|
|
|
const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({
|
|
|
createCrudOptions,
|
|
@@ -508,11 +480,12 @@ const handleBatchStatusSuccess = () => {
|
|
|
|
|
|
// 处理导入成功
|
|
|
const handleImportSuccess = (response: any) => {
|
|
|
- if (response.code === 2000) {
|
|
|
+ console.log(response)
|
|
|
+ if (response.message === '导入完成') {
|
|
|
ElMessage.success('导入成功');
|
|
|
// 刷新数据和状态统计
|
|
|
crudExpose.doRefresh();
|
|
|
- fetchStatusSummary();
|
|
|
+ fetchNotifications();
|
|
|
} else {
|
|
|
ElMessage.error(response.message || '导入失败');
|
|
|
}
|
|
@@ -590,45 +563,14 @@ const fetchNotificationList = async () => {
|
|
|
|
|
|
// 显示测试数据
|
|
|
const showTestData = () => {
|
|
|
- notificationList.value = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: '张三',
|
|
|
- phone: '13800138001',
|
|
|
- position_title: '前端开发工程师',
|
|
|
- apply_time: '2024-01-15',
|
|
|
- status: '待通知',
|
|
|
- source: '智联招聘',
|
|
|
- remark: '有3年前端开发经验,熟悉Vue.js'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- name: '李四',
|
|
|
- phone: '13800138002',
|
|
|
- position_title: 'Java开发工程师',
|
|
|
- apply_time: '2024-01-14',
|
|
|
- status: '待通知',
|
|
|
- source: 'BOSS直聘',
|
|
|
- remark: '5年Java开发经验,熟悉Spring框架'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- name: '王五',
|
|
|
- phone: '13800138003',
|
|
|
- position_title: 'UI设计师',
|
|
|
- apply_time: '2024-01-13',
|
|
|
- status: '待通知',
|
|
|
- source: '拉勾网',
|
|
|
- remark: '有设计作品集,擅长移动端设计'
|
|
|
- }
|
|
|
- ];
|
|
|
+ notificationList.value = [];
|
|
|
notificationPagination.total = 3;
|
|
|
};
|
|
|
|
|
|
// 搜索待通知列表
|
|
|
const handleNotificationSearch = () => {
|
|
|
notificationPagination.current = 1;
|
|
|
- fetchNotificationList();
|
|
|
+ fetchNotifications();
|
|
|
};
|
|
|
|
|
|
// 重置搜索条件
|
|
@@ -640,7 +582,7 @@ const handleNotificationReset = () => {
|
|
|
dateRange: []
|
|
|
});
|
|
|
notificationPagination.current = 1;
|
|
|
- fetchNotificationList();
|
|
|
+ fetchNotifications();
|
|
|
};
|
|
|
|
|
|
// 刷新待通知列表
|
|
@@ -657,13 +599,13 @@ const handleNotificationSelectionChange = (selection: NotificationItem[]) => {
|
|
|
const handleNotificationSizeChange = (size: number) => {
|
|
|
notificationPagination.size = size;
|
|
|
notificationPagination.current = 1;
|
|
|
- fetchNotificationList();
|
|
|
+ fetchNotifications();
|
|
|
};
|
|
|
|
|
|
// 处理当前页变化
|
|
|
const handleNotificationCurrentChange = (current: number) => {
|
|
|
notificationPagination.current = current;
|
|
|
- fetchNotificationList();
|
|
|
+ fetchNotifications();
|
|
|
};
|
|
|
|
|
|
// 单个通知
|
|
@@ -694,13 +636,27 @@ const handleBatchNotify = () => {
|
|
|
smSnotificationRef.value.open(selectedNotificationRows.value);
|
|
|
};
|
|
|
|
|
|
-// 批量安排面试
|
|
|
-const handleBatchInterview = () => {
|
|
|
- if (selectedNotificationRows.value.length === 0) {
|
|
|
- ElMessage.warning('请选择要安排面试的申请');
|
|
|
- return;
|
|
|
- }
|
|
|
- batchStatusDialogRef.value.open(selectedNotificationRows.value);
|
|
|
+// 下载模板
|
|
|
+const handleBatchInterview = async () => {
|
|
|
+ try {
|
|
|
+ const response = await axios.get(`${import.meta.env.VITE_API_URL}/api/system/sms_notifications/download_template/`, {
|
|
|
+ headers: {
|
|
|
+ 'Authorization': `JWT ${Session.get('token')}`
|
|
|
+ },
|
|
|
+ responseType: 'blob' // 确保响应类型为 blob,以便下载文件
|
|
|
+ });
|
|
|
+
|
|
|
+ // 创建一个 URL 对象
|
|
|
+ const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = url;
|
|
|
+ link.setAttribute('download', 'template.xlsx'); // 设置下载文件名
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ link.remove();
|
|
|
+ } catch (error) {
|
|
|
+ console.error('下载模板失败:', error);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
// 页面打开后获取列表数据
|
|
@@ -763,8 +719,37 @@ onMounted(async () => {
|
|
|
// 没有URL参数时,执行普通刷新
|
|
|
crudExpose.doRefresh();
|
|
|
}
|
|
|
+ fetchNotifications()
|
|
|
});
|
|
|
|
|
|
+
|
|
|
+ const fetchNotifications=async()=> {
|
|
|
+ notificationLoading.value = true; // 开始加载
|
|
|
+ try {
|
|
|
+ const response = await axios.get(`${import.meta.env.VITE_API_URL}/api/system/sms_notifications/`,{
|
|
|
+ params:{
|
|
|
+ page: notificationPagination.current,
|
|
|
+ limit: notificationPagination.size,
|
|
|
+ name: notificationSearchForm.name,
|
|
|
+ phone: notificationSearchForm.phone,
|
|
|
+ },
|
|
|
+ headers: {
|
|
|
+ 'Authorization': `JWT ${Session.get('token')}`
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(response.data)
|
|
|
+ if(response.data.code === 2000){
|
|
|
+ notificationList.value = response.data.data; // 更新通知列表
|
|
|
+ }else{
|
|
|
+ ElMessage.error(response.data.message || '获取通知列表失败');
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取通知列表失败:', error);
|
|
|
+ } finally {
|
|
|
+ notificationLoading.value = false; // 结束加载
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const getPositionList = async () => {
|
|
|
try {
|
|
|
// 从环境变量或配置中获取
|
|
@@ -874,8 +859,6 @@ const getPositionList = async () => {
|
|
|
background-color: #fff;
|
|
|
padding: 20px;
|
|
|
border-radius: 8px;
|
|
|
- margin-bottom: 16px;
|
|
|
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
|
|
|
|
.action-bar {
|
|
@@ -885,8 +868,7 @@ const getPositionList = async () => {
|
|
|
background-color: #fff;
|
|
|
padding: 16px 20px;
|
|
|
border-radius: 8px;
|
|
|
- margin-bottom: 16px;
|
|
|
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
.left-actions {
|
|
@@ -902,7 +884,7 @@ const getPositionList = async () => {
|
|
|
.table-container {
|
|
|
background-color: #fff;
|
|
|
border-radius: 8px;
|
|
|
- margin-bottom: 16px;
|
|
|
+
|
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
overflow: hidden;
|
|
|
}
|
|
@@ -911,9 +893,8 @@ const getPositionList = async () => {
|
|
|
background-color: #fff;
|
|
|
padding: 16px 20px;
|
|
|
border-radius: 8px;
|
|
|
- display: flex;
|
|
|
- justify-content: center;
|
|
|
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
|
+ /* display: flex;
|
|
|
+ justify-content: center; */
|
|
|
}
|
|
|
|
|
|
/* 原有的侧边栏和内容样式 */
|