|
@@ -20,6 +20,11 @@
|
|
|
prefix
|
|
|
:teaching-id="searchModel.teachingId"
|
|
|
/>
|
|
|
+ <select-range-datetime
|
|
|
+ v-model:startTime="searchModel.startDate"
|
|
|
+ v-model:endTime="searchModel.endDate"
|
|
|
+ >
|
|
|
+ </select-range-datetime>
|
|
|
<a-input v-model.trim="searchModel.name" placeholder="请输入" allow-clear>
|
|
|
<template #prefix>姓名</template>
|
|
|
</a-input>
|
|
@@ -49,13 +54,18 @@
|
|
|
</template>
|
|
|
导入预考
|
|
|
</a-button>
|
|
|
- <a-button type="text" :loading="assginLoading" @click="toAssgin">
|
|
|
+ <a-button
|
|
|
+ v-if="isAdmin"
|
|
|
+ type="text"
|
|
|
+ :loading="assginLoading"
|
|
|
+ @click="toAssgin"
|
|
|
+ >
|
|
|
<template #icon> <svg-icon name="icon-assign" /> </template>
|
|
|
一键自动分配
|
|
|
</a-button>
|
|
|
- <a-button type="text" :loading="printLoading" @click="toPrint">
|
|
|
+ <a-button type="text" @click="toPrint">
|
|
|
<template #icon> <svg-icon name="icon-print" /> </template>
|
|
|
- 打印签到表
|
|
|
+ 导出签到表
|
|
|
</a-button>
|
|
|
</a-space>
|
|
|
<a-table
|
|
@@ -97,17 +107,18 @@
|
|
|
:auto-upload="false"
|
|
|
@upload-success="getList"
|
|
|
/>
|
|
|
+ <!-- PrintDialog -->
|
|
|
+ <PrintDialog ref="printDialogRef" />
|
|
|
</div>
|
|
|
</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,
|
|
|
orderRecordTemplate,
|
|
|
} from '@/api/order';
|
|
|
import { OrderRecordItem, OrderRecordListFilter } from '@/api/types/order';
|
|
@@ -116,11 +127,13 @@
|
|
|
import useLoading from '@/hooks/loading';
|
|
|
import { timestampFilter } from '@/utils/filter';
|
|
|
import { modalConfirm } from '@/utils/arco';
|
|
|
- import { downloadByApi } from '@/utils/download';
|
|
|
import { parseTimeRangeDateAndTimeContent } from '@/utils/utils';
|
|
|
+ import { useAppStore, useUserStore } from '@/store';
|
|
|
+ import { downloadByApi } from '@/utils/download';
|
|
|
+ import { getBeforeWeek } from '@/utils/day';
|
|
|
|
|
|
import ImportDialog from '@/components/import-dialog/index.vue';
|
|
|
- import { useAppStore } from '@/store';
|
|
|
+ import PrintDialog from './printDialog.vue';
|
|
|
|
|
|
defineOptions({
|
|
|
name: 'OrderRecordManage',
|
|
@@ -128,9 +141,10 @@
|
|
|
|
|
|
const appStore = useAppStore();
|
|
|
appStore.setInfo({ breadcrumbs: ['考试预约管理', '预约明细'] });
|
|
|
+ const userStore = useUserStore();
|
|
|
+ const isAdmin = computed(() => userStore.role === 'ADMIN');
|
|
|
|
|
|
- // const { getLabel: getAbleLabel } = useDictOption('ABLE_TYPE');
|
|
|
-
|
|
|
+ const preDate = getBeforeWeek();
|
|
|
const searchModel = reactive<OrderRecordListFilter>({
|
|
|
taskId: null,
|
|
|
teachingId: null,
|
|
@@ -138,6 +152,8 @@
|
|
|
name: '',
|
|
|
identityNumber: '',
|
|
|
studentCode: '',
|
|
|
+ startDate: preDate[0],
|
|
|
+ endDate: preDate[1],
|
|
|
});
|
|
|
|
|
|
const columns: TableColumnData[] = [
|
|
@@ -249,26 +265,9 @@
|
|
|
}
|
|
|
|
|
|
// 打印签到表
|
|
|
- const { loading: printLoading, setLoading: setPrintLoading } = useLoading();
|
|
|
- async function toPrint() {
|
|
|
- if (printLoading.value) return;
|
|
|
- if (!searchModel.teachingId) {
|
|
|
- Message.error('请先选择教学点');
|
|
|
- return;
|
|
|
- }
|
|
|
- setPrintLoading(true);
|
|
|
-
|
|
|
- const res = await downloadByApi(() =>
|
|
|
- orderRecordPrint({
|
|
|
- teachingId: searchModel.teachingId as number,
|
|
|
- agentId: searchModel.agentId || undefined,
|
|
|
- })
|
|
|
- ).catch((e) => {
|
|
|
- Message.error(e || '下载失败,请重新尝试!');
|
|
|
- });
|
|
|
- setPrintLoading(false);
|
|
|
- if (!res) return;
|
|
|
- Message.success('下载成功!');
|
|
|
+ const printDialogRef = ref();
|
|
|
+ function toPrint() {
|
|
|
+ printDialogRef.value?.open();
|
|
|
}
|
|
|
|
|
|
// 取消
|