This commit is contained in:
ycy 2024-04-08 10:37:51 +08:00
commit ea61580c55
8 changed files with 615 additions and 22 deletions

View File

@ -9,6 +9,7 @@ const data = Mock.mock({
"major": `@pick(['机械制造与自动化', '材料科学与工程', '环境科学与工程', '建筑工程', '护理学'])`, "major": `@pick(['机械制造与自动化', '材料科学与工程', '环境科学与工程', '建筑工程', '护理学'])`,
"grade": `@pick(['机制1班', '材料1班', '环境1班', '建筑1班','护理1班'])`, "grade": `@pick(['机制1班', '材料1班', '环境1班', '建筑1班','护理1班'])`,
"tuition": `@pick(['已付学费', '未缴学费'])`, "tuition": `@pick(['已付学费', '未缴学费'])`,
"tu": 16800,
} }
] ]
}) })

4
package-lock.json generated
View File

@ -9,6 +9,7 @@
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"axios": "^1.6.8", "axios": "^1.6.8",
"dayjs": "^1.11.10",
"less": "^4.2.0", "less": "^4.2.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",
@ -998,7 +999,8 @@
}, },
"node_modules/dayjs": { "node_modules/dayjs": {
"version": "1.11.10", "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": { "node_modules/debug": {
"version": "4.3.4", "version": "4.3.4",

View File

@ -10,6 +10,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^1.6.8", "axios": "^1.6.8",
"dayjs": "^1.11.10",
"less": "^4.2.0", "less": "^4.2.0",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"pinia": "^2.1.7", "pinia": "^2.1.7",

View File

@ -20,7 +20,7 @@
<t-icon name="application" /> <t-icon name="application" />
</template> </template>
<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-submenu> </t-submenu>
</t-menu> </t-menu>

View File

@ -0,0 +1,354 @@
<template>
<div class="back-color">
<div>
<div class="invoiceContainer">
<div class="invoiceHeade">
<div class="headeLeft"></div>
<div class="headeMiddle">
<span class="title">xxx增值税电子普通发票</span>
<hr />
<hr />
</div>
<div class="headeRight">
<ul>
<li><label> 发票代码 </label><span>1234</span></li>
<li><label> 发票号码 </label><span>223</span></li>
<li>
<label> 开票日期 </label><span>{{ InvoiceData.xdate }}</span>
</li>
<li><label> 校验码 </label><span>111111</span></li>
</ul>
</div>
</div>
<div class="invoiceBody">
<div class="userInfo">
<div class="buy">缴费方</div>
<div class="buyInfo">
<ul>
<li>
<label>学生姓名</label><span>{{ InvoiceData.xname }}</span>
</li>
<li>
<label>学号</label><span>{{ InvoiceData.xstudent }}</span>
</li>
<li style="display: flex">
<label>电话</label
><t-input
size="small"
style="width: 300px"
v-model="InvoiceData.xphone"
/>
</li>
<li style="display: flex">
<label>缴费方式</label
><t-input
size="small"
style="width: 300px"
v-model="InvoiceData.xpayment"
/>
</li>
</ul>
</div>
<div class="password">缴费方</div>
<div class="department">
<ul>
<li>
<label>学生部门</label
><span>{{ InvoiceData.xdepartment }}</span>
</li>
<li>
<label>学生班级</label><span>{{ InvoiceData.xgrade }}</span>
</li>
</ul>
</div>
</div>
<div class="Table">
备入
<div>
<t-textarea
placeholder="请输入内容"
v-model="InvoiceData.xremark"
/>
</div>
</div>
<div class="saleInfo">
<div class="total">价税合计(大写)</div>
<span class="max"
><t-input
size="small"
style="width: 150px; padding-top: 0.2rem"
v-model="InvoiceData.xchargebig"
/></span>
<div class="total2" style="display: flex">
(小写)
<span style="display: flex"
><t-input
size="small"
style="width: 150px; padding-top: 0.2rem"
v-model="InvoiceData.xcharge"
/>
</span>
</div>
</div>
<div class="userInfo2">
<div class="buy">收费方</div>
<div class="buyInfo">
<ul>
<li><label>名称</label><span>xxxxxxx学院</span></li>
<li>
<label>纳税人识别号</label><span>12443536377484848</span>
</li>
<li>
<label>地址&nbsp;&nbsp;&nbsp;电话</label
><span>11223443532</span>
</li>
<li><label>开户行及账号</label><span>中国农业银行</span></li>
</ul>
</div>
<div class="remark">备注</div>
</div>
<div class="userInfo3">
<ul class="invoicetFooter" style="display: flex">
<li style="display: flex">
<label>收款人:</label
><t-input
size="small"
style="width: 100px"
v-model="InvoiceData.xpayee"
/>
</li>
<li style="display: flex">
<label>复核:</label
><t-input
size="small"
style="width: 100px"
v-model="InvoiceData.xreviewer"
/>
</li>
<li style="display: flex">
<label>开票人:</label
><t-input
size="small"
style="width: 100px"
v-model="InvoiceData.xdrawer"
/>
</li>
<li><label>销售方</label></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import dayjs from 'dayjs'
const Route = useRoute()
//
const InvoiceData = ref({
//
xdate: dayjs().format('YYYY-MM-DD'),
//
xname: Route.query.firstName,
//
xstudent: 12346,
//
xphone: '',
//
xpayment: '',
//
xdepartment: Route.query.status,
//
xgrade: Route.query.classname,
//
xremark: '',
// ()
xcharge: Route.query.letters[0],
// ()
xchargebig: '',
//
xpayee: '',
//
xreviewer: '',
//
xdrawer: ''
})
</script>
<style lang="scss" scoped>
.headeRight {
width: 240px;
height: 100%;
font-size: 16px;
line-height: 30px;
text-align: left;
float: left;
}
.headeRight > ul {
display: inline-block;
margin-left: 16px;
margin-top: 10px;
}
.invoicetFooter > li {
margin-top: 16px;
margin-right: 100px;
margin-left: 11px;
display: inline-block;
}
.max {
display: inline-block;
margin-top: 5px;
margin-left: 4px;
}
.total {
width: 270px;
height: 100%;
font-size: 17px;
line-height: 30px;
text-align: center;
border-right: 1px solid black;
float: left;
padding-top: 0.25rem;
}
.total2 {
width: 270px;
height: 100%;
font-size: 17px;
line-height: 30px;
text-align: center;
margin-right: 130px;
float: right;
margin-top: 0.25rem;
}
.buyer {
width: 30px;
height: 100%;
font-size: 17px;
text-align: center;
border-right: 1px solid black;
float: left;
}
.title {
font-size: 33px;
display: inline-block;
margin-top: 50px;
font-family: '仿宋';
}
.headeMiddle {
width: 400px;
height: 100%;
font-size: 17px;
line-height: 30px;
text-align: center;
float: left;
}
.headeLeft {
width: 300px;
height: 100%;
font-size: 17px;
line-height: 30px;
text-align: center;
float: left;
}
.buy {
width: 30px;
height: 100%;
font-size: 17px;
line-height: 30px;
text-align: center;
border-right: 1px solid black;
border-left: 1px solid black;
float: left;
}
.buyInfo {
width: 510px;
height: 100%;
font-size: 16px;
line-height: 25px;
text-align: left;
border-right: 1px solid black;
float: left;
}
.department {
height: 100%;
font-size: 16px;
line-height: 25px;
text-align: left;
float: left;
}
.password {
width: 30px;
height: 100%;
font-size: 17px;
line-height: 30px;
text-align: center;
border-right: 1px solid black;
float: left;
}
.remark {
width: 30px;
height: 100%;
font-size: 17px;
line-height: 50px;
text-align: center;
border-right: 1px solid black;
float: left;
}
ul {
list-style-type: none;
margin: 0;
padding-left: 5px;
}
.invoiceContainer {
width: 1000px;
margin: 0 auto;
border-top: 1px solid black;
}
.invoiceHeade {
width: 1000px;
height: 140px;
border-bottom: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
}
.userInfo {
width: 1000px;
height: 100px;
border-bottom: 1px solid black;
border-right: 1px solid black;
}
.userInfo2 {
width: 1000px;
height: 100px;
border-right: 1px solid black;
}
.userInfo3 {
width: 1000px;
height: 100px;
border-top: 1px solid black;
}
.Table {
width: 999px;
height: 400px;
border-bottom: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
}
.sum {
width: 1000px;
height: 50px;
border-bottom: 1px solid black;
}
.saleInfo {
width: 999px;
height: 40px;
border-bottom: 1px solid black;
border-right: 1px solid black;
border-left: 1px solid black;
}
</style>

View File

@ -78,6 +78,11 @@
}}</t-tag> }}</t-tag>
<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 }">
<t-button v-if="row.tuition === '未缴学费'" @click="handleTicket(row)"
>清缴学费</t-button
>
</template>
</t-table> </t-table>
</div> </div>
</div> </div>
@ -88,6 +93,8 @@ import {
APIReceivablesList, APIReceivablesList,
APIReceivablesAdd APIReceivablesAdd
} from '@/api/receivables-management/management' } from '@/api/receivables-management/management'
import { useRouter } from 'vue-router'
const router = useRouter()
// //
const formData = reactive({ const formData = reactive({
name: '', name: '',
@ -179,23 +186,6 @@ const CONDITION = [
] ]
// //
const tableData = ref([]) 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([ const columns = ref([
{ colKey: 'serial-number' }, { colKey: 'serial-number' },
@ -204,15 +194,43 @@ const columns = ref([
{ colKey: 'department', title: '部门' }, { colKey: 'department', title: '部门' },
{ colKey: 'major', title: '专业' }, { colKey: 'major', title: '专业' },
{ colKey: 'grade', title: '班级' }, { colKey: 'grade', title: '班级' },
{ colKey: 'tuition', title: '是否缴费' } { colKey: 'tuition', title: '是否缴费' },
{ colKey: 'action', title: '操作', align: 'center' }
]) ])
// //
let pagination = { let pagination = {
defaultCurrent: 1, defaultCurrent: 1,
defaultPageSize: 5, defaultPageSize: 10,
total: 50 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 () => { const ReceivablesList = async () => {
loading.value = true loading.value = true
@ -229,6 +247,13 @@ const onPageChange = (Newpage, PreviousPagePrev) => {
clearInterval(timerId) clearInterval(timerId)
}, 300) }, 300)
} }
//
const handleTicket = row => {
router.push({
path: '/billCollected',
query: row
})
}
onMounted(() => { onMounted(() => {
ReceivablesList() ReceivablesList()
}) })

View File

@ -0,0 +1,198 @@
<template>
<div class="back-color">
<t-table
ref="tableRef"
row-key="key"
:columns="columns"
:data="data"
:editable-cell-state="editableCellState"
bordered
lazy-load
>
<template #operation="{ row }">
<t-button theme="default" variant="text" @click="handleEdit(row)"
>填写电子票据</t-button
>
</template>
</t-table>
</div>
</template>
<script setup lang="jsx">
import { ref, computed } from 'vue'
import { Input, Select } from 'tdesign-vue-next'
import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router'
import dayjs from 'dayjs'
const route = useRoute()
const router = useRouter()
const initData = new Array(1).fill(null).map((_, i) => ({
key: String(i + 1),
//
firstName: route.query.name,
//
status: route.query.department,
//
classname: route.query.grade,
letters: [],
createTime: dayjs().format('YYYY-MM-DD')
}))
//
const STATUS_OPTIONS = [
{ label: '机电工程系', value: '机电工程系' },
{ label: '护理分院', value: '护理分院' },
{ label: '建筑系', value: '建筑系' },
{ label: '材料科学与工程系', value: '材料科学与工程系' },
{ label: '审批环境科学与工程系过期', value: '审批环境科学与工程系过期' }
]
//
const CLASS_NAME = [
{ label: '机制1班', value: '机制1班' },
{ label: '材料1班', value: '材料1班' },
{ label: '环境1班', value: '环境1班' },
{ label: '建筑1班', value: '建筑1班' },
{ label: '护理1班', value: '护理1班' }
]
const align = ref('left')
const data = ref([...initData])
const editableCellState = cellParams => {
const { row } = cellParams
return row.status !== 2
}
const tableRef = ref()
const columns = computed(() => [
{
title: '学生姓名',
colKey: 'firstName',
align: align.value,
edit: {
component: Input,
props: {
clearable: true,
autofocus: true
},
validateTrigger: 'change',
on: editContext => ({
onBlur: () => {
console.log('失去焦点', editContext)
},
onEnter: ctx => {
ctx?.e?.preventDefault()
console.log('onEnter', ctx)
}
}),
abortEditOnEvent: ['onEnter'],
onEdited: context => {
console.log(context)
const newData = [...data.value]
newData.splice(context.rowIndex, 1, context.newRowData)
data.value = newData
console.log('Edit firstName:', context)
},
defaultEditable: true
}
},
{
title: '学生部门',
colKey: 'status',
cell: (h, { row }) =>
STATUS_OPTIONS.find(t => t.value === row.status)?.label,
edit: {
component: Select,
props: {
clearable: true,
options: STATUS_OPTIONS
},
on: editContext => ({
onChange: params => {
console.log('status changed', editContext, params)
}
}),
onEdited: context => {
data.value.splice(context.rowIndex, 1, context.newRowData)
}
}
},
{
title: '学生班级',
colKey: 'classname',
cell: (h, { row }) =>
CLASS_NAME.find(t => t.value === row.classname)?.label,
edit: {
component: Select,
props: {
clearable: true,
options: CLASS_NAME
},
on: editContext => ({
onChange: params => {
console.log('status changed', editContext, params)
}
}),
onEdited: context => {
data.value.splice(context.rowIndex, 1, context.newRowData)
}
}
},
{
title: '学生状态',
colKey: 'letters',
cell: (h, { row }) => row.letters.join('、'),
edit: {
keepEditMode: true,
component: Select,
props: () => {
return {
multiple: true,
minCollapsedNum: 1,
options: [
{ label: '初级学生', value: '2000元' },
{ label: '中级学生', value: '3000元' },
{ label: '高级学生', value: '4000元' },
{ label: '老年学生', value: '5000元' },
{ label: '神级学生', value: '6000元' }
].filter(t => (t.show === undefined ? true : t.show()))
}
},
onEdited: context => {
data.value.splice(context.rowIndex, 1, context.newRowData)
}
}
},
{
title: '应缴金额',
colKey: 'letters',
cell: (h, { row }) => row.letters.join('、'),
edit: {
keepEditMode: true,
component: Select,
props: () => {
return {
multiple: true,
minCollapsedNum: 1
}
},
onEdited: context => {
data.value.splice(context.rowIndex, 1, context.newRowData)
}
}
},
{
title: '创建日期',
colKey: 'createTime'
},
{
title: '操作',
colKey: 'operation'
}
])
const handleEdit = row => {
router.push({
path: 'bill-bill',
query: row
})
console.log(row)
}
</script>
<style scoped lang="less"></style>

View File

@ -15,6 +15,18 @@ const ReceivablesManagement = [
title: "应收款管理", title: "应收款管理",
}, },
}, },
{
path: "/billCollected",
name: "BillCollected",
component: () => import("@/pages/receivables-management/billCollected.vue"),
meta: { title: "票据收款", hidden: false },
},
{
path: "/bill-bill",
name: "BillBill",
component: () => import("@/pages/receivables-management/Bill.vue"),
meta: { title: "票据", hidden: false },
}
], ],
}, },
]; ];