更新优化

This commit is contained in:
gyq 2025-11-06 09:58:05 +08:00
parent 1a4a8515c3
commit 2432c53a73
16 changed files with 289 additions and 288 deletions

View File

@ -74,6 +74,7 @@ const accountList = reactive([
{ username: "19191703856", type: 'warning', label: '喜气洋洋' },
{ username: "19107220837", type: 'danger', label: '快乐时光店铺' },
{ username: "18199991111", type: 'success', label: '草莓加盟主店可直接管理' },
{ username: "18821670757", type: 'primary', label: '强盛集团' },
]);
//

View File

@ -1,5 +1,6 @@
<template>
<div class="m-4 bg-white p-4">
<div v-if="shopInfo.isHeadShop == 1 || isUse">
<HeaderCard name="生日有礼" intro="用户生日管理设置" icon="birthdayGift"
:showSwitch="shopInfo.isHeadShop == 1 || shopInfo.shopType == 'only'" v-model:isOpen="basicForm.isEnable">
</HeaderCard>
@ -68,9 +69,10 @@
</template>
</el-tab-pane>
</el-tabs>
<DialogPlans ref="refDialogPlans" @submitSuccess="submitSuccess"></DialogPlans>
</div>
<div style="padding-top: 14px;" v-else>门店未参与生日有礼或主店未开启活动如需开启参与请联系主店</div>
</div>
</template>
<script setup>
@ -85,7 +87,7 @@ import { ref, reactive, watch, toRaw, getCurrentInstance, onMounted } from "vue"
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
const shopInfo = ref("");
const shopInfo = ref(JSON.parse(localStorage.getItem("userInfo")));
const inputStyle = {
width: "340px",
};
@ -150,21 +152,40 @@ function basicSubmit() {
});
}
const isUse = ref(false)
async function init() {
birthdayGiftApi.getConfig().then((res) => {
res.configList = res.configList || [];
Object.assign(basicForm, res);
basicForm.isEnable = basicForm.isEnable;
if (res.isEnable == 1) {
isUse.value = true
// if (shopInfo.value.shopType == 'only') {
// isUse.value = true
// }
// else {
// if (res.useType == 'all') {
// isUse.value = true
// } else {
// let currentShopId = shopInfo.value.shopId;
// res.shopIdList.some((item) => {
// if (item == currentShopId) {
// isUse.value = true;
// return true;
// }
// });
// }
// }
} else {
isUse.value = false
}
});
}
//
function getLocalShopInfo() {
shopInfo.value = JSON.parse(localStorage.getItem("userInfo"));
}
onMounted(() => {
init();
getLocalShopInfo();
});
//
function totalCount(arr) {

View File

@ -2,6 +2,7 @@
<template>
<div class="gyq_container">
<div class="gyq_content">
<div v-if="shopInfo.isHeadShop == 1 || isUse">
<HeaderCard name="消费返现" intro="允许客户充值并使用余额支付" icon="xffx"
:showSwitch="shopInfo.isHeadShop == 1 || shopInfo.shopType == 'only'" v-model:isOpen="form.isEnable">
</HeaderCard>
@ -79,6 +80,8 @@
</el-tabs>
</div>
</div>
<div v-else>门店未参与消费返现或主店已关闭活动如需开启参与请联系主店</div>
</div>
</div>
</template>
@ -182,6 +185,7 @@ function submitHandle() {
}
//
const isUse = ref(false)
async function consumeCashbackAjax() {
try {
const res = await consumeCashback()
@ -189,6 +193,22 @@ async function consumeCashbackAjax() {
res.cashbackStepList = []
}
form.value = res
if (res.isEnable == 1) {
if (res.useType == 'all' || shopInfo.value.shopType == 'only') {
isUse.value = true
} else {
let currentShopId = shopInfo.value.shopId;
res.shopIdList.some((item) => {
if (item == currentShopId) {
isUse.value = true;
return true;
}
});
}
} else {
isUse.value = false
}
} catch (error) {
console.log(error);
}

View File

@ -808,43 +808,43 @@ function convertTimeToDate(timeStr, options = {}) {
// input
const time = 500;
const discountNumInput = _.debounce(function (value) {
form.value.discountNum = filterNumberInput(value, true);
form.value.discountNum = filterNumberInput(value, 1);
if (form.value.discountNum == "") {
form.value.discountNum = 1;
}
}, time);
const discountRateInput = _.debounce(function (value) {
form.value.discountRate = filterNumberInput(value, true);
form.value.discountRate = filterNumberInput(value, 1);
if (form.value.discountRate >= 100) {
form.value.discountRate = 100;
}
}, time);
const validDaysInput = _.debounce(function (value) {
form.value.validDays = filterNumberInput(value, true);
form.value.validDays = filterNumberInput(value, 1);
}, time);
const daysToTakeEffectInput = _.debounce(function (value) {
form.value.daysToTakeEffect = filterNumberInput(value, true);
form.value.daysToTakeEffect = filterNumberInput(value, 1);
if (form.value.daysToTakeEffect === "") {
form.value.daysToTakeEffect = 0;
}
}, time);
const giveNumInput = _.debounce(function (value) {
form.value.giveNum = filterNumberInput(value, true);
form.value.giveNum = filterNumberInput(value, 1);
}, time);
const getLimitInput = _.debounce(function (value) {
form.value.getLimit = filterNumberInput(value, true);
form.value.getLimit = filterNumberInput(value, 1);
if (form.value.getLimit == "") {
form.value.getLimit = 1;
}
}, time);
const useLimitInput = _.debounce(function (value) {
form.value.useLimit = filterNumberInput(value, true);
form.value.useLimit = filterNumberInput(value, 1);
if (form.value.useLimit >= form.value.getLimit) {
form.value.useLimit = form.value.getLimit;
}

View File

@ -1,36 +1,15 @@
<template>
<div>
<el-dialog
v-model="dialogVisible"
:title="titleOptions.title"
width="80%"
@closed="closedReset"
>
<el-form
ref="formRef"
:model="form"
:rules="formRules"
label-width="100px"
class="dialog-form"
>
<el-dialog v-model="dialogVisible" :title="titleOptions.title" width="80%" @closed="closedReset">
<el-form ref="formRef" :model="form" :rules="formRules" label-width="100px" class="dialog-form">
<el-form-item label="赠券门槛" prop="fullAmount">
<div class="center">
<el-input
v-model="form.fullAmount"
placeholder="请输入赠券门槛"
style="width: 240px"
input-style="text-align: center;"
@input="(e) => (form.fullAmount = filterNumberInput(e))"
>
<el-input v-model="form.fullAmount" placeholder="请输入赠券门槛" style="width: 240px"
input-style="text-align: center;" @input="(e) => (form.fullAmount = filterNumberInput(e))">
<template #prepend></template>
<template #append></template>
</el-input>
<el-tooltip
class="box-item"
effect="dark"
content="每单消费满此金额后赠送券 "
placement="top-start"
>
<el-tooltip class="box-item" effect="dark" content="每单消费满此金额后赠送券 " placement="top-start">
<el-icon size="18">
<QuestionFilled />
</el-icon>
@ -39,17 +18,8 @@
</el-form-item>
<el-form-item label="优惠券" prop="coupon">
<div class="center">
<el-select
v-model="couponGiftList"
placeholder="请选择优惠券"
style="width: 300px"
>
<el-option
:label="item.title"
:value="item.id"
v-for="item in couponList"
:key="item.id"
/>
<el-select v-model="couponGiftList" placeholder="请选择优惠券" style="width: 300px">
<el-option :label="item.title" :value="item.id" v-for="item in couponList" :key="item.id" />
</el-select>
</div>
</el-form-item>
@ -70,46 +40,28 @@
<span>关闭则为无限制</span>
</div>
<div v-if="infiniteGiveNum" style="margin-top: 10px">
<el-input
v-model="form.giveNum"
placeholder="请输入总发放数量"
style="width: 200px"
input-style="text-align: center;"
@input="giveNumInput"
>
<el-input v-model="form.giveNum" placeholder="请输入总发放数量" style="width: 200px"
input-style="text-align: center;" @input="giveNumInput">
<template #append></template>
</el-input>
</div>
</div>
</el-form-item>
<el-form-item label="每次赠送">
<el-input
v-model="couponGiveNum"
placeholder="请输入"
style="width: 200px"
input-style="text-align: center;"
@input="couponGiveNumInput"
>
<el-input v-model="couponGiveNum" placeholder="请输入" style="width: 200px" input-style="text-align: center;"
@input="couponGiveNumInput">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="每人限量" prop="getLimit">
<div class="column">
<div class="center">
<el-switch
v-model="infiniteUseLimit"
@change="infiniteUseLimitChange"
/>
<el-switch v-model="infiniteUseLimit" @change="infiniteUseLimitChange" />
<span>关闭则为无限制</span>
</div>
<div v-if="infiniteUseLimit" style="margin-top: 10px">
<el-input
v-model="form.getLimit"
placeholder="请输入每人限量"
style="width: 200px"
input-style="text-align: center;"
@input="getLimitInput"
>
<el-input v-model="form.getLimit" placeholder="请输入每人限量" style="width: 200px"
input-style="text-align: center;" @input="getLimitInput">
<template #append></template>
</el-input>
</div>
@ -369,18 +321,18 @@ onMounted(() => {
// input
const time = 500;
const couponGiveNumInput = _.debounce(function (value) {
couponGiveNum.value = filterNumberInput(value, true);
couponGiveNum.value = filterNumberInput(value, 1);
if (couponGiveNum.value == "") {
couponGiveNum.value = 1;
}
}, time);
const giveNumInput = _.debounce(function (value) {
form.value.giveNum = filterNumberInput(value, true);
form.value.giveNum = filterNumberInput(value, 1);
}, time);
const getLimitInput = _.debounce(function (value) {
form.value.getLimit = filterNumberInput(value, true);
form.value.getLimit = filterNumberInput(value, 1);
}, time);
defineExpose({

View File

@ -62,7 +62,7 @@
</div>
</div>
<div class="gyq_content" v-else>
门店未参券兑换码活动如需开启参与请联系主店
门店未参券兑换码活动或主店未开启活动如需开启参与请联系主店
</div>
<useShops ref="useShopsRef" />
<add ref="addRef" @success="getTableData" />
@ -168,6 +168,8 @@ async function rechargeRedemptionEnableStatusAjax() {
const res = await couponRedemptionEnableStatus();
queryForm.value.isEnable = res.isEnable;
if (res.isEnable == 1) {
if (shopInfo.value.shopType == 'only') {
isUse.value = true
} else {
@ -183,6 +185,9 @@ async function rechargeRedemptionEnableStatusAjax() {
});
}
}
} else {
isUse.value = false;
}
} catch (error) {
console.log(error);
}

View File

@ -419,7 +419,7 @@ function convertTimeToDate(timeStr, options = {}) {
// input
const time = 500;
const discountNumInput = _.debounce(function (value) {
form.value.discountNum = filterNumberInput(value, true);
form.value.discountNum = filterNumberInput(value, 1);
if (form.value.discountNum == "") {
form.value.discountNum = 1;
}

View File

@ -187,7 +187,7 @@ const form = ref({
//
const discountRateInput = _.debounce(function (value) {
form.value.discountRate = filterNumberInput(value, true);
form.value.discountRate = filterNumberInput(value, 1);
if (form.value.discountRate > 99) {
form.value.discountRate = 99;
}

View File

@ -1,6 +1,5 @@
<!-- 限时折扣 -->
<template>
<div class="gyq_container">
<div class="gyq_content">
<HeaderCard name="限时折扣" intro="批量设置商品折扣" icon="xszk"></HeaderCard>

View File

@ -347,6 +347,7 @@ async function distributionGetAjax() {
const res = await distributionGet()
nextTick(() => {
form.value = { ...res }
delete form.value.isEnable
if (form.value.rewardCount == -1) {
isLimitCount.value = 1
}

View File

@ -1,8 +1,7 @@
<template>
<div class="gyq_container">
<div class="gyq_content">
<HeaderCard name="分销" intro="用户成为业务员,可促进消费" icon="xffx"
:showSwitch="shopInfo.isHeadShop == 1 || shopInfo.shopType == 'only'" v-model:isOpen="form.isEnable">
<HeaderCard name="分销" intro="用户成为业务员,可促进消费" icon="xffx" showSwitch v-model:isOpen="form.isEnable">
</HeaderCard>
<div class="row mt14">
<tabHeader v-model="tabActiveIndex" :list="tabList" />

View File

@ -64,7 +64,7 @@
</div>
</div>
<div class="gyq_content" v-else>
门店未参与霸王餐活动如需开启参与请联系主店
门店未参与霸王餐活动或主店未开启活动如需开启参与请联系主店
</div>
</div>
</template>
@ -138,6 +138,7 @@ async function freeDingGetAjax() {
form.value = { ...res }
form.value.enable = res.enable ? 1 : 0
if (res.enable == true) {
if (shopInfo.value.shopType == 'only') {
isUse.value = true
} else {
@ -153,6 +154,9 @@ async function freeDingGetAjax() {
});
}
}
} else {
isUse.value = false
}
} catch (err) {
console.log(err);
}

View File

@ -3,25 +3,15 @@
<el-dialog title="添加方案" v-model="show" @closed="reset" width="730px">
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="减免金额" prop="amount">
<el-input
v-model="form.amount"
placeholder="请输入减免金额"
style="width: 270px"
:maxlength="8"
@input="amountInput"
>
<el-input v-model="form.amount" placeholder="请输入减免金额" style="width: 270px" :maxlength="8"
@input="amountInput">
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="概率" prop="probability">
<div class="column">
<div class="item">
<el-input
v-model="form.probability"
placeholder="请输入概率"
style="width: 270px"
@input="probabilityInput"
>
<el-input v-model="form.probability" placeholder="请输入概率" style="width: 270px" @input="probabilityInput">
<template #append>%</template>
</el-input>
</div>
@ -63,7 +53,7 @@ const amountInput = _.debounce(function (value) {
form.value.amount = filterNumberInput(value);
}, time);
const probabilityInput = _.debounce(function (value) {
form.value.probability = filterNumberInput(value, true);
form.value.probability = filterNumberInput(value, 1);
if (form.value.probability >= 100) {
form.value.probability = 100;
}
@ -162,6 +152,7 @@ function filterNumberInput(value, isIntegerOnly = false) {
.column {
display: flex;
flex-direction: column;
.item {
flex: 1;
}

View File

@ -52,7 +52,7 @@
</div>
</div>
<div class="gyq_content" v-else>
门店未参与充值兑换码活动如需开启参与请联系主店
门店未参与充值兑换码活动或主店未开启活动如需开启参与请联系主店
</div>
<useShops ref="useShopsRef" />
<add ref="addRef" @success="getTableData" />
@ -150,6 +150,7 @@ async function rechargeRedemptionEnableStatusAjax() {
const res = await rechargeRedemptionEnableStatus();
queryForm.value.isEnable = res.isEnable;
if (res.isEnable == 1) {
if (shopInfo.value.shopType == 'only') {
isUse.value = true
} else {
@ -165,6 +166,9 @@ async function rechargeRedemptionEnableStatusAjax() {
});
}
}
} else {
isUse.value = false
}
} catch (error) {
console.log(error);
}

View File

@ -247,7 +247,7 @@
</el-tab-pane>
</el-tabs>
</div>
<div style="padding-top: 14px;" v-else>门店未参券兑换码活动如需开启参与请联系主店</div>
<div style="padding-top: 14px;" v-else>门店未参与超级会员活动或主店未开启活动如需开启参与请联系主店</div>
<DialogPlans ref="refDialogPlans" @submitSuccess="submitSuccess"></DialogPlans>
</div>
</template>
@ -528,7 +528,8 @@ async function init() {
});
console.log(conditionLists.value);
if (res.useType == 'all' || shopInfo.value.shopType == 'only') {
if (res.isOpen == 1) {
if (res.memberPriceShopType == 'ALL' || shopInfo.value.shopType == 'only') {
isUse.value = true
} else {
let currentShopId = shopInfo.value.shopId;
@ -539,6 +540,9 @@ async function init() {
}
});
}
} else {
isUse.value = false;
}
});
memberApi.levelList().then((res) => {
if (res && res.length) {

View File

@ -94,7 +94,7 @@
</el-tabs>
</div>
</div>
<div class="gyq_content err" v-else>门店未参与充值活动如需开启参与请联系主店</div>
<div class="gyq_content err" v-else>门店未参与智慧充值活动如需开启参与请联系主店</div>
<AddDialog ref="AddDialogRef" :couponList="couponList" @success="addSuccess" />
</div>
</template>