学生资助-励志奖学金-移动端开发(补)
This commit is contained in:
@@ -60,3 +60,38 @@ export function doApply(data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取体能测试成绩
|
||||
export function selectTestStu(data) {
|
||||
return request({
|
||||
url: '/system/score/selectTestStu',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取处分记录
|
||||
export function listDisciplinaryApplication(data) {
|
||||
return request({
|
||||
url: '/routine/disciplinaryApplication/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
});
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
export function getDicts(type) {
|
||||
return request({
|
||||
url: `/system/dict/data/type/${type}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取成绩排名
|
||||
export function listOwnScoreClassRankByTag(tag) {
|
||||
return request({
|
||||
url: '/comprehensive/goodapply/listOwnScoreRankByTag',
|
||||
method: 'get',
|
||||
params: { tag }
|
||||
});
|
||||
}
|
||||
@@ -152,7 +152,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listOwn, doEdit, doCancel, doReApply } from '@/api/finance/knzzGl';
|
||||
import { listOwn, doEdit, doCancel, doReApply, selectTestStu, listDisciplinaryApplication, getDicts, listOwnScoreClassRankByTag } from '@/api/finance/knzzGl';
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
export default {
|
||||
name: "KnzzGlList",
|
||||
@@ -385,9 +385,163 @@
|
||||
|
||||
// 跳转到申请页面
|
||||
applyGl() {
|
||||
uni.navigateTo({
|
||||
url: './apply'
|
||||
this.checkAllConditions();
|
||||
},
|
||||
|
||||
// 检查所有申请条件
|
||||
async checkAllConditions() {
|
||||
uni.showLoading({
|
||||
title: '正在校验资格...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
try {
|
||||
const [sportResult, disciplinaryResult, scoreResult] = await Promise.all([
|
||||
this.fetchTestScoreData(),
|
||||
this.fetchcfwjc(),
|
||||
this.fetchcjpm()
|
||||
]);
|
||||
|
||||
uni.hideLoading();
|
||||
|
||||
if (sportResult && disciplinaryResult && scoreResult) {
|
||||
// 所有条件都满足,跳转到申请页面
|
||||
uni.navigateTo({
|
||||
url: './apply'
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('资格校验失败:', error);
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
title: '资格校验失败,请稍后重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 获取体能测试成绩
|
||||
async fetchTestScoreData() {
|
||||
try {
|
||||
const res = await selectTestStu();
|
||||
if (res.code === 200 && res.rows && res.rows.length > 0) {
|
||||
const testScore = res.rows[res.rows.length - 1].testScore;
|
||||
if (testScore >= 60) {
|
||||
return true;
|
||||
} else if (testScore === 0) {
|
||||
uni.showToast({
|
||||
title: '当前学年没有您的体能成绩',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '您的体能成绩不达标',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '请先完成体能测试',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('体能测试数据获取失败:', error);
|
||||
uni.showToast({
|
||||
title: '体能测试数据获取失败',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// 获取处分记录
|
||||
async fetchcfwjc() {
|
||||
try {
|
||||
const [dictResponse, disciplinaryResponse] = await Promise.all([
|
||||
getDicts('rt_penalty_status'),
|
||||
listDisciplinaryApplication()
|
||||
]);
|
||||
|
||||
if (Array.isArray(disciplinaryResponse.rows) && disciplinaryResponse.rows.length > 0) {
|
||||
const penaltyStatus = disciplinaryResponse.rows[0].penaltyStatus;
|
||||
const dictData = dictResponse.data || [];
|
||||
|
||||
// 查找对应处分状态的字典项
|
||||
const处分中 = dictData.find(item => item.dictSort === '1');
|
||||
const已解除 = dictData.find(item => item.dictSort === '2');
|
||||
const解除申请中 = dictData.find(item => item.dictSort === '3');
|
||||
const处分申请中 = dictData.find(item => item.dictSort === '4');
|
||||
|
||||
if (penaltyStatus === '1') {
|
||||
uni.showToast({
|
||||
title: '您目前处于处分中,无法申请',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} else if (penaltyStatus === '3') {
|
||||
uni.showToast({
|
||||
title: '您的解除处分申请正在处理中',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} else if (penaltyStatus === '4') {
|
||||
uni.showToast({
|
||||
title: '您的处分申请正在处理中',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('处分状态获取失败:', error);
|
||||
uni.showToast({
|
||||
title: '处分状态获取失败',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// 获取成绩排名
|
||||
async fetchcjpm() {
|
||||
try {
|
||||
const res = await listOwnScoreClassRankByTag('NLZJ');
|
||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||
const data = res.data[0];
|
||||
if (data.stuMajorRank != null && data.majorCount != null) {
|
||||
const stuRank = Math.round(Math.round(data.stuMajorRank / data.majorCount * 10000) / 100);
|
||||
if (stuRank <= 30) {
|
||||
return true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '您的学业成绩未达到专业前30%',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
uni.showToast({
|
||||
title: '无法获取您的专业排名数据',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
} catch (error) {
|
||||
console.error('成绩排名获取失败:', error);
|
||||
uni.showToast({
|
||||
title: '成绩排名获取失败',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
// 重新提交申请
|
||||
|
||||
Reference in New Issue
Block a user