|
@@ -83,10 +83,12 @@
|
|
|
<p v-show="excelValid.idRep.includes(row.id)" class="account-warning-tips">{{$t('stuAccount.idRepErr') }}</p>
|
|
|
<p v-show="excelValid.stuYear.includes(row.id)" class="account-error-tips">{{$t('stuAccount.stuYearErr') }}</p>
|
|
|
<p v-show="excelValid.classYear.includes(row.id)" class="account-error-tips">{{$t('stuAccount.classYearErr') }}</p>
|
|
|
+ <p v-show="excelValid.noErr.includes(row.id)" class="account-error-tips">11{{$t('stuAccount.noFormatErr') }}</p>
|
|
|
+ <p v-show="excelValid.classErr.includes(row.id)" class="account-error-tips">22{{$t('stuAccount.classFormatErr') }}</p>
|
|
|
</template>
|
|
|
</Table>
|
|
|
<p style="margin-top:15px;">{{$t('stuAccount.passwordTips')}}</p>
|
|
|
- <Button class="confirm-btn" :disabled="!!excelValid.idErr.length || !!excelValid.classYear.length || !!excelValid.stuYear.length" :loading="uploadLoading" @click="saveFileData">
|
|
|
+ <Button class="confirm-btn" :disabled="!!excelValid.idErr.length || !!excelValid.classYear.length || !!excelValid.stuYear.length || !!excelValid.noErr.length || !!excelValid.classErr.length" :loading="uploadLoading" @click="saveFileData">
|
|
|
{{$t('stuAccount.submitList')}}
|
|
|
</Button>
|
|
|
</div>
|
|
@@ -124,7 +126,8 @@ export default {
|
|
|
classYear: [],
|
|
|
idErr: [], //id格式不对
|
|
|
idRep: [], // id已存在
|
|
|
-
|
|
|
+ noErr:[],
|
|
|
+ classErr:[]
|
|
|
},
|
|
|
totalNum: 0,
|
|
|
seatRepeatNum: 0,
|
|
@@ -205,10 +208,10 @@ export default {
|
|
|
if (this.excelValid.fieldIds.indexOf(row.id) >= 0 || this.excelValid.noReaptIds.indexOf(row.id) >= 0 || this.excelValid.reaptIds.indexOf(row.id) >= 0 || this.excelValid.gradeIds.indexOf(row.id) >= 0) {
|
|
|
className = className + 'account-warning-row-bg'
|
|
|
} else {
|
|
|
- if (!(this.repeatAccounts.length == 0 || this.repeatAccounts.indexOf(row.id) == -1) || row.seatRepeat || this.excelValid.idErr.includes(row.id) || this.excelValid.classYear.includes(row.id) || this.excelValid.stuYear.includes(row.id)) {
|
|
|
+ if (this.repeatAccounts.includes(row.id) || row.seatRepeat || this.excelValid.idErr.includes(row.id) || this.excelValid.classYear.includes(row.id) || this.excelValid.stuYear.includes(row.id) || this.excelValid.noErr.includes(row.id) || this.excelValid.classErr.includes(row.id)) {
|
|
|
className = className + 'account-error-row-bg '
|
|
|
}
|
|
|
- if (row.classId == '' || row.classId == null || row.no == '' || row.no == null) {
|
|
|
+ if (!row.classId || !row.no) {
|
|
|
className = className + 'account-warning-row-bg'
|
|
|
}
|
|
|
}
|
|
@@ -353,7 +356,6 @@ export default {
|
|
|
let stud = this.students.filter((studInfo) => {
|
|
|
return (classItem.classId == studInfo.classNo && classItem.classYear == studInfo.classYear)
|
|
|
})
|
|
|
-
|
|
|
updStuds.push(...stud)
|
|
|
})
|
|
|
|
|
@@ -546,7 +548,7 @@ export default {
|
|
|
_this.seatRepeatNum++
|
|
|
}
|
|
|
}
|
|
|
- //验证入学年和学级是否合法
|
|
|
+ //验证入学年、学级是否合法
|
|
|
if (!yearZG.test(item.stuYear)) {
|
|
|
_this.excelValid.stuYear.push(item.id)
|
|
|
}
|
|
@@ -558,6 +560,14 @@ export default {
|
|
|
if (!idZG.test(item.id)) {
|
|
|
_this.excelValid.idErr.push(item.id)
|
|
|
}
|
|
|
+ //no格式检查(只能包含数字)
|
|
|
+ if (!idZG.test(item.no)) {
|
|
|
+ _this.excelValid.noErr.push(item.id)
|
|
|
+ }
|
|
|
+ //classid格式检查(只能包含数字)
|
|
|
+ if (!idZG.test(item.classId)) {
|
|
|
+ _this.excelValid.classErr.push(item.id)
|
|
|
+ }
|
|
|
|
|
|
// 导入数据中 ID 重複
|
|
|
let repID = array.filter((i, key) => {
|