✨ feat:完成了贷款页面
This commit is contained in:
parent
735135a86b
commit
b57abb9ab7
|
@ -13,7 +13,22 @@ const data = Mock.mock({
|
|||
}
|
||||
]
|
||||
})
|
||||
const loans = Mock.mock({
|
||||
"list|45": [
|
||||
{
|
||||
"id|+1": 1,
|
||||
'proposer': '@cname',
|
||||
'student': '@integer(100000000,999999999)',
|
||||
'allowance': '@integer(10000,50000)',
|
||||
'department': '@pick(["机电工程系","护理分院","建筑系","材料科学与工程系","环境科学与工程系"])',
|
||||
'cation': '@pick(["2021-2022学年度","2022-2023学年度"])',
|
||||
'loanTerm': '@pick(["已放款","未放款"])',
|
||||
'timeofapplication': '@date("yyyy-MM-dd")',
|
||||
}
|
||||
]
|
||||
})
|
||||
export default [
|
||||
// 应收管理
|
||||
{
|
||||
url: '/get-sdy-managment-list',
|
||||
method: 'get',
|
||||
|
@ -24,6 +39,7 @@ export default [
|
|||
}
|
||||
}
|
||||
},
|
||||
// 查找应收管理
|
||||
{
|
||||
url: '/post-sdy-managment-find',
|
||||
method: 'post',
|
||||
|
@ -58,5 +74,38 @@ export default [
|
|||
code: 200,
|
||||
}
|
||||
}
|
||||
},
|
||||
// 借款管理
|
||||
{
|
||||
url: '/get-sdy-loan-list',
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return {
|
||||
code: 200,
|
||||
data: loans
|
||||
}
|
||||
}
|
||||
},
|
||||
// 添加借款人
|
||||
{
|
||||
url: '/post-sdy-loan-add',
|
||||
method: 'post',
|
||||
response: (req) => {
|
||||
const newLoan = {
|
||||
id: loans.list.length + 1,
|
||||
proposer: req.body.proposer,
|
||||
student: req.body.student,
|
||||
allowance: req.body.allowance,
|
||||
department: req.body.department,
|
||||
cation: req.body.cation,
|
||||
loanTerm: req.body.loanTerm,
|
||||
timeofapplication: req.body.timeofapplication,
|
||||
}
|
||||
loans.list.push(newLoan)
|
||||
return {
|
||||
code: 200,
|
||||
data: newLoan
|
||||
}
|
||||
}
|
||||
},
|
||||
]
|
908
package-lock.json
generated
908
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -11,6 +11,7 @@
|
|||
"dependencies": {
|
||||
"axios": "^1.6.8",
|
||||
"dayjs": "^1.11.10",
|
||||
"exceljs": "^4.4.0",
|
||||
"less": "^4.2.0",
|
||||
"mockjs": "^1.1.0",
|
||||
"pinia": "^2.1.7",
|
||||
|
|
|
@ -1,8 +1,17 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 收款管理
|
||||
export function APIReceivablesList() {
|
||||
return request.get('/get-sdy-managment-list')
|
||||
}
|
||||
//查询收款
|
||||
export function APIReceivablesAdd(data) {
|
||||
return request.post('/post-sdy-managment-find', data)
|
||||
}
|
||||
//贷款管理
|
||||
export function APILoansList() {
|
||||
return request.get('/get-sdy-loan-list')
|
||||
}
|
||||
//查询贷款
|
||||
export function APILoansAdd(data) {
|
||||
return request.post('/post-sdy-loan-add', data)
|
||||
}
|
|
@ -36,6 +36,9 @@
|
|||
<t-menu-item value="3-2" to="/billCollected">
|
||||
<span>学生收款</span>
|
||||
</t-menu-item>
|
||||
<t-menu-item value="3-3" to="/student-loan">
|
||||
<span>助学贷款</span>
|
||||
</t-menu-item>
|
||||
</t-submenu>
|
||||
<t-submenu value="4" title="学生管理">
|
||||
<template #icon>
|
||||
|
|
|
@ -180,7 +180,7 @@ const InvoiceData = ref({
|
|||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
<style lang="less" scoped>
|
||||
.headeRight {
|
||||
width: 240px;
|
||||
height: 100%;
|
||||
|
|
|
@ -199,6 +199,7 @@ const columns = ref([
|
|||
{ colKey: 'major', title: '专业' },
|
||||
{ colKey: 'grade', title: '班级' },
|
||||
{ colKey: 'tuition', title: '是否缴费' },
|
||||
{ colKey: 'tuition', title: '学贷款缴费' },
|
||||
{ colKey: 'action', title: '操作', align: 'center' }
|
||||
])
|
||||
// 表格分页数据
|
||||
|
|
202
src/pages/receivables-management/studentLoan.vue
Normal file
202
src/pages/receivables-management/studentLoan.vue
Normal file
|
@ -0,0 +1,202 @@
|
|||
<template>
|
||||
<div class="back-color">
|
||||
<!-- 表单 -->
|
||||
<div class="search-form">
|
||||
<t-form
|
||||
ref="form"
|
||||
:data="formData"
|
||||
reset-type="initial"
|
||||
colon
|
||||
@reset="onReset"
|
||||
@submit="onSubmit"
|
||||
>
|
||||
<t-row>
|
||||
<t-col :span="3">
|
||||
<t-form-item label="学生姓名" name="name">
|
||||
<t-input v-model="formData.name"></t-input>
|
||||
</t-form-item>
|
||||
</t-col>
|
||||
<t-col :span="3">
|
||||
<t-form-item label="学号" name="studentnumber">
|
||||
<t-input v-model="formData.studentnumber"></t-input>
|
||||
</t-form-item>
|
||||
</t-col>
|
||||
<t-col :push="4" :span="2">
|
||||
<t-button type="submit" class="button" style="margin-left: -0.5rem"
|
||||
>搜索</t-button
|
||||
>
|
||||
<t-button type="reset" style="margin-left: 1.5rem">重置</t-button>
|
||||
</t-col>
|
||||
</t-row>
|
||||
</t-form>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div>
|
||||
<div>
|
||||
<t-row>
|
||||
<t-col :span="3" :offset="10" style="margin-bottom: 0.5rem">
|
||||
<t-button theme="default" variant="text" @click="onClick"
|
||||
>申请助学贷款</t-button
|
||||
>
|
||||
</t-col>
|
||||
</t-row>
|
||||
</div>
|
||||
<t-table
|
||||
row-key="id"
|
||||
:data="data"
|
||||
:columns="columns"
|
||||
table-layout="fixed"
|
||||
size="medium"
|
||||
:pagination="pagination"
|
||||
:show-header="true"
|
||||
cell-empty-content="-"
|
||||
resizable
|
||||
lazy-load
|
||||
:loading="loading"
|
||||
@row-click="handleRowClick"
|
||||
@page-change="onPageChange"
|
||||
>
|
||||
</t-table>
|
||||
</div>
|
||||
<!-- 弹出框 -->
|
||||
<div>
|
||||
<t-space>
|
||||
<t-dialog
|
||||
v-model:visible="visible"
|
||||
header="申请贷款"
|
||||
width="20%"
|
||||
:on-cancel="onCancel"
|
||||
:on-close-btn-click="onCloseBtnClick"
|
||||
:on-confirm="onConfirmAnother"
|
||||
:close-on-overlay-click="false"
|
||||
>
|
||||
<t-space direction="vertical" style="width: 100%">
|
||||
<t-space direction="vertical" size="large">
|
||||
<t-form
|
||||
ref="form"
|
||||
:data="formData"
|
||||
reset-type="initial"
|
||||
colon
|
||||
@reset="onReset"
|
||||
>
|
||||
<t-form-item label="申请人" name="name">
|
||||
<t-input v-model="addData.proposer"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="学号" name="RoutingAddress">
|
||||
<t-input v-model="addData.student"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="所在部门" name="RoutingAddress">
|
||||
<t-input v-model="addData.department"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="助学金额" name="RoutingAddress">
|
||||
<t-input v-model="addData.allowance"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="是否下款" name="RoutingAddress">
|
||||
<t-input v-model="addData.loanTerm"></t-input>
|
||||
</t-form-item>
|
||||
<t-form-item label="申请时间" name="RoutingAddress">
|
||||
<t-input v-model="addData.timeofapplication"></t-input>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
</t-space>
|
||||
</t-space>
|
||||
</t-dialog>
|
||||
</t-space>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import {
|
||||
APILoansList,
|
||||
APILoansAdd
|
||||
} from '@/api/receivables-management/management'
|
||||
|
||||
const data = ref([])
|
||||
// 搜索框
|
||||
const formData = ref({
|
||||
name: '',
|
||||
studentnumber: ''
|
||||
})
|
||||
// 加载状态
|
||||
const loading = ref(false)
|
||||
//表头数据
|
||||
const columns = ref([
|
||||
{ colKey: 'proposer', title: '申请人', width: '100' },
|
||||
{ colKey: 'student', title: '学号', width: '100' },
|
||||
{ colKey: 'department', title: '所在部门', width: '100' },
|
||||
{ colKey: 'allowance', title: '助学金额', width: '100' },
|
||||
{ colKey: 'loanTerm', title: '是否下款', width: '100' },
|
||||
{ colKey: 'timeofapplication', title: '申请时间', width: '100' },
|
||||
{ colKey: 'status', title: '操作', width: '100' }
|
||||
])
|
||||
//页码
|
||||
const pagination = ref({
|
||||
defaultCurrent: 1,
|
||||
defaultPageSize: 10,
|
||||
total: 30
|
||||
})
|
||||
//弹出框
|
||||
const visible = ref(false)
|
||||
//弹出框表单数据
|
||||
const addData = ref({
|
||||
proposer: '',
|
||||
student: '',
|
||||
department: '',
|
||||
allowance: '',
|
||||
loanTerm: '',
|
||||
timeofapplication: ''
|
||||
})
|
||||
const handleRowClick = e => {
|
||||
console.log(e)
|
||||
}
|
||||
//监听页码变化了
|
||||
const onPageChange = () => {
|
||||
loading.value = true
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false
|
||||
clearInterval(timerId)
|
||||
}, 300)
|
||||
}
|
||||
//发送请求
|
||||
const LoansList = async () => {
|
||||
const res = await APILoansList()
|
||||
data.value = res.data.list
|
||||
pagination.value.total = res.data.list.length
|
||||
}
|
||||
//表单重置
|
||||
const onReset = () => {
|
||||
LoansList()
|
||||
}
|
||||
//表单提交
|
||||
const onSubmit = async () => {}
|
||||
//弹出框
|
||||
const onClick = context => {
|
||||
console.log('点击了确认按钮,弹出弹窗', context)
|
||||
visible.value = true
|
||||
}
|
||||
const onConfirmAnother = async context => {
|
||||
console.log('点击了确认按钮', context)
|
||||
await APILoansAdd(addData.value)
|
||||
visible.value = false
|
||||
}
|
||||
const onCancel = context => {
|
||||
console.log('点击了取消按钮', context)
|
||||
}
|
||||
const onCloseBtnClick = context => {
|
||||
console.log('点击了关闭按钮', context)
|
||||
}
|
||||
onMounted(() => {
|
||||
LoansList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.search-form {
|
||||
margin-bottom: 1.5rem;
|
||||
background-color: #fff;
|
||||
height: 4rem;
|
||||
padding-top: 1rem;
|
||||
}
|
||||
</style>
|
|
@ -25,6 +25,12 @@ const ReceivablesManagement = [
|
|||
name: "BillBill",
|
||||
component: () => import("@/pages/receivables-management/Bill.vue"),
|
||||
meta: { title: "票据", hidden: false },
|
||||
},
|
||||
{
|
||||
path: "/student-loan",
|
||||
name: "StudentLoan",
|
||||
component: () => import("@/pages/receivables-management/studentLoan.vue"),
|
||||
meta: { title: "助学贷款", },
|
||||
}
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user