import { listOneHundred, listSelect } from '@/api/stuCQS/lake/type'
-import { listOwnApply, cancelOwnApply, applyLake, applyTen, reApplyLake } from '@/api/stuCQS/lake/apply'
+import { applyLake, applyTen, cancelOwnApply, listOwnApply, reApplyLake } from '@/api/stuCQS/lake/apply'
-import {
- getOwnPassCountByCode, getOwnIamCountByCode, getOwnRankByCode,
- listXyjxjCanType, countOwnPass, listOwnScoreClassRank,
- listOwnYearCourseScore, countOwnIam
-} from '@/api/stuCQS/good/apply'
import { listAllYear as listYear } from '@/api/stuCQS/basedata/year'
-
import {
- applyStatus
-} from '@/api/stuCQS/good/audit'
+ countOwnIam,
+ countOwnPass,
+ getOwnIamCountByCode,
+ getOwnPassCountByCode,
+ getOwnRankByCode,
+ listOwnScoreClassRank,
+ listOwnYearCourseScore,
+ listXyjxjCanType
+} from '@/api/stuCQS/good/apply'
+
import { isEmpty } from '@/api/helpFunc'
import { alipayVali } from '@/api/helpFunc/bank'
+import {
+ applyStatus
+} from '@/api/stuCQS/good/audit'
-import lodash from 'lodash'
import MoreDetail from '@/views/stuCQS/lake/MoreDetail.vue'
+import lodash from 'lodash'
export default {
name: 'Iwantapply',
@@ -579,6 +584,7 @@ export default {
applyStatus,
isEmpty,
fullLoading: false,
+ loadingText: '',
lookNeedV: false,
@@ -806,26 +812,33 @@ export default {
}
},
async addTenVClick() {
- this.loading = true
- let code = cans[0].typeCode
- let res3 = await getOwnRankByCode(code)
- if (res3.code == 200) {
- if (!isEmpty(res3.data)) {
- let rankData = res3.data
- let classCount = rankData.classCount
- let cphClassRank = rankData.cphClassRank
+ this.loadingText = '正在校验资格.....'
+ this.fullLoading = true
+ try {
+ const cans = [...this.can_list]
+ if (cans.length === 0) {
+ this.$message.info('暂无可申请的奖项')
+ return
+ }
+ const code = cans[0].typeCode
+ const res3 = await getOwnRankByCode(code)
+ if (res3.code === 200 && !isEmpty(res3.data)) {
+ const rankData = res3.data
+ const classCount = rankData.classCount
+ const cphClassRank = rankData.cphClassRank
- let cphPer = Math.round(cphClassRank / classCount * 10000) / 100
+ const cphPer = classCount ? Math.round(cphClassRank / classCount * 10000) / 100 : NaN
- if (cphPer > 10.5) {
+ if (!isNaN(cphPer) && cphPer > 10.5) {
this.$message.info('您的综合素质成绩排名不达标')
- this.fullLoading = false
return
}
-
}
+ this.addTenV = true
+ } finally {
+ this.fullLoading = false
+ this.loadingText = ''
}
- this.addTenV = true
},
async changeType(v) {
let need = 'XYZX'
@@ -940,78 +953,71 @@ export default {
}
},
async addVClick() {
+ this.loadingText = '正在校验资格.....'
this.fullLoading = true
- let cans = [...this.can_list]
- if (cans.length == 0) {
- this.fullLoading = false
- return
- }
- let code = cans[0].typeCode
- let res1 = await getOwnPassCountByCode(code)
- if (res1.code == 200) {
- let data1 = res1.data
- if (isEmpty(data1)) {
- data1 = {
- unpassCount: 0
- }
- }
- if (data1.unpassCount != 0) {
- this.$message.info('您有课程成绩没通过,不能申请哦')
- this.fullLoading = false
+ try {
+ const cans = [...this.can_list]
+ if (cans.length === 0) {
+ this.$message.info('暂无可申请的奖项')
return
}
- }
-
- let res2 = await getOwnIamCountByCode(code)
- if (res2.code == 200) {
- let data2 = res2.data
- if (isEmpty(data2)) {
- data2 = {
- minusCount: 0
+ const code = cans[0].typeCode
+ const res1 = await getOwnPassCountByCode(code)
+ if (res1.code === 200) {
+ let data1 = res1.data
+ if (isEmpty(data1)) {
+ data1 = { unpassCount: 0 }
+ }
+ if (data1.unpassCount != 0) {
+ this.$message.info('您有课程成绩没通过,不能申请哦')
+ return
}
}
- if (data2.minusCount != 0) {
- this.$message.info('您有思想品德扣分项,不能申请哦')
- this.fullLoading = false
- return
+
+ const res2 = await getOwnIamCountByCode(code)
+ if (res2.code === 200) {
+ let data2 = res2.data
+ if (isEmpty(data2)) {
+ data2 = { minusCount: 0 }
+ }
+ if (data2.minusCount != 0) {
+ this.$message.info('您有思想品德扣分项,不能申请哦')
+ return
+ }
}
- }
- let res3 = await getOwnRankByCode(code)
- if (res3.code == 200) {
- if (!isEmpty(res3.data)) {
- let rankData = res3.data
- let classCount = rankData.classCount
- let cphClassRank = rankData.cphClassRank
- let majorCount = rankData.majorCount
- let stuMajorRank = rankData.stuMajorRank
+ const res3 = await getOwnRankByCode(code)
+ if (res3.code === 200 && !isEmpty(res3.data)) {
+ const rankData = res3.data
+ const classCount = rankData.classCount
+ const cphClassRank = rankData.cphClassRank
+ const majorCount = rankData.majorCount
+ const stuMajorRank = rankData.stuMajorRank
- let cphPer = Math.round(cphClassRank / classCount * 10000) / 100
- let stuPer = Math.round(stuMajorRank / majorCount * 10000) / 100
+ const cphPer = classCount ? Math.round(cphClassRank / classCount * 10000) / 100 : NaN
+ const stuPer = majorCount ? Math.round(stuMajorRank / majorCount * 10000) / 100 : NaN
- if (cphPer > 35) {
+ if (!isNaN(cphPer) && cphPer > 35) {
this.$message.info('您的综合素质成绩排名不达标')
- this.fullLoading = false
return
}
- if (stuPer > 35) {
+ if (!isNaN(stuPer) && stuPer > 35) {
this.$message.info('您的平均学分绩排名不达标')
- this.fullLoading = false
return
}
- let sportScore = rankData.sportScore
- if (sportScore < 60) {
+ const sportScore = rankData.sportScore
+ if (!isEmpty(sportScore) && sportScore < 60) {
this.$message.info('您的体能成绩不达标')
- this.fullLoading = false
return
}
}
+ this.addV = true
+ } finally {
+ this.fullLoading = false
+ this.loadingText = ''
}
-
- this.fullLoading = false
- this.addV = true
},
async listCan() {