🐞 fix:修复了应收款管理的查询学号失败的问题
This commit is contained in:
parent
0176354677
commit
d931037347
|
@ -2,7 +2,7 @@ import Mock from "mockjs"
|
|||
const data = Mock.mock({
|
||||
"list|200": [
|
||||
{
|
||||
"id|+1": 1,
|
||||
"id|+1": '1',
|
||||
"name": "@cname",
|
||||
"studentnumber": "@integer(1000000000,9999999999)",
|
||||
"department": `@pick(['机电工程系', '护理分院','建筑系','材料科学与工程系','环境科学与工程系'])`,
|
||||
|
@ -22,5 +22,40 @@ export default [
|
|||
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
1220
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -3,3 +3,6 @@ import request from '@/utils/request'
|
|||
export function APIReceivablesList() {
|
||||
return request.get('/get-sdy-managment-list')
|
||||
}
|
||||
export function APIReceivablesAdd(data) {
|
||||
return request.post('/post-sdy-managment-find', data)
|
||||
}
|
|
@ -217,175 +217,175 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted } from "vue";
|
||||
import { MessagePlugin } from "tdesign-vue-next";
|
||||
import { AddIcon, LoadIcon } from "tdesign-icons-vue-next";
|
||||
import { reqStockList } from "@/api/stockList";
|
||||
import { useStock } from "@/stores/billStock";
|
||||
import { number } from "echarts";
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
import { AddIcon, LoadIcon } from 'tdesign-icons-vue-next'
|
||||
import { reqStockList } from '@/api/stockList'
|
||||
import { useStock } from '@/stores/billStock'
|
||||
// import { number } from "echarts";
|
||||
|
||||
const loading = ref(false);
|
||||
const visiblePost = ref(false);
|
||||
const stockList = useStock();
|
||||
const tableData = ref();
|
||||
const data = ref();
|
||||
const loading = ref(false)
|
||||
const visiblePost = ref(false)
|
||||
const stockList = useStock()
|
||||
const tableData = ref()
|
||||
const data = ref()
|
||||
const columns = ref([
|
||||
{
|
||||
colKey: "serial-number",
|
||||
title: "序号",
|
||||
width: 50,
|
||||
colKey: 'serial-number',
|
||||
title: '序号',
|
||||
width: 50
|
||||
},
|
||||
{
|
||||
colKey: "billserial",
|
||||
title: "票据编号",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'billserial',
|
||||
title: '票据编号',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "billType",
|
||||
title: "票据类型",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'billType',
|
||||
title: '票据类型',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "stockNum",
|
||||
title: "入库数量",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'stockNum',
|
||||
title: '入库数量',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "unit",
|
||||
title: "单位(如:本、张)",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'unit',
|
||||
title: '单位(如:本、张)',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "stockDate",
|
||||
title: "入库日期",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'stockDate',
|
||||
title: '入库日期',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "operator",
|
||||
title: "操作员",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'operator',
|
||||
title: '操作员',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "remark",
|
||||
title: "备注",
|
||||
align: "center",
|
||||
width: "100",
|
||||
colKey: 'remark',
|
||||
title: '备注',
|
||||
align: 'center',
|
||||
width: '100'
|
||||
},
|
||||
{
|
||||
colKey: "status",
|
||||
title: "操作",
|
||||
colKey: 'status',
|
||||
title: '操作',
|
||||
width: 120,
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
},
|
||||
]);
|
||||
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 },
|
||||
]);
|
||||
{ label: '票据类型1', value: 0 },
|
||||
{ label: '票据类型2', value: 1 },
|
||||
{ label: '票据类型3', value: 2 },
|
||||
{ label: '票据类型4', value: 3 },
|
||||
{ label: '票据类型5', value: 4 }
|
||||
])
|
||||
|
||||
const tableList = async () => {
|
||||
tableData.value = await stockList.getStockList();
|
||||
data.value = await stockList.getStockList();
|
||||
pagination.value.total = tableData.value.length;
|
||||
};
|
||||
tableData.value = await stockList.getStockList()
|
||||
data.value = await stockList.getStockList()
|
||||
pagination.value.total = tableData.value.length
|
||||
}
|
||||
|
||||
const dialogData = ref({
|
||||
billserial: "",
|
||||
billserial: '',
|
||||
stockNum: number,
|
||||
unit: "",
|
||||
operator: "",
|
||||
remark: "",
|
||||
stockDate: "",
|
||||
});
|
||||
unit: '',
|
||||
operator: '',
|
||||
remark: '',
|
||||
stockDate: ''
|
||||
})
|
||||
const formData = ref({
|
||||
billserial: "",
|
||||
billType: "",
|
||||
stockDate: "",
|
||||
});
|
||||
billserial: '',
|
||||
billType: '',
|
||||
stockDate: ''
|
||||
})
|
||||
const pagination = ref({
|
||||
defaultCurrent: 1,
|
||||
defaultPageSize: 10,
|
||||
total: 50,
|
||||
});
|
||||
total: 50
|
||||
})
|
||||
const resetting = () => {
|
||||
formData.value = {
|
||||
billserial: "",
|
||||
billType: "",
|
||||
stockDate: "",
|
||||
};
|
||||
tableList();
|
||||
};
|
||||
billserial: '',
|
||||
billType: '',
|
||||
stockDate: ''
|
||||
}
|
||||
tableList()
|
||||
}
|
||||
|
||||
const headerQuery = ({ validateResult, firstError }) => {
|
||||
tableData.value = data.value;
|
||||
tableData.value = data.value
|
||||
if (
|
||||
formData.value.billserial === "" &&
|
||||
(formData.value.billType === undefined || formData.value.billType === "") &&
|
||||
formData.value.stockDate === ""
|
||||
formData.value.billserial === '' &&
|
||||
(formData.value.billType === undefined || formData.value.billType === '') &&
|
||||
formData.value.stockDate === ''
|
||||
) {
|
||||
tableList();
|
||||
tableList()
|
||||
} else {
|
||||
const list = tableData.value.filter((item) => {
|
||||
console.log(item);
|
||||
let arrList;
|
||||
const list = tableData.value.filter(item => {
|
||||
console.log(item)
|
||||
let arrList
|
||||
if (formData.value.billserial === item.billserial) {
|
||||
arrList = item;
|
||||
arrList = item
|
||||
}
|
||||
if (formData.value.billType === item.billType) {
|
||||
arrList = item;
|
||||
arrList = item
|
||||
}
|
||||
if (formData.value.stockDate === item.stockDate) {
|
||||
arrList = item;
|
||||
arrList = item
|
||||
}
|
||||
if (
|
||||
formData.value.billserial === "" &&
|
||||
formData.value.billType === "" &&
|
||||
formData.value.stockDate === ""
|
||||
formData.value.billserial === '' &&
|
||||
formData.value.billType === '' &&
|
||||
formData.value.stockDate === ''
|
||||
) {
|
||||
arrList = item;
|
||||
arrList = item
|
||||
}
|
||||
return arrList;
|
||||
});
|
||||
console.log(list);
|
||||
return arrList
|
||||
})
|
||||
console.log(list)
|
||||
|
||||
tableData.value = list;
|
||||
tableData.value = list
|
||||
// @ts-expect-error
|
||||
pagination.value.total = list.length;
|
||||
pagination.value.total = list.length
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const addStock = () => {
|
||||
visiblePost.value = true;
|
||||
};
|
||||
visiblePost.value = true
|
||||
}
|
||||
// 表单校验
|
||||
const FORM_RULES = {
|
||||
billserial: [{ required: true, message: "请输入票据编号", trigger: "blur" }],
|
||||
billserial: [{ required: true, message: '请输入票据编号', trigger: 'blur' }],
|
||||
billType: [
|
||||
{ required: true, message: "请选择票据类型", trigger: ["blur", "change"] },
|
||||
{ required: true, message: '请选择票据类型', trigger: ['blur', 'change'] }
|
||||
],
|
||||
stockNum: [{ required: true, message: "请输入库存数量", trigger: "blur" }],
|
||||
unit: [{ required: true, message: "请输入单位", trigger: "blur" }],
|
||||
stockNum: [{ required: true, message: '请输入库存数量', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请输入单位', trigger: 'blur' }],
|
||||
stockDate: [
|
||||
{ required: true, message: "请选择入库日期", trigger: ["blur", "change"] },
|
||||
{ required: true, message: '请选择入库日期', trigger: ['blur', 'change'] }
|
||||
],
|
||||
operator: [{ required: true, message: "请输入操作员", trigger: "blur" }],
|
||||
};
|
||||
const stockAdd = () => {};
|
||||
operator: [{ required: true, message: '请输入操作员', trigger: 'blur' }]
|
||||
}
|
||||
const stockAdd = () => {}
|
||||
|
||||
onMounted(() => {
|
||||
tableList();
|
||||
});
|
||||
tableList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
cell-empty-content="-"
|
||||
lazy-load
|
||||
@row-click="handleRowClick"
|
||||
@page-change="onPageChange"
|
||||
:loading="loading"
|
||||
>
|
||||
<template #tuition="{ row }">
|
||||
|
@ -84,11 +85,9 @@
|
|||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import {
|
||||
ErrorCircleFilledIcon,
|
||||
CheckCircleFilledIcon,
|
||||
CloseCircleFilledIcon
|
||||
} from 'tdesign-icons-vue-next'
|
||||
import { APIReceivablesList } from '@/api/receivables-management/management'
|
||||
APIReceivablesList,
|
||||
APIReceivablesAdd
|
||||
} from '@/api/receivables-management/management'
|
||||
//表单数据
|
||||
const formData = reactive({
|
||||
name: '',
|
||||
|
@ -178,18 +177,21 @@ const CONDITION = [
|
|||
value: '未缴学费'
|
||||
}
|
||||
]
|
||||
//表单提交
|
||||
const onSubmit = () => {
|
||||
console.log(formData)
|
||||
}
|
||||
//表单重置
|
||||
const onReset = () => {
|
||||
console.log('重置成功')
|
||||
}
|
||||
// 表格数据
|
||||
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)
|
||||
|
@ -206,17 +208,26 @@ const columns = ref([
|
|||
])
|
||||
|
||||
// 表格分页数据
|
||||
const pagination = {
|
||||
let pagination = {
|
||||
defaultCurrent: 1,
|
||||
defaultPageSize: 5,
|
||||
total: 50
|
||||
}
|
||||
//获取表格数据
|
||||
const ReceivablesList = async () => {
|
||||
loading.value = true
|
||||
const res = await APIReceivablesList()
|
||||
tableData.value = res.data.list
|
||||
console.log(res.data.list)
|
||||
console.log(tableData)
|
||||
pagination.total = res.data.list.length
|
||||
loading.value = false
|
||||
}
|
||||
// 监听分页变化事件
|
||||
const onPageChange = (Newpage, PreviousPagePrev) => {
|
||||
loading.value = true
|
||||
const timerId = setTimeout(() => {
|
||||
loading.value = false
|
||||
clearInterval(timerId)
|
||||
}, 300)
|
||||
}
|
||||
onMounted(() => {
|
||||
ReceivablesList()
|
|
@ -10,7 +10,7 @@ const ReceivablesManagement = [
|
|||
{
|
||||
path: "/accounts",
|
||||
name: "Accounts",
|
||||
component: () => import("@/pages/receivables-management/account-receivable.vue"),
|
||||
component: () => import("@/pages/receivables-management/accountReceivable.vue"),
|
||||
meta: {
|
||||
title: "应收款管理",
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user