Commit 319568d4 by chenxin

fix: 转赠 回车

parent 3115fdd0
......@@ -70,6 +70,19 @@ const initForm = {
};
const sale_limit = { fee: 0, goods: '', flag: false, type: 0 }; //最低消费
const goods = { ok: '', no: '', flag: false };
// 禁止回车
const preventEnter = function(e) {
let et = e || window.event;
let keycode = et.charCode || et.keyCode;
if (keycode == 13) {
if (window.event) {
window.event.returnValue = false;
} else {
e.preventDefault(); // for firefox
}
}
};
export default {
mixins: [xxSysp_mix],
data() {
......@@ -229,6 +242,16 @@ export default {
};
},
watch: {
'form.giveFlag'(val) {
if (val) {
this.$nextTick(_ => {
// 禁止卡券转赠规则textare回车
this.$refs.ruleTextarea.$el.querySelector('textarea').addEventListener('keydown', preventEnter);
});
} else {
this.$refs.ruleTextarea.$el.querySelector('textarea').removeEventListener('keydown', preventEnter);
}
},
giveImg1: {
handler(val) {
this.form.giveImage = val.imgUrl;
......@@ -451,7 +474,7 @@ export default {
this.storeMode = card.storeMode === 0 ? 0 : 1;
this.form.cardApplyChannel = card.cardApplyChannel ? card.cardApplyChannel.split(',') : [];
this.form.auditingStatus = card.auditingStatus || '';
this.form.giveFlag = res.result.giveEnable ? card.giveFlag : 0;
this.form.giveFlag = card.giveFlag;
this.form.refundFlag = card.refundFlag || 0;
this.form.coupCardId = this.isCopy ? '' : card.coupCardId;
this.form.cardType = card.cardType;
......@@ -462,6 +485,10 @@ export default {
this.form.cardColor = card.cardColor;
this.form.cardDenomination = card.cardDenomination || 0;
if (this.isCopy && !res.result.giveEnable) {
this.form.giveFlag = 0;
}
if (card.useCondition) {
const useCondition = (this.form.useCondition = JSON.parse(card.useCondition));
this.sale_limit.fee = useCondition.sale_limit ? useCondition.sale_limit.fee || 0 : 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment