dykj-college-back-office-ma.../mock/modules/sdy.js

619 lines
15 KiB
JavaScript
Raw Normal View History

2024-04-06 15:06:22 +08:00
import Mock from "mockjs"
2024-04-06 15:27:58 +08:00
const data = Mock.mock({
"list|200": [
2024-04-06 15:27:58 +08:00
{
"id|+1": '1',
2024-04-06 15:27:58 +08:00
"name": "@cname",
"studentnumber": "@integer(1000000000,9999999999)",
"department": `@pick(['机电工程系', '护理分院','建筑系','材料科学与工程系','环境科学与工程系'])`,
"major": `@pick(['机械制造与自动化', '材料科学与工程', '环境科学与工程', '建筑工程', '护理学'])`,
"grade": `@pick(['机制1班', '材料1班', '环境1班', '建筑1班','护理1班'])`,
"tuition": `@pick(['已付学费', '未缴学费'])`,
"tu": 16800,
2024-04-06 15:27:58 +08:00
}
]
})
const loans = Mock.mock({
"list|45": [
{
"id|+1": 1,
'proposer': '@cname',
'student': '@integer(100000000,999999999)',
'allowance': '@integer(10000,50000)',
'department': '@pick(["机电工程系","护理分院","建筑系","材料科学与工程系","环境科学与工程系"])',
'cation': '@pick(["2021-2022学年度","2022-2023学年度"])',
'loanTerm': '@pick(["已放款","未放款"])',
'timeofapplication': "@now('yyyy-MM-dd')",
}
]
})
2024-04-09 19:00:18 +08:00
const daily = Mock.mock({
'list|10': [
{
'date': "@now('yyyy-MM-dd')",
2024-04-09 19:00:18 +08:00
'tuiti': '@integer(10000,50000)',
'incidentals': '@integer(1000,5000)',
'materials': '@integer(1000,5000)',
'major': '@integer(1000,5000)',
'grade': '@integer(1000,5000)',
'tuit': '@integer(10000,50000)',
'cost': '@integer(10000,50000)',
'tuition': '@integer(10000,50000)',
}
]
})
const paragraph = Mock.mock({
'list|15': [
{
'name': '@cname',
department: '机电工程系',
grade: '机制1班',
counselor: '王刚',
cellPhone: '13354679999',
money: 16800,
condition: '未还款'
},
{
'name': '@cname',
department: '护理分院',
grade: '护理1班',
counselor: '李昆',
cellPhone: '18845065230',
money: 24000,
condition: '未还款'
},
{
'name': '@cname',
department: '建筑系',
grade: '建筑1班',
counselor: '张明',
cellPhone: '16656664666',
money: 12000,
condition: '未还款'
}
]
})
const analysis = Mock.mock({
list: [
{
id: 1,
name: '机电工程系',
studentnumber: 120,
department: 120,
major: 80,
grade: '1344000',
tuition: 40,
weigrade: 672000,
shition: 2016000
},
{
id: 2,
name: '护理分院',
studentnumber: 200,
department: 200,
major: 120,
grade: '2016000',
tuition: 80,
weigrade: 1344000,
shition: 33600000
},
{
id: 3,
name: '建筑系',
studentnumber: 300,
department: 300,
major: 200,
grade: '2016000',
tuition: 100,
weigrade: 1680000,
shition: 5040000
}
]
})
const message = Mock.mock({
'list|10': [
{
'id|+1': 1,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(132000000,1329999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//学院
'date': '@date',
//籍贯
'nativePlace': "@city",
//民族
'nation': '汉族',
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '机电工程系',
//专业
'major': '机械制造与自动化',
//部门
'grade': '机制1班',
//辅导员
'tutor': '王刚',
//手机号
'phone': '@integer(13200000000,13299999999)',
},
{
'id|+1': 11,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(188000000,18899999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//学院
'date': '@date',
//籍贯
'nativePlace': "@city",
//民族
'nation': '汉族',
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '护理分院',
//专业
'major': '护理学',
//部门
'grade': '护理学1班',
//辅导员
'tutor': '张明',
//手机号
'phone': '@integer(18800000000,18899999999)',
},
{
'id|+1': 21,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(186000000,1869999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//出生时间
'date': '@date',
//籍贯
'nativePlace': "@city",
//民族
'nation': '汉族',
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '建筑系',
//专业
'major': '建筑工程',
//部门
'grade': '建筑1班',
//辅导员
'tutor': '李宇',
//手机号
'phone': '@integer(18600000000,18699999999)',
}
]
})
const mitigate = Mock.mock({
'list|10': [
{
'id|+1': 1,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(132000000,1329999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//学费
'tuition': 16800,
//减免金额
'mitigate': 12800,
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '机电工程系',
//专业
'major': '机械制造与自动化',
//部门
'grade': '机制1班',
//辅导员
'tutor': '王刚',
},
{
'id|+1': 11,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(188000000,18899999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
'tuition': 16800,
//减免金额
'mitigate': 10000,
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '护理分院',
//专业
'major': '护理学',
//部门
'grade': '护理学1班',
//辅导员
'tutor': '张明',
},
{
'id|+1': 21,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(186000000,1869999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
'tuition': 16800,
//减免金额
'mitigate': 12000,
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '建筑系',
//专业
'major': '建筑工程',
//部门
'grade': '建筑1班',
//辅导员
'tutor': '李宇',
}
]
})
const premium = Mock.mock({
'list|10': [
{
'id|+1': 1,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(132000000,1329999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//退费金额
'tuition': 16800,
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '机电工程系',
//专业
'major': '机械制造与自动化',
//部门
'grade': '机制1班',
//辅导员
'tutor': '王刚',
},
{
'id|+1': 11,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(188000000,18899999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//退费金额
'tuition': 16800,
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '护理分院',
//专业
'major': '护理学',
//部门
'grade': '护理学1班',
//辅导员
'tutor': '张明',
},
{
'id|+1': 21,
//学生姓名
'name': '@cname',
//学生学号
'studentNumber': '@integer(186000000,1869999999)',
//性别
'gender': '@pick(["男","女"])',
//年龄
'age': '@integer(20,21)',
//退费金额
'tuition': 16800,
//入学时间
'enrollmentyear': '@now("yyyy")',
//部门
'college': '建筑系',
//专业
'major': '建筑工程',
//部门
'grade': '建筑1班',
//辅导员
'tutor': '李宇',
}
]
})
2024-04-09 19:00:18 +08:00
export default [
//应收管理列表
{
url: '/get-sdy-managment-list',
method: 'get',
response: () => {
return {
code: 200,
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,
}
}
},
// 借款管理
{
url: '/get-sdy-loan-list',
method: 'get',
response: () => {
return {
code: 200,
data: loans
}
}
},
// 借款管理搜索
{
url: '/post-sdy-loan-find',
method: 'post',
response: (req) => {
if (req.body.name !== '') {
const arr = loans.list.filter(item => item.proposer.includes(req.body.name))
return arr
} else if (req.body.studentnumber !== '') {
const studentnumber = Number(req.body.studentnumber)
const arr = loans.list.filter(item => item.student === studentnumber)
return arr
}
return {
code: 200,
data: arr
}
}
},
// 添加借款人
{
url: '/post-sdy-loan-add',
method: 'post',
response: (req) => {
const newLoan = {
id: loans.list.length + 1,
proposer: req.body.proposer,
student: req.body.student,
allowance: req.body.allowance,
department: req.body.department,
cation: req.body.cation,
loanTerm: req.body.loanTerm,
timeofapplication: req.body.timeofapplication,
}
loans.list.push(newLoan)
return {
code: 200,
data: newLoan
}
}
},
// 当日明细列表
2024-04-09 19:00:18 +08:00
{
url: '/get-sdy-daily-list',
2024-04-09 19:00:18 +08:00
method: 'get',
response: () => {
return {
code: 200,
data: daily
}
}
},
// 学生催款表
{
url: '/get-sdy-paragraph-list',
method: 'get',
response: () => {
return {
code: 200,
data: paragraph
}
}
},
// 学生催款表搜索
{
url: '/post-sdy-paragraph-find',
method: 'post',
response: (req) => {
if (req.body.name !== '') {
const arr = paragraph.list.filter(item => item.name.includes(req.body.name))
return arr
} else if (req.body.studentnumber !== '') {
const arr = paragraph.list.filter(item => item.department.includes(req.body.studentnumber))
return arr
} else if (req.body.counselor !== '') {
const arr = paragraph.list.filter(item => item.counselor.includes(req.body.counselor))
return arr
} else if (req.body.tutor !== '') {
const arr = paragraph.list.filter(item => item.grade.includes(req.body.tutor))
return arr
}
return {
code: 200,
data: arr
}
}
},
// 学院分析
{
url: '/get-sdy-analysis-list',
method: 'get',
response: () => {
return {
code: 200,
data: analysis
}
}
},
// 学生信息统计
{
url: '/get-sdy-message-list',
method: 'get',
response: () => {
return {
code: 200,
data: message
}
}
},
// 学生信息统计搜索
{
url: '/post-sdy-message-find',
method: 'post',
response: (req) => {
if (req.body.name !== '') {
const arr = message.list.filter(item => item.name.includes(req.body.name))
return arr
} else if (req.body.studentnumber !== '') {
const arr = message.list.filter(item => item.department.includes(req.body.studentnumber))
return arr
} else if (req.body.college !== '') {
const arr = message.list.filter(item => item.counselor.includes(req.body.counselor))
return arr
} else if (req.body.grade !== '') {
const arr = message.list.filter(item => item.grade.includes(req.body.grade))
return arr
}
return {
code: 200,
data: arr
}
}
},
// 减免管理
{
url: '/get-sdy-mitigate-list',
method: 'get',
response: () => {
return {
code: 200,
data: mitigate
}
}
},
// 减免管理搜索
{
url: '/post-sdy-mitigate-find',
method: 'post',
response: (req) => {
if (req.body.name !== '') {
const arr = mitigate.list.filter(item => item.name.includes(req.body.name))
return arr
} else if (req.body.studentnumber !== '') {
const arr = mitigate.list.filter(item => item.department.includes(req.body.studentnumber))
return arr
} else if (req.body.college !== '') {
const arr = mitigate.list.filter(item => item.counselor.includes(req.body.counselor))
return arr
} else if (req.body.tutor !== '') {
const arr = mitigate.list.filter(item => item.tutor.includes(req.body.tutor))
return arr
}
return {
code: 200,
data: arr
}
}
},
// 退费管理
{
url: '/get-sdy-premium-list',
method: 'get',
response: () => {
return {
code: 200,
data: premium
}
}
},
// 退费管理搜索
{
url: '/post-sdy-premium-find',
method: 'post',
response: (req) => {
if (req.body.name !== '') {
const arr = premium.list.filter(item => item.name.includes(req.body.name))
return arr
} else if (req.body.studentnumber !== '') {
const arr = premium.list.filter(item => item.department.includes(req.body.studentnumber))
return arr
} else if (req.body.college !== '') {
const arr = premium.list.filter(item => item.counselor.includes(req.body.counselor))
return arr
} else if (req.body.tutor !== '') {
const arr = premium.list.filter(item => item.tutor.includes(req.body.tutor))
return arr
}
return {
code: 200,
data: arr
}
}
},
]