Commit b3870110 by zhangzhen

充值配置优化

parent d88236d6
...@@ -112,6 +112,15 @@ ...@@ -112,6 +112,15 @@
<!-- <el-table-column align="center" label="主键" prop="id"/>--> <!-- <el-table-column align="center" label="主键" prop="id"/>-->
<el-table-column align="center" label="配置名称" prop="name"/> <el-table-column align="center" label="配置名称" prop="name"/>
<el-table-column align="center" label="充值金额" prop="rechargeAmount"/> <el-table-column align="center" label="充值金额" prop="rechargeAmount"/>
<el-table-column align="center" label="充值赠送方式" prop="giveType">
<template slot-scope="scope">
<div v-if="scope.row.giveType" style="display: flex;flex-wrap: wrap;width: 100%;">
<dict-tag v-for="(item ,k) in scope.row.giveType" :key="k" :options="dict.type.recharge_giveaways" :value="item"
style="margin: 0 3px;"/>
</div>
</template>
</el-table-column>
<!-- <el-table-column align="center" label="充值赠送方式;1-不送,2-送金额,3-送优惠券,4-送金额及优惠券" prop="giveType"/>--> <!-- <el-table-column align="center" label="充值赠送方式;1-不送,2-送金额,3-送优惠券,4-送金额及优惠券" prop="giveType"/>-->
<!-- <el-table-column align="center" label="充值赠送方式" prop="giveType"/>--> <!-- <el-table-column align="center" label="充值赠送方式" prop="giveType"/>-->
<el-table-column align="center" label="积分赠送比例" prop="giveRatio"/> <el-table-column align="center" label="积分赠送比例" prop="giveRatio"/>
...@@ -129,14 +138,14 @@ ...@@ -129,14 +138,14 @@
<dict-tag :options="dict.type.recharge_suit_type" :value="scope.row.suitType"/> <dict-tag :options="dict.type.recharge_suit_type" :value="scope.row.suitType"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="适用门店" prop="storeIds" width="350"> <!-- <el-table-column align="center" label="适用门店" prop="storeIds" width="350">-->
<template slot-scope="scope"> <!-- <template slot-scope="scope">-->
<div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;"> <!-- <div v-if="scope.row.storeIds" style="display: flex;flex-wrap: wrap;width: 100%;">-->
<dict-tag v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList" :value="item" <!-- <dict-tag v-for="(item ,k) in scope.row.storeIds" :key="k" :options="storeList" :value="item"-->
style="margin: 0 3px;"/> <!-- style="margin: 0 3px;"/>-->
</div> <!-- </div>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column align="center" label="备注" prop="remark"/> <el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作"> <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -169,7 +178,7 @@ ...@@ -169,7 +178,7 @@
/> />
<!-- 添加或修改充值配置对话框 --> <!-- 添加或修改充值配置对话框 -->
<el-dialog :title="title" :visible.sync="open" append-to-body width="500px"> <el-dialog :title="title" :visible.sync="open" append-to-body width="700px">
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="配置名称" prop="name"> <el-form-item label="配置名称" prop="name">
<el-input v-model="form.name" placeholder="请输入配置名称"/> <el-input v-model="form.name" placeholder="请输入配置名称"/>
...@@ -183,13 +192,23 @@ ...@@ -183,13 +192,23 @@
<!-- <el-form-item label="充值满送金额" prop="giveAmount">--> <!-- <el-form-item label="充值满送金额" prop="giveAmount">-->
<!-- <el-input v-model="form.giveAmount" placeholder="请输入充值满送金额"/>--> <!-- <el-input v-model="form.giveAmount" placeholder="请输入充值满送金额"/>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<el-form-item label="充值满送金额" prop="giveAmount"> <el-form-item label="赠送类型" prop="storeIds">
<el-input-number v-model="form.giveAmount" :max="100" :min="0"/> <el-select v-model="form.giveType" clearable multiple placeholder="请选择赠送类型" @change="onChange">
<el-option
v-for="dict in dict.type.recharge_giveaways"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="form.giveType.includes('1')" label="充值满送金额" prop="giveAmount">
<el-input-number v-model="form.giveAmount" :max="1000" :min="0"/>
</el-form-item> </el-form-item>
<el-form-item label="充值赠送时长" prop="giveDuration"> <el-form-item v-if="form.giveType.includes('2')" label="充值赠送时长" prop="giveDuration">
<el-input-number v-model="form.giveDuration" :max="100" :min="0.5" :step="0.5"/> <el-input-number v-model="form.giveDuration" :max="100" :min="0" :step="0.5"/>
</el-form-item> </el-form-item>
<el-form-item label="积分赠送比例" prop="giveRatio"> <el-form-item v-if="form.giveType.includes('3')" label="积分赠送比例" prop="giveRatio">
<el-input-number v-model="form.giveRatio" :max="100" :min="0"/> <el-input-number v-model="form.giveRatio" :max="100" :min="0"/>
</el-form-item> </el-form-item>
<!-- <el-form-item label="启用禁用:1-启用,0-禁用" prop="enable">--> <!-- <el-form-item label="启用禁用:1-启用,0-禁用" prop="enable">-->
...@@ -244,7 +263,7 @@ import { ...@@ -244,7 +263,7 @@ import {
import {storeList} from '@/api/system/store'; import {storeList} from '@/api/system/store';
export default { export default {
name: "RechargeConf", name: "RechargeConf",
dicts: ['store_is_use_coupon', 'recharge_suit_type'], dicts: ['store_is_use_coupon', 'recharge_suit_type','recharge_giveaways'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -272,7 +291,7 @@ export default { ...@@ -272,7 +291,7 @@ export default {
pageSize: 10, pageSize: 10,
name: null, name: null,
rechargeAmount: null, rechargeAmount: null,
giveType: null, giveType: [],
giveAmount: null, giveAmount: null,
enable: null, enable: null,
suitType: null, suitType: null,
...@@ -281,7 +300,9 @@ export default { ...@@ -281,7 +300,9 @@ export default {
giveDuration: null giveDuration: null
}, },
// 表单参数 // 表单参数
form: {}, form: {
giveType:[]
},
// 表单校验 // 表单校验
rules: { rules: {
rechargeAmount: [ rechargeAmount: [
...@@ -305,7 +326,8 @@ export default { ...@@ -305,7 +326,8 @@ export default {
this.rechargeConfList = response.rows.map(item => { this.rechargeConfList = response.rows.map(item => {
return { return {
...item, ...item,
storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : [] storeIds: item.storeIds && item.storeIds.length ? item.storeIds.split(",") : [],
giveType: item.giveType && item.giveType.length ? item.giveType.split(",") : []
} }
}); });
this.total = response.total; this.total = response.total;
...@@ -323,7 +345,7 @@ export default { ...@@ -323,7 +345,7 @@ export default {
id: null, id: null,
name: null, name: null,
rechargeAmount: null, rechargeAmount: null,
giveType: null, giveType: [],
giveAmount: null, giveAmount: null,
enable: null, enable: null,
suitType: null, suitType: null,
...@@ -387,6 +409,9 @@ export default { ...@@ -387,6 +409,9 @@ export default {
if (this.form.storeIds) { if (this.form.storeIds) {
this.form.storeIds = this.form.storeIds.split(",") this.form.storeIds = this.form.storeIds.split(",")
} }
if (this.form.giveType) {
this.form.giveType = this.form.giveType.split(",")
}
this.open = true; this.open = true;
this.title = "修改充值配置"; this.title = "修改充值配置";
}); });
...@@ -396,6 +421,7 @@ export default { ...@@ -396,6 +421,7 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
this.form.storeIds = this.form.storeIds && this.form.storeIds.length ? this.form.storeIds.join() : '' this.form.storeIds = this.form.storeIds && this.form.storeIds.length ? this.form.storeIds.join() : ''
this.form.giveType = this.form.giveType && this.form.giveType.length ? this.form.giveType.join() : ''
if (this.form.id != null) { if (this.form.id != null) {
updateRechargeConf(this.form).then(response => { updateRechargeConf(this.form).then(response => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
......
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