Merge branch 'dev' of https://gitea.dykj.co/sundongyu/dykj-college-back-office-management-system into dev
This commit is contained in:
commit
0d0c7de975
|
@ -26,6 +26,47 @@ const student = Mock.mock({
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/api-updateStudent',
|
||||
method: 'post',
|
||||
response: (req) => {
|
||||
if (req.body.name !== '') {
|
||||
return student.list.filter(item => item.name.includes(req.body.name))
|
||||
}
|
||||
else if (req.body.studentId !== '') {
|
||||
const studentId = Number(req.body.studentId)
|
||||
if (!isNaN(studentId)) {
|
||||
return student.list.filter(item => item.studentId === studentId)
|
||||
} else {
|
||||
return {
|
||||
code: 400,
|
||||
message: 'Invalid student number format'
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (req.body.name !== '') {
|
||||
return student.list.filter(item => item.name.includes(req.body.name))
|
||||
}
|
||||
else if (req.body.gender !== '') {
|
||||
return student.list.filter(item => item.gender.includes(req.body.gender))
|
||||
}
|
||||
else if (req.body.department !== '') {
|
||||
return student.list.filter(item => item.grade.includes(req.body.department))
|
||||
}
|
||||
else if (req.body.major !== '') {
|
||||
return student.list.filter(item => item.major.includes(req.body.major))
|
||||
}
|
||||
else if (req.body.classes !== '') {
|
||||
return student.list.filter(item => item.classes.includes(req.body.classes))
|
||||
}
|
||||
else if (req.body.status !== '') {
|
||||
return student.list.filter(item => item.major.includes(req.body.status))
|
||||
}
|
||||
return {
|
||||
code: 200,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
url: '/api-student',
|
||||
method: 'post',
|
||||
|
|
|
@ -44,6 +44,7 @@ const daily = Mock.mock({
|
|||
})
|
||||
|
||||
export default [
|
||||
//应收管理列表
|
||||
{
|
||||
url: '/get-sdy-managment-list',
|
||||
method: 'get',
|
||||
|
@ -54,6 +55,7 @@ export default [
|
|||
}
|
||||
}
|
||||
},
|
||||
// 应收管理搜索
|
||||
{
|
||||
url: '/post-sdy-managment-find',
|
||||
method: 'post',
|
||||
|
@ -100,6 +102,25 @@ export default [
|
|||
}
|
||||
}
|
||||
},
|
||||
// 借款管理搜索
|
||||
{
|
||||
url: '/post-sdy-loan-find',
|
||||
method: 'post',
|
||||
response: (req) => {
|
||||
if (req.body.name !== '') {
|
||||
const arr = loans.list.filter(item => item.proposer.includes(req.body.name))
|
||||
return arr
|
||||
} else if (req.body.studentnumber !== '') {
|
||||
const studentnumber = Number(req.body.studentnumber)
|
||||
const arr = loans.list.filter(item => item.student === studentnumber)
|
||||
return arr
|
||||
}
|
||||
return {
|
||||
code: 200,
|
||||
data: arr
|
||||
}
|
||||
}
|
||||
},
|
||||
// 添加借款人
|
||||
{
|
||||
url: '/post-sdy-loan-add',
|
||||
|
@ -122,6 +143,7 @@ export default [
|
|||
}
|
||||
}
|
||||
},
|
||||
// 当日明细列表
|
||||
{
|
||||
url: '/post-sdy-daily-list',
|
||||
method: 'get',
|
||||
|
@ -132,4 +154,5 @@ export default [
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
]
|
914
package-lock.json
generated
914
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -12,6 +12,10 @@ export function APILoansList() {
|
|||
return request.get('/get-sdy-loan-list')
|
||||
}
|
||||
//查询贷款
|
||||
export function APILoansFind(data) {
|
||||
return request.post('/post-sdy-loan-find', data)
|
||||
}
|
||||
//添加贷款
|
||||
export function APILoansAdd(data) {
|
||||
return request.post('/post-sdy-loan-add', data)
|
||||
}
|
||||
|
|
|
@ -6,3 +6,7 @@ export function getList() {
|
|||
export function getStudents(studentData) {
|
||||
return request.post('/api-student', studentData)
|
||||
}
|
||||
|
||||
export function updateStudent(updateStudent) {
|
||||
return request.post('/api-updateStudent', updateStudent)
|
||||
}
|
|
@ -52,7 +52,10 @@
|
|||
<span>助学贷款</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="3-4" to="/daily">
|
||||
<span>收费日报</span>
|
||||
<span>收费日报及收费明细</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="3-5" to="/charge-schedule">
|
||||
<span>学生催款单</span>
|
||||
</t-menu-item>
|
||||
</t-submenu>
|
||||
<t-submenu value="4" title="学生管理">
|
||||
|
|
|
@ -90,6 +90,11 @@
|
|||
</template>
|
||||
</t-table>
|
||||
</div>
|
||||
<div>
|
||||
<t-button style="margin-top: 1rem" type="primary" @click="handleExport"
|
||||
>导出excel表格</t-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
|
@ -99,6 +104,7 @@ import {
|
|||
APIReceivablesAdd
|
||||
} from '@/api/receivables-management/management'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ExcelUtils } from '@/utils/excel'
|
||||
const router = useRouter()
|
||||
//表单数据
|
||||
const formData = reactive({
|
||||
|
@ -265,6 +271,31 @@ const hreturn = row => {
|
|||
path: 'bill-bill'
|
||||
})
|
||||
}
|
||||
//导出excel表格
|
||||
const handleExport = () => {
|
||||
const title = '报表明细excel'
|
||||
const titleFile = '报表明细'
|
||||
const columns = [
|
||||
{ header: '姓名', key: '1', width: 20 },
|
||||
{ header: '学号', key: '2', width: 20 },
|
||||
{ header: '部门', key: '3', width: 20 },
|
||||
{ header: '专业', key: '4', width: 20 },
|
||||
{ header: '班级', key: '5', width: 20 },
|
||||
{ header: '是否缴费', key: '6', width: 20 }
|
||||
]
|
||||
const addRow = []
|
||||
tableData.value.forEach(item => {
|
||||
addRow.push({
|
||||
1: item.name,
|
||||
2: item.studentnumber,
|
||||
3: item.department,
|
||||
4: item.major,
|
||||
5: item.grade,
|
||||
6: item.tuition
|
||||
})
|
||||
})
|
||||
ExcelUtils(title, titleFile, columns, addRow)
|
||||
}
|
||||
onMounted(() => {
|
||||
ReceivablesList()
|
||||
})
|
||||
|
|
7
src/pages/receivables-management/chargeSchedule.vue
Normal file
7
src/pages/receivables-management/chargeSchedule.vue
Normal file
|
@ -0,0 +1,7 @@
|
|||
<template>
|
||||
<div>1</div>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
|
||||
<style lang="less" scoped></style>
|
|
@ -11,7 +11,7 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="table">
|
||||
<div>1</div>
|
||||
<div>收费日报表</div>
|
||||
<t-table
|
||||
row-key="id"
|
||||
:data="tableData"
|
||||
|
@ -21,7 +21,64 @@
|
|||
:pagination="pagination"
|
||||
:show-header="true"
|
||||
cell-empty-content="-"
|
||||
max-height="500"
|
||||
max-height="550"
|
||||
lazy-load
|
||||
@row-click="handleRowClick"
|
||||
@page-change="onPageChange"
|
||||
:loading="loading"
|
||||
>
|
||||
</t-table>
|
||||
</div>
|
||||
<div class="table">
|
||||
<div>减免明细表</div>
|
||||
<t-table
|
||||
row-key="id"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:hover="true"
|
||||
table-layout="auto"
|
||||
:pagination="pagination"
|
||||
:show-header="true"
|
||||
cell-empty-content="-"
|
||||
max-height="550"
|
||||
lazy-load
|
||||
@row-click="handleRowClick"
|
||||
@page-change="onPageChange"
|
||||
:loading="loading"
|
||||
>
|
||||
</t-table>
|
||||
</div>
|
||||
<div class="table">
|
||||
<div>退费明细表</div>
|
||||
<t-table
|
||||
row-key="id"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:hover="true"
|
||||
table-layout="auto"
|
||||
:pagination="pagination"
|
||||
:show-header="true"
|
||||
cell-empty-content="-"
|
||||
max-height="550"
|
||||
lazy-load
|
||||
@row-click="handleRowClick"
|
||||
@page-change="onPageChange"
|
||||
:loading="loading"
|
||||
>
|
||||
</t-table>
|
||||
</div>
|
||||
<div class="table">
|
||||
<div>学生欠费明细表</div>
|
||||
<t-table
|
||||
row-key="id"
|
||||
:data="tableData"
|
||||
:columns="columns"
|
||||
:hover="true"
|
||||
table-layout="auto"
|
||||
:pagination="pagination"
|
||||
:show-header="true"
|
||||
cell-empty-content="-"
|
||||
max-height="550"
|
||||
lazy-load
|
||||
@row-click="handleRowClick"
|
||||
@page-change="onPageChange"
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
:pagination="pagination"
|
||||
:show-header="true"
|
||||
cell-empty-content="-"
|
||||
resizable
|
||||
max-height="550"
|
||||
lazy-load
|
||||
:loading="loading"
|
||||
@row-click="handleRowClick"
|
||||
|
@ -124,7 +124,8 @@
|
|||
import { ref, onMounted } from 'vue'
|
||||
import {
|
||||
APILoansList,
|
||||
APILoansAdd
|
||||
APILoansAdd,
|
||||
APILoansFind
|
||||
} from '@/api/receivables-management/management'
|
||||
import * as echarts from 'echarts'
|
||||
// 表格数据
|
||||
|
@ -149,6 +150,7 @@ const columns = ref([
|
|||
//页码
|
||||
const pagination = ref({
|
||||
defaultCurrent: 1,
|
||||
current: 1,
|
||||
defaultPageSize: 10,
|
||||
total: 30
|
||||
})
|
||||
|
@ -174,7 +176,8 @@ const handleRowClick = e => {
|
|||
console.log(e)
|
||||
}
|
||||
//监听页码变化了
|
||||
const onPageChange = () => {
|
||||
const onPageChange = pageInfo => {
|
||||
pagination.value.current = pageInfo.current
|
||||
loading.value = true
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false
|
||||
|
@ -186,13 +189,33 @@ const LoansList = async () => {
|
|||
const res = await APILoansList()
|
||||
data.value = res.data.list
|
||||
pagination.value.total = res.data.list.length
|
||||
pagination.value.current = 1
|
||||
}
|
||||
//表单重置
|
||||
const onReset = () => {
|
||||
loading.value = true
|
||||
LoansList()
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false
|
||||
clearInterval(timerId)
|
||||
}, 300)
|
||||
}
|
||||
//表单提交
|
||||
const onSubmit = async () => {}
|
||||
const onSubmit = async () => {
|
||||
console.log('表单提交', formData.value)
|
||||
if (formData.value.name !== '') {
|
||||
const res = await APILoansFind(formData.value)
|
||||
data.value = res
|
||||
pagination.value.total = res.data.length
|
||||
pagination.value.current = 1
|
||||
}
|
||||
if (formData.value.studentnumber !== '') {
|
||||
const res = await APILoansFind(formData.value)
|
||||
data.value = res
|
||||
pagination.value.total = res.data.length
|
||||
pagination.value.current = 1
|
||||
}
|
||||
}
|
||||
//弹出框
|
||||
const onClick = context => {
|
||||
console.log('点击了确认按钮,弹出弹窗', context)
|
||||
|
|
|
@ -22,17 +22,30 @@
|
|||
</t-form-item>
|
||||
</t-col>
|
||||
<t-col :push="2" :span="4">
|
||||
<t-button theme="primary" type="submit"
|
||||
>查询</t-button
|
||||
>
|
||||
<t-button theme="default" variant="base" type="reset"
|
||||
style="margin-left: 1rem;">重置</t-button
|
||||
<t-button theme="primary" type="submit">查询</t-button>
|
||||
<t-button
|
||||
theme="default"
|
||||
variant="base"
|
||||
type="reset"
|
||||
style="margin-left: 1rem"
|
||||
>重置</t-button
|
||||
>
|
||||
</t-col>
|
||||
</t-row>
|
||||
</t-form>
|
||||
</t-header>
|
||||
<t-content class="table-box">
|
||||
<div class="table-header">
|
||||
<div>
|
||||
<h4 style="font-size: 110%">学生列表</h4>
|
||||
</div>
|
||||
<div>
|
||||
<t-button theme="primary" size="small" style="margin-right:2.5rem" @click="onAddSubmit">
|
||||
<template #icon><add-icon /></template>
|
||||
增加学员信息
|
||||
</t-button>
|
||||
</div>
|
||||
</div>
|
||||
<t-table
|
||||
rowKey="Id"
|
||||
:data="studentList"
|
||||
|
@ -59,10 +72,7 @@
|
|||
@click="Modify(row)"
|
||||
>修改</t-button
|
||||
>
|
||||
<t-popconfirm
|
||||
content="确认删除吗"
|
||||
@confirm="Delete(row)"
|
||||
>
|
||||
<t-popconfirm content="确认删除吗" @confirm="Delete(row)">
|
||||
<t-button theme="default" variant="text" size="small"
|
||||
>删除</t-button
|
||||
>
|
||||
|
@ -71,46 +81,66 @@
|
|||
</t-table>
|
||||
</t-content>
|
||||
</t-layout>
|
||||
|
||||
<t-space>
|
||||
<t-dialog
|
||||
ref="postForm"
|
||||
v-model="visible"
|
||||
header="学生变动处理"
|
||||
width="40%"
|
||||
:confirm-on-enter="true"
|
||||
:on-cancel="onCancel"
|
||||
:on-esc-keydown="onEscKeydown"
|
||||
:on-close-btn-click="onCloseBtnClick"
|
||||
:on-overlay-click="onOverlayClick"
|
||||
:on-close="close"
|
||||
:on-confirm="onConfirmAnother"
|
||||
:close-on-overlay-click="false"
|
||||
ref="postForm"
|
||||
>
|
||||
<t-space direction="vertical" style="width: 100%">
|
||||
<div>
|
||||
<t-form
|
||||
ref="form"
|
||||
:data="formData"
|
||||
:data="dialogData"
|
||||
reset-type="initial"
|
||||
colon
|
||||
@reset="onReset"
|
||||
>
|
||||
<t-form-item label="姓名" name="name">
|
||||
<t-input v-model="formData.name"></t-input>
|
||||
<t-input v-model="dialogData.name"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="性别" name="gender">
|
||||
<t-input v-model="formData.gender"></t-input>
|
||||
<t-input v-model="dialogData.gender"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="学号" name="studentId">
|
||||
<t-input v-model="formData.studentId"></t-input>
|
||||
<t-input v-model="dialogData.studentId"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="系院" name="department">
|
||||
<t-input v-model="formData.department"></t-input>
|
||||
<t-input v-model="dialogData.department"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="专业" name="major">
|
||||
<t-input v-model="formData.major"></t-input>
|
||||
<t-input v-model="dialogData.major"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="班级" name="classes">
|
||||
<t-input v-model="formData.classes"></t-input>
|
||||
<t-input v-model="dialogData.classes"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="状态" name="status">
|
||||
<t-input v-model="formData.status"></t-input>
|
||||
<t-form-item
|
||||
label="状态"
|
||||
name="status"
|
||||
:span="12"
|
||||
style="width: 16rem; margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-select
|
||||
v-model="dialogData.status"
|
||||
clearable
|
||||
placeholder="请选择状态"
|
||||
>
|
||||
<t-option
|
||||
v-for="item in status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
|
@ -118,12 +148,77 @@
|
|||
</t-dialog>
|
||||
</t-space>
|
||||
|
||||
<!-- <t-space>
|
||||
<t-dialog
|
||||
v-model:visible="visible"
|
||||
header="新增学生信息"
|
||||
width="40%"
|
||||
:confirm-on-enter="true"
|
||||
:on-cancel="onCancel"
|
||||
:on-esc-keydown="onEscKeydown"
|
||||
:on-close-btn-click="onCloseBtnClick"
|
||||
:on-overlay-click="onOverlayClick"
|
||||
:on-close="close"
|
||||
:on-confirm="onConfirmAnother"
|
||||
ref="postForm"
|
||||
>
|
||||
<t-space direction="vertical" style="width: 100%">
|
||||
<div>
|
||||
<t-form
|
||||
ref="form"
|
||||
:data="AddDialogData"
|
||||
reset-type="initial"
|
||||
colon
|
||||
@reset="onReset"
|
||||
>
|
||||
<t-form-item label="姓名" name="name">
|
||||
<t-input v-model="AddDialogData.name"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="性别" name="gender">
|
||||
<t-input v-model="AddDialogData.gender"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="学号" name="studentId">
|
||||
<t-input v-model="AddDialogData.studentId"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="系院" name="department">
|
||||
<t-input v-model="AddDialogData.department"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="专业" name="major">
|
||||
<t-input v-model="AddDialogData.major"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="班级" name="classes">
|
||||
<t-input v-model="AddDialogData.classes"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item
|
||||
label="状态"
|
||||
name="status"
|
||||
:span="12"
|
||||
style="width: 16rem; margin-bottom: 0.5rem"
|
||||
>
|
||||
<t-select
|
||||
v-model="AddDialogData.status"
|
||||
clearable
|
||||
placeholder="请选择状态"
|
||||
>
|
||||
<t-option
|
||||
v-for="item in status"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</t-select>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</div>
|
||||
</t-space>
|
||||
</t-dialog>
|
||||
</t-space> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted } from "vue";
|
||||
import {getList, getStudents } from "@/api/students";
|
||||
import { getList, getStudents, updateStudent } from "@/api/students";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { useRouter } from "vue-router";
|
||||
// import { reqStudent } from "@/api/students";
|
||||
|
@ -142,7 +237,7 @@ const studentData = reactive({
|
|||
});
|
||||
|
||||
// 弹出框表单
|
||||
const formData = ref({
|
||||
const dialogData = ref({
|
||||
name: "",
|
||||
gender: "",
|
||||
studentId: "",
|
||||
|
@ -150,8 +245,19 @@ const formData = ref({
|
|||
major: "",
|
||||
classes: "",
|
||||
status: "",
|
||||
})
|
||||
const visible = ref(true)
|
||||
});
|
||||
|
||||
// const AddDialogData = ref({
|
||||
// name: "",
|
||||
// gender: "",
|
||||
// studentId: "",
|
||||
// department: "",
|
||||
// major: "",
|
||||
// classes: "",
|
||||
// status: "",
|
||||
// });
|
||||
|
||||
const visible = ref(false);
|
||||
const studentList = ref([]);
|
||||
|
||||
const studentColumns = ref([
|
||||
|
@ -190,7 +296,7 @@ const studentColumns = ref([
|
|||
{
|
||||
colKey: "operation",
|
||||
title: "操作",
|
||||
align: "center"
|
||||
align: "center",
|
||||
},
|
||||
]);
|
||||
|
||||
|
@ -223,27 +329,32 @@ const onSubmit = async () => {
|
|||
|
||||
//表单重置
|
||||
const onReset = () => {
|
||||
TableData()
|
||||
}
|
||||
TableData();
|
||||
};
|
||||
|
||||
const status = ref([
|
||||
{ label: "休学", value: 0 },
|
||||
{ label: "退学", value: 1 },
|
||||
{ label: "复学", value: 2 },
|
||||
]);
|
||||
|
||||
//获取表格数据
|
||||
const TableData = async () => {
|
||||
const res = await getList()
|
||||
const res = await getList();
|
||||
// console.log(res);
|
||||
studentList.value = res.data.list
|
||||
pagination.total = res.data.list.length
|
||||
}
|
||||
console.log(TableData.name);
|
||||
studentList.value = res.data.list;
|
||||
pagination.total = res.data.list.length;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
TableData()
|
||||
})
|
||||
TableData();
|
||||
});
|
||||
|
||||
// 修改学生状态
|
||||
const Modify = row => {
|
||||
conlose.log(1)
|
||||
const Modify = (row) => {
|
||||
console.log("点击了确认按钮,弹出弹窗", row);
|
||||
visible.value = true;
|
||||
formData.value = {
|
||||
dialogData.value = {
|
||||
name: row.name,
|
||||
gender: row.gender,
|
||||
studentId: row.studentId,
|
||||
|
@ -254,16 +365,85 @@ const Modify = row => {
|
|||
};
|
||||
};
|
||||
|
||||
// const onConfirmAnother = async () => {
|
||||
// console.log("点击了确认按钮", );
|
||||
// visible.value = false;
|
||||
// await updateStudent(dialogData.value)
|
||||
|
||||
// };
|
||||
const onConfirmAnother = async () => {
|
||||
console.log("点击了确认按钮");
|
||||
// 准备要更新的数据
|
||||
const studentId = dialogData.value.studentId;
|
||||
// 调用更新学生信息的接口
|
||||
try {
|
||||
// 这里假设存在一个更新学生信息的API方法,例如updateStudent
|
||||
await updateStudent(formData.value);
|
||||
// 更新成功后,关闭弹窗并重新加载表格数据
|
||||
visible.value = false;
|
||||
TableData();
|
||||
} catch (error) {
|
||||
console.error('更新学生信息失败:', error);
|
||||
const response = await updateStudent({ ...dialogData.value, studentId });
|
||||
// 检查接口返回结果是否成功
|
||||
if (response.success) {
|
||||
// 同步更新表格数据(这部分逻辑已在之前的解答中给出)
|
||||
const index = studentList.value.findIndex(
|
||||
(stu) => stu.studentId === studentId
|
||||
);
|
||||
if (index !== -1) {
|
||||
studentList.value.splice(index, 1, dialogData.value);
|
||||
}
|
||||
|
||||
MessagePlugin.success("学生信息更新成功");
|
||||
} else {
|
||||
MessagePlugin.error(response.message || "学生信息更新失败");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("更新学生信息时发生错误", error);
|
||||
MessagePlugin.error("学生信息更新失败");
|
||||
}
|
||||
// 关闭对话框
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const Delete = async (row) => {
|
||||
try {
|
||||
// 调用删除学生的API,这里假设后端接口名为deleteStudent,且需要学生ID作为参数
|
||||
const response = await deleteStudent(row.studentId);
|
||||
|
||||
if (response.success) {
|
||||
// 删除表格数据中对应的学生记录
|
||||
const index = studentList.value.findIndex((stu) => stu.studentId === row.studentId);
|
||||
if (index !== -1) {
|
||||
studentList.value.splice(index, 1);
|
||||
}
|
||||
|
||||
pagination.total -= 1;
|
||||
|
||||
// 提示删除成功
|
||||
MessagePlugin.success('学生信息删除成功');
|
||||
} else {
|
||||
// 提示删除失败
|
||||
MessagePlugin.error(response.message || '学生信息删除失败');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('删除学生信息时发生错误', error);
|
||||
MessagePlugin.error('学生信息删除失败');
|
||||
}
|
||||
};
|
||||
|
||||
const onAddSubmit = () =>{
|
||||
console.log("点击新增");
|
||||
visible.value = true;
|
||||
}
|
||||
const close = (context) => {
|
||||
console.log("关闭弹窗,点击关闭按钮、按下ESC、点击蒙层等触发", context);
|
||||
};
|
||||
const onCancel = (context) => {
|
||||
console.log("点击了取消按钮", context);
|
||||
};
|
||||
const onEscKeydown = (context) => {
|
||||
console.log("按下了ESC", context);
|
||||
};
|
||||
const onCloseBtnClick = (context) => {
|
||||
console.log("点击了关闭按钮", context);
|
||||
};
|
||||
const onOverlayClick = (context) => {
|
||||
console.log("点击了蒙层", context);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -42,7 +42,13 @@ const ReceivablesManagement = [
|
|||
path: "/daily",
|
||||
name: "Daily",
|
||||
component: () => import("@/pages/receivables-management/daily.vue"),
|
||||
meta: { title: "收费日报", },
|
||||
meta: { title: "收费日报及收费明细", },
|
||||
},
|
||||
{
|
||||
path: "/charge-schedule",
|
||||
name: "ChargeSchedule",
|
||||
component: () => import("@/pages/receivables-management/chargeSchedule.vue"),
|
||||
meta: { title: "学生催款单", },
|
||||
}
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user