|
@@ -58,10 +58,24 @@
|
|
|
clearable
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="pageSize" label="纸张类型:">
|
|
|
+ <el-select
|
|
|
+ v-model="modalForm.pageSize"
|
|
|
+ placeholder="请选择纸张类型"
|
|
|
+ @change="pageSizeChange"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in PAPER_SIZE_TYPE"
|
|
|
+ :key="item"
|
|
|
+ :value="item"
|
|
|
+ :label="item"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item prop="cardTemplateId" label="模板选择">
|
|
|
<div class="template-list">
|
|
|
<div
|
|
|
- v-for="item in templates"
|
|
|
+ v-for="item in templateList"
|
|
|
:key="item.id"
|
|
|
:class="[
|
|
|
'template-item',
|
|
@@ -107,6 +121,7 @@ import {
|
|
|
cardTemplateListApi,
|
|
|
} from "../api";
|
|
|
import PreviewCardTemplate from "../components/PreviewCardTemplate.vue";
|
|
|
+import { PAPER_SIZE_TYPE } from "../enumerate";
|
|
|
|
|
|
const initModalForm = {
|
|
|
id: null,
|
|
@@ -115,6 +130,7 @@ const initModalForm = {
|
|
|
attention: "",
|
|
|
objectiveAttention: "",
|
|
|
subjectiveAttention: "",
|
|
|
+ pageSize: "A3",
|
|
|
cardTemplateId: null,
|
|
|
};
|
|
|
|
|
@@ -136,6 +152,7 @@ export default {
|
|
|
cardHeadId: this.$route.params.cardHeadId,
|
|
|
templates: [],
|
|
|
modalForm: { ...initModalForm },
|
|
|
+ PAPER_SIZE_TYPE,
|
|
|
rules: {
|
|
|
name: [
|
|
|
{
|
|
@@ -211,6 +228,13 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
+ pageSize: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: "请选择纸张类型",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
cardTemplateId: [
|
|
|
{
|
|
|
required: true,
|
|
@@ -222,6 +246,13 @@ export default {
|
|
|
imageList: [],
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ templateList() {
|
|
|
+ return this.templates.filter(
|
|
|
+ (item) => item.pageSize === this.modalForm.pageSize
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.initData();
|
|
|
this.getTemplates();
|
|
@@ -252,6 +283,9 @@ export default {
|
|
|
this.modalForm.cardTemplateId = item.id;
|
|
|
this.$refs.modalFormComp.validateField("cardTemplateId");
|
|
|
},
|
|
|
+ pageSizeChange() {
|
|
|
+ this.modalForm.cardTemplateId = "";
|
|
|
+ },
|
|
|
async submit() {
|
|
|
const valid = await this.$refs.modalFormComp.validate().catch(() => {});
|
|
|
if (!valid) return;
|