|
@@ -6,6 +6,13 @@
|
|
|
:label-col-props="{ span: 0, offset: 0 }"
|
|
|
:wrapper-col-props="{ span: 24, offset: 0 }"
|
|
|
>
|
|
|
+ <a-form-item label="教学点">
|
|
|
+ <SelectTask
|
|
|
+ v-model="searchModel.taskId"
|
|
|
+ placeholder="教学点"
|
|
|
+ allow-clear
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
<a-form-item label="教学点">
|
|
|
<SelectTeaching
|
|
|
v-model="searchModel.teachingId"
|
|
@@ -47,9 +54,6 @@
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
<div>
|
|
|
- <a-button type="primary" :loading="exportLoading" @click="toExport"
|
|
|
- >导出</a-button
|
|
|
- >
|
|
|
<a-button type="primary" @click="toImport">导入预考</a-button>
|
|
|
<a-button type="primary" :loading="assginLoading" @click="toAssgin"
|
|
|
>一键自动分配</a-button
|
|
@@ -61,11 +65,21 @@
|
|
|
</div>
|
|
|
<div class="part-box">
|
|
|
<a-table :columns="columns" :data="dataList" :pagination="pagination">
|
|
|
- <template #operationTime="{ record }">
|
|
|
- {{ timestampFilter(record.operationTime) }}
|
|
|
+ <template #status="{ record }">
|
|
|
+ {{ record.cancel ? '已取消' : '正常' }}
|
|
|
+ </template>
|
|
|
+ <template #period="{ record }">
|
|
|
+ {{ parseTimeRangeDateAndTimeContent(record.startTime, record.endTime) }}
|
|
|
+ </template>
|
|
|
+ <template #updateTime="{ record }">
|
|
|
+ {{ timestampFilter(record.updateTime) }}
|
|
|
</template>
|
|
|
<template #action="{ record }">
|
|
|
- <a-button type="text" class="btn-primary" @click="toCancel(record)"
|
|
|
+ <a-button
|
|
|
+ v-if="!record.cancel"
|
|
|
+ type="text"
|
|
|
+ class="btn-danger"
|
|
|
+ @click="toCancel(record)"
|
|
|
>取消</a-button
|
|
|
>
|
|
|
</template>
|
|
@@ -73,12 +87,13 @@
|
|
|
|
|
|
<!-- ImportDialog -->
|
|
|
<ImportDialog
|
|
|
- ref="importStudentDialog"
|
|
|
+ ref="importStudentDialogRef"
|
|
|
title="导入预考"
|
|
|
- upload-url="/api/admin/sys/user/import"
|
|
|
+ upload-url="/api/apply/import"
|
|
|
+ :upload-data="uploadData"
|
|
|
:format="['xls', 'xlsx']"
|
|
|
- download-url="12312"
|
|
|
- download-filename="学生预约导入模板.xlsx"
|
|
|
+ :download-handle="downloadTemplate"
|
|
|
+ download-filename="预考导入模板.xlsx"
|
|
|
:auto-upload="false"
|
|
|
@upload-success="getList"
|
|
|
/>
|
|
@@ -86,14 +101,14 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import { reactive, ref } from 'vue';
|
|
|
+ import { computed, reactive, ref } from 'vue';
|
|
|
import { Message, TableColumnData } from '@arco-design/web-vue';
|
|
|
import {
|
|
|
orderRecordCancel,
|
|
|
orderRecordAutoAssign,
|
|
|
orderRecordListPage,
|
|
|
orderRecordPrint,
|
|
|
- orderRecordExport,
|
|
|
+ orderRecordTemplate,
|
|
|
} from '@/api/order';
|
|
|
import { OrderRecordItem } from '@/api/types/order';
|
|
|
import useTable from '@/hooks/table';
|
|
@@ -102,6 +117,7 @@
|
|
|
import { timestampFilter } from '@/utils/filter';
|
|
|
import { modalConfirm } from '@/utils/arco';
|
|
|
import { downloadByApi } from '@/utils/download';
|
|
|
+ import { parseTimeRangeDateAndTimeContent } from '@/utils/utils';
|
|
|
|
|
|
import ImportDialog from '@/components/import-dialog/index.vue';
|
|
|
|
|
@@ -112,6 +128,7 @@
|
|
|
// const { getLabel: getAbleLabel } = useDictOption('ABLE_TYPE');
|
|
|
|
|
|
const searchModel = reactive({
|
|
|
+ taskId: '',
|
|
|
teachingId: '',
|
|
|
agentId: '',
|
|
|
name: '',
|
|
@@ -122,87 +139,92 @@
|
|
|
const columns: TableColumnData[] = [
|
|
|
{
|
|
|
title: '姓名',
|
|
|
- dataIndex: 'stdName',
|
|
|
+ dataIndex: 'name',
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: '证件号',
|
|
|
dataIndex: 'identityNumber',
|
|
|
+ width: 200,
|
|
|
},
|
|
|
{
|
|
|
title: '学号',
|
|
|
dataIndex: 'studentCode',
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '教学点',
|
|
|
dataIndex: 'teachingName',
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '考点',
|
|
|
dataIndex: 'agentName',
|
|
|
+ width: 160,
|
|
|
},
|
|
|
{
|
|
|
title: '预约时段',
|
|
|
- dataIndex: 'applyTimePeriod',
|
|
|
+ dataIndex: 'startTime',
|
|
|
+ slotName: 'period',
|
|
|
width: 200,
|
|
|
},
|
|
|
{
|
|
|
title: '考场',
|
|
|
dataIndex: 'roomName',
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: '座位号',
|
|
|
dataIndex: 'seatNumber',
|
|
|
+ width: 100,
|
|
|
},
|
|
|
{
|
|
|
title: '状态',
|
|
|
- dataIndex: 'seatNumber',
|
|
|
+ dataIndex: 'cancel',
|
|
|
+ slotName: 'status',
|
|
|
+ width: 100,
|
|
|
},
|
|
|
{
|
|
|
title: '操作时间',
|
|
|
- dataIndex: 'operationTime',
|
|
|
- slotName: 'operationTime',
|
|
|
+ dataIndex: 'updateTime',
|
|
|
+ slotName: 'updateTime',
|
|
|
width: 170,
|
|
|
},
|
|
|
{
|
|
|
title: '操作人',
|
|
|
- dataIndex: 'operationUser',
|
|
|
+ dataIndex: 'userName',
|
|
|
+ width: 120,
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
slotName: 'action',
|
|
|
- width: 100,
|
|
|
+ width: 80,
|
|
|
fixed: 'right',
|
|
|
cellClass: 'action-column',
|
|
|
},
|
|
|
];
|
|
|
+ const uploadData = computed(() => {
|
|
|
+ return searchModel.teachingId ? { teachingId: searchModel.teachingId } : {};
|
|
|
+ });
|
|
|
const { dataList, pagination, toPage, getList } = useTable<OrderRecordItem[]>(
|
|
|
orderRecordListPage,
|
|
|
searchModel,
|
|
|
true
|
|
|
);
|
|
|
|
|
|
- // table action
|
|
|
- const { loading: exportLoading, setLoading: setExportLoading } = useLoading();
|
|
|
- async function toExport() {
|
|
|
- if (exportLoading.value) return;
|
|
|
- setExportLoading(true);
|
|
|
-
|
|
|
- const res = await downloadByApi(() =>
|
|
|
- orderRecordExport({
|
|
|
- teachingId: searchModel.teachingId,
|
|
|
- agentId: searchModel.agentId,
|
|
|
- })
|
|
|
- ).catch((e) => {
|
|
|
+ async function downloadTemplate() {
|
|
|
+ const res = await downloadByApi(() => orderRecordTemplate()).catch((e) => {
|
|
|
Message.error(e || '下载失败,请重新尝试!');
|
|
|
});
|
|
|
- setExportLoading(false);
|
|
|
if (!res) return;
|
|
|
Message.success('下载成功!');
|
|
|
}
|
|
|
+
|
|
|
+ // table action
|
|
|
// 导入
|
|
|
- const importStudentDialog = ref(null);
|
|
|
+ const importStudentDialogRef = ref(null);
|
|
|
function toImport() {
|
|
|
- importStudentDialog.value?.open();
|
|
|
+ importStudentDialogRef.value?.open();
|
|
|
}
|
|
|
|
|
|
// 一键分配
|
|
@@ -211,7 +233,9 @@
|
|
|
if (assginLoading.value) return;
|
|
|
setAssignLoading(true);
|
|
|
|
|
|
- const res = await orderRecordAutoAssign().catch(() => false);
|
|
|
+ const res = await orderRecordAutoAssign({
|
|
|
+ taskId: searchModel.taskId || undefined,
|
|
|
+ }).catch(() => false);
|
|
|
setAssignLoading(false);
|
|
|
if (!res) return;
|
|
|
Message.success('操作成功!');
|
|
@@ -226,8 +250,7 @@
|
|
|
|
|
|
const res = await downloadByApi(() =>
|
|
|
orderRecordPrint({
|
|
|
- teachingId: searchModel.teachingId,
|
|
|
- agentId: searchModel.agentId,
|
|
|
+ teachingId: searchModel.teachingId || undefined,
|
|
|
})
|
|
|
).catch((e) => {
|
|
|
Message.error(e || '下载失败,请重新尝试!');
|
|
@@ -241,7 +264,7 @@
|
|
|
async function toCancel(row: OrderRecordItem) {
|
|
|
const confirmRes = await modalConfirm(
|
|
|
'提示',
|
|
|
- `确定要取消【${row.stdName}】的预约吗?`
|
|
|
+ `确定要取消【${row.name}】的预约吗?`
|
|
|
).catch(() => false);
|
|
|
if (confirmRes !== 'confirm') return;
|
|
|
|