兵马未动 粮草先行
This commit is contained in:
@@ -204,7 +204,8 @@ const dataRules = ref({
|
||||
{ required: true, message: '学院不能为空', trigger: 'change' }
|
||||
],
|
||||
classCode: [
|
||||
{ required: true, message: '班级代码不能为空', trigger: 'blur' }
|
||||
{ required: true, message: '班级代码不能为空', trigger: 'blur' },
|
||||
{ min: 4, message: '班级代码至少4位(班号取后4位)', trigger: 'blur' }
|
||||
],
|
||||
classNo: [
|
||||
{ required: true, message: '班号不能为空', trigger: 'blur' }
|
||||
@@ -406,11 +407,11 @@ watch(() => form.enterDate, (newVal) => {
|
||||
}
|
||||
})
|
||||
|
||||
// 监听班级代码,取后四位为班号
|
||||
// 监听班级代码,取后四位为班号(班级代码至少4位)
|
||||
watch(() => form.classCode, (newVal) => {
|
||||
if (newVal) {
|
||||
const length = newVal.length
|
||||
if (length > 4) {
|
||||
if (length >= 4) {
|
||||
// 只在新增模式下自动填充班号,编辑模式下如果班号为空才填充
|
||||
if (!form.id || !form.classNo) {
|
||||
form.classNo = newVal.substring(length - 4, length)
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" fixed="right" width="200">
|
||||
<el-table-column label="操作" align="center" fixed="right" width="260">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
icon="View"
|
||||
|
||||
Reference in New Issue
Block a user