Commit 39c1ddb4 by zhouzy

绑了id

1 parent 04d76c41
......@@ -12,13 +12,15 @@
<div class="baseinformation">基础信息</div>
<div class="itemContainer">
<el-form-item label="权益卡名称:" prop="name">
<el-input v-model="ruleForm.name" style="width: 60%"></el-input>
<el-input v-model="ruleForm.name" style="width: 60%" id="nameId"></el-input>
</el-form-item>
<el-form-item label="权益卡说明:" prop="explain">
<el-input
maxlength="200"
type="textarea"
v-model="ruleForm.explain"
style="width: 60%"
id="explainId"
></el-input>
</el-form-item>
<el-form-item label="套餐有效期:" prop="validity"
......@@ -28,6 +30,7 @@
controls-position="right"
:min="1"
size="mini"
id="validityId"
></el-input-number>
月内有效
</el-form-item>
......@@ -43,6 +46,7 @@
size="middle"
style="width: 60%"
:disabled="!ruleForm.currencyCheckbox"
id="currencyInputionId"
></el-input
>个
</el-form-item>
......@@ -57,6 +61,7 @@
size="middle"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
id="oilInputionId"
></el-input
>公里
</el-form-item>
......@@ -66,6 +71,7 @@
size="middle"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
id="timeInputionId"
></el-input
>天
</el-form-item>
......@@ -96,6 +102,7 @@
size="middle"
style="width: 60%"
:disabled="!ruleForm.specialOfferCheckbox"
id="rebateRatioId"
></el-input>
</el-form-item>
......@@ -120,7 +127,7 @@
</template>
<script>
import { insertMemberCardDefineRf } from '@/api/test'
import { insertMemberCardDefineRf } from "@/api/test";
export default {
data() {
return {
......@@ -132,22 +139,22 @@ export default {
// },
submit: false,
ruleForm: {
name: '',
explain: '',
name: "",
explain: "",
validity: 1,
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,
......@@ -155,127 +162,135 @@ 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" },
],
explain: [
{
min: 0,
max: 200,
required: true,
message: '请填写200字以内的说明',
trigger: 'blur'
}
message: "请填写200字以内的说明",
trigger: "blur",
},
],
validity: [{ required: true, message: '请选择有效期', trigger: 'blur' }]
validity: [{ required: true, message: "请选择有效期", trigger: "blur" }],
// currencyInpution: [
// { required: true, message: "请填写返回的嘀币数", trigger: "blur" },
// ],
// oilInpution: [{ required: true, message: "请填写推荐半径", trigger: "blur" }],
// timeInpution: [{ required: true, message: "请填写最大天数", trigger: "blur" }],
// rebateRatio: [{ required: true, message: "请填写返利比例", trigger: "blur" }],
}
}
},
};
},
methods: {
jumpScroll(idName) {
document.getElementById(idName).scrollIntoView();
},
cancel() {
window.history.go(-1)
window.history.go(-1);
},
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) => {
this.$refs[formName].validate((valid, options) => {
if (valid) {
insertMemberCardDefineRf(params).then((res) => {
if (res > 0) {
window.history.go(-1)
this.ruleForm = {}
alert('增加权益卡成功')
} else {
window.history.go(-1);
this.ruleForm = {};
this.$message({
message: '请至少选择一项服务',
type: 'error'
})
message: "增加成功!",
type: "error",
});
} else {
}
})
});
} else {
alert('必选项未填,增加权益卡失败')
return false
this.$message({
message: "增加失败!",
type: "error",
});
console.log(options)
this.jumpScroll(options)
return false;
}
})
});
// if (this.ruleForm.name) {
// if (this.submit == true) {
// insertMemberCardDefineRf(params).then((res) => {
......@@ -302,7 +317,7 @@ export default {
// type: "error",
// });
// }
}
},
// inableInpution(checkStatus, inputStatus) {
// this[inputStatus] = !this[checkStatus]
......@@ -312,8 +327,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!