This commit is contained in:
吕才卓 2024-04-08 12:40:37 +08:00
commit ad899d0238
16 changed files with 1059 additions and 85 deletions

View File

@ -13,6 +13,60 @@ const StockList = Mock.mock({
},
],
});
const ReceiptList = Mock.mock([
{
"list|20-30": [
{
"id|+1": 0,
billserial: "@integer(100000000,199999999)1",
proposer: "孙东宇",
billType: "@integer(0,4)",
receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
],
},
{
"list|20-30": [
{
"id|+1": 0,
billserial: "@integer(100000000,199999999)1",
proposer: "杨春宇",
billType: "@integer(0,4)",
receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
],
},
{
"list|20-30": [
{
"id|+1": 0,
billserial: "@integer(100000000,199999999)1",
proposer: "吕才卓",
billType: "@integer(0,4)",
receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
],
},
{
"list|20-30": [
{
"id|+1": 0,
billserial: "@integer(100000000,199999999)1",
proposer: "刘欣宇",
billType: "@integer(0,4)",
receiptNum: "@integer(1,10)",
receiptDate: "@date",
useInfo: "@csentence",
},
],
},
]);
const personName = () => {
return [
@ -83,4 +137,31 @@ export default [
};
},
},
{
url: "/api/receiptList",
method: "post",
response: (req) => {
if (req.body.name === "孙东宇") {
return {
code: 200,
data: ReceiptList[0].list,
};
} else if (req.body.name === "杨春宇") {
return {
code: 200,
data: ReceiptList[1].list,
};
} else if (req.body.name === "吕才卓") {
return {
code: 200,
data: ReceiptList[2].list,
};
} else {
return {
code: 200,
data: ReceiptList[3].list,
};
}
},
},
];

View File

@ -2,6 +2,8 @@ import request from "@/utils/requestMock";
const API = {
PERSON_LIST: "/personName",
RECEIPT_LIST: "/receiptList",
};
export const reqPersonName = () => request.get(API.PERSON_LIST);
export const reqReceiptList = (data) => request.post(API.RECEIPT_LIST, data);

View File

@ -1,6 +1,14 @@
<template>
<div style="height: 100%">
<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="财务票据管理">
<template #icon>
<t-icon name="application" />
@ -14,6 +22,9 @@
<t-menu-item value="1-3" to="/Bill/BillReceipt">
<span>票据领用管理</span>
</t-menu-item>
<t-menu-item value="1-4" to="/Bill/BillQuitneck">
<span>票据退领管理</span>
</t-menu-item>
</t-submenu>
<t-submenu value="2" title="应收款管理">
<template #icon>
@ -22,6 +33,9 @@
<t-menu-item value="2-1" to="/accounts">
<span>应收款管理</span>
</t-menu-item>
<t-menu-item value="2-2" to="/billCollected">
<span>学生收款</span>
</t-menu-item>
</t-submenu>
</t-menu>
</div>

View File

@ -66,7 +66,7 @@
<t-content class="table-box">
<div class="table-header">
<div>
<h4 style="font-size: 110%">票据列表</h4>
<h4 style="font-size: 110%">票据退库列表</h4>
</div>
<div>
<t-button
@ -87,7 +87,7 @@
:columns="columns"
:pagination="pagination"
class="table"
:max-height="650"
:max-height="550"
>
<template #billType="{ row }">
<div v-for="item in billType" :key="item">
@ -294,10 +294,12 @@ const columns = ref([
fixed: "right",
},
]);
//
const FORM_RULES = {
approver: [{ required: true, message: "请输入审批人", trigger: "blur" }],
approvalDate: [
{ required: true, message: "请选择入库日期", trigger: ["blur", "change"] },
{ required: true, message: "请选择入库日期", trigger: "change" },
],
approvalReason: [
{ required: true, message: "请输入审批原因", trigger: "blur" },
@ -371,7 +373,7 @@ const headerQuery = () => {
if (
scarchData.value.billserial === "" &&
scarchData.value.billType === "" &&
scarchData.value.stockDate === ""
scarchData.value.appleDate === ""
) {
arrList = item;
}

View File

@ -0,0 +1,389 @@
<template>
<div class="back-color" style="overflow-y: hidden">
<t-layout style="height: 100%; background-color: #f5f7fb">
<t-aside class="asideTree">
<t-space direction="vertical">
<t-tree
:data="personName"
hover
transition
activable
expandAll
:expand-mutex="mutex"
expand-on-click-node="true"
@click="onClick"
/>
</t-space>
</t-aside>
<t-content>
<t-layout style="height: 100%; background-color: #f5f7fb">
<t-header class="scarch-box">
<t-form
ref="form"
:data="scarchData"
label-width="calc(2em + 40px)"
layout="inline"
scroll-to-first-error="smooth"
class="scarch-from"
@reset="resetting"
@submit="headerQuery"
>
<div style="margin-left: 1rem; margin-top: 1px">
<t-form-item label="票据编号:" name="billserial">
<t-input
v-model="scarchData.billserial"
maxlength="10"
></t-input>
</t-form-item>
<t-form-item label="退领时间:" name="receiptDate">
<t-date-picker v-model="scarchData.receiptDate" clearable />
</t-form-item>
<t-form-item
label="票据类型:"
name="billType"
style="margin-bottom: 0.3rem"
>
<t-select
v-model="scarchData.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 #billType="{ row }">
<div v-for="item in billType" :key="item">
<span v-if="row.billType === item.value">{{
item.label
}}</span>
</div>
</template>
<template #receiptNum="{ row }">
{{ `${row.receiptNum}` }}
</template>
</t-base-table>
</t-content>
</t-layout>
</t-content>
</t-layout>
</div>
</template>
<script setup>
import { ref, onMounted, nextTick } from "vue";
import { MessagePlugin } from "tdesign-vue-next";
import { LoadIcon } from "tdesign-icons-vue-next";
import { useReceiptList } from "@/stores/billReceipt";
const receiptList = useReceiptList();
const personName = ref([]);
const tableData = ref([]);
const data = ref([]);
const loading = ref(false);
const visiblePost = ref(false);
const columns = ref([
{
colKey: "serial-number",
title: "序号",
width: 50,
},
{
colKey: "billserial",
title: "票据编号",
align: "center",
width: 100,
},
{
colKey: "proposer",
title: "申请人",
align: "center",
width: 100,
},
{
colKey: "billType",
title: "票据类型",
align: "center",
width: 100,
},
{
colKey: "quitneckNum",
title: "退领数量",
align: "center",
width: 100,
},
{
colKey: "quitneckDate",
title: "退领时间",
align: "center",
width: 100,
},
{
colKey: "quitneckInfo",
title: "退领原来",
ellipsis: true,
align: "center",
width: 200,
},
]);
//
const billType = ref([
{ label: "票据类型1", value: 0 },
{ label: "票据类型2", value: 1 },
{ label: "票据类型3", value: 2 },
{ label: "票据类型4", value: 3 },
{ label: "票据类型5", value: 4 },
]);
const dialogData = ref({
quitneckDate: "",
quitneckReason: "",
quitneckNum: "",
});
//
const scarchData = ref({
billserial: "",
});
//
const pagination = ref({
defaultCurrent: 1,
defaultPageSize: 10,
total: 50,
});
//
const personList = async () => {
personName.value = await receiptList.getPersonNameList();
};
//
const FORM_RULES = {
quitneckNum: [{ required: true, message: "请输入退领张数", trigger: "blur" }],
quitneckDate: [
{ required: true, message: "请选择退领日期", trigger: "change" },
],
quitneckReason: [
{ required: true, message: "请输入退领原因", trigger: "blur" },
],
};
//
const headerQuery = () => {
tableData.value = data.value;
console.log(
scarchData.value.billserial,
scarchData.value.billType,
scarchData.value.receiptDate
);
if (
scarchData.value.billserial === "" &&
(scarchData.value.billType === undefined ||
scarchData.value.billType === "") &&
(scarchData.value.receiptDate === undefined ||
scarchData.value.receiptDate === "")
) {
getNewTable();
} else {
const list = tableData.value.filter((item) => {
let arrList;
if (scarchData.value.billserial === item.billserial) {
arrList = item;
}
if (scarchData.value.billType === item.billType) {
arrList = item;
}
if (scarchData.value.receiptDate === item.receiptDate) {
arrList = item;
}
if (
scarchData.value.billserial === "" &&
scarchData.value.billType === "" &&
scarchData.value.receiptDate === ""
) {
arrList = item;
}
return arrList;
});
tableData.value = list;
pagination.value.total = list.length;
}
};
//
const resetting = () => {
scarchData.value = {
billserial: "",
billType: "",
receiptDate: "",
};
getNewTable();
};
const rowItem = ref({});
const Quitneck = (value) => {
dialogData.value = {
quitneckDate: "",
quitneckReason: "",
quitneckNum: "",
};
visiblePost.value = true;
rowItem.value = value;
};
//
const quitneckAdd = async ({ validateResult, firstError }) => {
if (validateResult === true) {
if (rowItem.value.row.receiptNum - dialogData.value.quitneckNum < 0) {
return MessagePlugin.error("退领数量不能大于领用数量");
}
dialogData.value.quitneckNum =
rowItem.value.row.receiptNum - dialogData.value.quitneckNum;
dialogData.value.id = rowItem.value.row.id;
await receiptList.getquitneckNum(dialogData.value);
getTableData();
MessagePlugin.success("提交成功");
visiblePost.value = false;
} else {
console.log("Validate Errors: ", firstError, validateResult);
}
};
const onClick = async (context) => {
//
if (context.node.value === "t1") {
return;
}
loading.value = true;
//
tableData.value = await receiptList.getReceiptList({
name: context.node.label,
});
data.value = await receiptList.getReceiptList({
name: context.node.label,
});
pagination.value.total = tableData.value.length;
const timerId = setTimeout(() => {
loading.value = false;
clearInterval(timerId);
}, 300);
};
//
const refresh = () => {
getTableData();
};
// menuManagement
const getPersonName = () => {
let arr = JSON.parse(localStorage.getItem("ReceiptList"));
if (arr) {
personName.value = arr.personName;
} else {
personList();
}
};
// menuManagement
const getTableData = async () => {
let arr = JSON.parse(localStorage.getItem("ReceiptList"));
if (arr.receiptList.length > 0) {
loading.value = true;
tableData.value = arr.receiptList;
pagination.value.total = tableData.value.length;
const timerId = setTimeout(() => {
loading.value = false;
clearInterval(timerId);
}, 300);
} else {
await nextTick();
//
const firstNodeWithChildren = personName.value.find(
(node) => Array.isArray(node.children) && node.children.length > 0
);
if (firstNodeWithChildren) {
const simulatedContext = {
node: {
label: "孙东宇",
},
};
onClick(simulatedContext);
}
}
};
onMounted(async () => {
getPersonName();
getTableData();
// personName
});
</script>
<style scoped lang="less">
.asideTree {
margin-right: 2rem;
display: flex;
justify-content: center;
padding: 1rem;
}
.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: 41rem;
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-tree--transition .t-tree__label) {
width: 10rem;
}
:deep(.t-form__controls-content) {
justify-content: space-between;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<div class="back-color">
<div class="back-color" style="overflow-y: hidden">
<t-layout style="height: 100%; background-color: #f5f7fb">
<t-aside class="asideTree">
<t-space direction="vertical">
@ -35,6 +35,28 @@
maxlength="10"
></t-input>
</t-form-item>
<t-form-item label="领用时间:" name="receiptDate">
<t-date-picker v-model="scarchData.receiptDate" clearable />
</t-form-item>
<t-form-item
label="票据类型:"
name="billType"
style="margin-bottom: 0.3rem"
>
<t-select
v-model="scarchData.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>
@ -45,7 +67,7 @@
<t-content class="table-box">
<div class="table-header">
<div>
<h4 style="font-size: 110%">票据列表</h4>
<h4 style="font-size: 110%">票据领用列表</h4>
</div>
<div>
<t-button
@ -66,7 +88,7 @@
:columns="columns"
:pagination="pagination"
class="table"
:max-height="650"
:max-height="550"
>
<template #billType="{ row }">
<div v-for="item in billType" :key="item">
@ -75,70 +97,300 @@
}}</span>
</div>
</template>
<template #approvalStatus="{ row }">
<div v-for="item in approvalStatus" :key="item">
<t-tag
v-if="row.approvalStatus === item.value"
:theme="tagColor(row.approvalStatus)"
variant="light"
>
{{ item.label }}
</t-tag>
</div>
<template #receiptNum="{ row }">
{{ `${row.receiptNum}` }}
</template>
<template #status="slotProps">
<t-button
theme="default"
variant="text"
size="small"
@click="Approve(slotProps)"
@click="Quitneck(slotProps)"
:disabled="slotProps.row.receiptNum === 0"
>退领</t-button
>
<span v-if="slotProps.row.approvalStatus === 0">{{
"审批"
}}</span>
<span v-if="slotProps.row.approvalStatus === 3">{{
"重新审批"
}}</span>
</t-button>
</template>
</t-base-table>
</t-content>
</t-layout>
</t-content>
</t-layout>
<t-space>
<t-dialog
ref="postForm"
v-model:visible="visiblePost"
header="退领"
width="40%"
:confirm-on-enter="true"
:on-close="closePost"
:confirm-btn="null"
:cancel-btn="null"
>
<t-space direction="vertical">
<div>
<t-form
ref="formDialog"
scroll-to-first-error="smooth"
label-align="left"
:rules="FORM_RULES"
:data="dialogData"
:colon="true"
@submit="quitneckAdd"
label-width="calc(2em + 55px)"
@reset="onReset"
>
<t-form-item
label="退领张数"
name="quitneckNum"
style="margin-bottom: 1.5rem; width: 35rem"
>
<t-input
v-model="dialogData.quitneckNum"
type="number"
placeholder="请输入退领张数"
></t-input>
</t-form-item>
<t-form-item
label="退领时间"
name="quitneckDate"
style="margin-bottom: 1.5rem; width: 35rem"
>
<t-date-picker
v-model="dialogData.quitneckDate"
placeholder="请选择退领时间"
clearable
style="width: 35rem"
/>
</t-form-item>
<t-form-item label="退领原因" name="quitneckReason">
<t-textarea
v-model="dialogData.quitneckReason"
placeholder="请输入退领原因"
></t-textarea>
</t-form-item>
<t-form-item>
<t-space size="small">
<t-button theme="primary" type="submit">提交</t-button>
<t-button theme="default" variant="base" type="reset"
>重置</t-button
>
</t-space>
</t-form-item>
</t-form>
</div>
</t-space>
</t-dialog>
</t-space>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { ref, onMounted, nextTick } from "vue";
import { MessagePlugin } from "tdesign-vue-next";
import { LoadIcon } from "tdesign-icons-vue-next";
import { useReceiptList } from "@/stores/billReceipt";
const receiptList = useReceiptList();
const personName = ref([]);
const tableData = ref([]);
const data = ref([]);
const loading = ref(false);
const visiblePost = ref(false);
const columns = ref([
{
colKey: "serial-number",
title: "序号",
width: 50,
},
{
colKey: "billserial",
title: "票据编号",
align: "center",
width: 100,
},
{
colKey: "proposer",
title: "申请人",
align: "center",
width: 100,
},
{
colKey: "billType",
title: "票据类型",
align: "center",
width: 100,
},
{
colKey: "receiptNum",
title: "领用数量",
align: "center",
width: 100,
},
{
colKey: "receiptDate",
title: "领用时间",
align: "center",
width: 100,
},
{
colKey: "useInfo",
title: "用途",
ellipsis: true,
align: "center",
width: 200,
},
{
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 dialogData = ref({
quitneckDate: "",
quitneckReason: "",
quitneckNum: "",
});
//
const scarchData = ref({
billserial: "",
});
//
const pagination = ref({
defaultCurrent: 1,
defaultPageSize: 10,
total: 50,
});
//
const personList = async () => {
personName.value = await receiptList.getPersonNameList();
console.log(personName.value);
};
const onClick = (context) => {
//
const FORM_RULES = {
quitneckNum: [{ required: true, message: "请输入退领张数", trigger: "blur" }],
quitneckDate: [
{ required: true, message: "请选择退领日期", trigger: "change" },
],
quitneckReason: [
{ required: true, message: "请输入退领原因", trigger: "blur" },
],
};
//
const headerQuery = () => {
tableData.value = data.value;
console.log(
scarchData.value.billserial,
scarchData.value.billType,
scarchData.value.receiptDate
);
if (
scarchData.value.billserial === "" &&
(scarchData.value.billType === undefined ||
scarchData.value.billType === "") &&
(scarchData.value.receiptDate === undefined ||
scarchData.value.receiptDate === "")
) {
getNewTable();
} else {
const list = tableData.value.filter((item) => {
let arrList;
if (scarchData.value.billserial === item.billserial) {
arrList = item;
}
if (scarchData.value.billType === item.billType) {
arrList = item;
}
if (scarchData.value.receiptDate === item.receiptDate) {
arrList = item;
}
if (
scarchData.value.billserial === "" &&
scarchData.value.billType === "" &&
scarchData.value.receiptDate === ""
) {
arrList = item;
}
return arrList;
});
tableData.value = list;
pagination.value.total = list.length;
}
};
//
const resetting = () => {
scarchData.value = {
billserial: "",
billType: "",
receiptDate: "",
};
getNewTable();
};
const rowItem = ref({});
const Quitneck = (value) => {
dialogData.value = {
quitneckDate: "",
quitneckReason: "",
quitneckNum: "",
};
visiblePost.value = true;
rowItem.value = value;
};
//
const quitneckAdd = async ({ validateResult, firstError }) => {
if (validateResult === true) {
if (rowItem.value.row.receiptNum - dialogData.value.quitneckNum < 0) {
return MessagePlugin.error("退领数量不能大于领用数量");
}
dialogData.value.quitneckNum =
rowItem.value.row.receiptNum - dialogData.value.quitneckNum;
dialogData.value.id = rowItem.value.row.id;
await receiptList.getquitneckNum(dialogData.value);
getTableData();
MessagePlugin.success("提交成功");
visiblePost.value = false;
} else {
console.log("Validate Errors: ", firstError, validateResult);
}
};
const onClick = async (context) => {
//
if (context.node.value === "t1") {
return;
}
console.info("onClick", context);
loading.value = true;
//
tableData.value = await receiptList.getReceiptList({
name: context.node.label,
});
data.value = await receiptList.getReceiptList({
name: context.node.label,
});
pagination.value.total = tableData.value.length;
const timerId = setTimeout(() => {
loading.value = false;
clearInterval(timerId);
}, 300);
};
//
const refresh = () => {
getTableData();
};
// menuManagement
const getNewTable = () => {
const getPersonName = () => {
let arr = JSON.parse(localStorage.getItem("ReceiptList"));
if (arr) {
personName.value = arr.personName;
@ -146,9 +398,38 @@ const getNewTable = () => {
personList();
}
};
// menuManagement
const getTableData = async () => {
let arr = JSON.parse(localStorage.getItem("ReceiptList"));
if (arr.receiptList.length > 0) {
loading.value = true;
tableData.value = arr.receiptList;
pagination.value.total = tableData.value.length;
const timerId = setTimeout(() => {
loading.value = false;
clearInterval(timerId);
}, 300);
} else {
await nextTick();
//
const firstNodeWithChildren = personName.value.find(
(node) => Array.isArray(node.children) && node.children.length > 0
);
if (firstNodeWithChildren) {
const simulatedContext = {
node: {
label: "孙东宇",
},
};
onClick(simulatedContext);
}
}
};
onMounted(() => {
getNewTable();
onMounted(async () => {
getPersonName();
getTableData();
// personName
});
</script>

View File

@ -48,7 +48,7 @@
<t-content class="table-box">
<div class="table-header">
<div>
<h4 style="font-size: 110%">票据列表</h4>
<h4 style="font-size: 110%">票据入库列表</h4>
</div>
<div>
<t-button theme="primary" size="small" @click="addStock">
@ -73,7 +73,7 @@
:columns="columns"
:pagination="pagination"
class="table"
:max-height="650"
:max-height="550"
>
<template #billType="{ row }">
<div v-for="item in billType" :key="item">
@ -407,14 +407,10 @@ const closePost = () => {
//
const FORM_RULES = {
billserial: [{ required: true, message: "请输入票据编号", trigger: "blur" }],
billType: [
{ required: true, message: "请选择票据类型", trigger: ["blur", "change"] },
],
billType: [{ required: true, message: "请选择票据类型", trigger: "change" }],
stockNum: [{ required: true, message: "请输入库存数量", trigger: "blur" }],
unit: [{ required: true, message: "请输入单位", trigger: "blur" }],
stockDate: [
{ required: true, message: "请选择入库日期", trigger: ["blur", "change"] },
],
stockDate: [{ required: true, message: "请选择入库日期", trigger: "change" }],
operator: [{ required: true, message: "请输入操作员", trigger: "blur" }],
};

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: '',
// ()
xcharge: Route.query.letters[0],
xcharge: Route.query.letters ? Route.query.letters[0] : 0,
// ()
xchargebig: '',
//

View File

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

View File

@ -1,25 +1,98 @@
<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
<div>
<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>
<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>
</t-table>
<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>
<script setup lang="jsx">
import { ref, computed } from 'vue'
import { ref, computed, reactive, watchEffect } from 'vue'
import { Input, Select } from 'tdesign-vue-next'
import { useRoute } from 'vue-router'
import { useRouter } from 'vue-router'
@ -27,17 +100,19 @@ 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 initData = reactive(
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: '机电工程系' },
@ -54,6 +129,40 @@ const CLASS_NAME = [
{ 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 data = ref([...initData])
const editableCellState = cellParams => {
@ -146,13 +255,9 @@ const columns = computed(() => [
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()))
options: RATES_OPTIONS.filter(t =>
t.show === undefined ? true : t.show()
)
}
},
onEdited: context => {
@ -192,7 +297,55 @@ const handleEdit = row => {
path: 'bill-bill',
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>
<style scoped lang="less"></style>

View File

@ -9,7 +9,22 @@ import Layout from "@/layout/index.vue";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
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",
name: "login",
@ -27,7 +42,7 @@ const router = createRouter({
},
...FinanceBillManage,
...ReceivablesManagement
],
]
});
export default router;

View File

@ -2,6 +2,7 @@ import Layout from "@/layout/index.vue";
import BillStockURL from "@/pages/finance-bill-manage/billStock.vue";
import BillCancelURL from "@/pages/finance-bill-manage/billCancel.vue";
import BillReceiptURL from "@/pages/finance-bill-manage/billReceipt.vue";
import BillQuitneckURL from "@/pages/finance-bill-manage/billQuitneck.vue";
const financeBillManage = [
{
@ -34,6 +35,14 @@ const financeBillManage = [
title: "票据领用",
},
},
{
path: "BillQuitneck",
name: "billQuitneck",
component: BillQuitneckURL,
meta: {
title: "票据退领",
},
},
],
},
];

View File

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

View File

@ -1,10 +1,14 @@
import { defineStore } from "pinia";
import { reqPersonName } from "@/api/finance-bill-manage/receiptList";
import {
reqPersonName,
reqReceiptList,
} from "@/api/finance-bill-manage/receiptList";
export const useReceiptList = defineStore("ReceiptList", {
state: () => {
return {
personName: [],
receiptList: [],
};
},
actions: {
@ -14,6 +18,20 @@ export const useReceiptList = defineStore("ReceiptList", {
console.log(this.personName);
return this.personName;
},
async getReceiptList(obj) {
const { data } = await reqReceiptList(obj);
this.receiptList = data;
return this.receiptList;
},
async getquitneckNum(obj) {
console.log(obj);
const index = this.receiptList.findIndex((item) => item.id === obj.id);
if (index !== -1) {
this.receiptList[index].receiptNum = obj.quitneckNum;
}
console.log(this.receiptList);
},
},
persist: true,
});

View File

@ -15,10 +15,8 @@ export const useStock = defineStore("menuManagement", {
},
addStockList(arr) {
const index = this.stockList.findIndex((item) => item.id === arr.id);
console.log(arr);
if (index !== -1) {
this.stockList[index] = arr;
console.log(this.stockList, "222");
} else {
arr.id = new Date().getTime();
this.stockList.unshift(arr);