Commit 9e1598c2 by zhouzy

新增界面验证

1 parent 171733d6
......@@ -5458,9 +5458,9 @@
}
},
"glsx-vue-common": {
"version": "1.2.6",
"resolved": "https://registry.npm.taobao.org/glsx-vue-common/download/glsx-vue-common-1.2.6.tgz",
"integrity": "sha1-Adhh5rj6OqT/PTBjD8xc4D24gDw=",
"version": "1.2.4",
"resolved": "https://registry.npm.taobao.org/glsx-vue-common/download/glsx-vue-common-1.2.4.tgz",
"integrity": "sha1-fMhwcowJfQAZ8/hBEQXhxulqVXY=",
"requires": {
"vue": "^2.5.10"
}
......
......@@ -10,7 +10,7 @@
"dependencies": {
"axios": "^0.18.0",
"element-ui": "^2.15.1",
"glsx-vue-common": "^1.2.6",
"glsx-vue-common": "^1.2.4",
"glsx-vue-components": "^1.0.13",
"vee-validate": "^2.1.7",
"vue": "^2.5.17",
......
......@@ -288,6 +288,12 @@
icon="el-icon-search"
>搜索</el-button>
</div>
<div class="buttonContainer" @click="exportCollection">
<el-button
type="primary"
icon="el-icon-search"
>导出</el-button>
</div>
</div>
</div>
<div class="block">
......@@ -443,7 +449,7 @@ import {
listMemberCard,
listRequisitionMemberCard,
getMemberCardDetail,
// exportMemberCard,
exportMemberCard,
// getmemberRights
} from "@/api/test";
......@@ -456,6 +462,7 @@ export default {
// getmemberRights:getmemberRights,
// exportMemberCard: exportMemberCard,
// rate: ChangeDecimalToPercentage(this.cardsInformationForm.activationCount/this.cardsInformationForm.number),
exportMemberCard:exportMemberCard,
colletionDate: "",
batchDate: "",
date_format,
......@@ -841,6 +848,16 @@ export default {
},
methods: {
//领用界面导出
exportCollection(){
var params = {
beginTime: "" ,
endTime: "" ,
sn: "" ,
mobile: "",
defineCode: "" ,
};
},
//批次详情导出数据
// exportDetail() {
// var params = {
......
......@@ -11,10 +11,20 @@
>
<div class="baseinformation">基础信息</div>
<div class="itemContainer">
<el-form-item label="权益卡名称:" prop="name">
<el-input v-model="ruleForm.name" style="width: 60%" id="name"></el-input>
<el-form-item
label="权益卡名称:"
prop="name"
>
<el-input
v-model="ruleForm.name"
style="width: 60%"
id="name"
></el-input>
</el-form-item>
<el-form-item label="权益卡说明:" prop="explain">
<el-form-item
label="权益卡说明:"
prop="explain"
>
<el-input
maxlength="200"
type="textarea"
......@@ -23,8 +33,10 @@
id="explain"
></el-input>
</el-form-item>
<el-form-item label="套餐有效期:" prop="validity"
>领卡时起
<el-form-item
label="套餐有效期:"
prop="validity"
>领卡时起
<el-input-number
v-model="ruleForm.validity"
controls-position="right"
......@@ -38,49 +50,67 @@
<div>权益配置</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox v-model="ruleForm.currencyCheckbox" @change="startcurrencyInputioncheck">停驶返嘀币</el-checkbox>
<el-checkbox
v-model="ruleForm.currencyCheckbox"
@change="startcurrencyInputioncheck"
>停驶返嘀币</el-checkbox>
</el-form-item>
<el-form-item label="返嘀币(每小时):" prop="currencyInpution">
<el-form-item
label="返嘀币(每小时):"
prop="currencyInpution"
>
<el-input
v-model="ruleForm.currencyInpution"
size="middle"
style="width: 60%"
:disabled="!ruleForm.currencyCheckbox"
id="currencyInpution"
></el-input
>个
></el-input>个
</el-form-item>
</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox v-model="ruleForm.oilCheckbox" @change="startoilInputioncheck">加油无忧</el-checkbox>
<el-checkbox
v-model="ruleForm.oilCheckbox"
@change="startoilInputioncheck"
>加油无忧</el-checkbox>
</el-form-item>
<el-form-item label="油站推荐半径:" prop="oilInpution">
<el-form-item
label="油站推荐半径:"
prop="oilInpution"
>
<el-input
v-model="ruleForm.oilInpution"
size="middle"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
id="oilInpution"
></el-input
>公里
></el-input>公里
</el-form-item>
<el-form-item label="加油优惠推送最长间隔 :" prop="timeInpution">
<el-form-item
label="加油优惠推送最长间隔 :"
prop="timeInpution"
>
<el-input
v-model="ruleForm.timeInpution"
size="middle"
style="width: 60%"
:disabled="!ruleForm.oilCheckbox"
id="timeInpution"
></el-input
>天
></el-input>天
</el-form-item>
</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox v-model="ruleForm.worryFreeCheckbox" @change="startpushCollisioncheck">出险无忧</el-checkbox>
<el-checkbox
v-model="ruleForm.worryFreeCheckbox"
@change="startpushCollisioncheck"
>出险无忧</el-checkbox>
</el-form-item>
<el-form-item label="启用碰撞推送:" prop="pushCollision">
<el-form-item
label="启用碰撞推送:"
prop="pushCollision"
>
<el-switch
v-model="ruleForm.pushCollision"
active-text="开"
......@@ -94,9 +124,15 @@
</div>
<div class="itemContainer">
<el-form-item>
<el-checkbox v-model="ruleForm.specialOfferCheckbox" @change="startrebateRatiocheck">特惠商品</el-checkbox>
<el-checkbox
v-model="ruleForm.specialOfferCheckbox"
@change="startrebateRatiocheck"
>特惠商品</el-checkbox>
</el-form-item>
<el-form-item label="嘀币返利比例(%):" prop="rebateRatio">
<el-form-item
label="嘀币返利比例(%):"
prop="rebateRatio"
>
<el-input
v-model="ruleForm.rebateRatio"
size="middle"
......@@ -117,10 +153,16 @@
</el-form-item>
</div>
<div class="buttonContainer">
<el-button size="middle" @click="cancel">取消</el-button>
<el-button :plain="true" size="middle" @click="jump('ruleForm')" type="primary"
>提交</el-button
>
<el-button
size="middle"
@click="cancel"
>取消</el-button>
<el-button
:plain="true"
size="middle"
@click="jump('ruleForm')"
type="primary"
>提交</el-button>
</div>
</el-form>
</div>
......@@ -184,9 +226,9 @@ export default {
],
validity: [{ required: true, message: "请选择有效期", trigger: "blur" }],
currencyInpution: [{ required: false, message: "请填写嘀币值", trigger: "blur" }],
oilInpution:[{ required: false, message: "请填写半径值", trigger: "blur" }],
timeInpution:[{ required: false, message: "请填写最长间隔", trigger: "blur" }],
rebateRatio:[{ required: false, message: "嘀币返利比例", trigger: "blur" }]
oilInpution: [{ required: false, message: "请填写半径值", trigger: "blur" }],
timeInpution: [{ required: false, message: "请填写最长间隔", trigger: "blur" }],
rebateRatio: [{ required: false, message: "嘀币返利比例", trigger: "blur" }]
......@@ -200,28 +242,28 @@ export default {
},
};
},
activated () {
console.log(1111)
activated() {
console.log(1111)
},
methods: {
//开启input验证
startcurrencyInputioncheck(){
startcurrencyInputioncheck() {
this.rules.currencyInpution[0].required = !this.rules.currencyInpution[0].required
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();
},
startpushCollisioncheck(){
this.rules.pushCollision[0].required = !this.rules.pushCollision[0].required
this.$refs.ruleForm.clearValidate();
},
startrebateRatiocheck(){
this.rules.rebateRatio[0].required = !this.rules.rebateRatio[0].required
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();
},
startpushCollisioncheck() {
this.rules.pushCollision[0].required = !this.rules.pushCollision[0].required
this.$refs.ruleForm.clearValidate();
},
startrebateRatiocheck() {
this.rules.rebateRatio[0].required = !this.rules.rebateRatio[0].required
this.$refs.ruleForm.clearValidate();
},
//检验跳转
jumpScroll(nameId) {
document.getElementById(nameId).scrollIntoView();
......@@ -300,18 +342,29 @@ this.$refs.ruleForm.clearValidate();
}
this.$refs[formName].validate((valid, options) => {
if (valid) {
insertMemberCardDefineRf(params).then((res) => {
if (res > 0) {
window.history.go(-1);
this.ruleForm = {};
this.$message({
message: "增加成功!",
type: "success",
});
} else {
}
});
if (this.submit == true) {
insertMemberCardDefineRf(params).then((res) => {
if (res > 0) {
window.history.go(-1);
this.ruleForm = {};
this.$message({
message: "增加成功!",
type: "success",
});
} else {
this.$message({
message: "增加失败!",
type: "error",
});
}
});
} else {
this.$message({
message: "请至少选择一项服务!",
type: "error",
});
}
} else {
this.$message({
message: "增加失败!",
......@@ -322,8 +375,8 @@ this.$refs.ruleForm.clearValidate();
// var temp = {
// "name": 'nameId'
// }
// this.jumpScroll(temp[Object.keys(options)[0]])
this.jumpScroll(Object.keys(options)[0])
// this.jumpScroll(temp[Object.keys(options)[0]])
this.jumpScroll(Object.keys(options)[0])
return false;
}
});
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!