mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-06 17:09:08 +08:00
refactor: 移除停用促销、批发和短信管理界面
This commit is contained in:
@@ -127,26 +127,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 限时折扣 -->
|
|
||||||
<div class="item-price-row" v-if="promotionMap['DISCOUNT']">
|
|
||||||
<p>
|
|
||||||
<span class="item-price-title">促销</span>
|
|
||||||
<span class="item-promotion">限时折扣</span>
|
|
||||||
<span class="item-desc-pintuan" v-if="promotionMap['DISCOUNT'].discount">
|
|
||||||
享 {{ promotionMap["DISCOUNT"].discount }} 折
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- 第N件优惠 -->
|
|
||||||
<div class="item-price-row" v-if="promotionMap['NTH']">
|
|
||||||
<p>
|
|
||||||
<span class="item-price-title">促销</span>
|
|
||||||
<span class="item-promotion">第N件</span>
|
|
||||||
<span class="item-desc-pintuan">
|
|
||||||
第 {{ promotionMap["NTH"].nthNum || promotionMap["NTH"].num }} 件优惠
|
|
||||||
</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<!-- 拼团 -->
|
<!-- 拼团 -->
|
||||||
<div class="item-price-row" v-if="promotionMap['PINTUAN']">
|
<div class="item-price-row" v-if="promotionMap['PINTUAN']">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const brandList = computed(() => {
|
|||||||
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
||||||
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
||||||
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
||||||
{ title: '品质生活 · 限时第2件半价', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
{ title: '品质生活 · 精选好物', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const E_COUPON_ORDER_TYPE = "E_COUPON";
|
|||||||
/** 单次购买数量上限(O-09 默认:min(quantity, 999)) */
|
/** 单次购买数量上限(O-09 默认:min(quantity, 999)) */
|
||||||
export const E_COUPON_MAX_BUY_NUM = 999;
|
export const E_COUPON_MAX_BUY_NUM = 999;
|
||||||
|
|
||||||
/** 常规立即购买(秒杀/满减/券/限时/第N件等) */
|
/** 常规立即购买(秒杀/满减/券等) */
|
||||||
export const E_COUPON_CART_BUY_NOW = "BUY_NOW";
|
export const E_COUPON_CART_BUY_NOW = "BUY_NOW";
|
||||||
export const E_COUPON_CART_PINTUAN = "PINTUAN";
|
export const E_COUPON_CART_PINTUAN = "PINTUAN";
|
||||||
export const E_COUPON_CART_POINTS = "POINTS";
|
export const E_COUPON_CART_POINTS = "POINTS";
|
||||||
@@ -72,8 +72,6 @@ export function createEmptyPromotionMap() {
|
|||||||
SECKILL: null,
|
SECKILL: null,
|
||||||
FULL_DISCOUNT: null,
|
FULL_DISCOUNT: null,
|
||||||
COUPON: [],
|
COUPON: [],
|
||||||
DISCOUNT: null,
|
|
||||||
NTH: null,
|
|
||||||
PINTUAN: null,
|
PINTUAN: null,
|
||||||
KANJIA: null,
|
KANJIA: null,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,14 +5,10 @@ import {
|
|||||||
postRequest
|
postRequest
|
||||||
} from '@/libs/axios';
|
} from '@/libs/axios';
|
||||||
|
|
||||||
// 查询短信站内信信息
|
// 查询站内信信息
|
||||||
export const getMessageData = params => {
|
export const getMessageData = params => {
|
||||||
return getRequest("/other/message", params);
|
return getRequest("/other/message", params);
|
||||||
};
|
};
|
||||||
//修改短信模板
|
|
||||||
export const editSmsMessageTemplate = (id, params) => {
|
|
||||||
return putRequest(`/sms/sms/${id}`, params)
|
|
||||||
}
|
|
||||||
//修改站内信模板
|
//修改站内信模板
|
||||||
export const editNoticeMessage = (id, params) => {
|
export const editNoticeMessage = (id, params) => {
|
||||||
return putRequest(`/setting/noticeMessage/${id}`, params)
|
return putRequest(`/setting/noticeMessage/${id}`, params)
|
||||||
@@ -45,14 +41,6 @@ export const openNoticeMessage = (id) => {
|
|||||||
export const updateMessageStatus = (id,status) => {
|
export const updateMessageStatus = (id,status) => {
|
||||||
return putRequest(`/setting/noticeMessage/${id}/${status}`);
|
return putRequest(`/setting/noticeMessage/${id}/${status}`);
|
||||||
};
|
};
|
||||||
//获取短信模板
|
|
||||||
export const getSmsTemplatePage = (params) => {
|
|
||||||
return getRequest("/sms/sms/template", params);
|
|
||||||
};
|
|
||||||
//获取短信签名
|
|
||||||
export const getSmsSignPage = (params) => {
|
|
||||||
return getRequest("/sms/sms/sign", params);
|
|
||||||
};
|
|
||||||
//获取设置
|
//获取设置
|
||||||
export const getSetting = (key) => {
|
export const getSetting = (key) => {
|
||||||
return getRequest(`/setting/setting/get/${key}`);
|
return getRequest(`/setting/setting/get/${key}`);
|
||||||
@@ -66,42 +54,6 @@ export const setSetting = (key, params) => {
|
|||||||
return postRequest(`/setting/setting/put/${key}`, params);
|
return postRequest(`/setting/setting/put/${key}`, params);
|
||||||
};
|
};
|
||||||
|
|
||||||
//查看短信签名
|
|
||||||
export const getSmsSign = () => {
|
|
||||||
return getRequest(`/sms/sms/sign`);
|
|
||||||
};
|
|
||||||
//添加短信签名
|
|
||||||
export const addSmsSign = (params) => {
|
|
||||||
return postRequest(`/sms/sms/sign`, params);
|
|
||||||
};
|
|
||||||
//修改短信签名
|
|
||||||
export const editSmsSign = (params) => {
|
|
||||||
return putRequest(`/sms/sms/sign`, params);
|
|
||||||
};
|
|
||||||
//删除短信签名
|
|
||||||
export const delSmsSign = (id) => {
|
|
||||||
return deleteRequest(`/sms/sms/sign/${id}`);
|
|
||||||
};
|
|
||||||
//添加短信模板
|
|
||||||
export const addSmsTemplate = (params) => {
|
|
||||||
return postRequest(`/sms/sms/template`, params);
|
|
||||||
};
|
|
||||||
//修改短信模板
|
|
||||||
export const editSmsTemplate = (params) => {
|
|
||||||
return putRequest(`/sms/sms/template`, params);
|
|
||||||
};
|
|
||||||
//删除短信模板
|
|
||||||
export const delSmsTemplate = (id) => {
|
|
||||||
return deleteRequest(`/sms/sms/template/${id}`);
|
|
||||||
};
|
|
||||||
//查询短信发送记录
|
|
||||||
export const getSmsReachPage = (params) => {
|
|
||||||
return getRequest(`/sms/sms`, params);
|
|
||||||
};
|
|
||||||
//重新发送
|
|
||||||
export const repeatSendSms = (id) => {
|
|
||||||
return postRequest(`/sms/sms/repeat/${id}`);
|
|
||||||
};
|
|
||||||
//获取设置
|
//获取设置
|
||||||
export const getExperienceData = (key) => {
|
export const getExperienceData = (key) => {
|
||||||
return getRequest(`/setting/experience/get/${key}`);
|
return getRequest(`/setting/experience/get/${key}`);
|
||||||
@@ -218,41 +170,11 @@ export const updateWechatMpMessageTemplate = params => {
|
|||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// 补充缺失的系统配置、短信、版本及验证码 API
|
// 补充缺失的系统配置、版本及验证码 API
|
||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
|
|
||||||
// 短信任务发送与记录 (sms.vue)
|
|
||||||
export const getSmsPage = (params) => {
|
|
||||||
return getRequest(`/sms/sms`, params);
|
|
||||||
};
|
|
||||||
export const sendSms = (params) => {
|
|
||||||
return postRequest(`/sms/sms`, params);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 短信签名同步与详细 (sms.vue, smsSign.vue)
|
|
||||||
export const syncSign = () => {
|
|
||||||
return putRequest(`/sms/sign/querySmsSign`);
|
|
||||||
};
|
|
||||||
export const deleteSign = (id) => {
|
|
||||||
return deleteRequest(`/sms/sign/${id}`);
|
|
||||||
};
|
|
||||||
export const smsSignDetail = (id) => {
|
|
||||||
return getRequest(`/sms/sign/${id}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 短信模板管理与同步 (sms.vue)
|
|
||||||
export const syncTemplate = () => {
|
|
||||||
return putRequest(`/sms/template/querySmsSign`);
|
|
||||||
};
|
|
||||||
export const addSmsTemplatePage = (params) => {
|
|
||||||
return postRequest(`/sms/template`, params);
|
|
||||||
};
|
|
||||||
export const editSmsTemplatePage = (params) => {
|
|
||||||
return putRequest(`/sms/template/modifySmsTemplate`, params);
|
|
||||||
};
|
|
||||||
export const deleteSmsTemplatePage = (params) => {
|
|
||||||
return deleteRequest(`/sms/template`, params);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 支付支持方式表单 (PAYMENT_SUPPORT.vue)
|
// 支付支持方式表单 (PAYMENT_SUPPORT.vue)
|
||||||
export const getPaymentSupportForm = () => {
|
export const getPaymentSupportForm = () => {
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ let util = {};
|
|||||||
|
|
||||||
/** 已弃用、前端未实现或已移除的菜单 frontRoute,注册路由时跳过 */
|
/** 已弃用、前端未实现或已移除的菜单 frontRoute,注册路由时跳过 */
|
||||||
const DEPRECATED_FRONT_ROUTES = new Set([
|
const DEPRECATED_FRONT_ROUTES = new Set([
|
||||||
|
"sys/message/sms",
|
||||||
|
"sys/message/smsSign",
|
||||||
"goods/goods-manage/spec",
|
"goods/goods-manage/spec",
|
||||||
"member/list/memberRecycle",
|
"member/list/memberRecycle",
|
||||||
"order/order/fictitiousOrderList",
|
"order/order/fictitiousOrderList",
|
||||||
|
|||||||
@@ -385,12 +385,6 @@ export const otherRouter = {
|
|||||||
component: () => import("@/views/promotions/seckill/seckill-goods.vue")
|
component: () => import("@/views/promotions/seckill/seckill-goods.vue")
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
path: "add-sms-sign",
|
|
||||||
title: "短信签名",
|
|
||||||
name: "add-sms-sign",
|
|
||||||
component: () => import("@/views/sys/message/smsSign.vue")
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: "live-add",
|
path: "live-add",
|
||||||
title: "创建直播",
|
title: "创建直播",
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ export const COMPONENT_DEFINITIONS = [
|
|||||||
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
||||||
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
||||||
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
||||||
{ title: '品质生活 · 限时第2件半价', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
{ title: '品质生活 · 精选好物', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
defaultComponentStyle: {
|
defaultComponentStyle: {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const brandList = computed(() => {
|
|||||||
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
||||||
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
||||||
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
||||||
{ title: '品质生活 · 限时第2件半价', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
{ title: '品质生活 · 精选好物', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,701 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="search">
|
|
||||||
<el-card>
|
|
||||||
<el-tabs v-model="activeTab" class="sms-tabs" @tab-change="paneChange">
|
|
||||||
<el-tab-pane label="发送任务列表" name="LIST">
|
|
||||||
<div class="operation" style="margin-bottom: 10px">
|
|
||||||
<el-button type="primary" @click="sendBatchSmsModal">发送短信</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table v-loading="loading" border :data="smsData" style="width: 100%">
|
|
||||||
<el-table-column prop="smsName" label="模板名称" width="250" />
|
|
||||||
<el-table-column prop="signName" label="签名" width="150" />
|
|
||||||
<el-table-column prop="context" label="短信内容" min-width="300" show-overflow-tooltip />
|
|
||||||
<el-table-column prop="num" label="预计发送条数" width="140" />
|
|
||||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<a v-if="row" class="link-text" @click="detail(row)">详细</a>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
|
||||||
<el-pagination
|
|
||||||
v-model:current-page="smsSearchForm.pageNumber"
|
|
||||||
v-model:page-size="smsSearchForm.pageSize"
|
|
||||||
:total="smsTotal"
|
|
||||||
:page-sizes="[20, 50, 100]"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
size="small"
|
|
||||||
@current-change="smsChangePage"
|
|
||||||
@size-change="smsChangePageSize"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane label="短信模板" name="TEMPLATE">
|
|
||||||
<div class="operation" style="margin-bottom: 10px">
|
|
||||||
<el-button type="primary" @click="addTemplate">添加短信模板</el-button>
|
|
||||||
<el-button type="info" @click="syncTemplate">同步</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table v-loading="loading" border :data="templateData" style="width: 100%">
|
|
||||||
<el-table-column prop="templateCode" label="模板code" min-width="120" />
|
|
||||||
<el-table-column prop="templateName" label="模板名称" min-width="140" />
|
|
||||||
<el-table-column prop="templateContent" label="模板内容" min-width="200" show-overflow-tooltip />
|
|
||||||
<el-table-column label="状态" width="120" align="center">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<span v-if="row">{{ templateStatusText(row.templateStatus) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<template v-if="row">
|
|
||||||
<a
|
|
||||||
class="link-text"
|
|
||||||
:class="{ disabled: row.templateStatus != 2 }"
|
|
||||||
@click="row.templateStatus == 2 && editTemplate(row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</a>
|
|
||||||
<span class="op-split">|</span>
|
|
||||||
<a
|
|
||||||
class="link-text"
|
|
||||||
:class="{ disabled: row.templateStatus == 0 }"
|
|
||||||
@click="row.templateStatus != 0 && deleteSmsTemplate(row)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
|
||||||
<el-pagination
|
|
||||||
v-model:current-page="templateSearchForm.pageNumber"
|
|
||||||
v-model:page-size="templateSearchForm.pageSize"
|
|
||||||
:total="templateTotal"
|
|
||||||
:page-sizes="[20, 50, 100]"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
size="small"
|
|
||||||
@current-change="templateChangePage"
|
|
||||||
@size-change="templateChangePageSize"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
|
|
||||||
<el-tab-pane label="短信签名" name="SIGN">
|
|
||||||
<div class="operation" style="margin-bottom: 10px">
|
|
||||||
<el-button type="primary" @click="addSign">添加短信签名</el-button>
|
|
||||||
<el-button type="info" @click="syncSign">同步</el-button>
|
|
||||||
</div>
|
|
||||||
<el-table v-loading="loading" border :data="signData" style="width: 100%">
|
|
||||||
<el-table-column prop="signName" label="签名名称" min-width="140" />
|
|
||||||
<el-table-column prop="remark" label="申请说明" min-width="160" show-overflow-tooltip />
|
|
||||||
<el-table-column label="状态" width="160" align="center">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<template v-if="row">
|
|
||||||
<template v-if="row.signStatus == 2">
|
|
||||||
审核拒绝
|
|
||||||
<el-popover trigger="hover" :content="row.reason" placement="top-start" width="200">
|
|
||||||
<template #reference>
|
|
||||||
<span style="color: #ed3f14; cursor: pointer">【原因】</span>
|
|
||||||
</template>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
<span v-else-if="row.signStatus == 0">审核中</span>
|
|
||||||
<span v-else-if="row.signStatus == 1">审核通过</span>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<template v-if="row">
|
|
||||||
<a
|
|
||||||
class="link-text"
|
|
||||||
:class="{ disabled: row.signStatus != 2 }"
|
|
||||||
@click="row.signStatus == 2 && editSign(row)"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</a>
|
|
||||||
<span class="op-split">|</span>
|
|
||||||
<a
|
|
||||||
class="link-text"
|
|
||||||
:class="{ disabled: row.signStatus == 0 }"
|
|
||||||
@click="row.signStatus != 0 && deleteSmsSign(row)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</a>
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
|
||||||
<el-pagination
|
|
||||||
v-model:current-page="signSearchForm.pageNumber"
|
|
||||||
v-model:page-size="signSearchForm.pageSize"
|
|
||||||
:total="signTotal"
|
|
||||||
:page-sizes="[20, 50, 100]"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
|
||||||
size="small"
|
|
||||||
@current-change="signChangePage"
|
|
||||||
@size-change="signChangePageSize"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
<el-dialog
|
|
||||||
v-model="templateModalVisible"
|
|
||||||
:title="templateModalTitle"
|
|
||||||
width="520px"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
destroy-on-close
|
|
||||||
>
|
|
||||||
<el-form ref="templateFormRef" :model="templateForm" label-width="100px" :rules="templateFormValidate">
|
|
||||||
<el-form-item label="模板名称" prop="templateName">
|
|
||||||
<el-input v-model="templateForm.templateName" maxlength="30" clearable placeholder="请输入模板名称,不超过30字符" />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="模板内容" prop="templateContent">
|
|
||||||
<el-input
|
|
||||||
v-model="templateForm.templateContent"
|
|
||||||
type="textarea"
|
|
||||||
maxlength="200"
|
|
||||||
:rows="5"
|
|
||||||
show-word-limit
|
|
||||||
placeholder="请输入短信内容"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="申请说明" prop="remark">
|
|
||||||
<el-input
|
|
||||||
v-model="templateForm.remark"
|
|
||||||
type="textarea"
|
|
||||||
maxlength="150"
|
|
||||||
:rows="4"
|
|
||||||
show-word-limit
|
|
||||||
placeholder="请描述您的业务使用场景"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="templateModalVisible = false">取消</el-button>
|
|
||||||
<el-button type="primary" :loading="submitLoading" @click="templateSubmit">提交</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
|
|
||||||
<el-dialog
|
|
||||||
v-model="sendSmsModal"
|
|
||||||
:title="sendSmsModalTitle"
|
|
||||||
width="1100px"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
destroy-on-close
|
|
||||||
>
|
|
||||||
<div class="send-setting">
|
|
||||||
<div class="left-show" v-html="smsContent"></div>
|
|
||||||
<div class="sms">效果预览</div>
|
|
||||||
<div class="send-form">
|
|
||||||
<el-form ref="smsFormRef" :model="smsForm" label-width="100px" :rules="smsFormValidate">
|
|
||||||
<el-form-item label="短信签名" prop="signName">
|
|
||||||
<el-select v-model="smsForm.signName" style="width: 35%" @change="selectSmsSign">
|
|
||||||
<el-option
|
|
||||||
v-for="item in smsSigns"
|
|
||||||
:key="item.signName"
|
|
||||||
:label="item.signName"
|
|
||||||
:value="item.signName"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="短信模板" prop="messageCode">
|
|
||||||
<el-select v-model="smsForm.messageCode" style="width: 35%" @change="selectSmsTemplate">
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in smsTemplates"
|
|
||||||
:key="index"
|
|
||||||
:label="item.templateName"
|
|
||||||
:value="item.templateCode"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="短信内容" prop="context">
|
|
||||||
<el-input
|
|
||||||
v-model="smsForm.context"
|
|
||||||
type="textarea"
|
|
||||||
maxlength="50"
|
|
||||||
:rows="4"
|
|
||||||
show-word-limit
|
|
||||||
disabled
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="接收人" prop="smsRange">
|
|
||||||
<p>
|
|
||||||
已选<span style="color: #f56c1d"> {{ memberNum }}</span>人,预计耗费条数<span style="color: #f56c1d">
|
|
||||||
{{ smsForm.num }}条</span
|
|
||||||
>
|
|
||||||
</p>
|
|
||||||
<el-radio-group v-model="smsForm.smsRange" @change="smsRangeChange">
|
|
||||||
<el-radio value="1">全部会员</el-radio>
|
|
||||||
<el-radio value="2">自定义选择</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="customSms" label-width="0" class="choose-member-item">
|
|
||||||
<div class="choose-member">
|
|
||||||
<div class="source-member">
|
|
||||||
<el-input
|
|
||||||
v-model="memberSearchParam.mobile"
|
|
||||||
placeholder="请输入手机号码"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="memberSearch"
|
|
||||||
@blur="memberSearch"
|
|
||||||
>
|
|
||||||
<template #append>
|
|
||||||
<el-button @click="memberSearch">搜索</el-button>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
<el-scrollbar height="280px" class="member-scroll" @scroll="onMemberScroll">
|
|
||||||
<div v-for="(item, index) in members" :key="index" class="scroll-card">
|
|
||||||
<el-button
|
|
||||||
class="btns"
|
|
||||||
:class="{ active: item.____selected }"
|
|
||||||
style="width: 100%; text-align: left"
|
|
||||||
@click="moveMember(index, item)"
|
|
||||||
>
|
|
||||||
<span v-if="item.mobile" class="mobile">{{ item.mobile }}</span>
|
|
||||||
<span class="nickname">{{ item.nickName }}</span>
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
<div class="traget-member">
|
|
||||||
<el-tag
|
|
||||||
v-for="(item, index) in alreadyCheckShow"
|
|
||||||
:key="index"
|
|
||||||
closable
|
|
||||||
class="checkbox-tag"
|
|
||||||
@close="alreadyCheckClose(item, index)"
|
|
||||||
>
|
|
||||||
{{ item.mobile || item.nickName }}
|
|
||||||
</el-tag>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="sendSmsModal = false">取消</el-button>
|
|
||||||
<el-button type="primary" :loading="submitLoading" @click="sendSms">发送</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted } from "vue";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
|
||||||
import * as API_Setting from "@/api/setting.js";
|
|
||||||
import * as API_Member from "@/api/member.js";
|
|
||||||
|
|
||||||
defineOptions({ name: "sms" });
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const activeTab = ref("LIST");
|
|
||||||
const loading = ref(false);
|
|
||||||
const customSms = ref(false);
|
|
||||||
const alreadyCheck = ref([]);
|
|
||||||
const alreadyCheckShow = ref([]);
|
|
||||||
const memberPage = ref(0);
|
|
||||||
const members = ref([]);
|
|
||||||
const smsTemplateContent = ref("");
|
|
||||||
const memberNum = ref(0);
|
|
||||||
const smsContent = ref("<div class='sms'>效果预览</div>");
|
|
||||||
const smsTemplates = ref([]);
|
|
||||||
const smsSigns = ref([]);
|
|
||||||
const sendSmsModal = ref(false);
|
|
||||||
const sendSmsModalTitle = ref("短信发送");
|
|
||||||
const modalType = ref(0);
|
|
||||||
const templateModalVisible = ref(false);
|
|
||||||
const templateModalTitle = ref("");
|
|
||||||
const templateForm = ref({});
|
|
||||||
const submitLoading = ref(false);
|
|
||||||
const signSearchForm = reactive({ pageNumber: 1, pageSize: 20 });
|
|
||||||
const templateSearchForm = reactive({ pageNumber: 1, pageSize: 20 });
|
|
||||||
const memberSearchFrom = reactive({ disabled: "OPEN" });
|
|
||||||
const memberSearchParam = reactive({
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 8,
|
|
||||||
disabled: "OPEN",
|
|
||||||
});
|
|
||||||
const smsSearchForm = reactive({
|
|
||||||
sort: "createTime",
|
|
||||||
order: "desc",
|
|
||||||
pageNumber: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
});
|
|
||||||
const smsForm = ref({
|
|
||||||
smsName: "",
|
|
||||||
signName: "",
|
|
||||||
context: "",
|
|
||||||
smsRange: "1",
|
|
||||||
num: 0,
|
|
||||||
messageCode: "",
|
|
||||||
});
|
|
||||||
const smsFormValidate = reactive({
|
|
||||||
signName: [{ required: true, message: "请选择短信签名", trigger: "change" }],
|
|
||||||
messageCode: [{ required: true, message: "请选择短信模板", trigger: "change" }],
|
|
||||||
});
|
|
||||||
const templateFormValidate = reactive({
|
|
||||||
templateName: [{ required: true, message: "请输入短信模板名称", trigger: "blur" }],
|
|
||||||
templateContent: [{ required: true, message: "请输入短信模板内容", trigger: "blur" }],
|
|
||||||
remark: [{ required: true, message: "请输入短信模板申请说明", trigger: "blur" }],
|
|
||||||
});
|
|
||||||
const smsData = ref([]);
|
|
||||||
const smsTotal = ref(0);
|
|
||||||
const templateData = ref([]);
|
|
||||||
const templateTotal = ref(0);
|
|
||||||
const signData = ref([]);
|
|
||||||
const signTotal = ref(0);
|
|
||||||
const memberLoadingMore = ref(false);
|
|
||||||
|
|
||||||
const smsFormRef = ref(null);
|
|
||||||
const templateFormRef = ref(null);
|
|
||||||
|
|
||||||
function templateStatusText(status) {
|
|
||||||
const map = { 0: "审核中", 1: "审核通过", 2: "审核失败" };
|
|
||||||
return map[status] ?? map[String(status)] ?? "-";
|
|
||||||
}
|
|
||||||
function init() {
|
|
||||||
getSms();
|
|
||||||
getMemberNum();
|
|
||||||
}
|
|
||||||
function getMemberNum() {
|
|
||||||
API_Member.getMemberNum(memberSearchFrom).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
memberNum.value = res.result;
|
|
||||||
smsForm.value.num = memberNum.value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function alreadyCheckClose(val, index) {
|
|
||||||
alreadyCheck.value.splice(index, 1);
|
|
||||||
alreadyCheckShow.value.splice(index, 1);
|
|
||||||
members.value.forEach((item) => {
|
|
||||||
if (item.____selected && item.mobile == val.mobile) {
|
|
||||||
item.____selected = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
smsForm.value.num--;
|
|
||||||
memberNum.value--;
|
|
||||||
}
|
|
||||||
function detail() {}
|
|
||||||
function smsRangeChange(v) {
|
|
||||||
memberNum.value = 0;
|
|
||||||
smsForm.value.num = 0;
|
|
||||||
if (v == 1) {
|
|
||||||
alreadyCheck.value = [];
|
|
||||||
alreadyCheckShow.value = [];
|
|
||||||
customSms.value = false;
|
|
||||||
getMemberNum();
|
|
||||||
}
|
|
||||||
if (v == 2) {
|
|
||||||
customSms.value = true;
|
|
||||||
members.value = [];
|
|
||||||
memberSearchParam.pageNumber = 1;
|
|
||||||
getMembers();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function memberSearch() {
|
|
||||||
memberSearchParam.pageNumber = 1;
|
|
||||||
members.value = [];
|
|
||||||
getMembers();
|
|
||||||
}
|
|
||||||
function moveMember(index, item) {
|
|
||||||
if (!item.mobile) {
|
|
||||||
ElMessage.error("当前用户暂无手机号绑定");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
item.____selected = true;
|
|
||||||
if (alreadyCheck.value.length == 0) {
|
|
||||||
alreadyCheck.value.push(item.mobile);
|
|
||||||
alreadyCheckShow.value.push(item);
|
|
||||||
smsForm.value.num++;
|
|
||||||
memberNum.value++;
|
|
||||||
} else {
|
|
||||||
const result = alreadyCheck.value.indexOf(item.mobile);
|
|
||||||
if (result < 0) {
|
|
||||||
smsForm.value.num++;
|
|
||||||
memberNum.value++;
|
|
||||||
alreadyCheck.value.push(item.mobile);
|
|
||||||
alreadyCheckShow.value.push(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function onMemberScroll({ scrollTop }) {
|
|
||||||
const wrap = document.querySelector(".member-scroll .el-scrollbar__wrap");
|
|
||||||
if (!wrap || memberLoadingMore.value) return;
|
|
||||||
const nearBottom = scrollTop + wrap.clientHeight >= wrap.scrollHeight - 20;
|
|
||||||
if (nearBottom && memberPage.value != memberSearchParam.pageNumber) {
|
|
||||||
memberLoadingMore.value = true;
|
|
||||||
memberSearchParam.pageNumber++;
|
|
||||||
getMembers(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function getMembers(append = false) {
|
|
||||||
API_Member.getMemberListData(memberSearchParam).then((res) => {
|
|
||||||
memberLoadingMore.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
res.result.records.forEach((item) => {
|
|
||||||
item.____selected = false;
|
|
||||||
members.value.push(item);
|
|
||||||
});
|
|
||||||
memberPage.value = res.result.pages;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function sendBatchSmsModal() {
|
|
||||||
templateSearchForm.templateStatus = 1;
|
|
||||||
API_Setting.getSmsTemplatePage(templateSearchForm).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
smsTemplates.value = res.result.records;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
signSearchForm.signStatus = 1;
|
|
||||||
API_Setting.getSmsSignPage(signSearchForm).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
smsSigns.value = res.result.records;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
smsContent.value = "<div class='sms'>效果预览</div>";
|
|
||||||
alreadyCheck.value = [];
|
|
||||||
alreadyCheckShow.value = [];
|
|
||||||
smsTemplateContent.value = "效果预览";
|
|
||||||
smsForm.value = {
|
|
||||||
smsName: "",
|
|
||||||
signName: "",
|
|
||||||
context: "",
|
|
||||||
smsRange: "1",
|
|
||||||
num: 0,
|
|
||||||
messageCode: "",
|
|
||||||
};
|
|
||||||
getMemberNum();
|
|
||||||
sendSmsModal.value = true;
|
|
||||||
}
|
|
||||||
function paneChange(name) {
|
|
||||||
if (name == "TEMPLATE") {
|
|
||||||
getSmsTemplate();
|
|
||||||
}
|
|
||||||
if (name == "SIGN") {
|
|
||||||
getSmsSign();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function selectSmsSign(v) {
|
|
||||||
if (v != undefined) {
|
|
||||||
smsContent.value = "<div class='sms'>【" + v + "】" + " " + smsTemplateContent.value + "</div>";
|
|
||||||
} else {
|
|
||||||
smsContent.value = "<div class='sms'>效果预览" + smsTemplateContent.value + "</div>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function selectSmsTemplate() {
|
|
||||||
smsTemplates.value.forEach((e) => {
|
|
||||||
if (smsForm.value.messageCode == e.templateCode) {
|
|
||||||
smsTemplateContent.value = e.templateContent;
|
|
||||||
smsForm.value.smsName = e.templateName;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (smsForm.value.signName) {
|
|
||||||
smsContent.value =
|
|
||||||
"<div class='sms'>【" + smsForm.value.signName + "】" + smsTemplateContent.value + "</div>";
|
|
||||||
} else {
|
|
||||||
smsContent.value = "<div class='sms'>" + smsTemplateContent.value + "</div>";
|
|
||||||
}
|
|
||||||
smsForm.value.context = smsTemplateContent.value;
|
|
||||||
}
|
|
||||||
function deleteSmsTemplate(v) {
|
|
||||||
ElMessageBox.confirm("您确认要删除此短信模板?", "确认删除", { type: "warning" }).then(() => {
|
|
||||||
API_Setting.deleteSmsTemplatePage({ templateCode: v.templateCode }).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("删除成功");
|
|
||||||
getSmsTemplate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(() => {});
|
|
||||||
}
|
|
||||||
function sendSms() {
|
|
||||||
smsFormRef.value.validate((valid) => {
|
|
||||||
if (!valid) return;
|
|
||||||
smsForm.value.mobile = alreadyCheck.value;
|
|
||||||
API_Setting.sendSms(smsForm.value).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("发送成功");
|
|
||||||
getSms();
|
|
||||||
sendSmsModal.value = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function addSign() {
|
|
||||||
router.push({ name: "add-sms-sign" });
|
|
||||||
}
|
|
||||||
function addTemplate() {
|
|
||||||
templateModalVisible.value = true;
|
|
||||||
templateModalTitle.value = "添加短信模板";
|
|
||||||
templateForm.value = {};
|
|
||||||
modalType.value = 0;
|
|
||||||
}
|
|
||||||
function editTemplate(v) {
|
|
||||||
templateModalVisible.value = true;
|
|
||||||
templateModalTitle.value = "修改短信模板";
|
|
||||||
templateForm.value = { ...v };
|
|
||||||
modalType.value = 1;
|
|
||||||
}
|
|
||||||
function syncSign() {
|
|
||||||
loading.value = true;
|
|
||||||
API_Setting.syncSign().then((res) => {
|
|
||||||
loading.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("同步成功");
|
|
||||||
getSmsSign();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function templateSubmit() {
|
|
||||||
templateFormRef.value.validate((valid) => {
|
|
||||||
if (!valid) return;
|
|
||||||
submitLoading.value = true;
|
|
||||||
const req =
|
|
||||||
modalType.value == 0
|
|
||||||
? API_Setting.addSmsTemplatePage(templateForm.value)
|
|
||||||
: API_Setting.editSmsTemplatePage(templateForm.value);
|
|
||||||
req
|
|
||||||
.then((res) => {
|
|
||||||
submitLoading.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success(modalType.value == 0 ? "添加成功" : "修改成功");
|
|
||||||
templateModalVisible.value = false;
|
|
||||||
getSmsTemplate();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
submitLoading.value = false;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function deleteSmsSign(v) {
|
|
||||||
ElMessageBox.confirm("您确认要删除此短信签名?", "确认删除", { type: "warning" }).then(() => {
|
|
||||||
API_Setting.deleteSign(v.id).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("删除成功");
|
|
||||||
getSmsSign();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).catch(() => {});
|
|
||||||
}
|
|
||||||
function syncTemplate() {
|
|
||||||
loading.value = true;
|
|
||||||
API_Setting.syncTemplate().then((res) => {
|
|
||||||
loading.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("同步成功");
|
|
||||||
getSmsTemplate();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function smsChangePage(v) {
|
|
||||||
smsSearchForm.pageNumber = v;
|
|
||||||
getSms();
|
|
||||||
}
|
|
||||||
function smsChangePageSize(v) {
|
|
||||||
smsSearchForm.pageNumber = 1;
|
|
||||||
smsSearchForm.pageSize = v;
|
|
||||||
getSms();
|
|
||||||
}
|
|
||||||
function templateChangePage(v) {
|
|
||||||
templateSearchForm.pageNumber = v;
|
|
||||||
getSmsTemplate();
|
|
||||||
}
|
|
||||||
function templateChangePageSize(v) {
|
|
||||||
templateSearchForm.pageNumber = 1;
|
|
||||||
templateSearchForm.pageSize = v;
|
|
||||||
getSmsTemplate();
|
|
||||||
}
|
|
||||||
function getSmsTemplate() {
|
|
||||||
loading.value = true;
|
|
||||||
API_Setting.getSmsTemplatePage(templateSearchForm)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
templateData.value = res.result.records;
|
|
||||||
templateTotal.value = res.result.total;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function getSms() {
|
|
||||||
loading.value = true;
|
|
||||||
API_Setting.getSmsPage(smsSearchForm)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
smsData.value = res.result.records;
|
|
||||||
smsTotal.value = res.result.total;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function signChangePage(v) {
|
|
||||||
signSearchForm.pageNumber = v;
|
|
||||||
getSmsSign();
|
|
||||||
}
|
|
||||||
function signChangePageSize(v) {
|
|
||||||
signSearchForm.pageNumber = 1;
|
|
||||||
signSearchForm.pageSize = v;
|
|
||||||
getSmsSign();
|
|
||||||
}
|
|
||||||
function editSign(v) {
|
|
||||||
router.push({ name: "add-sms-sign", query: { id: v.id } });
|
|
||||||
}
|
|
||||||
function getSmsSign() {
|
|
||||||
loading.value = true;
|
|
||||||
API_Setting.getSmsSignPage(signSearchForm)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
signData.value = res.result.records;
|
|
||||||
signTotal.value = res.result.total;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@import "sms.scss";
|
|
||||||
|
|
||||||
.link-text {
|
|
||||||
color: #409eff;
|
|
||||||
cursor: pointer;
|
|
||||||
text-decoration: none;
|
|
||||||
&.disabled {
|
|
||||||
color: #c5c8ce;
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.op-split {
|
|
||||||
margin: 0 8px;
|
|
||||||
color: #dcdee2;
|
|
||||||
}
|
|
||||||
.mt_10 {
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
.sms-tabs {
|
|
||||||
min-height: 500px;
|
|
||||||
}
|
|
||||||
.checkbox-tag {
|
|
||||||
margin: 4px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-card>
|
|
||||||
<div style="margin-top: 0">
|
|
||||||
<div class="sign-name">{{ id ? "修改签名" : "新增签名" }}</div>
|
|
||||||
<el-form ref="formRef" :model="form" label-width="100px" :rules="formValidate">
|
|
||||||
<el-form-item label="签名" prop="signName">
|
|
||||||
<el-input
|
|
||||||
v-model="form.signName"
|
|
||||||
maxlength="12"
|
|
||||||
clearable
|
|
||||||
style="width: 28%"
|
|
||||||
placeholder="仅限2-12个字符,建议使用App应用名称或是网站名/公司名"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="签名来源" prop="signSource">
|
|
||||||
<el-select v-model="form.signSource" placeholder="请选择签名来源" style="width: 28%">
|
|
||||||
<el-option label="企事业单位的全称或简称" :value="0" />
|
|
||||||
<el-option label="工信部备案网站的全称或简称" :value="1" />
|
|
||||||
<el-option label="App应用的全称或简称" :value="2" />
|
|
||||||
<el-option label="公众号或小程序的全称或简称" :value="3" />
|
|
||||||
<el-option label="电商平台店铺名的全称或简称" :value="4" />
|
|
||||||
<el-option label="商标名的全称或简称" :value="5" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="div-remark div-remark-first">
|
|
||||||
签名来源选择工信部备案网站的全称或简称时,请在说明中添加网站域名,加快审核速度;
|
|
||||||
</div>
|
|
||||||
<div class="div-remark div-remark-bottom">
|
|
||||||
如果选择APP应用的全称或简称或公众号或小程序的全称或简称,则网站、APP、小程序或公众号必须已上线;
|
|
||||||
</div>
|
|
||||||
<el-form-item label="证明文件">
|
|
||||||
<div style="float: left">
|
|
||||||
<upload-pic-thumb v-model="form.businessLicense" :multiple="false" :max-size="2048" />
|
|
||||||
</div>
|
|
||||||
<div style="float: left; margin-left: 20px">
|
|
||||||
<upload-pic-thumb v-model="form.license" :max-size="2048" :multiple="false" />
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<div class="div-remark div-remark-first">
|
|
||||||
第一张为营业执照,第二张为授权委托书,请上传签名归属方的企事业单位的企业营业执照、组织机构代码证、税务登记证三证合一的证件及授权委托书
|
|
||||||
</div>
|
|
||||||
<div class="div-remark div-remark-bottom">支持jpg、png、gif、jpeg格式的图片,每张图片不大于2MB</div>
|
|
||||||
<el-form-item label="申请说明" prop="remark">
|
|
||||||
<el-input
|
|
||||||
v-model="form.remark"
|
|
||||||
clearable
|
|
||||||
type="textarea"
|
|
||||||
style="width: 50%"
|
|
||||||
maxlength="100"
|
|
||||||
:autosize="{ maxRows: 4, minRows: 4 }"
|
|
||||||
show-word-limit
|
|
||||||
placeholder="请描述您的业务使用场景,不超过100字符;如:验证码、双十一大促营销"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div class="footer">
|
|
||||||
<el-button type="primary" :loading="submitLoading" @click="addSignSubmit">提交</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, reactive, onMounted } from "vue";
|
|
||||||
import { useRoute, useRouter } from "vue-router";
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import * as API_Setting from "@/api/setting.js";
|
|
||||||
import uploadPicThumb from "@/components/lili/upload-pic-thumb";
|
|
||||||
|
|
||||||
defineOptions({ name: "smsSign" });
|
|
||||||
|
|
||||||
const route = useRoute();
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
const id = ref(0);
|
|
||||||
const form = ref({
|
|
||||||
signName: "",
|
|
||||||
businessLicense: "",
|
|
||||||
license: "",
|
|
||||||
signSource: "",
|
|
||||||
remark: "",
|
|
||||||
});
|
|
||||||
const loading = ref(false);
|
|
||||||
const formValidate = reactive({
|
|
||||||
signName: [{ required: true, message: "签名名称不能为空", trigger: "blur" }],
|
|
||||||
remark: [{ required: true, message: "申请说明不能为空", trigger: "blur" }],
|
|
||||||
businessLicense: [{ required: true, message: " ", trigger: "blur" }],
|
|
||||||
});
|
|
||||||
const submitLoading = ref(false);
|
|
||||||
|
|
||||||
const formRef = ref(null);
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
id.value = route.query.id;
|
|
||||||
if (id.value != undefined) {
|
|
||||||
getSmsSignDetail();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function addSignSubmit() {
|
|
||||||
if (form.value.businessLicense == "" || form.value.license == "") {
|
|
||||||
ElMessage.error("请完善证件信息");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (form.value.signSource === "" || form.value.signSource === null || form.value.signSource === undefined) {
|
|
||||||
ElMessage.error("请选择签名来源");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
formRef.value.validate((valid) => {
|
|
||||||
if (valid) {
|
|
||||||
loading.value = true;
|
|
||||||
if (id.value == undefined) {
|
|
||||||
API_Setting.addSmsSign(form.value)
|
|
||||||
.then((res) => {
|
|
||||||
loading.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("添加成功");
|
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
API_Setting.editSmsSign(form.value)
|
|
||||||
.then((res) => {
|
|
||||||
loading.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
ElMessage.success("修改成功");
|
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSmsSignDetail() {
|
|
||||||
API_Setting.smsSignDetail(id.value).then((res) => {
|
|
||||||
loading.value = false;
|
|
||||||
if (res.success) {
|
|
||||||
form.value = res.result;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
init();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
|
||||||
.sign-name {
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-left: 20px;
|
|
||||||
font-size: 16px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.div-remark {
|
|
||||||
margin-left: 100px;
|
|
||||||
margin-bottom: 2px;
|
|
||||||
color: #999;
|
|
||||||
}
|
|
||||||
|
|
||||||
.div-remark-first {
|
|
||||||
margin-top: -17px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.div-remark-bottom {
|
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
margin-left: 100px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -2539,7 +2539,6 @@ function save() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
baseInfoForm.value.salesModel = "RETAIL";
|
baseInfoForm.value.salesModel = "RETAIL";
|
||||||
baseInfoForm.value.wholesaleList = [];
|
|
||||||
|
|
||||||
// 判断是否是复制商品(复制商品时不复用原有 goodsId,重新生成)
|
// 判断是否是复制商品(复制商品时不复用原有 goodsId,重新生成)
|
||||||
if (!route.query.copyId) {
|
if (!route.query.copyId) {
|
||||||
@@ -2550,7 +2549,6 @@ function save() {
|
|||||||
syncIntroFromEditors();
|
syncIntroFromEditors();
|
||||||
let submit = JSON.parse(JSON.stringify(baseInfoForm.value));
|
let submit = JSON.parse(JSON.stringify(baseInfoForm.value));
|
||||||
submit.salesModel = "RETAIL";
|
submit.salesModel = "RETAIL";
|
||||||
submit.wholesaleList = [];
|
|
||||||
|
|
||||||
// 5. 商品主图相册校验
|
// 5. 商品主图相册校验
|
||||||
if (
|
if (
|
||||||
@@ -3357,51 +3355,6 @@ onBeforeUnmount(() => {
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wholesale-rule-form-item {
|
|
||||||
width: 100% !important;
|
|
||||||
min-width: 900px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-preview-table {
|
|
||||||
width: 480px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-preview-table :deep(.el-table__cell .cell) {
|
|
||||||
overflow: visible;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-rule-form-item :deep(.el-form-item__content) {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-num-input {
|
|
||||||
width: 190px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-num-input :deep(.el-input__wrapper) {
|
|
||||||
min-width: 140px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-price-cell {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-price-input {
|
|
||||||
width: 190px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.wholesale-price-del {
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
margin-left: 100px;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 单/多规格切换与单规格表格样式 */
|
/* 单/多规格切换与单规格表格样式 */
|
||||||
.spec-mode-switch-bar {
|
.spec-mode-switch-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ const ALL_COMPONENT_DEFINITIONS = [
|
|||||||
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
||||||
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
||||||
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
||||||
{ title: '品质生活 · 限时第2件半价', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
{ title: '品质生活 · 精选好物', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
defaultComponentStyle: {
|
defaultComponentStyle: {
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ const brandList = computed(() => {
|
|||||||
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
{ title: '数码潮玩 · 爆款立减500', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_1.png', url: '/goodsList?category=1' },
|
||||||
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
{ title: '美妆奢宠 · 每满300减50', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_2.png', url: '/goodsList?category=2' },
|
||||||
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
{ title: '运动潮品 · 爆款低至5折', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_3.png', url: '/goodsList?category=3' },
|
||||||
{ title: '品质生活 · 限时第2件半价', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
{ title: '品质生活 · 精选好物', img: 'https://lilishop-pc.oss-cn-beijing.aliyuncs.com/static/brand-wall/brand_4.png', url: '/goodsList?category=4' }
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user