This commit is contained in:
吕才卓 2024-04-10 18:03:02 +08:00
commit 087756c014
12 changed files with 539 additions and 8 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 [
} }
} }
} }
] ]

View File

@ -16,6 +16,7 @@
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"less": "^4.2.0", "less": "^4.2.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"pdfmake": "^0.2.10",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"tdesign-vue-next": "^1.9.3", "tdesign-vue-next": "^1.9.3",
@ -26,6 +27,7 @@
"devDependencies": { "devDependencies": {
"@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0", "@vitejs/plugin-vue-jsx": "^3.1.0",
"gulp": "^5.0.0",
"sass": "^1.74.1", "sass": "^1.74.1",
"vite": "^5.1.6" "vite": "^5.1.6"
} }

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

@ -34,6 +34,9 @@
<t-menu-item value="2-7" to="/Bill/DetailReport"> <t-menu-item value="2-7" to="/Bill/DetailReport">
<span>报表明细</span> <span>报表明细</span>
</t-menu-item> </t-menu-item>
<t-menu-item value="2-8" to="/Bill/BillDraw">
<span>票据列表</span>
</t-menu-item>
</t-submenu> </t-submenu>
<t-submenu value="3" title="应收款管理"> <t-submenu value="3" title="应收款管理">
<template #icon> <template #icon>
@ -49,7 +52,10 @@
<span>助学贷款</span> <span>助学贷款</span>
</t-menu-item> </t-menu-item>
<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 value="3-5" to="/charge-schedule">
<span>学生催款单</span>
</t-menu-item> </t-menu-item>
</t-submenu> </t-submenu>
<t-submenu value="4" title="学生管理"> <t-submenu value="4" title="学生管理">

View File

