|
@@ -0,0 +1,202 @@
|
|
|
+import { BasicColumn, FormSchema } from '/@/components/Table';
|
|
|
+import { requestMagicApi } from '/@/api/magicApi';
|
|
|
+import { formatToDate } from '/@/utils/dateUtil';
|
|
|
+import { Switch } from 'ant-design-vue';
|
|
|
+import { h } from 'vue';
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+import { postStudentReportRecordSign } from '/@/services/apis/StudentReportRecordController';
|
|
|
+
|
|
|
+export const stateOptions = [
|
|
|
+ { label: '草稿', value: 0 },
|
|
|
+ { label: '进行中', value: 1 },
|
|
|
+ { label: '已结束', value: 2 },
|
|
|
+];
|
|
|
+
|
|
|
+export const tableColumns: BasicColumn[] = [
|
|
|
+ {
|
|
|
+ title: '年级',
|
|
|
+ dataIndex: 'gradeName',
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '班级',
|
|
|
+ dataIndex: 'classNmae',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '班主任',
|
|
|
+ dataIndex: 'teacherName',
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '学生姓名',
|
|
|
+ dataIndex: 'name',
|
|
|
+ align: 'left',
|
|
|
+ width: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '性别',
|
|
|
+ dataIndex: 'grendCn',
|
|
|
+ align: 'left',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '身份证号',
|
|
|
+ dataIndex: 'credentialNumber',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '手机号',
|
|
|
+ dataIndex: 'mobile',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '家长联系电话',
|
|
|
+ dataIndex: 'parentMobile',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '学生来源',
|
|
|
+ dataIndex: 'sourceName',
|
|
|
+ align: 'left',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '学籍状态',
|
|
|
+ dataIndex: 'status',
|
|
|
+ align: 'left',
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '状态',
|
|
|
+ dataIndex: 'isReport',
|
|
|
+ customRender: ({ record }) => {
|
|
|
+ if (!Reflect.has(record, 'pendingStatus')) {
|
|
|
+ record.pendingStatus = false;
|
|
|
+ }
|
|
|
+ return h(Switch, {
|
|
|
+ checked: record.isReport === 1,
|
|
|
+ checkedChildren: '报到',
|
|
|
+ unCheckedChildren: '未报到',
|
|
|
+ loading: record.pendingStatus,
|
|
|
+ onChange(checked: boolean) {
|
|
|
+ record.pendingStatus = true;
|
|
|
+ const newStatus = checked ? 1 : 0;
|
|
|
+ const { createMessage } = useMessage();
|
|
|
+ postStudentReportRecordSign(record.id)
|
|
|
+ .then(() => {
|
|
|
+ record.isReport = newStatus;
|
|
|
+ createMessage.success('已成功修改状态');
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ createMessage.error('修改状态失败');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ record.pendingStatus = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ width: 80,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: '报到日期',
|
|
|
+ dataIndex: 'reportDate',
|
|
|
+ align: 'left',
|
|
|
+ width: 120,
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+export const searchFormSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ field: 'baseSemesterId',
|
|
|
+ label: '学期',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: requestMagicApi,
|
|
|
+ params: { url: 'baseData/semester/option' },
|
|
|
+ },
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'classId',
|
|
|
+ label: '班级',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'name',
|
|
|
+ label: '学生姓名',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: '身份证号',
|
|
|
+ label: '状态',
|
|
|
+ component: 'Input',
|
|
|
+ colProps: { span: 8 },
|
|
|
+ },
|
|
|
+];
|
|
|
+
|
|
|
+export const formSchema: FormSchema[] = [
|
|
|
+ {
|
|
|
+ label: '计划名称',
|
|
|
+ field: 'name',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'semesterId',
|
|
|
+ label: '学期',
|
|
|
+ component: 'ApiSelect',
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ api: requestMagicApi,
|
|
|
+ params: { url: 'baseData/semester/option' },
|
|
|
+ },
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '报到时间',
|
|
|
+ field: 'dateTime',
|
|
|
+ component: 'RangePicker',
|
|
|
+ colProps: { span: 24 },
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ format: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ showTime: { format: 'HH:mm:ss' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '就读修改时间',
|
|
|
+ field: 'date',
|
|
|
+ component: 'RangePicker',
|
|
|
+ colProps: { span: 24 },
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ getPopupContainer: () => document.body,
|
|
|
+ placeholder: ['开始时间', '结束时间'],
|
|
|
+ format: 'YYYY-MM-DD',
|
|
|
+ valueFormat: 'YYYY-MM-DD',
|
|
|
+ showTime: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '参与班级',
|
|
|
+ field: 'classIds',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ slot: 'classIds',
|
|
|
+ },
|
|
|
+];
|