diff --git a/mock/modules/sdy.js b/mock/modules/sdy.js index d2fd653..893a20c 100644 --- a/mock/modules/sdy.js +++ b/mock/modules/sdy.js @@ -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 [ } } } + ] \ No newline at end of file diff --git a/package.json b/package.json index beb66d2..cfb60b4 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "file-saver": "^2.0.5", "less": "^4.2.0", "mockjs": "^1.1.0", + "pdfmake": "^0.2.10", "pinia": "^2.1.7", "pinia-plugin-persistedstate": "^3.2.1", "tdesign-vue-next": "^1.9.3", @@ -26,6 +27,7 @@ "devDependencies": { "@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue-jsx": "^3.1.0", + "gulp": "^5.0.0", "sass": "^1.74.1", "vite": "^5.1.6" } diff --git a/src/api/receivables-management/management.js b/src/api/receivables-management/management.js index 3ec056d..ce8f9e9 100644 --- a/src/api/receivables-management/management.js +++ b/src/api/receivables-management/management.js @@ -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) } diff --git a/src/layout/components/LayoutAside.vue b/src/layout/components/LayoutAside.vue index 15d9975..512504b 100644 --- a/src/layout/components/LayoutAside.vue +++ b/src/layout/components/LayoutAside.vue @@ -34,6 +34,9 @@ 报表明细 + + 票据列表 + +
+ 导出excel表格 +
+ + diff --git a/src/pages/receivables-management/daily.vue b/src/pages/receivables-management/daily.vue index 7fed84c..a85bd14 100644 --- a/src/pages/receivables-management/daily.vue +++ b/src/pages/receivables-management/daily.vue @@ -11,7 +11,7 @@ />
-
1
+
收费日报表
+ +
+
+
减免明细表
+ + +
+
+
退费明细表
+ + +
+
+
学生欠费明细表
+ { 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) diff --git a/src/router/modules/financeBillManage.js b/src/router/modules/financeBillManage.js index 642f93f..355bc5e 100644 --- a/src/router/modules/financeBillManage.js +++ b/src/router/modules/financeBillManage.js @@ -6,6 +6,7 @@ import BillQuitneckURL from "@/pages/finance-bill-manage/billQuitneck.vue"; import BillBreakagekURL from "@/pages/finance-bill-manage/billBreakage.vue"; import BillDestroyURL from "@/pages/finance-bill-manage/billDestroy.vue"; import DetailReportURL from "@/pages/finance-bill-manage/detailReport.vue"; +import BillDrawURL from "@/pages/finance-bill-manage/billDraw.vue"; const financeBillManage = [ { @@ -70,6 +71,14 @@ const financeBillManage = [ title: "报表明细", }, }, + { + path: "BillDraw", + name: "billDraw", + component: BillDrawURL, + meta: { + title: "报表明细", + }, + }, ], }, ]; diff --git a/src/router/modules/receivablesManagement.js b/src/router/modules/receivablesManagement.js index 2f199e8..723938c 100644 --- a/src/router/modules/receivablesManagement.js +++ b/src/router/modules/receivablesManagement.js @@ -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: "学生催款单", }, } ], }, diff --git a/src/utils/pdf.js b/src/utils/pdf.js new file mode 100644 index 0000000..dd36b23 --- /dev/null +++ b/src/utils/pdf.js @@ -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"); +};