Browse Source

feat:修改BUG

DESKTOP-USV654P\pc 6 months ago
parent
commit
58f5e56063

+ 3 - 0
src/services/apis/BaseNewStudentController.ts

@@ -39,6 +39,9 @@ export async function getBaseNewStudentInfo(params:any,mode: ErrorMessageMode =
 /** 新生维护信息列表(分页) GET /student/baseNewStudent/page */
 export async function getBaseNewStudentPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.BaseNewStudentPageVo>>
         ({url: '/student/baseNewStudent/page', params:params},{errorMessageMode:mode});}
+/** 导出 POST /student/baseNewStudent/report-export */
+export async function postBaseNewStudentReportExport(mode: ErrorMessageMode = 'modal'){ return defHttp.download<any>
+        ({url: '/student/baseNewStudent/report-export',responseType:'blob', data:{}},{errorMessageMode:mode});}
 /** 新生报到(分页) GET /student/baseNewStudent/report-page */
 export async function getBaseNewStudentReportPage(params:any,mode: ErrorMessageMode = 'modal'){ return defHttp.get<API.PageOutput<API.BaseNewStudentPageVo>>
         ({url: '/student/baseNewStudent/report-page', params:params},{errorMessageMode:mode});}

+ 12 - 0
src/services/typing.d.ts

@@ -5431,6 +5431,8 @@ height?: number;
 id?: string;
 /** 是否可调配(0:否,1:是) */
 isAdjust?: number;
+/** 是否已报到(1:是 0:否) */
+isReport?: number;
 /** 手机号 */
 mobile?: string;
 /** 学生姓名 */
