|
@@ -18,7 +18,7 @@
|
|
|
>店铺名称:
|
|
|
|
|
|
<a-tooltip>
|
|
|
- <template #title>{{ record.orderType == 3 || record.orderType == 4 ? record.departName : record.siteName }}</template>
|
|
|
+ <template #title>{{ record.orderType == 3 || record.orderType == 4 ? record.departName : record.siteName }} </template>
|
|
|
{{ record.orderType == 3 || record.orderType == 4 ? record.departName : record.siteName }}
|
|
|
</a-tooltip>
|
|
|
</div>
|
|
@@ -61,18 +61,23 @@
|
|
|
</template>
|
|
|
</BasicTable>
|
|
|
<orderModelView @register="registerModal"></orderModelView>
|
|
|
+ <a-modal v-model:open="openExportData" title="导出赛事名单" @ok="handleExportData" :confirmLoading="exportLoading">
|
|
|
+ <BasicForm :showActionButtonGroup="false" @register="registerForm" style="margin: 50px 50px 0 50px" />
|
|
|
+ </a-modal>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import orderModelView from './components/orderModelView.vue';
|
|
|
- import { Image, message } from 'ant-design-vue';
|
|
|
+ import { Image, message, Modal, QRCode } from 'ant-design-vue';
|
|
|
import { ref, reactive, computed, unref } from 'vue';
|
|
|
- import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table';
|
|
|
+ import { BasicTable, TableAction } from '/@/components/Table';
|
|
|
+ import { useForm, BasicForm, FormSchema } from '/@/components/Form';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
import { useListPage } from '/@/hooks/system/useListPage';
|
|
|
import { columns, searchFormSchema, afterSaleStatus, orderStatus } from './order.data';
|
|
|
- import { list } from './order.api';
|
|
|
+ import { list, exportData, queryEvents, queryProject } from './order.api';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
+
|
|
|
const queryParam = reactive<any>({});
|
|
|
const userStore = useUserStore();
|
|
|
//注册model
|
|
@@ -101,6 +106,69 @@
|
|
|
});
|
|
|
|
|
|
const [registerTable, { reload }, { selectedRowKeys }] = tableContext;
|
|
|
+ //自定义表单字段
|
|
|
+ const formSchemas: FormSchema[] = [
|
|
|
+ {
|
|
|
+ label: '赛事名称',
|
|
|
+ field: 'name',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ componentProps: {
|
|
|
+ api: queryEvents,
|
|
|
+ fieldNames: {
|
|
|
+ label: 'name',
|
|
|
+ value: 'id',
|
|
|
+ },
|
|
|
+ onChange: (value) => {
|
|
|
+ exportQueryParam.gameId = value;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '比赛项目',
|
|
|
+ field: 'project',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ required: true,
|
|
|
+ labelWidth: 100,
|
|
|
+ componentProps: {
|
|
|
+ api: queryProject,
|
|
|
+ fieldNames: {
|
|
|
+ label: 'name',
|
|
|
+ value: 'id',
|
|
|
+ },
|
|
|
+ onChange: (value) => {
|
|
|
+ exportQueryParam.projectId = value;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '报名结束时间',
|
|
|
+ field: 'entryTime',
|
|
|
+ component: 'RangePicker',
|
|
|
+ labelWidth: 100,
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ onChange: (value) => {
|
|
|
+ exportQueryParam.startTime = value[0];
|
|
|
+ exportQueryParam.endTime = value[1];
|
|
|
+ console.log(value);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ];
|
|
|
+
|
|
|
+ /**
|
|
|
+ * BasicForm绑定注册;
|
|
|
+ */
|
|
|
+ const [registerForm] = useForm({
|
|
|
+ //注册表单列
|
|
|
+ schemas: formSchemas,
|
|
|
+ showResetButton: false,
|
|
|
+ submitButtonOptions: { text: '提交', preIcon: '' },
|
|
|
+ actionColOptions: { span: 17 },
|
|
|
+ });
|
|
|
+
|
|
|
/**
|
|
|
* 编辑事件
|
|
|
*/
|
|
@@ -109,6 +177,7 @@
|
|
|
record,
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 操作栏
|
|
|
*/
|
|
@@ -121,15 +190,51 @@
|
|
|
},
|
|
|
];
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 下拉操作栏
|
|
|
*/
|
|
|
function getDropDownAction(record) {
|
|
|
return [];
|
|
|
}
|
|
|
+
|
|
|
+ const openExportData = ref(false);
|
|
|
+
|
|
|
function handleExport() {
|
|
|
- message.error('记得提醒搞导出,现在暂时没有这个功能!');
|
|
|
+ openExportData.value = true;
|
|
|
+ // message.error('记得提醒搞导出,现在暂时没有这个功能!');
|
|
|
}
|
|
|
+
|
|
|
+ // 提交导出
|
|
|
+ const exportQueryParam = reactive<any>({
|
|
|
+ gameId: null,
|
|
|
+ projectId: null,
|
|
|
+ startTime: null,
|
|
|
+ endTime: null,
|
|
|
+ });
|
|
|
+ const exportLoading = ref(false);
|
|
|
+ const handleExportData = async () => {
|
|
|
+ exportLoading.value = true;
|
|
|
+ try {
|
|
|
+ const response = await exportData(exportQueryParam);
|
|
|
+ const blob = new Blob([response], { type: 'application/vnd.ms-excel' });
|
|
|
+ const downloadUrl = window.URL.createObjectURL(blob);
|
|
|
+ const link = document.createElement('a');
|
|
|
+ link.href = downloadUrl;
|
|
|
+ link.download = '赛事名单.xlsx';
|
|
|
+ document.body.appendChild(link);
|
|
|
+ link.click();
|
|
|
+ document.body.removeChild(link);
|
|
|
+ window.URL.revokeObjectURL(downloadUrl);
|
|
|
+ message.success('导出成功!');
|
|
|
+ } catch (error) {
|
|
|
+ console.error('导出失败:', error);
|
|
|
+ message.error('导出失败,请稍后重试');
|
|
|
+ } finally {
|
|
|
+ exportLoading.value = false;
|
|
|
+ openExportData.value = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
</script>
|
|
|
|
|
|
<style scoped></style>
|