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