|
@@ -27,14 +27,32 @@
|
|
</a-space>
|
|
</a-space>
|
|
</div>
|
|
</div>
|
|
<div class="part-box">
|
|
<div class="part-box">
|
|
- <a-space
|
|
|
|
- v-if="searchModel.examSiteId && searchModel.taskId && tableData.length"
|
|
|
|
- class="part-action"
|
|
|
|
- :size="12"
|
|
|
|
- >
|
|
|
|
- <a-button type="primary" @click="save">保存</a-button>
|
|
|
|
- <span style="color: #ff9a2e">时段关联最小单位是考点</span>
|
|
|
|
- </a-space>
|
|
|
|
|
|
+ <div class="box-justify mb-10">
|
|
|
|
+ <div>
|
|
|
|
+ <a-space
|
|
|
|
+ v-if="
|
|
|
|
+ searchModel.examSiteId && searchModel.taskId && tableData.length
|
|
|
|
+ "
|
|
|
|
+ :size="12"
|
|
|
|
+ >
|
|
|
|
+ <a-button type="primary" @click="save">保存</a-button>
|
|
|
|
+ <span style="color: #ff9a2e">时段关联最小单位是考点</span>
|
|
|
|
+ </a-space>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <a-space v-if="userStore.isAdmin">
|
|
|
|
+ <span>自主预约:</span>
|
|
|
|
+ <a-switch
|
|
|
|
+ v-model="timeExamPeriodEnable"
|
|
|
|
+ @change="timeExamPeriodEnableChange"
|
|
|
|
+ >
|
|
|
|
+ <template #checked> 开启 </template>
|
|
|
|
+ <template #unchecked> 关闭 </template>
|
|
|
|
+ </a-switch>
|
|
|
|
+ </a-space>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<!-- <div
|
|
<!-- <div
|
|
v-if="searchModel.examSiteId && searchModel.taskId && !userStore.isAdmin"
|
|
v-if="searchModel.examSiteId && searchModel.taskId && !userStore.isAdmin"
|
|
class="part-action"
|
|
class="part-action"
|
|
@@ -71,8 +89,8 @@
|
|
>
|
|
>
|
|
<template #checked> 开启 </template>
|
|
<template #checked> 开启 </template>
|
|
<template #unchecked> 关闭 </template>
|
|
<template #unchecked> 关闭 </template>
|
|
- </a-switch></template
|
|
|
|
- >
|
|
|
|
|
|
+ </a-switch>
|
|
|
|
+ </template>
|
|
<template
|
|
<template
|
|
v-for="head in sliceTimeArr"
|
|
v-for="head in sliceTimeArr"
|
|
#[head]="{ record, rowIndex }"
|
|
#[head]="{ record, rowIndex }"
|
|
@@ -105,6 +123,8 @@
|
|
getDateAndTimeList,
|
|
getDateAndTimeList,
|
|
saveReservation,
|
|
saveReservation,
|
|
toggleSelfYYStatus,
|
|
toggleSelfYYStatus,
|
|
|
|
+ adminSwitchReservationStatus,
|
|
|
|
+ adminSwitchReservation,
|
|
} from '@/api/order';
|
|
} from '@/api/order';
|
|
import { TaskItem } from '@/api/types/order';
|
|
import { TaskItem } from '@/api/types/order';
|
|
import useTable from '@/hooks/table';
|
|
import useTable from '@/hooks/table';
|
|
@@ -123,9 +143,9 @@
|
|
appStore.setInfo({ breadcrumbs: ['考试预约管理', '考点预约设置'] });
|
|
appStore.setInfo({ breadcrumbs: ['考试预约管理', '考点预约设置'] });
|
|
|
|
|
|
const searchModel = reactive({
|
|
const searchModel = reactive({
|
|
- taskId: '',
|
|
|
|
- examSiteId: '',
|
|
|
|
- teachingId: '',
|
|
|
|
|
|
+ taskId: null,
|
|
|
|
+ examSiteId: null,
|
|
|
|
+ teachingId: null,
|
|
});
|
|
});
|
|
const sliceTimeArr = ref([]);
|
|
const sliceTimeArr = ref([]);
|
|
|
|
|
|
@@ -162,11 +182,11 @@
|
|
const tableData = ref<any>([]);
|
|
const tableData = ref<any>([]);
|
|
const getTimeSilce = () => {
|
|
const getTimeSilce = () => {
|
|
getTimeSliceList({ taskId: searchModel.taskId }).then((res: any) => {
|
|
getTimeSliceList({ taskId: searchModel.taskId }).then((res: any) => {
|
|
- console.log('times', res);
|
|
|
|
|
|
+ // console.log('times', res);
|
|
sliceTimeArr.value = res || [];
|
|
sliceTimeArr.value = res || [];
|
|
});
|
|
});
|
|
};
|
|
};
|
|
- onMounted(() => {});
|
|
|
|
|
|
+
|
|
const search = () => {
|
|
const search = () => {
|
|
if (
|
|
if (
|
|
!searchModel.taskId ||
|
|
!searchModel.taskId ||
|
|
@@ -267,4 +287,40 @@
|
|
Message.success('设置成功');
|
|
Message.success('设置成功');
|
|
});
|
|
});
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+ // timeExamPeriodEnable set;
|
|
|
|
+ const timeExamPeriodEnable = ref<boolean>(false);
|
|
|
|
+ async function timeExamPeriodEnableStatus() {
|
|
|
|
+ const res = await adminSwitchReservationStatus();
|
|
|
|
+ timeExamPeriodEnable.value = Boolean(res);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async function timeExamPeriodEnableChange() {
|
|
|
|
+ if (!userStore.isAdmin) return;
|
|
|
|
+
|
|
|
|
+ const action = timeExamPeriodEnable.value ? '开启' : '关闭';
|
|
|
|
+ const confirmRes = await modalConfirm(
|
|
|
|
+ '提示',
|
|
|
|
+ `确定要${action}自助预约吗?`
|
|
|
|
+ ).catch(() => false);
|
|
|
|
+ if (confirmRes !== 'confirm') {
|
|
|
|
+ timeExamPeriodEnable.value = !timeExamPeriodEnable.value;
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const res = await adminSwitchReservation(timeExamPeriodEnable.value).catch(
|
|
|
|
+ () => {
|
|
|
|
+ timeExamPeriodEnable.value = !timeExamPeriodEnable.value;
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (!res) return;
|
|
|
|
+ Message.success('操作成功!');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ onMounted(() => {
|
|
|
|
+ if (userStore.isAdmin) {
|
|
|
|
+ timeExamPeriodEnableStatus();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
</script>
|
|
</script>
|