From dfdfbd2c5a71c9cdf39bdea0c9eae30435444253 Mon Sep 17 00:00:00 2001 From: sundongyu <2811054731@qq.com> Date: Sun, 7 Apr 2024 21:41:06 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=E5=AE=8C=E6=88=90=E5=BA=94?= =?UTF-8?q?=E6=94=B6=E7=AE=A1=E7=90=86=E7=9A=84=E5=AD=A6=E7=94=9F=E8=B4=B9?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/modules/sdy.js | 1 + package-lock.json | 4 +- package.json | 1 + src/layout/components/LayoutAside.vue | 2 +- .../accountReceivable.vue | 65 ++++-- .../receivables-management/billCollected.vue | 194 ++++++++++++++++++ src/router/modules/receivables-management.js | 6 + 7 files changed, 251 insertions(+), 22 deletions(-) create mode 100644 src/pages/receivables-management/billCollected.vue diff --git a/mock/modules/sdy.js b/mock/modules/sdy.js index 38331f9..f748914 100644 --- a/mock/modules/sdy.js +++ b/mock/modules/sdy.js @@ -9,6 +9,7 @@ const data = Mock.mock({ "major": `@pick(['机械制造与自动化', '材料科学与工程', '环境科学与工程', '建筑工程', '护理学'])`, "grade": `@pick(['机制1班', '材料1班', '环境1班', '建筑1班','护理1班'])`, "tuition": `@pick(['已付学费', '未缴学费'])`, + "tu": 16800, } ] }) diff --git a/package-lock.json b/package-lock.json index bc6aac9..dbf7f58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "axios": "^1.6.8", + "dayjs": "^1.11.10", "less": "^4.2.0", "mockjs": "^1.1.0", "pinia": "^2.1.7", @@ -998,7 +999,8 @@ }, "node_modules/dayjs": { "version": "1.11.10", - "license": "MIT" + "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.10.tgz", + "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==" }, "node_modules/debug": { "version": "4.3.4", diff --git a/package.json b/package.json index c275677..98f0615 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "axios": "^1.6.8", + "dayjs": "^1.11.10", "less": "^4.2.0", "mockjs": "^1.1.0", "pinia": "^2.1.7", diff --git a/src/layout/components/LayoutAside.vue b/src/layout/components/LayoutAside.vue index aee43c0..d011cab 100644 --- a/src/layout/components/LayoutAside.vue +++ b/src/layout/components/LayoutAside.vue @@ -14,7 +14,7 @@ - 菜单二 + 应收款管理 diff --git a/src/pages/receivables-management/accountReceivable.vue b/src/pages/receivables-management/accountReceivable.vue index 522ca63..05f5711 100644 --- a/src/pages/receivables-management/accountReceivable.vue +++ b/src/pages/receivables-management/accountReceivable.vue @@ -78,6 +78,11 @@ }} {{ row.tuition }} + @@ -88,6 +93,8 @@ import { APIReceivablesList, APIReceivablesAdd } from '@/api/receivables-management/management' +import { useRouter } from 'vue-router' +const router = useRouter() //表单数据 const formData = reactive({ name: '', @@ -179,23 +186,6 @@ const CONDITION = [ ] // 表格数据 const tableData = ref([]) -//表单提交 -const onSubmit = async () => { - const res = await APIReceivablesAdd(formData) - console.log(res) - tableData.value = res - pagination.total = res.length -} -// 表格加载状态 -const loading = ref(false) -//表单重置 -const onReset = () => { - ReceivablesList() -} -// 表格点击事件 -const handleRowClick = e => { - console.log(e) -} // 表格头数据 const columns = ref([ { colKey: 'serial-number' }, @@ -204,15 +194,43 @@ const columns = ref([ { colKey: 'department', title: '部门' }, { colKey: 'major', title: '专业' }, { colKey: 'grade', title: '班级' }, - { colKey: 'tuition', title: '是否缴费' } + { colKey: 'tuition', title: '是否缴费' }, + { colKey: 'action', title: '操作', align: 'center' } ]) - // 表格分页数据 let pagination = { defaultCurrent: 1, - defaultPageSize: 5, + defaultPageSize: 10, total: 50 } +//表单提交 +const onSubmit = async () => { + if ( + formData.name || + formData.studentnumber || + formData.department || + formData.major || + formData.grade || + formData.tuition + ) { + const res = await APIReceivablesAdd(formData) + console.log(res) + tableData.value = Array.from(res) + pagination.total = res.length + } else { + alert('请填写完整信息') + } +} +// 表格加载状态 +const loading = ref(false) +//表单重置 +const onReset = () => { + ReceivablesList() +} +// 表格点击事件 +const handleRowClick = e => { + console.log(e) +} //获取表格数据 const ReceivablesList = async () => { loading.value = true @@ -229,6 +247,13 @@ const onPageChange = (Newpage, PreviousPagePrev) => { clearInterval(timerId) }, 300) } +//跳转票据页面 +const handleTicket = row => { + router.push({ + path: '/billCollected', + query: row + }) +} onMounted(() => { ReceivablesList() }) diff --git a/src/pages/receivables-management/billCollected.vue b/src/pages/receivables-management/billCollected.vue new file mode 100644 index 0000000..e5bf965 --- /dev/null +++ b/src/pages/receivables-management/billCollected.vue @@ -0,0 +1,194 @@ + + + + diff --git a/src/router/modules/receivables-management.js b/src/router/modules/receivables-management.js index f96f692..f6991c7 100644 --- a/src/router/modules/receivables-management.js +++ b/src/router/modules/receivables-management.js @@ -15,6 +15,12 @@ const ReceivablesManagement = [ title: "应收款管理", }, }, + { + path: "/billCollected", + name: "BillCollected", + component: () => import("@/pages/receivables-management/billCollected.vue"), + meta: { title: "票据收款", hidden: false }, + } ], }, ];