Commit 39175816 authored by 华国豪's avatar 华国豪 🙄

新增会员等级特权页面

parent 3afc7304
<template>
<div class="flexOne">
<div class="query-box">
<ul class="user_time_picker">
<li>
<input type="button" @click=" " class="hollowFixedBtn" value="查询">
<input type="button" @click="outerVisible = true,dialogTitle=$t('active.ad_addad'),resetInfo()" class="normalBtn" :value="$t('pub.addBtn')">
</li>
</ul>
</div>
<div class="clearfix"></div>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0" v-loading="loading">
<tr>
<th>会员等级</th>
<th>等级名称</th>
<th>积分</th>
<th>特权</th>
<th>升降级标准</th>
<th>星级有效期延长的条件</th>
<th>操作</th>
</tr>
<tr v-for="item in dataList">
<td>{{item.rank}}</td>
<td>{{item.awardName}}</td>
<td>{{item.awardCount}}</td>
<td>{{item.awardWinningCount}}</td>
<td>223</td>
<td>22</td>
<td>
<el-tooltip class="item" effect="dark" :content="$t('active.ld_editInfo')" placement="top">
<el-button
type="primary"
icon="el-icon-edit"
circle
@click="outerVisible=true,dialogTitle=$t('active.ld_editInfo'),updateData(item)"
></el-button>
</el-tooltip>
</td>
</tr>
</table>
<div class="noDataNotice" v-if="dataList.length<1">
<i class="iconfont icon-kong"></i>
<p>{{$t("active.ld_noData")}}</p>
</div>
<el-dialog
custom-class="w800"
:title="dialogTitle"
:visible.sync="outerVisible"
center
:before-close="closeChangeMachie"
>
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<table class="layerTable layerNoIcon">
<tr>
<td>
<el-form-item label="会员等级" prop="memberLevel">
<el-input v-model="addMsg.memberLevel" class="w217" />
</el-form-item>
</td>
<td>
<el-form-item label="等级名称" prop="memberName">
<el-input v-model="addMsg.memberName" class="w217" />
</el-form-item>
</td>
</tr>
<td>
<el-form-item label="积分" prop="integral">
<el-input v-model="addMsg.integral" class="w217" />
</el-form-item>
</td>
<td>
<el-form-item label="特权" prop="privilege" >
<el-select filterable v-model="addMsg.privilege" class="w217" >
<el-option :label="$t('pub.unlimitedSel')" :value="0"></el-option>
<el-option v-for="item in awardRelationList" :label="item.couponsName" :value="item.couponId" :key="item.couponId"></el-option>
</el-select>
</el-form-item>
</td>
</tr>
<tr>
<td colspan="2">
<el-form-item label="升降级标准" prop="standard">
<el-input v-model="addMsg.standard" type="textarea"/>
</el-form-item>
</td>
</tr>
<tr>
<td colspan="2">
<el-form-item label="星级有效期延长的条件" prop="condition">
<el-input v-model="addMsg.condition" type="textarea"/>
</el-form-item>
</td>
</tr>
</table>
</el-form>
<div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false">{{$t('pub.cancelBtn')}}</button> &nbsp;
<button class="normalBtn" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
data() {
return {
//请求
msg: {
lotteryId: '',
},
addMsg:{
id:0,
memberLevel: '',
memberName: '',
integral: '',
privilege: '',
standard: '',
condition: ''
},
rules:{
memberLevel: [{ required: true, message: '请输入会员等级', trigger: "blur" }],
memberName: [{ required: true, message: '请输入等级名称', trigger: "blur" }],
integral: [{required: true, message: '请输入积分', trigger: "blur"}],
privilege: [{ required: true, message: '请选择特选', trigger: "change" }],
standard: [{ required: true, message: '请输入升降级标准', trigger: "blur" }],
condition: [{ required: true, message: '请输入星级有效期延长的条件', trigger: "blur" }],
},
loading:false,
outerVisible:false,
dialogTitle:'',
dataList:[],
awardRelationList:[],
};
},
mounted() {
this.msg.lotteryId = this.$route.query.lotteryId;
// this.getList();
},
filters: {
},
methods: {
//获取数据
getList() {
this.loading = true;
this.apiJavaPost("/api/sell/lottery/getLotteryAwardList", this.msg, res => {
this.loading = false;
if (res.data.resultCode === 1) {
this.dataList = res.data.data;
console.log(this.dataList,'datalist');
} else {
this.Error(res.data.message)
}
}, null);
},
//提交
submitForm(addMsg) {
//提交创建、修改表单
this.$refs[addMsg].validate(valid => {
if (valid) {
this.addAward();
} else {
return false;
}
});
},
//提交添加
addAward(){
this.addMsg.lotteryId = this.$route.query.lotteryId;
if(this.addMsg.awardType==1||this.addMsg.awardType==2){
this.addMsg.awardRelationId = 0;
}
this.apiJavaPost("/api/sell/lottery/setLotteryAward", this.addMsg, res => {
if (res.data.resultCode === 1) {
this.Success(res.data.message);
this.outerVisible = false;
this.getList();
} else {
this.Error(res.data.message)
}
}, null);
},
//修改信息
updateData(item){
this.addMsg.id=item.id;
this.addMsg.lotteryId = item.lotteryId;
this.addMsg.awardName = item.awardName;
this.addMsg.awardType = item.awardType;
this.addMsg.awardRelationId = item.awardRelationId;
this.addMsg.awardCount = item.awardCount;
this.addMsg.awardStatus = item.awardStatus;
this.addMsg.rank = item.rank;
this.getAwardRelationId(3);
},
//根据奖项类型请求关联Id
getAwardRelationId(id){
let branchId = this.$route.query.branchId;
if(id==3){
let msg = {
couponId:this.addMsg.awardRelationId,
branchId:branchId
}
this.apiJavaPost("/api/sell/lottery/getCouponsList", msg, res => {
if (res.data.resultCode === 1) {
this.awardRelationList = res.data.data;
} else {
this.Error(res.data.message)
}
}, null);
}
},
//重置信息
resetInfo(){
var newMsg = {
id:0,
lotteryId:0,
awardName:'',
awardType:1,
awardRelationId:0,
awardCount:'',
awardStatus:1,
rank:'',
}
this.addMsg = newMsg;
},
closeChangeMachie(done) {
//弹出框关闭初始化弹框内表单
done();
this.resetForm("addMsg");
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
}
};
</script>
\ No newline at end of file
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