Commit d876a7df by 胡悦

修复bug

1 parent 64c1ff41
......@@ -93,6 +93,7 @@
>
<el-input
v-model="ruleForm.timeInpution"
placeholder="若车主近期无加油记录,系统将触发该规则进行消息推送"
size="middle"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
......@@ -136,6 +137,7 @@
<el-input
v-model="ruleForm.rebateRatio"
size="middle"
placeholder="如设置10%,代表消费100元返利10嘀币"
style="width: 60%"
:disabled="!ruleForm.specialOfferCheckbox"
id="rebateRatio"
......@@ -169,7 +171,7 @@
</template>
<script>
import { insertMemberCardDefineRf } from "@/api/test";
import { insertMemberCardDefineRf } from '@/api/test'
export default {
data() {
return {
......@@ -181,22 +183,22 @@ export default {
// },
submit: false,
ruleForm: {
name: "",
explain: "",
name: '',
explain: '',
validity: 0,
date1: "",
date2: "",
date1: '',
date2: '',
delivery: false,
type: [],
resource: "",
resource: '',
currencyCheckbox: false,
currencyInpution: "",
currencyInpution: '',
oilCheckbox: false,
oilInpution: "",
timeInpution: "",
oilInpution: '',
timeInpution: '',
worryFreeCheckbox: false,
pushCollision: false,
rebateRatio: "",
rebateRatio: '',
specialOfferCheckbox: false,
exchangeStandard: false,
rescueCheckbox: false,
......@@ -204,24 +206,21 @@ export default {
rescueWorryFree: null,
creditInstallment: null,
meiTuan: null,
meituanCheckbox: false,
meituanCheckbox: false
},
rules: {
name: [
{
required: true,
message: "请输入长度在2-10以内的权益卡名称",
trigger: "blur",
message: '请输入长度在2-10以内的权益卡名称',
trigger: 'blur'
},
{ min: 2, max: 10, message: "长度在 2 到 10 个字符", trigger: "blur" }
{ min: 2, max: 10, message: '长度在 2 到 10 个字符', trigger: 'blur' }
],
validity: [{ required: true, message: "请选择有效期", trigger: "blur" }],
currencyInpution: [{ required: false, message: "请填写嘀币值", trigger: "blur" }],
timeInpution: [{ required: false, message: "请填写最长间隔", trigger: "blur" }],
rebateRatio: [{ required: false, message: "嘀币返利比例", trigger: "blur" }]
validity: [{ required: true, message: '请选择有效期', trigger: 'blur' }],
currencyInpution: [{ required: false, message: '请填写嘀币值', trigger: 'blur' }],
timeInpution: [{ required: false, message: '请填写最长间隔', trigger: 'blur' }],
rebateRatio: [{ required: false, message: '嘀币返利比例', trigger: 'blur' }]
// currencyInpution: [
// { required: true, message: "请填写返回的嘀币数", trigger: "blur" },
......@@ -229,148 +228,147 @@ export default {
// oilInpution: [{ required: true, message: "请填写推荐半径", trigger: "blur" }],
// timeInpution: [{ required: true, message: "请填写最大天数", trigger: "blur" }],
// rebateRatio: [{ required: true, message: "请填写返利比例", trigger: "blur" }],
},
};
}
}
},
activated() {
console.log(1111)
},
methods: {
//开启input验证
// 开启input验证
startcurrencyInputioncheck() {
this.rules.currencyInpution[0].required = !this.rules.currencyInpution[0].required
this.$refs.ruleForm.clearValidate();
this.$refs.ruleForm.clearValidate()
},
startoilInputioncheck() {
this.rules.oilInpution[0].required = !this.rules.oilInpution[0].required
this.rules.timeInpution[0].required = !this.rules.timeInpution[0].required
this.$refs.ruleForm.clearValidate();
this.$refs.ruleForm.clearValidate()
},
startpushCollisioncheck() {
this.rules.pushCollision[0].required = !this.rules.pushCollision[0].required
this.$refs.ruleForm.clearValidate();
this.$refs.ruleForm.clearValidate()
},
startrebateRatiocheck() {
this.rules.rebateRatio[0].required = !this.rules.rebateRatio[0].required
this.$refs.ruleForm.clearValidate();
this.$refs.ruleForm.clearValidate()
},
//检验跳转
// 检验跳转
jumpScroll(nameId) {
document.getElementById(nameId).scrollIntoView();
document.getElementById(nameId).scrollIntoView()
},
cancel() {
window.history.go(-1);
this.ruleForm = {};
window.history.go(-1)
this.ruleForm = {}
},
jump(formName) {
var equityItemJson = {
returnDicoins: this.ruleForm.currencyInpution,
oilWorry: {
oilRadius: +this.ruleForm.oilInpution,
oioilInterval: +this.ruleForm.timeInpution,
oioilInterval: +this.ruleForm.timeInpution
},
collisionPush: this.ruleForm.pushCollision,
dicoinRatio: this.ruleForm.rebateRatio,
rescueWorryFree: this.ruleForm.rescueWorryFree,
creditInstallment: this.ruleForm.creditInstallment,
meiTuan: this.ruleForm.meiTuan,
};
meiTuan: this.ruleForm.meiTuan
}
var params = {
memberDescription: this.ruleForm.explain,
memberName: this.ruleForm.name,
validitVaule: this.ruleForm.validity,
rightsList: [],
};
rightsList: []
}
if (this.ruleForm.currencyCheckbox) {
params.rightsList.push({
rightsId: 20,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.oilCheckbox) {
params.rightsList.push({
rightsId: 21,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.worryFreeCheckbox) {
params.rightsList.push({
rightsId: 22,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.specialOfferCheckbox) {
params.rightsList.push({
rightsId: 23,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.rescueCheckbox) {
params.rightsList.push({
rightsId: 24,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.creditCheckbox) {
params.rightsList.push({
rightsId: 25,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
if (this.ruleForm.meituanCheckbox) {
params.rightsList.push({
rightsId: 26,
equityItemJson: JSON.stringify(equityItemJson),
});
this.submit = true;
equityItemJson: JSON.stringify(equityItemJson)
})
this.submit = true
}
this.$refs[formName].validate((valid, options) => {
if (valid) {
if (this.submit == true) {
insertMemberCardDefineRf(params).then((res) => {
if (res > 0) {
window.history.go(-1);
this.ruleForm = {};
window.history.go(-1)
this.ruleForm = {}
this.$message({
message: "增加成功!",
type: "success",
});
message: '增加成功!',
type: 'success'
})
} else {
this.$message({
message: "增加失败!",
type: "error",
});
message: '增加失败!',
type: 'error'
})
}
});
})
} else {
this.$message({
message: "请至少选择一项服务!",
type: "error",
});
message: '请至少选择一项服务!',
type: 'error'
})
}
} else {
this.$message({
message: "增加失败!",
type: "error",
});
message: '增加失败!',
type: 'error'
})
console.log(Object.keys(options))
//转换成prop对应的id,需要分别转,最好id取唯一的prop值
// 转换成prop对应的id,需要分别转,最好id取唯一的prop值
// var temp = {
// "name": 'nameId'
// }
// this.jumpScroll(temp[Object.keys(options)[0]])
// this.jumpScroll(Object.keys(options)[0])
console.log('----------------');
return false;
console.log('----------------')
return false
}
});
})
// if (this.ruleForm.name) {
// if (this.submit == true) {
// insertMemberCardDefineRf(params).then((res) => {
......@@ -397,7 +395,7 @@ export default {
// type: "error",
// });
// }
},
}
// inableInpution(checkStatus, inputStatus) {
// this[inputStatus] = !this[checkStatus]
......@@ -407,8 +405,8 @@ export default {
// // this. stopdrivingInpution=true
// // }
// }
},
};
}
}
</script>
<style>
* {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!