|
@@ -1,7 +1,12 @@
|
|
<template>
|
|
<template>
|
|
<div class="rule-exam part-box part-box-pad part-box-border">
|
|
<div class="rule-exam part-box part-box-pad part-box-border">
|
|
<h4 class="part-box-tips">变量印刷考务字段配置:</h4>
|
|
<h4 class="part-box-tips">变量印刷考务字段配置:</h4>
|
|
- <el-form ref="modalFormComp" :model="modalForm" label-width="170px">
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ ref="modalFormComp"
|
|
|
|
+ :model="modalForm"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ label-width="170px"
|
|
|
|
+ >
|
|
<el-form-item label="必选字段:" required>
|
|
<el-form-item label="必选字段:" required>
|
|
<el-checkbox
|
|
<el-checkbox
|
|
v-for="field in modalForm.requiredFields"
|
|
v-for="field in modalForm.requiredFields"
|
|
@@ -36,6 +41,17 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item prop="examNumberDigit" label="考号位数:" required>
|
|
|
|
+ <el-input-number
|
|
|
|
+ v-model="modalForm.examNumberDigit"
|
|
|
|
+ :min="5"
|
|
|
|
+ :max="15"
|
|
|
|
+ :step="1"
|
|
|
|
+ step-strictly
|
|
|
|
+ :controls="false"
|
|
|
|
+ style="width: 100px;"
|
|
|
|
+ ></el-input-number>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="是否启用入库审核:" required>
|
|
<el-form-item label="是否启用入库审核:" required>
|
|
<el-switch v-model="modalForm.review" inactive-color="#dcdfe6">
|
|
<el-switch v-model="modalForm.review" inactive-color="#dcdfe6">
|
|
</el-switch>
|
|
</el-switch>
|
|
@@ -83,6 +99,7 @@ const initModalForm = {
|
|
id: null,
|
|
id: null,
|
|
review: true,
|
|
review: true,
|
|
includePaper: true,
|
|
includePaper: true,
|
|
|
|
+ examNumberDigit: 8,
|
|
printMethod: "AUTO",
|
|
printMethod: "AUTO",
|
|
requiredFields: "[]",
|
|
requiredFields: "[]",
|
|
extendFields: "[]"
|
|
extendFields: "[]"
|
|
@@ -95,7 +112,16 @@ export default {
|
|
return {
|
|
return {
|
|
modalForm: { ...initModalForm },
|
|
modalForm: { ...initModalForm },
|
|
isSubmit: false,
|
|
isSubmit: false,
|
|
- CONFIRM_PRINT_TYPE
|
|
|
|
|
|
+ CONFIRM_PRINT_TYPE,
|
|
|
|
+ rules: {
|
|
|
|
+ examNumberDigit: [
|
|
|
|
+ {
|
|
|
|
+ required: true,
|
|
|
|
+ message: "请输入考号位数",
|
|
|
|
+ trigger: "change"
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ }
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -105,7 +131,10 @@ export default {
|
|
async init() {
|
|
async init() {
|
|
const requiredFields = await getEnums("REQUIRED_FIELDS");
|
|
const requiredFields = await getEnums("REQUIRED_FIELDS");
|
|
const examRule = await examRuleDetail();
|
|
const examRule = await examRuleDetail();
|
|
- this.modalForm = Object.assign(initModalForm, examRule || {});
|
|
|
|
|
|
+ this.modalForm = Object.assign({}, initModalForm, examRule || {});
|
|
|
|
+ this.modalForm.examNumberDigit =
|
|
|
|
+ examRule.examNumberDigit || initModalForm.examNumberDigit;
|
|
|
|
+
|
|
this.modalForm.requiredFields = requiredFields.map(item => {
|
|
this.modalForm.requiredFields = requiredFields.map(item => {
|
|
return {
|
|
return {
|
|
code: item.code,
|
|
code: item.code,
|
|
@@ -113,7 +142,7 @@ export default {
|
|
enable: true
|
|
enable: true
|
|
};
|
|
};
|
|
});
|
|
});
|
|
- console.log(this.modalForm.extendFields);
|
|
|
|
|
|
+ // console.log(this.modalForm.extendFields);
|
|
this.modalForm.extendFields = JSON.parse(this.modalForm.extendFields);
|
|
this.modalForm.extendFields = JSON.parse(this.modalForm.extendFields);
|
|
},
|
|
},
|
|
validateRequiredFields() {
|
|
validateRequiredFields() {
|