@ -0,0 +1,343 @@
<template>
<div class="back-color">
<t-layout style="height: 90%; background-color: #f5f7fb">
<t-header class="scarch-box">
<t-form
ref="form"
:data="formData"
label-width="calc(2em + 40px)"
layout="inline"
scroll-to-first-error="smooth"
class="scarch-from"
@reset="resetting"
@submit="headerQuery"
>
<div style="margin-left: 1rem">
<t-form-item label="票据编号:" name="billserial">
<t-input v-model="formData.billserial" maxlength="10"></t-input>
</t-form-item>
<t-form-item label="入库日期:" name="stockDate">
<t-date-picker v-model="formData.stockDate" clearable />
</t-form-item>
<t-form-item
label="票据类型:"
name="billType"
style="margin-bottom: 0.3rem"
>
<t-select
v-model="formData.billType"
placeholder="请选择票据类型"
clearable
>
<t-option
v-for="item in billType"
:key="item.value"
:value="item.value"
:label="item.label"
></t-option>
</t-select>
</t-form-item>
</div>
<t-form-item style="margin-right: 1rem">
<t-button theme="primary" type="submit">查询</t-button>
<t-button theme="primary" type="reset">重置</t-button>
</t-form-item>
</t-form>
</t-header>
<t-content class="table-box">
<div class="table-header">
<div>
<h4 style="font-size: 110%">票据列表</h4>
</div>
<div>
<t-button
shape="circle"
theme="primary"
@click="refresh"
style="margin-left: 0.8rem"
>
<template #icon><load-icon /></template>
</t-button>
</div>
</div>
<t-base-table
hover
row-key="index"
:loading="loading"
:data="tableData"
:columns="columns"
:pagination="pagination"
class="table"
:max-height="550"
>
<template #stockNum="{ row }">
{{ `${row.stockNum}` }}
</template>
<template #billType="{ row }">
<div v-for="item in billType" :key="item">
<span v-if="row.billType === item.value">{{ item.label }}</span>
</div>
</template>
<template #status="slotProps">
<t-button
theme="default"
variant="text"
size="small"
@click="exportPdf(slotProps)"
>导出pdf</t-button
>
</template>
</t-base-table>
</t-content>
</t-layout>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { MessagePlugin } from "tdesign-vue-next";
import { LoadIcon } from "tdesign-icons-vue-next";
import { useStock } from "@/stores/billStock";
import { exportToPDF } from "@/utils/pdf";
//
const loading = ref(false);
const stockList = useStock();
const tableData = ref();
const data = ref();
//
const columns = ref([
{
colKey: "serial-number",
title: "序号",
width: 50,
},
{
colKey: "billserial",
title: "票据编号",
align: "center",
width: "100",
},
{
colKey: "billType",
title: "票据类型",
align: "center",
width: "100",
},
{
colKey: "stockNum",
title: "入库数量",
align: "center",
width: "100",
},
{
colKey: "stockDate",
title: "入库日期",
align: "center",
width: "100",
},
{
colKey: "operator",
title: "操作员",
align: "center",
width: "100",
},
{
colKey: "remark",
title: "备注",
align: "center",
width: "100",
},
{
colKey: "status",
title: "操作",
width: 120,
align: "center",
fixed: "right",
},
]);
//
const billType = ref([
{ label: "票据类型1", value: 0 },
{ label: "票据类型2", value: 1 },
{ label: "票据类型3", value: 2 },
{ label: "票据类型4", value: 3 },
{ label: "票据类型5", value: 4 },
]);
//
const tableList = async () => {
loading.value = true;
tableData.value = await stockList.getStockList();
data.value = await stockList.getStockList();
pagination.value.total = tableData.value.length;
const timerId = setTimeout(() => {
loading.value = false;
clearInterval(timerId);
}, 300);
};
//
const refresh = () => {
tableList();
};
//
const formData = ref({
billserial: "",
billType: "",
stockDate: "",
});
//
const pagination = ref({
defaultCurrent: 1,
defaultPageSize: 10,
total: 50,
});
//
const resetting = () => {
formData.value = {
billserial: "",
billType: "",
stockDate: "",
};
getNewTable();
};
//
const headerQuery = () => {
tableData.value = data.value;
if (
formData.value.billserial === "" &&
(formData.value.billType === undefined || formData.value.billType === "") &&
formData.value.stockDate === ""
) {
getNewTable();
} else {
const list = tableData.value.filter((item) => {
let arrList;
if (formData.value.billserial === item.billserial) {
arrList = item;
}
if (formData.value.billType === item.billType) {
arrList = item;
}
if (formData.value.stockDate === item.stockDate) {
arrList = item;
}
if (
formData.value.billserial === "" &&
formData.value.billType === "" &&
formData.value.stockDate === ""
) {
arrList = item;
}
return arrList;
});
tableData.value = list;
pagination.value.total = list.length;
}
};
// menuManagement
const getNewTable = () => {
let arr = JSON.parse(localStorage.getItem("menuManagement"));
if (arr) {
tableData.value = arr.stockList;
data.value = arr.stockList;
pagination.value.total = tableData.value.length;
} else {
tableList();
}
};
// pdf
const exportPdf = (slotProps) => {
// const content = slotProps.row;
const content = [
//
{
text: "票据标题",
style: "header",
alignment: "center",
margin: [0, 0, 0, 0],
},
//
{
columns: [
{ text: "发票编号:", style: "label", alignment: "right" },
{ text: "1234567890", style: "value" },
{ text: "日期:", style: "label", alignment: "right" },
{ text: "2023-04-05", style: "value" },
],
margin: [0, 20, 0, 0],
},
//
{
table: {
widths: ["*", "auto", "*"],
body: [
[
{ text: "商品名称", style: "tableHeader" },
{ text: "数量", style: "tableHeader" },
{ text: "单价", style: "tableHeader" },
],
["商品A", "10件", "$10.00"],
["商品B", "5件", "$20.00"],
// [{ text: "", colSpan: 2, alignment: "right" }, "$150.00"],
],
},
layout: "noBorders",
margin: [0, 20, 0, 0],
},
//
{
text: "本票据一式两份,甲乙双方各执一份,具有同等法律效力。",
style: "footer",
alignment: "center",
margin: [0, 0, 0, 30],
},
];
exportToPDF(content);
};
onMounted(() => {
getNewTable();
});
</script>
<style scoped lang="less">
.scarch-box {
width: 100%;
background-color: @base-white-color;
margin-bottom: 2rem;
.scarch-from {
height: 60px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.table-box {
height: 42rem;
background-color: @base-white-color;
padding: 1rem;
padding-top: 0;
.table-header {
height: 3rem;
display: flex;
justify-content: space-between;
align-items: center;
}
}
:deep(.t-form__controls-content) {
justify-content: space-between;
}
</style>

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

@ -11,7 +11,7 @@
/> />
</div> </div>
<div class="table"> <div class="table">
<div>1</div> <div>收费日报表</div>
<t-table <t-table
row-key="id" row-key="id"
:data="tableData" :data="tableData"
@ -21,7 +21,64 @@
:pagination="pagination" :pagination="pagination"
:show-header="true" :show-header="true"
cell-empty-content="-" 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 lazy-load
@row-click="handleRowClick" @row-click="handleRowClick"
@page-change="onPageChange" @page-change="onPageChange"

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

@ -6,6 +6,7 @@ import BillQuitneckURL from "@/pages/finance-bill-manage/billQuitneck.vue";
import BillBreakagekURL from "@/pages/finance-bill-manage/billBreakage.vue"; import BillBreakagekURL from "@/pages/finance-bill-manage/billBreakage.vue";
import BillDestroyURL from "@/pages/finance-bill-manage/billDestroy.vue"; import BillDestroyURL from "@/pages/finance-bill-manage/billDestroy.vue";
import DetailReportURL from "@/pages/finance-bill-manage/detailReport.vue"; import DetailReportURL from "@/pages/finance-bill-manage/detailReport.vue";
import BillDrawURL from "@/pages/finance-bill-manage/billDraw.vue";
const financeBillManage = [ const financeBillManage = [
{ {
@ -70,6 +71,14 @@ const financeBillManage = [
title: "报表明细", title: "报表明细",
}, },
}, },
{
path: "BillDraw",
name: "billDraw",
component: BillDrawURL,
meta: {
title: "报表明细",
},
},
], ],
}, },
]; ];

View File

@ -42,7 +42,13 @@ const ReceivablesManagement = [
path: "/daily", path: "/daily",
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: "学生催款单", },
} }
], ],
}, },

20
src/utils/pdf.js Normal file
View File

@ -0,0 +1,20 @@
import pdfMake from "pdfmake/build/pdfmake";
import pdfFonts from "pdfmake/build/vfs_fonts";
pdfMake.vfs = pdfFonts.pdfMake.vfs;
export const exportToPDF = (content) => {
const docDefinition = {
pageSize: "A4",
pageMargins: [40, 70, 40, 90],
content: content,
styles: {
header: { fontSize: 16, bold: true },
label: { fontSize: 12, bold: true },
value: { fontSize: 12 },
tableHeader: { fontSize: 12, bold: true, color: "#666" },
footer: { fontSize: 10, italics: true },
},
};
pdfMake.createPdf(docDefinition).download("output.pdf");
};