This commit is contained in:
ycy 2024-04-08 12:02:05 +08:00
commit ee31fe4dc4
7 changed files with 236 additions and 41 deletions

View File

@ -1,6 +1,14 @@
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<t-menu> <t-menu>
<t-submenu value="3" title="首页">
<template #icon>
<t-icon name="home" />
</template>
<t-menu-item value="3-1" to="/home">
<span>首页</span>
</t-menu-item>
</t-submenu>
<t-submenu value="1" title="财务票据管理"> <t-submenu value="1" title="财务票据管理">
<template #icon> <template #icon>
<t-icon name="application" /> <t-icon name="application" />
@ -25,6 +33,9 @@
<t-menu-item value="2-1" to="/accounts"> <t-menu-item value="2-1" to="/accounts">
<span>应收款管理</span> <span>应收款管理</span>
</t-menu-item> </t-menu-item>
<t-menu-item value="2-2" to="/billCollected">
<span>学生收款</span>
</t-menu-item>
</t-submenu> </t-submenu>
</t-menu> </t-menu>
</div> </div>

7
src/pages/home/index.vue Normal file
View File

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

View File

@ -168,7 +168,7 @@ const InvoiceData = ref({
// //
xremark: '', xremark: '',
// () // ()
xcharge: Route.query.letters[0], xcharge: Route.query.letters ? Route.query.letters[0] : 0,
// () // ()
xchargebig: '', xchargebig: '',
// //

View File

@ -79,9 +79,13 @@
<t-tag v-else theme="success">{{ row.tuition }}</t-tag> <t-tag v-else theme="success">{{ row.tuition }}</t-tag>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<t-button v-if="row.tuition === '未缴学费'" @click="handleTicket(row)" <t-button
v-if="row.tuition === '未缴学费'"
theme="danger"
@click="handleTicket(row)"
>清缴学费</t-button >清缴学费</t-button
> >
<t-button v-else @click="hreturn(row)">退还学费</t-button>
</template> </template>
</t-table> </t-table>
</div> </div>
@ -254,6 +258,12 @@ const handleTicket = row => {
query: row query: row
}) })
} }
//退
const hreturn = row => {
router.push({
path: 'bill-bill'
})
}
onMounted(() => { onMounted(() => {
ReceivablesList() ReceivablesList()
}) })

View File

