This commit is contained in:
ycy 2024-04-07 10:24:12 +08:00
commit 68e6e55810
6 changed files with 393 additions and 936 deletions

View File

@ -2,7 +2,7 @@ import Mock from "mockjs"
const data = Mock.mock({ const data = Mock.mock({
"list|200": [ "list|200": [
{ {
"id|+1": 1, "id|+1": '1',
"name": "@cname", "name": "@cname",
"studentnumber": "@integer(1000000000,9999999999)", "studentnumber": "@integer(1000000000,9999999999)",
"department": `@pick(['机电工程系', '护理分院','建筑系','材料科学与工程系','环境科学与工程系'])`, "department": `@pick(['机电工程系', '护理分院','建筑系','材料科学与工程系','环境科学与工程系'])`,
@ -22,5 +22,40 @@ export default [
data: data data: data
} }
} }
},
{
url: '/post-sdy-managment-find',
method: 'post',
response: (req) => {
if (req.body.name !== '') {
return data.list.filter(item => item.name.includes(req.body.name))
}
else if (req.body.studentnumber !== '') {
const studentnumber = Number(req.body.studentnumber)
if (!isNaN(studentnumber)) {
return data.list.filter(item => item.studentnumber === studentnumber)
} else {
return {
code: 400,
message: 'Invalid student number format'
}
}
}
else if (req.body.department !== '') {
return data.list.filter(item => item.department.includes(req.body.department))
}
else if (req.body.major !== '') {
return data.list.filter(item => item.major.includes(req.body.major))
}
else if (req.body.grade !== '') {
return data.list.filter(item => item.grade.includes(req.body.grade))
}
else if (req.body.tuition !== '') {
return data.list.filter(item => item.tuition.includes(req.body.tuition))
}
return {
code: 200,
}
}
} }
] ]

1220
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,4 +2,7 @@ import request from '@/utils/request'
export function APIReceivablesList() { export function APIReceivablesList() {
return request.get('/get-sdy-managment-list') return request.get('/get-sdy-managment-list')
}
export function APIReceivablesAdd(data) {
return request.post('/post-sdy-managment-find', data)
} }

View File

@ -222,13 +222,14 @@ import { MessagePlugin } from "tdesign-vue-next";
import { AddIcon, LoadIcon } from "tdesign-icons-vue-next"; import { AddIcon, LoadIcon } from "tdesign-icons-vue-next";
import { reqStockList } from "@/api/stockList"; import { reqStockList } from "@/api/stockList";
import { useStock } from "@/stores/billStock"; import { useStock } from "@/stores/billStock";
import { number } from "echarts";
//
const loading = ref(false); const loading = ref(false);
const visiblePost = ref(false); const visiblePost = ref(false);
const stockList = useStock(); const stockList = useStock();
const tableData = ref(); const tableData = ref();
const data = ref(); const data = ref();
//
const columns = ref([ const columns = ref([
{ {
colKey: "serial-number", colKey: "serial-number",
@ -286,6 +287,7 @@ const columns = ref([
}, },
]); ]);
//
const billType = ref([ const billType = ref([
{ label: "票据类型1", value: 0 }, { label: "票据类型1", value: 0 },
{ label: "票据类型2", value: 1 }, { label: "票据类型2", value: 1 },
@ -294,33 +296,48 @@ const billType = ref([
{ label: "票据类型5", value: 4 }, { label: "票据类型5", value: 4 },
]); ]);
//
const tableList = async () => { const tableList = async () => {
loading.value = true;
tableData.value = await stockList.getStockList(); tableData.value = await stockList.getStockList();
data.value = await stockList.getStockList(); data.value = await stockList.getStockList();
pagination.value.total = tableData.value.length; pagination.value.total = tableData.value.length;
const timerId = setTimeout(() => {
loading.value = false;
clearInterval(timerId);
}, 300);
}; };
//
const refresh = () => { const refresh = () => {
tableList(); tableList();
}; };
//
const dialogData = ref({ const dialogData = ref({
billserial: "", billserial: "",
stockNum: number, stockNum: Number,
unit: "", unit: "",
operator: "", operator: "",
remark: "", remark: "",
stockDate: "", stockDate: "",
}); });
//
const formData = ref({ const formData = ref({
billserial: "", billserial: "",
billType: "", billType: "",
stockDate: "", stockDate: "",
}); });
//
const pagination = ref({ const pagination = ref({
defaultCurrent: 1, defaultCurrent: 1,
defaultPageSize: 10, defaultPageSize: 10,
total: 50, total: 50,
}); });
//
const resetting = () => { const resetting = () => {
formData.value = { formData.value = {
billserial: "", billserial: "",
@ -330,6 +347,7 @@ const resetting = () => {
tableList(); tableList();
}; };
//
const headerQuery = () => { const headerQuery = () => {
tableData.value = data.value; tableData.value = data.value;
if ( if (
@ -424,8 +442,10 @@ const stockDelete = async (itme) => {
getNewTable(); getNewTable();
}; };
//
const onReset = () => {}; const onReset = () => {};
// menuManagement
const getNewTable = () => { const getNewTable = () => {
let arr = JSON.parse(localStorage.getItem("menuManagement")); let arr = JSON.parse(localStorage.getItem("menuManagement"));
if (arr) { if (arr) {

View File

@ -69,6 +69,7 @@
cell-empty-content="-" cell-empty-content="-"
lazy-load lazy-load
@row-click="handleRowClick" @row-click="handleRowClick"
@page-change="onPageChange"
:loading="loading" :loading="loading"
> >
<template #tuition="{ row }"> <template #tuition="{ row }">
@ -84,11 +85,9 @@
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { import {
ErrorCircleFilledIcon, APIReceivablesList,
CheckCircleFilledIcon, APIReceivablesAdd
CloseCircleFilledIcon } from '@/api/receivables-management/management'
} from 'tdesign-icons-vue-next'
import { APIReceivablesList } from '@/api/receivables-management/management'
// //
const formData = reactive({ const formData = reactive({
name: '', name: '',
@ -178,18 +177,21 @@ const CONDITION = [
value: '未缴学费' value: '未缴学费'
} }
] ]
//
const onSubmit = () => {
console.log(formData)
}
//
const onReset = () => {
console.log('重置成功')
}
// //
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 loading = ref(false)
//
const onReset = () => {
ReceivablesList()
}
// //
const handleRowClick = e => { const handleRowClick = e => {
console.log(e) console.log(e)
@ -206,17 +208,26 @@ const columns = ref([
]) ])
// //
const pagination = { let pagination = {
defaultCurrent: 1, defaultCurrent: 1,
defaultPageSize: 5, defaultPageSize: 5,
total: 50 total: 50
} }
// //
const ReceivablesList = async () => { const ReceivablesList = async () => {
loading.value = true
const res = await APIReceivablesList() const res = await APIReceivablesList()
tableData.value = res.data.list tableData.value = res.data.list
console.log(res.data.list) pagination.total = res.data.list.length
console.log(tableData) loading.value = false
}
//
const onPageChange = (Newpage, PreviousPagePrev) => {
loading.value = true
const timerId = setTimeout(() => {
loading.value = false
clearInterval(timerId)
}, 300)
} }
onMounted(() => { onMounted(() => {
ReceivablesList() ReceivablesList()

View File

@ -10,7 +10,7 @@ const ReceivablesManagement = [
{ {
path: "/accounts", path: "/accounts",
name: "Accounts", name: "Accounts",
component: () => import("@/pages/receivables-management/account-receivable.vue"), component: () => import("@/pages/receivables-management/accountReceivable.vue"),
meta: { meta: {
title: "应收款管理", title: "应收款管理",
}, },