@@ -10991,6 +10993,10 @@ type?: number;
 
 /** 分页入参 */
 type PageInput = {
+/** 学期id */
+baseSemesterId?: string;
+/** 班级id */
+classId?: string;
 /** 身份证 */
 credentialNumber?: string;
 /** 添加时间-结束 */
@@ -11009,6 +11015,8 @@ graduateSchool?: string;
 isAdjust?: number;
 /** 是否导入成绩(0:否,1:是) */
 isImportScore?: number;
+/** 是否已报到(1:是 0:否) */
+isReport?: number;
 /** 关键词 */
 keyword?: string;
 /** 当前页标 */
@@ -11021,10 +11029,14 @@ order?: string;
 secondAmbition?: string;
 /** 每页大小 */
 size?: number;
+/** 学生来源 */
+source?: string;
 /** 添加时间-开始 */
 startDate?: string;
 /** 班级状态(0:未分配, 1:已分配) */
 status?: number;
+/** 就读方式 */
+stduyStatus?: string;
 /** 班主任id */
 teacherId?: string;
 /** 树id */

+ 11 - 5
src/views/educational/stdudentBaseManager/index.vue

@@ -112,10 +112,10 @@
   const searchInfo = reactive<Recordable>({});
 
   const handelExportClick = (type) => {
-    if (searchInfo.treeType !== 4) {
-      createMessage.warning('请选择班级');
-      return;
-    }
+    // if (searchInfo.treeType !== 4) {
+    //   createMessage.warning('请选择班级');
+    //   return;
+    // }
     const data: Recordable = {
       conditions: [],
       ids: [],
@@ -125,7 +125,13 @@
       for (const key in formData) {
         data.conditions.push({ keyName: key, keyValue: formData[key], keyType: '1' });
       }
-      data.conditions.push({ keyName: 'classId', keyValue: searchInfo.treeId, keyType: '1' });
+      if (searchInfo.treeId) {
+        data.conditions.push({
+          keyName: searchInfo.treeType,
+          keyValue: searchInfo.treeId,
+          keyType: '1',
+        });
+      }
     } else {
       const selectKeys = getSelectRowKeys();
       if (selectKeys.length === 0) {

+ 15 - 2
src/views/educational/studentReport/index.vue

@@ -4,18 +4,23 @@
   import { searchFormSchema, tableColumns } from './data.config';
   import ClassTree from '/@/views/educational/basicInformation/components/tree.vue';
   import { reactive } from 'vue';
-  import { getBaseNewStudentReportPage } from '/@/services/apis/BaseNewStudentController';
+  import {
+    postBaseNewStudentReportExport,
+    getBaseNewStudentReportPage,
+  } from '/@/services/apis/BaseNewStudentController';
   import { Recordable } from 'vite-plugin-mock';
   import { useModal } from '/@/components/Modal';
   import FormEdit from './edit.vue';
   import { useMessage } from '/@/hooks/web/useMessage';
+  import { formatToDate } from '/@/utils/dateUtil';
+  import { downloadByData } from '/@/utils/file/download';
 
   const searchInfo = reactive<Recordable>({});
 
   const [registerModal, { openModal }] = useModal();
   const { createMessage } = useMessage();
 
-  const [registerTable, { reload, getSelectRows }] = useTable({
+  const [registerTable, { reload, getSelectRows, getForm }] = useTable({
     api: getBaseNewStudentReportPage,
     title: '新生列表',
     rowKey: 'id',
@@ -72,6 +77,13 @@
   const handleSuccess = () => {
     reload();
   };
+  const handleExport = async () => {
+    const postData = getForm().getFieldsValue();
+    downloadByData(
+      (await postBaseNewStudentReportExport({ ...postData, ...searchInfo })).data,
+      `新生列表${formatToDate(new Date())}.xlsx`,
+    );
+  };
 </script>
 
 <template>
@@ -80,6 +92,7 @@
     <BasicTable class="w-2/3 xl:w-3/4" @register="registerTable" :searchInfo="searchInfo">
       <template #toolbar>
         <a-button type="primary" @click="handleDeleteBatch">批量删除</a-button>
+        <a-button type="primary" @click="handleExport">导出</a-button>
       </template>
       <template #action="{ record }">
         <div style="display: flex; justify-content: center">

+ 6 - 6
src/views/finance/consumption/data.config.ts

@@ -223,12 +223,12 @@ export const tableMaterialColumns: BasicColumn[] = [
     align: 'left',
     width: 80,
   },
-  {
-    title: '数量',
-    dataIndex: 'studentSubscriptionNumber',
-    align: 'left',
-    width: 80,
-  },
+  // {
+  //   title: '数量',
+  //   dataIndex: 'studentSubscriptionNumber',
+  //   align: 'left',
+  //   width: 80,
+  // },
   {
     title: '价格(元)',
     dataIndex: 'price',

+ 5 - 3
src/views/finance/consumption/material.vue

@@ -18,8 +18,10 @@
   import { BasicModal, useModalInner } from '/@/components/Modal';
   import { useTable, BasicTable } from '/@/components/Table';
   import { tableMaterialColumns } from './data.config';
-  import { getTextbookPageConsumption } from '/@/services/apis/TextbookController';
+  // import { getTextbookPageConsumption } from '/@/services/apis/TextbookController';
+
   import { PageWrapper } from '/@/components/Page';
+  import { getTextbookStudentClaimPage } from '/@/services/apis/TextbookStudentClaimController';
 
   const searchInfo = reactive<Recordable>({});
 
@@ -27,7 +29,7 @@
   const modelRef = ref({});
   defineEmits(['success', 'register']);
   const [registerTable, { reload }] = useTable({
-    api: getTextbookPageConsumption,
+    api: getTextbookStudentClaimPage,
     title: '教材列表',
     rowKey: 'id',
     columns: tableMaterialColumns,
@@ -42,7 +44,7 @@
     setModalProps({ confirmLoading: false });
     isUpdate.value = !!data?.isUpdate;
     modelRef.value = { ...data.baseData };
-    searchInfo.classId = data.baseData.classId;
+    // searchInfo.classId = data.baseData.classId;
     searchInfo.studentUserId = data.baseData.userId;
     searchInfo.baseSemesterId = data.baseData.baseSemesterId;
     await reload();

+ 55 - 67
src/views/system/department/components/DeptDrawer.vue

@@ -10,7 +10,7 @@
     <BasicForm @register="registerForm" />
   </BasicModal>
 </template>
-<script lang="ts">
+<script lang="ts" setup>
   import { defineComponent, ref, computed, unref } from 'vue';
   import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
   import { BasicModal, useModalInner } from '/@/components/Modal';
@@ -26,7 +26,7 @@
   } from '/@/api/system/department';
   import { useI18n } from '/@/hooks/web/useI18n';
   const { t } = useI18n();
-  export const formSchema: FormSchema[] = [
+  const formSchema: FormSchema[] = [
     {
       field: 'name',
       label: t('组织名称'),
@@ -124,78 +124,66 @@
     },
   ];
 
-  export default defineComponent({
-    name: 'DeptDrawer',
-    components: { BasicModal, BasicForm },
-    emits: ['success', 'register'],
-    setup(_, { emit }) {
-      const isUpdate = ref(true);
-      const { notification } = useMessage();
-      const rowId = ref('');
+  const emit = defineEmits(['success', 'register']);
 
-      const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
-        labelWidth: 100,
-        schemas: formSchema,
-        showActionButtonGroup: false,
-        baseColProps: { lg: 12, md: 24 },
-      });
-      const [registerDrawer, { setModalProps, closeModal }] = useModalInner(async (data) => {
-        resetFields();
-        setModalProps({ confirmLoading: false });
-        isUpdate.value = !!data?.isUpdate;
+  const isUpdate = ref(true);
+  const { notification } = useMessage();
+  const rowId = ref('');
+
+  const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
+    labelWidth: 100,
+    schemas: formSchema,
+    showActionButtonGroup: false,
+    baseColProps: { lg: 12, md: 24 },
+  });
+  const [registerDrawer, { setModalProps, closeModal }] = useModalInner(async (data) => {
+    resetFields();
+    setModalProps({ confirmLoading: false });
+    isUpdate.value = !!data?.isUpdate;
 
-        const treeData = await getDepartmentTree();
-        updateSchema({
-          field: 'parentId',
-          componentProps: { treeData },
-        });
-        if (unref(isUpdate)) {
-          rowId.value = data.record.id;
+    const treeData = await getDepartmentTree();
+    updateSchema({
+      field: 'parentId',
+      componentProps: { treeData },
+    });
+    if (unref(isUpdate)) {
+      rowId.value = data.record.id;
 
-          const _data = await getDepartment(data.record.id);
+      const _data = await getDepartment(data.record.id);
 
-          setFieldsValue({
-            ..._data,
-          });
-        }
+      setFieldsValue({
+        ..._data,
       });
+    }
+  });
 
-      const getTitle = computed(() => (!unref(isUpdate) ? t('新增组织') : t('编辑组织')));
+  const getTitle = computed(() => (!unref(isUpdate) ? t('新增组织') : t('编辑组织')));
 
-      async function handleSubmit() {
-        try {
-          const values = await validate();
+  async function handleSubmit() {
+    try {
+      const values = await validate();
 
-          setModalProps({ confirmLoading: true });
-          // TODO custom api
-          if (!unref(isUpdate)) {
-            //false 新增
-            await addDepartment(values);
-            notification.success({
-              message: t('提示'),
-              description: t('新增成功'),
-            }); //提示消息
-          } else {
-            values.id = rowId.value;
-            await updateDepartment(values);
-            notification.success({
-              message: t('提示'),
-              description: t('编辑成功'),
-            }); //提示消息
-          }
-          closeModal();
-          emit('success');
-        } catch (error) {
-          setModalProps({ confirmLoading: false });
-        }
+      setModalProps({ confirmLoading: true });
+      // TODO custom api
+      if (!unref(isUpdate)) {
+        //false 新增
+        await addDepartment(values);
+        notification.success({
+          message: t('提示'),
+          description: t('新增成功'),
+        }); //提示消息
+      } else {
+        values.id = rowId.value;
+        await updateDepartment(values);
+        notification.success({
+          message: t('提示'),
+          description: t('编辑成功'),
+        }); //提示消息
       }
-
-      return {
-        registerDrawer,
-        registerForm,
-        getTitle,
-        handleSubmit,
-      };
-    },
-  });
+      closeModal();
+      emit('success');
+    } catch (error) {
+      setModalProps({ confirmLoading: false });
+    }
+  }
 </script>

+ 80 - 100
src/views/system/department/index.vue

@@ -56,8 +56,8 @@
     />
   </PageWrapper>
 </template>
-<script lang="ts">
-  import { defineComponent, h, ref } from 'vue';
+<script lang="ts" setup>
+  import { ref } from 'vue';
 
   import { BasicTable, useTable, TableAction, BasicColumn, FormSchema } from '/@/components/Table';
 
@@ -75,7 +75,7 @@
   } from '/@/api/system/department';
   import { useI18n } from '/@/hooks/web/useI18n';
   const { t } = useI18n();
-  export const columns: BasicColumn[] = [
+  const columns: BasicColumn[] = [
     {
       title: t('组织名称'),
       dataIndex: 'name',
@@ -125,7 +125,7 @@
     },
   ];
 
-  export const searchFormSchema: FormSchema[] = [
+  const searchFormSchema: FormSchema[] = [
     {
       field: 'name',
       label: t('组织名称'),
@@ -152,106 +152,86 @@
     },
   ];
 
-  export default defineComponent({
-    name: 'DeptManagement',
-    components: { BasicTable, TableAction, DeptDrawer, PageWrapper, SelectMember },
-    setup() {
-      const { notification } = useMessage();
-      const [registerDrawer, { openModal }] = useModal();
-      const [registerTable, { reload }] = useTable({
-        title: t('组织列表'),
-        api: getDepartmentEnabledTree,
-        columns,
-        formConfig: {
-          rowProps: {
-            gutter: 16,
-          },
-          schemas: searchFormSchema,
-          actionColOptions: { span: 16 },
-        },
-        beforeFetch: (params) => {
-          return {
-            ...params,
-            isOrg: 1,
-          };
-        },
-        pagination: {
-          pageSize: 20,
-        },
-        striped: false,
-        useSearchForm: true,
-        showTableSetting: true,
-        showIndexColumn: false,
-        actionColumn: {
-          width: 100,
-          title: t('操作'),
-          dataIndex: 'action',
-          slots: { customRender: 'action' },
-        },
-      });
-
-      const visible = ref<boolean>(false);
-      const selectedUserIds = ref<string[]>([]);
-      const deptId = ref('');
+  const { notification } = useMessage();
+  const [registerDrawer, { openModal }] = useModal();
+  const [registerTable, { reload }] = useTable({
+    title: t('组织列表'),
+    api: getDepartmentEnabledTree,
+    columns,
+    formConfig: {
+      rowProps: {
+        gutter: 16,
+      },
+      schemas: searchFormSchema,
+      actionColOptions: { span: 16 },
+    },
+    beforeFetch: (params) => {
+      return {
+        ...params,
+        isOrg: 1,
+      };
+    },
+    pagination: {
+      pageSize: 20,
+    },
+    striped: false,
+    useSearchForm: true,
+    showTableSetting: true,
+    showIndexColumn: false,
+    actionColumn: {
+      width: 100,
+      title: t('操作'),
+      dataIndex: 'action',
+      slots: { customRender: 'action' },
+    },
+  });
 
-      function handleCreate() {
-        openModal(true, {
-          isUpdate: false,
-        });
-      }
+  const visible = ref<boolean>(false);
+  const selectedUserIds = ref<string[]>([]);
+  const deptId = ref('');
 
-      function handleEdit(record: Recordable) {
-        openModal(true, {
-          record,
-          isUpdate: true,
-        });
-      }
+  function handleCreate() {
+    openModal(true, {
+      isUpdate: false,
+    });
+  }
 
-      function handleDelete(record: Recordable) {
-        deleteDepartment([record.id]).then((_) => {
-          reload();
-          notification.success({
-            message: t('提示'),
-            description: t('删除成功'),
-          }); //提示消息
-        });
-      }
-      function handleAddUser(record: Recordable) {
-        deptId.value = record.id;
-        getDepartmentUserList({ id: record.id }).then((res) => {
-          selectedUserIds.value = res.map((it) => {
-            return it.id;
-          });
-          visible.value = true;
-        });
-      }
+  function handleEdit(record: Recordable) {
+    openModal(true, {
+      record,
+      isUpdate: true,
+    });
+  }
 
-      function handleDeptUser(v) {
-        updateDepartmentUser({ id: deptId.value, userIds: v }).then(() => {
-          notification.success({
-            message: '添加人员',
-            description: t('成功'),
-          });
-        });
-      }
+  function handleDelete(record: Recordable) {
+    deleteDepartment([record.id]).then((_) => {
+      reload();
+      notification.success({
+        message: t('提示'),
+        description: t('删除成功'),
+      }); //提示消息
+    });
+  }
+  function handleAddUser(record: Recordable) {
+    deptId.value = record.id;
+    getDepartmentUserList({ id: record.id }).then((res) => {
+      selectedUserIds.value = res.map((it) => {
+        return it.id;
+      });
+      visible.value = true;
+    });
+  }
 
-      function handleSuccess() {
-        reload();
-      }
+  function handleDeptUser(v) {
+    updateDepartmentUser({ id: deptId.value, userIds: v }).then(() => {
+      notification.success({
+        message: '添加人员',
+        description: t('成功'),
+      });
+    });
+  }
 
-      return {
-        registerTable,
-        registerDrawer,
-        handleCreate,
-        handleEdit,
-        handleDelete,
-        handleAddUser,
-        handleDeptUser,
-        handleSuccess,
-        visible,
-        selectedUserIds,
-        t,
-      };
-    },
-  });
+  function handleSuccess() {
+    reload();
+  }
 </script>