@ -1,5 +1,6 @@
<template> <template>
<div class="back-color"> <div class="back-color">
<div>
<t-table <t-table
ref="tableRef" ref="tableRef"
row-key="key" row-key="key"
@ -16,10 +17,82 @@
</template> </template>
</t-table> </t-table>
</div> </div>
<div v-if="judge()">
<div
style="
font-size: 2rem;
height: 5rem;
line-height: 5rem;
text-align: center;
"
>
管理学生收费
</div>
<div>
<div>
<t-row justify="end">
<t-col span="2">
<t-button theme="default" variant="text" @click="onClick"
>添加收费标准</t-button
>
</t-col>
</t-row>
</div>
<t-base-table
row-key="index"
:data="RATES_OPTIONS"
:columns="ratesColumns"
@page-change="onPageChange"
:pagination="pagination"
>
<template #operation="{ row }">
<t-button theme="default" variant="text" @click="Role(row)"
>编辑</t-button
>
<t-button theme="default" variant="text" @click="DeleteRole(row)"
>删除</t-button
>
</template>
</t-base-table>
</div>
</div>
<div>
<t-space>
<t-dialog
v-model:visible="visible"
header="添加学生收费标准"
width="30%"
: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="formData.name"></t-input>
</t-form-item>
<t-form-item label="应收金额" name="RoutingAddress">
<t-input v-model="formData.RoutingAddress"></t-input>
</t-form-item>
</t-form>
</t-space>
</t-space>
</t-dialog>
</t-space>
</div>
</div>
</template> </template>
<script setup lang="jsx"> <script setup lang="jsx">
import { ref, computed } from 'vue' import { ref, computed, reactive, watchEffect } from 'vue'
import { Input, Select } from 'tdesign-vue-next' import { Input, Select } from 'tdesign-vue-next'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
@ -27,7 +100,8 @@ import dayjs from 'dayjs'
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const initData = new Array(1).fill(null).map((_, i) => ({ const initData = reactive(
new Array(1).fill(null).map((_, i) => ({
key: String(i + 1), key: String(i + 1),
// //
firstName: route.query.name, firstName: route.query.name,
@ -37,7 +111,8 @@ const initData = new Array(1).fill(null).map((_, i) => ({
classname: route.query.grade, classname: route.query.grade,
letters: [], letters: [],
createTime: dayjs().format('YYYY-MM-DD') createTime: dayjs().format('YYYY-MM-DD')
})) }))
)
// //
const STATUS_OPTIONS = [ const STATUS_OPTIONS = [
{ label: '机电工程系', value: '机电工程系' }, { label: '机电工程系', value: '机电工程系' },
@ -54,6 +129,40 @@ const CLASS_NAME = [
{ label: '建筑1班', value: '建筑1班' }, { label: '建筑1班', value: '建筑1班' },
{ label: '护理1班', value: '护理1班' } { label: '护理1班', value: '护理1班' }
] ]
//
let RATES_OPTIONS = reactive([
{ label: '初级学生', value: '2000元' },
{ label: '中级学生', value: '3000元' },
{ label: '高级学生', value: '4000元' },
{ label: '老年学生', value: '5000元' },
{ label: '神级学生', value: '6000元' }
])
//
const ratesColumns = [
{ title: '学生收费标准', colKey: 'label' },
{
title: '学生应收费',
colKey: 'value'
},
{
title: '操作',
colKey: 'operation',
width: 200,
align: 'center'
}
]
//
const formData = ref({
name: '',
RoutingAddress: ''
})
//
const pagination = ref({
defaultPageSize: 5,
total: 5,
defaultCurrent: 1
})
const visible = ref(false)
const align = ref('left') const align = ref('left')
const data = ref([...initData]) const data = ref([...initData])
const editableCellState = cellParams => { const editableCellState = cellParams => {
@ -146,13 +255,9 @@ const columns = computed(() => [
return { return {
multiple: true, multiple: true,
minCollapsedNum: 1, minCollapsedNum: 1,
options: [ options: RATES_OPTIONS.filter(t =>
{ label: '初级学生', value: '2000元' }, t.show === undefined ? true : t.show()
{ label: '中级学生', value: '3000元' }, )
{ label: '高级学生', value: '4000元' },
{ label: '老年学生', value: '5000元' },
{ label: '神级学生', value: '6000元' }
].filter(t => (t.show === undefined ? true : t.show()))
} }
}, },
onEdited: context => { onEdited: context => {
@ -192,7 +297,55 @@ const handleEdit = row => {
path: 'bill-bill', path: 'bill-bill',
query: row query: row
}) })
console.log(row) }
//
const onClick = context => {
console.log('点击了确认按钮,弹出弹窗', context)
visible.value = true
}
const onConfirmAnother = context => {
console.log('点击了确认按钮', context)
visible.value = false
const arr = {
label: formData.value.name,
value: formData.value.RoutingAddress
}
RATES_OPTIONS.push(arr)
}
const onCancel = context => {
console.log('点击了取消按钮', context)
}
const onCloseBtnClick = context => {
console.log('点击了关闭按钮', context)
}
//
const Role = row => {
visible.value = true
formData.value = {
name: row.label,
RoutingAddress: row.value
}
}
//
const DeleteRole = row => {
console.log('删除学生收费标准', row)
RATES_OPTIONS.splice(RATES_OPTIONS.indexOf(row), 1)
}
//
const onPageChange = () => {
isLoading.value = true
const timerId = setTimeout(() => {
isLoading.value = false
clearInterval(timerId)
}, 300)
}
//
const judge = () => {
if (!route.query.name) {
return true
} else {
return false
}
} }
</script> </script>
<style scoped lang="less"></style> <style scoped lang="less"></style>

View File

@ -9,7 +9,22 @@ import Layout from "@/layout/index.vue";
const router = createRouter({ const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL), history: createWebHistory(import.meta.env.BASE_URL),
routes: [ routes: [
{
path: "/",
redirect: "/home",
meta: { title: "首页", name: "home" },
component: Layout,
children: [
{
path: "/home",
name: "home",
component: () => import("@/pages/home/index.vue"),
meta: {
title: "首页",
},
},
],
},
{ {
path: "/login", path: "/login",
name: "login", name: "login",
@ -27,7 +42,7 @@ const router = createRouter({
}, },
...FinanceBillManage, ...FinanceBillManage,
...ReceivablesManagement ...ReceivablesManagement
], ]
}); });
export default router; export default router;

View File

@ -2,8 +2,7 @@ import Layout from "@/layout/index.vue";
const ReceivablesManagement = [ const ReceivablesManagement = [
{ {
path: "/", path: "/accounts",
redirect: "/accounts",
meta: { title: "应收款管理", name: "accounts" }, meta: { title: "应收款管理", name: "accounts" },
component: Layout, component: Layout,
children: [ children: [
@ -19,7 +18,7 @@ const ReceivablesManagement = [
path: "/billCollected", path: "/billCollected",
name: "BillCollected", name: "BillCollected",
component: () => import("@/pages/receivables-management/billCollected.vue"), component: () => import("@/pages/receivables-management/billCollected.vue"),
meta: { title: "票据收款", hidden: false }, meta: { title: "票据收款", },
}, },
{ {
path: "/bill-bill", path: "/bill-bill",