|
@@ -60,7 +60,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
- v-if="modalForm.examNumberStyle === 'FILL'"
|
|
|
+ v-if="isFillModel"
|
|
|
prop="examNumberDigit"
|
|
|
label="学号位数:"
|
|
|
class="inline-block"
|
|
@@ -99,7 +99,7 @@
|
|
|
>
|
|
|
<el-checkbox
|
|
|
v-model="modalForm.writeSign"
|
|
|
- :disabled="modalForm.examNumberStyle === 'FILL' || !editable"
|
|
|
+ :disabled="isFillModel || !editable"
|
|
|
>启用“手写签名”</el-checkbox
|
|
|
>
|
|
|
<el-checkbox v-model="modalForm.undertakingEnable"
|
|
@@ -130,9 +130,24 @@
|
|
|
:key="column.code"
|
|
|
v-model="column.enable"
|
|
|
:disabled="!editable"
|
|
|
+ @change="updateFillFields"
|
|
|
>{{ column.name }}</el-checkbox
|
|
|
>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ v-if="isFillModel"
|
|
|
+ label="变量填充字段:"
|
|
|
+ label-width="115px"
|
|
|
+ >
|
|
|
+ <el-checkbox-group v-model="modalForm.fillFields">
|
|
|
+ <el-checkbox
|
|
|
+ v-for="column in selectedFields"
|
|
|
+ :key="column.code"
|
|
|
+ :label="column.code"
|
|
|
+ >{{ column.name }}</el-checkbox
|
|
|
+ >
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
|
<el-form-item prop="titleRule" label="题卡标题规则:">
|
|
|
<card-title-rule-edit
|
|
@@ -223,6 +238,7 @@ const initModalForm = {
|
|
|
undertakingBody: UNDERTAKING_BODY,
|
|
|
requiredFields: [],
|
|
|
extendFields: [],
|
|
|
+ fillFields: [],
|
|
|
titleRule: "",
|
|
|
firstLevelSubheading: "",
|
|
|
secondLevelSubheading: "",
|
|
@@ -259,12 +275,15 @@ export default {
|
|
|
editable() {
|
|
|
return this.editType !== "PREVIEW";
|
|
|
},
|
|
|
- // fieldSourses() {
|
|
|
- // return [
|
|
|
- // ...this.modalForm.requiredFields,
|
|
|
- // ...this.modalForm.extendFields
|
|
|
- // ].filter(item => item.enable);
|
|
|
- // }
|
|
|
+ isFillModel() {
|
|
|
+ return this.modalForm.examNumberStyle === "FILL";
|
|
|
+ },
|
|
|
+ selectedFields() {
|
|
|
+ return [
|
|
|
+ ...this.modalForm.requiredFields,
|
|
|
+ ...this.modalForm.extendFields,
|
|
|
+ ].filter((item) => item.enable);
|
|
|
+ },
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -393,6 +412,9 @@ export default {
|
|
|
if (val.id) {
|
|
|
this.modalForm.requiredFields = JSON.parse(val.requiredFields);
|
|
|
this.modalForm.extendFields = JSON.parse(val.extendFields);
|
|
|
+ this.modalForm.fillFields = val.fillFields
|
|
|
+ ? val.fillFields.split(",")
|
|
|
+ : [];
|
|
|
}
|
|
|
},
|
|
|
visibleChange() {
|
|
@@ -412,22 +434,31 @@ export default {
|
|
|
this.modalForm.writeSign = this.modalForm.examNumberStyle !== "FILL";
|
|
|
if (this.modalForm.examNumberStyle !== "FILL") {
|
|
|
this.modalForm.examNumberDigit = 10;
|
|
|
+ this.modalForm.fillFields = [];
|
|
|
}
|
|
|
},
|
|
|
toEditUndertaking() {
|
|
|
this.$refs.ModifyCardRuleUndertaking.open();
|
|
|
},
|
|
|
+ updateFillFields() {
|
|
|
+ const fields = this.selectedFields.map((item) => item.code);
|
|
|
+ this.modalForm.fillFields = this.modalForm.fillFields.filter((item) =>
|
|
|
+ fields.includes(item)
|
|
|
+ );
|
|
|
+ },
|
|
|
async submit() {
|
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
|
if (!valid) return;
|
|
|
|
|
|
if (this.isSubmit) return;
|
|
|
this.isSubmit = true;
|
|
|
- let modals = {
|
|
|
+ this.updateFillFields();
|
|
|
+ const modals = {
|
|
|
...this.modalForm,
|
|
|
};
|
|
|
modals.requiredFields = JSON.stringify(modals.requiredFields);
|
|
|
modals.extendFields = JSON.stringify(modals.extendFields);
|
|
|
+ modals.fillFields = modals.fillFields.join();
|
|
|
const data = await saveCardRule(modals).catch(() => {});
|
|
|
this.isSubmit = false;
|
|
|
if (!data) return;
|