优化积分锁客 优化角色模板问题
This commit is contained in:
@@ -25,8 +25,9 @@
|
|||||||
<el-button @click="visible = false" size="large" style="width: 100%;">自己创建</el-button>
|
<el-button @click="visible = false" size="large" style="width: 100%;">自己创建</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-button type="primary" size="large" @click="submitHandle" :loading="loading" style="width: 100%;">确
|
<el-button type="primary" size="large" @click="submitHandle" :loading="loading" style="width: 100%;">
|
||||||
定</el-button>
|
确 定
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -45,7 +46,7 @@ const list = ref([])
|
|||||||
// 获取角色模板列表
|
// 获取角色模板列表
|
||||||
async function roleTemplateListAjax() {
|
async function roleTemplateListAjax() {
|
||||||
try {
|
try {
|
||||||
const res = await roleTemplateList()
|
const res = await roleTemplateList({ isEnable: 1 })
|
||||||
res.forEach(el => {
|
res.forEach(el => {
|
||||||
el.cehcked = false
|
el.cehcked = false
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -160,6 +160,19 @@ function handlePlatformTypeChange(e) {
|
|||||||
handleOpenAssignPermDialog(dialog.row);
|
handleOpenAssignPermDialog(dialog.row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开分配菜单菜单弹窗
|
||||||
|
async function handleOpenAssignPermDialog(row) {
|
||||||
|
const roleId = row.id;
|
||||||
|
dialog.row = row;
|
||||||
|
if (roleId) {
|
||||||
|
assignPermDialogVisible.value = true;
|
||||||
|
loading.value = true;
|
||||||
|
checkedRole.value.id = roleId;
|
||||||
|
checkedRole.value.name = row.name;
|
||||||
|
getMenuIds(roleId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const permKeywords = ref("");
|
const permKeywords = ref("");
|
||||||
const isExpanded = ref(true);
|
const isExpanded = ref(true);
|
||||||
const parentChildLinked = ref(false);
|
const parentChildLinked = ref(false);
|
||||||
@@ -233,6 +246,7 @@ function getMenuIds(roleId) {
|
|||||||
if (!roleId) {
|
if (!roleId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RoleApi.getMenu(roleId, platformType.value)
|
RoleApi.getMenu(roleId, platformType.value)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (platformType.value == 0) {
|
if (platformType.value == 0) {
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="padding: 15px;">
|
<div style="padding: 15px;">
|
||||||
|
<div class="head">
|
||||||
|
<headerCard name="积分锁客" icon="jfsk" intro="设置充值消费的N倍,当前订单立即免单" />
|
||||||
|
</div>
|
||||||
<el-tabs type="border-card" v-model="datas.activeName" @tab-click="handleClick">
|
<el-tabs type="border-card" v-model="datas.activeName" @tab-click="handleClick">
|
||||||
<el-tab-pane label="基本设置" name="BasicSettings" key="BasicSettings">
|
<el-tab-pane label="基本设置" name="BasicSettings" key="BasicSettings">
|
||||||
<BasicSettings />
|
<BasicSettings />
|
||||||
@@ -21,10 +24,21 @@ import BasicSettings from './pointsconfig/BasicSettings.vue'
|
|||||||
import Exchangerecords from './pointsconfig/exchangerecords.vue'
|
import Exchangerecords from './pointsconfig/exchangerecords.vue'
|
||||||
import Memberpoints from './pointsconfig/Memberpoints.vue'
|
import Memberpoints from './pointsconfig/Memberpoints.vue'
|
||||||
import ProductSettings from './pointsconfig/ProductSettings.vue'
|
import ProductSettings from './pointsconfig/ProductSettings.vue'
|
||||||
|
import headerCard from '@/views/marketing_center/components/headerCard.vue'
|
||||||
|
|
||||||
let datas = reactive({
|
let datas = reactive({
|
||||||
activeName: "BasicSettings",
|
activeName: "BasicSettings",
|
||||||
})
|
})
|
||||||
function handleClick(tab) {
|
function handleClick(tab) {
|
||||||
datas.activeName = tab.props.name;
|
datas.activeName = tab.props.name;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.head {
|
||||||
|
padding: 14px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 基本设置 -->
|
<!-- 基本设置 -->
|
||||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="150px">
|
<el-form ref="formRef" :model="form" :rules="rules" label-width="150px">
|
||||||
<el-form-item label="是否消费赠送积分">
|
<el-form-item label="开启积分">
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<el-switch v-model="form.enableRewards" :active-value="1" :inactive-value="0" />
|
<el-switch v-model="form.enableRewards" :active-value="1" :inactive-value="0" />
|
||||||
<span class="tips">开启后,所有用户可通过消费获得积分及可用积分抵扣支付</span>
|
<span class="tips">开启后,所有用户可通过消费获得积分及可用积分抵扣支付</span>
|
||||||
@@ -32,23 +32,21 @@
|
|||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="下单实付抵扣门槛" prop="minPaymentAmount">
|
<el-form-item label="下单实付抵扣门槛" prop="minPaymentAmount">
|
||||||
<el-col :span="3">
|
<el-input v-model="form.minPaymentAmount" :maxlength="8"
|
||||||
<el-input v-model="form.minPaymentAmount" :maxlength="8"
|
@input="e => form.minPaymentAmount = filterNumberInput(e)" style="width: 150px;">
|
||||||
@input="e => form.minPaymentAmount = filterNumberInput(e)">
|
<template #append>元</template>
|
||||||
<template #append>元</template>
|
</el-input>
|
||||||
</el-input>
|
|
||||||
</el-col>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下单最高抵扣比例">
|
<el-form-item label="下单最高抵扣比例" prop="maxDeductionRatio">
|
||||||
<el-input-number v-model="form.maxDeductionRatio" type="number" placeholder="" :min="1"
|
<el-input-number v-model="form.maxDeductionRatio" :min="1" :max="100"
|
||||||
:max="100"></el-input-number>
|
@blur="maxDeductionRatioBlur"></el-input-number>
|
||||||
<span class="u-m-l-10 color-999">%</span>
|
<span class="u-m-l-10 color-999">%</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="下单抵扣积分比例">
|
<el-form-item label="下单抵扣积分比例" prop="equivalentPoints">
|
||||||
<el-col :span="7">
|
<el-col :span="7">
|
||||||
<span class="color-999">1元等于</span>
|
<span class="color-999">1元等于</span>
|
||||||
<el-input-number class="u-m-l-10 u-m-r-10" v-model="form.equivalentPoints" type="number" placeholder=""
|
<el-input-number class="u-m-l-10 u-m-r-10" v-model="form.equivalentPoints" :min="1"
|
||||||
min="1"></el-input-number>
|
@blur="equivalentPointsBlur"></el-input-number>
|
||||||
<span class="color-999">积分</span>
|
<span class="color-999">积分</span>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -97,7 +95,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" :loading="loading" @click="onSubmit">确定</el-button>
|
<el-button type="primary" :loading="loading" @click="onSubmit">保存</el-button>
|
||||||
|
<el-button :loading="loading" @click="router.back()">取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</template>
|
</template>
|
||||||
@@ -106,15 +105,20 @@
|
|||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { pointsConfigGet, pointsConfigPost } from '@/api/points'
|
import { pointsConfigGet, pointsConfigPost } from '@/api/points'
|
||||||
import { filterNumberInput } from '@/utils'
|
import { filterNumberInput } from '@/utils'
|
||||||
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const form = ref({
|
const router = useRouter()
|
||||||
|
|
||||||
|
const formObj = ref({
|
||||||
enableRewards: 0, // 开启消费赠送积分 1-开启 0-关闭 开启后,所有用户可通过消费获得积分及可用积分抵扣支付
|
enableRewards: 0, // 开启消费赠送积分 1-开启 0-关闭 开启后,所有用户可通过消费获得积分及可用积分抵扣支付
|
||||||
consumeAmount: '', // 每消费xx元赠送1积分
|
consumeAmount: '', // 每消费xx元赠送1积分
|
||||||
minPaymentAmount: '', // 下单实付抵扣门槛
|
minPaymentAmount: '', // 下单实付抵扣门槛
|
||||||
maxDeductionRatio: '', // 下单最高抵扣比例
|
maxDeductionRatio: 100, // 下单最高抵扣比例
|
||||||
equivalentPoints: '', // 下单抵扣积分比例 1元=?积分
|
equivalentPoints: 1, // 下单抵扣积分比例 1元=?积分
|
||||||
enablePointsMall: '', // 开启积分商城
|
enablePointsMall: 0, // 开启积分商城
|
||||||
});
|
})
|
||||||
|
|
||||||
|
const form = ref({});
|
||||||
|
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
consumeAmount: [
|
consumeAmount: [
|
||||||
@@ -146,19 +150,52 @@ const rules = ref({
|
|||||||
maxDeductionRatio: [
|
maxDeductionRatio: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: ' ',
|
validator: (rule, value, callback) => {
|
||||||
|
if (form.value.maxDeductionRatio == '') {
|
||||||
|
callback(new Error('请输入'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
triiger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
equivalentPoints: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
validator: (rule, value, callback) => {
|
||||||
|
if (form.value.equivalentPoints == '') {
|
||||||
|
callback(new Error('请输入'))
|
||||||
|
} else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
},
|
||||||
triiger: 'blur'
|
triiger: 'blur'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function maxDeductionRatioBlur() {
|
||||||
|
if (!form.value.maxDeductionRatio) {
|
||||||
|
form.value.maxDeductionRatio = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function equivalentPointsBlur() {
|
||||||
|
if (!form.value.equivalentPoints) {
|
||||||
|
form.value.equivalentPoints = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 积分:配置:详情
|
// 积分:配置:详情
|
||||||
async function pointsConfigGetAjax() {
|
async function pointsConfigGetAjax() {
|
||||||
const res = await pointsConfigGet();
|
const res = await pointsConfigGet();
|
||||||
if (res) {
|
if (res.data !== null) {
|
||||||
form.value = res
|
form.value = res
|
||||||
formRef.value.clearValidate('consumeAmount');
|
// formRef.value.clearValidate('consumeAmount');
|
||||||
formRef.value.clearValidate('minPaymentAmount');
|
// formRef.value.clearValidate('minPaymentAmount');
|
||||||
|
} else {
|
||||||
|
form.value = { ...formObj.value }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="coupon_info" v-if="includesString(scope.row.goodsCategory, '优惠券')">
|
<div class="coupon_info" v-if="includesString(scope.row.goodsCategory, '优惠券')">
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<CouponIcon :item="scope.row.couponInfo" />
|
<CouponIcon :item="scope.row.couponInfo" v-if="scope.row.couponInfo" />
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -122,10 +122,10 @@ async function deleteHandle(row) {
|
|||||||
async function statusChange(e, row) {
|
async function statusChange(e, row) {
|
||||||
try {
|
try {
|
||||||
await pointsGoodsPost(row)
|
await pointsGoodsPost(row)
|
||||||
pointsGoodsPageAjax()
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
pointsGoodsPageAjax()
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -14,11 +14,11 @@
|
|||||||
<el-option v-for="item in couponList" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
<el-option v-for="item in couponList" :key="item.id" :label="item.title" :value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="商品名称" prop="goodsName">
|
||||||
|
<el-input v-model="form.goodsName" placeholder="请输入商品名称" :maxlength="30" clearable
|
||||||
|
style="width: 200px;"></el-input>
|
||||||
|
</el-form-item>
|
||||||
<div v-if="form.goodsCategory == '其它商品'">
|
<div v-if="form.goodsCategory == '其它商品'">
|
||||||
<el-form-item label="商品名称" prop="goodsName">
|
|
||||||
<el-input v-model="form.goodsName" placeholder="请输入商品名称" :maxlength="30" clearable
|
|
||||||
style="width: 200px;"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="商品图片" prop="goodsImageUrl">
|
<el-form-item label="商品图片" prop="goodsImageUrl">
|
||||||
<SingleImageUpload v-model="form.goodsImageUrl" />
|
<SingleImageUpload v-model="form.goodsImageUrl" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -53,7 +53,8 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="发放方式">
|
<el-form-item label="发放方式">
|
||||||
<div class="center">
|
<div class="center">
|
||||||
<span class="tips">系统发放</span>
|
<span class="tips" v-if="form.goodsCategory == '优惠券'">系统发放</span>
|
||||||
|
<span class="tips" v-if="form.goodsCategory == '其它商品'">需要用户到店内领取核销</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="每人限购" prop="limitQuota">
|
<el-form-item label="每人限购" prop="limitQuota">
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
@input="e => form.limitQuota = filterNumberInput(e, 1)" v-if="limitQuotaSwitch"></el-input>
|
@input="e => form.limitQuota = filterNumberInput(e, 1)" v-if="limitQuotaSwitch"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品详情">
|
<el-form-item label="商品详情" v-if="form.goodsCategory == '其它商品'">
|
||||||
<MultiImageUpload v-model="goodsDescription" @up-data-event="multiImgSuccess" />
|
<MultiImageUpload v-model="goodsDescription" @up-data-event="multiImgSuccess" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
</el-table-column> -->
|
</el-table-column> -->
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<el-pagination :total="tableData.total" :current-page="tableData.page + 1" :page-size="tableData.size"
|
<el-pagination :total="tableData.total" :current-page="tableData.page" :page-size="tableData.size"
|
||||||
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" @size-change="sizeChange" />
|
layout="total, sizes, prev, pager, next, jumper" @current-change="paginationChange" @size-change="sizeChange" />
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<span class="dialog-footer">
|
<span class="dialog-footer">
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ export const newMenus = [
|
|||||||
{
|
{
|
||||||
name: "积分锁客",
|
name: "积分锁客",
|
||||||
icon: "jfsk",
|
icon: "jfsk",
|
||||||
pathName: "points",
|
pathName: "point_manage",
|
||||||
intro: "设置充值消费的N倍,当前订单立即免单",
|
intro: "设置充值消费的N倍,当前订单立即免单",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,11 +69,11 @@ const contentConfig: IContentConfig<any> = {
|
|||||||
align: "center",
|
align: "center",
|
||||||
prop: "amount",
|
prop: "amount",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
label: "积分",
|
// label: "积分",
|
||||||
align: "center",
|
// align: "center",
|
||||||
prop: "accountPoints",
|
// prop: "accountPoints",
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
label: "消费累计",
|
label: "消费累计",
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|||||||
Reference in New Issue
Block a user