|
|
@@ -54,8 +54,9 @@
|
|
|
<script>
|
|
|
import QuestionItem from '@/components/QuestionItem/index3.vue'
|
|
|
import CusNotice from '@/components/CusNotice/index2.vue'
|
|
|
- import CusTeamInfo from '@/components/CusTeamInfo/index.vue'
|
|
|
- import CusTeamUser from '@/components/CusTeamUser/index.vue'
|
|
|
+ import CusTeamInfo from '@/components/CusTeamInfo/index.vue'
|
|
|
+ import CusTeamUser from '@/components/CusTeamUser/index.vue'
|
|
|
+ const { validateFutureExpectation } = require('@/utils/perillScore.js')
|
|
|
export default {
|
|
|
components:{ CusNotice, QuestionItem, CusTeamInfo, CusTeamUser },
|
|
|
data(){
|
|
|
@@ -246,7 +247,7 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- if (firstUnansweredIndex > -1) {
|
|
|
+ if (firstUnansweredIndex > -1) {
|
|
|
uni.showModal({
|
|
|
title: '提示',
|
|
|
content: `第 ${firstUnansweredIndex + 1} 项未选择答案,请选择。`,
|
|
|
@@ -258,9 +259,25 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
- return; // 终止提交
|
|
|
- }
|
|
|
-
|
|
|
+ return; // 终止提交
|
|
|
+ }
|
|
|
+
|
|
|
+ let firstInvalidExpectationIndex = -1;
|
|
|
+ this.list.forEach((l, i) => {
|
|
|
+ const error = validateFutureExpectation(l.answer);
|
|
|
+ this.$set(l, 'warn', !!error);
|
|
|
+ if (error && firstInvalidExpectationIndex === -1) firstInvalidExpectationIndex = i;
|
|
|
+ });
|
|
|
+ if (firstInvalidExpectationIndex > -1) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '一年后期待分应高于现状评分,请注意!',
|
|
|
+ showCancel: false,
|
|
|
+ success: res => { if (res.confirm) this.scrollToQuestion(firstInvalidExpectationIndex); }
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const submitList = this.list.map((l) => {
|
|
|
let {answer,userAnswer,warn,...other} = JSON.parse(JSON.stringify(l));
|
|
|
userAnswer.forEach(u=>{
|
|
|
@@ -485,4 +502,4 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|