🐞 fix:修复了助学贷款的搜索页面

This commit is contained in:
sundongyu 2024-04-10 11:46:41 +08:00
parent 4c9667e84b
commit a5c42f3bc3
8 changed files with 1013 additions and 6 deletions

View File

@ -44,6 +44,7 @@ const daily = Mock.mock({
}) })
export default [ export default [
//应收管理列表
{ {
url: '/get-sdy-managment-list', url: '/get-sdy-managment-list',
method: 'get', method: 'get',
@ -54,6 +55,7 @@ export default [
} }
} }
}, },
// 应收管理搜索
{ {
url: '/post-sdy-managment-find', url: '/post-sdy-managment-find',
method: 'post', 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', url: '/post-sdy-loan-add',
@ -122,6 +143,7 @@ export default [
} }
} }
}, },
// 当日明细列表
{ {
url: '/post-sdy-daily-list', url: '/post-sdy-daily-list',
method: 'get', method: 'get',
@ -132,4 +154,5 @@ export default [
} }
} }
} }
] ]

914
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,6 +12,10 @@ export function APILoansList() {
return request.get('/get-sdy-loan-list') return request.get('/get-sdy-loan-list')
} }
//查询贷款 //查询贷款
export function APILoansFind(data) {
return request.post('/post-sdy-loan-find', data)
}
//添加贷款
export function APILoansAdd(data) { export function APILoansAdd(data) {
return request.post('/post-sdy-loan-add', data) return request.post('/post-sdy-loan-add', data)
} }

View File

@ -51,6 +51,9 @@
<t-menu-item value="3-4" to="/daily"> <t-menu-item value="3-4" to="/daily">
<span>收费日报</span> <span>收费日报</span>
</t-menu-item> </t-menu-item>
<t-menu-item value="3-5" to="/charge-schedule">
<span>收费明细</span>
</t-menu-item>
</t-submenu> </t-submenu>
<t-submenu value="4" title="学生管理"> <t-submenu value="4" title="学生管理">
<template #icon> <template #icon>

View File

@ -90,6 +90,11 @@
</template> </template>
</t-table> </t-table>
</div> </div>
<div>
<t-button style="margin-top: 1rem" type="primary" @click="handleExport"
>导出excel表格</t-button
>
</div>
</div> </div>
</template> </template>
<script setup> <script setup>
@ -99,6 +104,7 @@ import {
APIReceivablesAdd APIReceivablesAdd
} from '@/api/receivables-management/management' } from '@/api/receivables-management/management'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { ExcelUtils } from '@/utils/excel'
const router = useRouter() const router = useRouter()
// //
const formData = reactive({ const formData = reactive({
@ -265,6 +271,31 @@ const hreturn = row => {
path: 'bill-bill' 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(() => { onMounted(() => {
ReceivablesList() ReceivablesList()
}) })

View File

@ -0,0 +1,7 @@
<template>
<div>1</div>
</template>
<script setup></script>
<style lang="less" scoped></style>

View File

@ -50,7 +50,7 @@
:pagination="pagination" :pagination="pagination"
:show-header="true" :show-header="true"
cell-empty-content="-" cell-empty-content="-"
resizable max-height="550"
lazy-load lazy-load
:loading="loading" :loading="loading"
@row-click="handleRowClick" @row-click="handleRowClick"
@ -124,7 +124,8 @@
import { ref, onMounted } from 'vue' import { ref, onMounted } from 'vue'
import { import {
APILoansList, APILoansList,
APILoansAdd APILoansAdd,
APILoansFind
} from '@/api/receivables-management/management' } from '@/api/receivables-management/management'
import * as echarts from 'echarts' import * as echarts from 'echarts'
// //
@ -149,6 +150,7 @@ const columns = ref([
// //
const pagination = ref({ const pagination = ref({
defaultCurrent: 1, defaultCurrent: 1,
current: 1,
defaultPageSize: 10, defaultPageSize: 10,
total: 30 total: 30
}) })
@ -174,7 +176,8 @@ const handleRowClick = e => {
console.log(e) console.log(e)
} }
// //
const onPageChange = () => { const onPageChange = pageInfo => {
pagination.value.current = pageInfo.current
loading.value = true loading.value = true
const timerId = setTimeout(() => { const timerId = setTimeout(() => {
loading.value = false loading.value = false
@ -186,13 +189,33 @@ const LoansList = async () => {
const res = await APILoansList() const res = await APILoansList()
data.value = res.data.list data.value = res.data.list
pagination.value.total = res.data.list.length pagination.value.total = res.data.list.length
pagination.value.current = 1
} }
// //
const onReset = () => { const onReset = () => {
loading.value = true
LoansList() 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 => { const onClick = context => {
console.log('点击了确认按钮,弹出弹窗', context) console.log('点击了确认按钮,弹出弹窗', context)

View File

@ -43,6 +43,12 @@ const ReceivablesManagement = [
name: "Daily", name: "Daily",
component: () => import("@/pages/receivables-management/daily.vue"), 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: "收费明细", },
} }
], ],
}, },