|
@@ -94,11 +94,11 @@
|
|
</div>
|
|
</div>
|
|
<div class="setting-params">
|
|
<div class="setting-params">
|
|
<div class="card-title">贺卡尺寸</div>
|
|
<div class="card-title">贺卡尺寸</div>
|
|
- <el-input :disabled="[9,11].includes(params.sizeType)" v-model="params.cardWidth">
|
|
|
|
|
|
+ <el-input ref="cardWidth" :disabled="[9,11].includes(params.sizeType)" v-model="params.cardWidth" @change="checkCardWidth">
|
|
<template slot="prepend">宽</template>
|
|
<template slot="prepend">宽</template>
|
|
<template slot="append">毫米</template>
|
|
<template slot="append">毫米</template>
|
|
</el-input>
|
|
</el-input>
|
|
- <el-input :disabled="[9,11].includes(params.sizeType)" v-model="params.cardHeight">
|
|
|
|
|
|
+ <el-input ref="cardHeight" :disabled="[9,11].includes(params.sizeType)" v-model="params.cardHeight" @change="checkCardHeight">
|
|
<template slot="prepend">高</template>
|
|
<template slot="prepend">高</template>
|
|
<template slot="append">毫米</template>
|
|
<template slot="append">毫米</template>
|
|
</el-input>
|
|
</el-input>
|
|
@@ -179,6 +179,7 @@ import {
|
|
cloudConfigAdd,
|
|
cloudConfigAdd,
|
|
} from "../../../api/shop";
|
|
} from "../../../api/shop";
|
|
import { getConfig, updateConfig } from "../../../api/setting.js";
|
|
import { getConfig, updateConfig } from "../../../api/setting.js";
|
|
|
|
+import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
|
|
export default {
|
|
export default {
|
|
name: "greetingCardPrinter",
|
|
name: "greetingCardPrinter",
|
|
components: {},
|
|
components: {},
|
|
@@ -378,7 +379,30 @@ export default {
|
|
},
|
|
},
|
|
// 方法集合
|
|
// 方法集合
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapMutations(["SET_USERINFO"]),
|
|
|
|
+ checkCardWidth(e) {
|
|
|
|
+ if (e < 195) {
|
|
|
|
+ this.$message.error(`自定义纸张宽度不可小于195毫米!`);
|
|
|
|
+ this.$refs.cardWidth.focus();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ checkCardHeight(e) {
|
|
|
|
+ if (e < 145) {
|
|
|
|
+ this.$message.error(`自定义纸张高度不可小于145毫米!`);
|
|
|
|
+ this.$refs.cardHeight.focus();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
saveCard() {
|
|
saveCard() {
|
|
|
|
+ if (this.params.sizeType === 0) {
|
|
|
|
+ if (this.params.cardWidth < 195) {
|
|
|
|
+ this.$refs.cardWidth.focus();
|
|
|
|
+ return this.$message.error(`自定义纸张宽度不可小于195毫米!`);
|
|
|
|
+ }
|
|
|
|
+ if (this.params.cardWidth < 145) {
|
|
|
|
+ this.$refs.cardHeight.focus();
|
|
|
|
+ return this.$message.error(`自定义纸张高度不可小于145毫米!`);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
cloudConfigAdd(this.params).then((res) => {
|
|
cloudConfigAdd(this.params).then((res) => {
|
|
console.log("添加贺卡配置信息", res);
|
|
console.log("添加贺卡配置信息", res);
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -709,6 +733,7 @@ export default {
|
|
getConfig() {
|
|
getConfig() {
|
|
getConfig().then((res) => {
|
|
getConfig().then((res) => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
|
|
+ this.SET_USERINFO(res.data);
|
|
this.list = this.list.map((v) => {
|
|
this.list = this.list.map((v) => {
|
|
v.value = res.data[v.field];
|
|
v.value = res.data[v.field];
|
|
return v;
|
|
return v;
|