From 21e8dbf985ece78b84a0172af419bbfcd60a4f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=BD=E6=97=A5=E6=99=9A=E9=A3=8E?= <1811466536@qq.com> Date: Fri, 22 Dec 2023 18:04:29 +0800 Subject: [PATCH 01/11] =?UTF-8?q?=E6=BB=A1=E5=87=8F=E9=80=81=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.dev | 5 +- .../mall/promotion/reward/rewardActivity.ts | 44 ++++++ src/utils/constants.ts | 6 +- .../promotion/rewardActivity/RewardForm.vue | 146 ++++++++++++++---- .../mall/promotion/rewardActivity/index.vue | 38 ++--- 5 files changed, 182 insertions(+), 57 deletions(-) create mode 100644 src/api/mall/promotion/reward/rewardActivity.ts diff --git a/.env.dev b/.env.dev index 21ffa920..610924b8 100644 --- a/.env.dev +++ b/.env.dev @@ -4,7 +4,8 @@ NODE_ENV=development VITE_DEV=true # 请求路径 -VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' +# VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' +VITE_BASE_URL='http://dofast.demo.huizhizao.vip:20001' # 上传路径 VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' @@ -34,4 +35,4 @@ VITE_OUT_DIR=dist VITE_MALL_H5_DOMAIN='http://mall.yudao.iocoder.cn' # 验证码的开关 -VITE_APP_CAPTCHA_ENABLE=false +VITE_APP_CAPTCHA_ENABLE=true diff --git a/src/api/mall/promotion/reward/rewardActivity.ts b/src/api/mall/promotion/reward/rewardActivity.ts new file mode 100644 index 00000000..50c33564 --- /dev/null +++ b/src/api/mall/promotion/reward/rewardActivity.ts @@ -0,0 +1,44 @@ +import request from '@/config/axios' + +export interface DiscountActivityVO { + id?:number, + name?: string + startTime?:Date + endTime?:Date + remark?:string + conditionType?:number + productScope?:number + productSpuIds?:number[] + rules?:DiscountProductVO[] +} +//优惠规则 +export interface DiscountProductVO { + limit: number + discountPrice: number + freeDelivery: boolean + point: number + couponIds: number[] + couponCounts: number[] +} + + +// 新增满减送活动 +export const createRewardActivity = async (data: DiscountActivityVO) => { + return await request.post({ url: '/promotion/reward-activity/create', data }) +} +// 更新满减送活动 +export const updateRewardActivity = async (data: DiscountActivityVO) => { + return await request.put({ url: '/promotion/reward-activity/update', data }) +} +// 查询满减送活动列表 +export const getRewardActivityPage = async (params) => { + return await request.get({ url: '/promotion/reward-activity/page', params }) +} +// 查询满减送活动详情 +export const getReward = async (id:number) => { + return await request.get({ url: '/promotion/reward-activity/get?id='+id, }) +} +// 删除限时折扣活动 +export const deleteRewardActivity = async (id: number) => { + return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id }) +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 41891a4a..d3d0fd45 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -244,15 +244,15 @@ export const CouponTemplateTakeTypeEnum = { */ export const PromotionProductScopeEnum = { ALL: { - scope: 1, + scope: 10, name: '通用劵' }, SPU: { - scope: 2, + scope: 20, name: '商品劵' }, CATEGORY: { - scope: 3, + scope: 30, name: '品类劵' } } diff --git a/src/views/mall/promotion/rewardActivity/RewardForm.vue b/src/views/mall/promotion/rewardActivity/RewardForm.vue index 18827014..716f4e26 100644 --- a/src/views/mall/promotion/rewardActivity/RewardForm.vue +++ b/src/views/mall/promotion/rewardActivity/RewardForm.vue @@ -30,7 +30,36 @@ - + + 添加活动层级 @@ -78,7 +107,7 @@ import { getSpuSimpleList } from '@/api/mall/product/spu' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { CommonStatusEnum } from '@/utils/constants' -import * as ProductBrandApi from '@/api/mall/product/brand' +import * as RewardActivityApi from '@/api/mall/promotion/reward/rewardActivity' import { PromotionConditionTypeEnum, PromotionProductScopeEnum, @@ -112,8 +141,19 @@ const formData = ref({ remark: undefined, productScope: PromotionProductScopeEnum.ALL.scope, productSpuIds: undefined, - rules: undefined + rules: [{ + limit: undefined, + discountPrice: undefined, + freeDelivery: undefined, + point: undefined, + couponIds: [], + couponCounts: [] + }], }) +// 优惠设置 +let rules=reactive([]); +// 优惠券列表 + const formRules = reactive({ name: [{ required: true, message: '活动名称不能为空', trigger: 'blur' }], startAndEndTime: [{ required: true, message: '活动时间不能为空', trigger: 'blur' }], @@ -121,7 +161,7 @@ const formRules = reactive({ productScope: [{ required: true, message: '商品范围不能为空', trigger: 'blur' }], productSpuIds: [{ required: true, message: '商品范围不能为空', trigger: 'blur' }] }) -const formRef = ref() // 表单 Ref +const formRef = ref([]) // 表单 Ref /** 打开弹窗 */ const open = async (type: string, id?: number) => { @@ -133,19 +173,23 @@ const open = async (type: string, id?: number) => { if (id) { formLoading.value = true try { - // formData.value = await ProductBrandApi.getBrand(id) - formData.value = { - conditionType: 10, - description: '', - id: undefined, - name: '测试活动', - picUrl: '', - productScope: 2, - productSpuIds: [634], - remark: '测试备注', - startAndEndTime: [new Date(), new Date('2023-12-31')], - status: 0 + let data= await RewardActivityApi.getReward(id); + data.startAndEndTime=[new Date(data.startTime), new Date(data.endTime)]; + rules.splice(0,rules.length); + data.rules.forEach((item)=>{ + let ars:string[]=reactive([]); + if(item.freeDelivery){ + ars.push('包邮') } + if(item.point){ + ars.push('送积分') + } + if(item.discountPrice){ + ars.push('订单金额优惠') + } + rules.push(ars) + }) + formData.value=data } finally { formLoading.value = false } @@ -160,18 +204,33 @@ const submitForm = async () => { if (!formRef) return const valid = await formRef.value.validate() if (!valid) return - console.log(formData.value) - message.success('已在控制台打印数据') - return + // 处理下数据兼容接口 + formData.value.startTime= +new Date(formData.value.startAndEndTime[0]) + formData.value.endTime=+new Date(formData.value.startAndEndTime[1]) + console.log(rules) + rules.forEach((item,index)=>{ + if(item.includes('包邮')){ + formData.value.rules[index].freeDelivery=true; + }else{ + formData.value.rules[index].freeDelivery=false; + } + if(!item.includes('送积分')){ + formData.value.rules[index].point=undefined; + } + if(!item.includes('订单金额优惠')){ + formData.value.rules[index].discountPrice=undefined; + } + }) + // 提交请求 formLoading.value = true try { - const data = formData.value as ProductBrandApi.BrandVO + const data = formData.value as RewardActivityApi.DiscountActivityVO if (formType.value === 'create') { - await ProductBrandApi.createBrand(data) + await RewardActivityApi.createRewardActivity(data) message.success(t('common.createSuccess')) } else { - await ProductBrandApi.updateBrand(data) + await RewardActivityApi.updateRewardActivity(data) message.success(t('common.updateSuccess')) } dialogVisible.value = false @@ -182,15 +241,50 @@ const submitForm = async () => { } } +const addStratum =()=>{ + formData.value.rules.push({ + limit: undefined, + discountPrice: undefined, + freeDelivery: undefined, + point: undefined, + couponIds: [], + couponCounts: [] + }) + rules.push([]); + console.log(rules) +} + +const deleteStratum=(index)=>{ + formData.value.rules.splice(index,1) + rules.splice(index,1) +} + /** 重置表单 */ const resetForm = () => { formData.value = { id: undefined, - name: '', - picUrl: '', - status: CommonStatusEnum.ENABLE, - description: '' + name: undefined, + startAndEndTime: undefined, + startTime: undefined, + endTime: undefined, + conditionType: PromotionConditionTypeEnum.PRICE.type, + remark: undefined, + productScope: PromotionProductScopeEnum.ALL.scope, + productSpuIds: undefined, + rules: [{ + limit: undefined, + discountPrice: undefined, + freeDelivery: undefined, + point: undefined, + couponIds: [], + couponCounts: [] + }], } + rules.splice(0,rules.length); + rules.push(reactive([])); + // 解决下有时刷新页面第一次点编辑报错 + nextTick(()=>{ formRef.value?.resetFields() + }) } diff --git a/src/views/mall/promotion/rewardActivity/index.vue b/src/views/mall/promotion/rewardActivity/index.vue index 7a05c9fc..86f91fea 100644 --- a/src/views/mall/promotion/rewardActivity/index.vue +++ b/src/views/mall/promotion/rewardActivity/index.vue @@ -65,13 +65,13 @@ @@ -123,6 +123,7 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' import * as ProductBrandApi from '@/api/mall/product/brand' +import * as RewardActivityApi from '@/api/mall/promotion/reward/rewardActivity' import RewardForm from './RewardForm.vue' defineOptions({ name: 'PromotionRewardActivity' }) @@ -146,22 +147,7 @@ const queryFormRef = ref() // 搜索的表单 const getList = async () => { loading.value = true try { - // const data = await ProductBrandApi.getBrandParam(queryParams) - const data = { - list: [ - { - createTime: 1693463998000, - description: '', - id: 3, - name: '索尼', - picUrl: - 'http://127.0.0.1:48080/admin-api/infra/file/4/get/f5b7a536306cd1180a42a2211a8212dc23de6b949d30c30d036caa063042f928.png', - sort: [+new Date(), +new Date('2023-12-31')], - status: 10 - } - ], - total: 1 - } + const data = await RewardActivityApi.getRewardActivityPage(queryParams) list.value = data.list total.value = data.total } finally { @@ -171,16 +157,16 @@ const getList = async () => { /** 搜索按钮操作 */ const handleQuery = () => { - console.log(queryParams) - message.success('已打印搜索参数') - return + // console.log(queryParams) + // message.success('已打印搜索参数') + // return getList() } /** 重置按钮操作 */ const resetQuery = () => { - message.success('重置查询表单获取数据') - return + // message.success('重置查询表单获取数据') + // return queryFormRef.value.resetFields() handleQuery() } @@ -196,10 +182,10 @@ const handleDelete = async (id: number) => { try { // 删除的二次确认 await message.delConfirm() - message.success('您以确认删除') - return + // message.success('您以确认删除') + // return // 发起删除 - await ProductBrandApi.deleteBrand(id) + await RewardActivityApi.deleteRewardActivity(id) message.success(t('common.delSuccess')) // 刷新列表 await getList() From 7fd564307d3bef974f2a0c99632e5020f38fda98 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Thu, 4 Jan 2024 12:10:01 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=9A?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E4=B8=80=E4=B8=AA=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=80=89=E6=8B=A9=E4=B8=8A=E4=BC=A0=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E4=B8=AA=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=A4=B1=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UploadFile/src/UploadFile.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index ce207a88..a0ef08d6 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -100,7 +100,9 @@ const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => { // 文件上传成功 const handleFileSuccess: UploadProps['onSuccess'] = (res: any): void => { message.success('上传成功') - fileList.value.shift() + // 删除自身 + const index = fileList.value.findIndex((item) => item.response?.data === res.data) + fileList.value.splice(index, 1) uploadList.value.push({ name: res.data, url: res.data }) if (uploadList.value.length == uploadNumber.value) { fileList.value.push(...uploadList.value) @@ -144,6 +146,7 @@ watch( fileList.value.push( ...val.split(',').map((url) => ({ name: url.substring(url.lastIndexOf('/') + 1), url })) ) + return } // 情况2:数组 fileList.value.push( From d36c4ab36cebed14100d8eb72c4bb5cf2726ed01 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 5 Jan 2024 22:46:22 +0800 Subject: [PATCH 03/11] =?UTF-8?q?=E2=9C=A8=20MALL=EF=BC=9A=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=88=86=E9=94=80=E6=8F=90=E7=8E=B0=E7=9A=84=E9=93=B6?= =?UTF-8?q?=E8=A1=8C=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/trade/config/index.ts | 1 - src/components/AppLinkInput/data.ts | 4 ---- src/views/mall/trade/config/index.vue | 13 ------------- 3 files changed, 18 deletions(-) diff --git a/src/api/mall/trade/config/index.ts b/src/api/mall/trade/config/index.ts index 66a81147..43fdbdf1 100644 --- a/src/api/mall/trade/config/index.ts +++ b/src/api/mall/trade/config/index.ts @@ -8,7 +8,6 @@ export interface ConfigVO { brokerageFirstPercent: number brokerageSecondPercent: number brokerageWithdrawMinPrice: number - brokerageBankNames: string brokerageFrozenDays: number brokerageWithdrawTypes: string } diff --git a/src/components/AppLinkInput/data.ts b/src/components/AppLinkInput/data.ts index 36412565..1916e083 100644 --- a/src/components/AppLinkInput/data.ts +++ b/src/components/AppLinkInput/data.ts @@ -181,10 +181,6 @@ export const APP_LINK_GROUP_LIST = [ { name: '充值记录', path: '/pages/pay/recharge-log' - }, - { - name: '申请提现', - path: '/pages/pay/withdraw' } ] }, diff --git a/src/views/mall/trade/config/index.vue b/src/views/mall/trade/config/index.vue index 48d04e08..0829345e 100644 --- a/src/views/mall/trade/config/index.vue +++ b/src/views/mall/trade/config/index.vue @@ -186,17 +186,6 @@ 商城开通提现的付款方式 - - - - - 商城开通提现的银行列表 - @@ -232,7 +221,6 @@ const formData = ref({ brokerageSecondPercent: 0, brokerageWithdrawMinPrice: 0, brokerageWithdrawFeePercent: 0, - brokerageBankNames: [], brokerageFrozenDays: 0, brokerageWithdrawTypes: [] }) @@ -246,7 +234,6 @@ const formRules = reactive({ { required: true, message: '用户提现最低金额不能为空', trigger: 'blur' } ], brokerageWithdrawFeePercent: [{ required: true, message: '提现手续费不能为空', trigger: 'blur' }], - brokerageBankNames: [{ required: true, message: '提现银行不能为空', trigger: 'blur' }], brokerageFrozenDays: [{ required: true, message: '佣金冻结时间不能为空', trigger: 'blur' }], brokerageWithdrawTypes: [ { From 17be1abb65cfaf5166bb62e8335d86b1a86a6674 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 6 Jan 2024 12:29:35 +0800 Subject: [PATCH 04/11] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/crm/customer/index.ts | 16 ++- src/api/crm/permission/index.ts | 12 -- .../OperateLogV2/src/OperateLogV2.vue | 87 ++----------- .../customer/detail/CustomerDetailsHeader.vue | 45 +------ src/views/crm/customer/detail/index.vue | 96 ++++++++++++--- src/views/crm/customer/index.vue | 115 +++++++++++++++--- .../permission/components/PermissionList.vue | 14 ++- 7 files changed, 209 insertions(+), 176 deletions(-) diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts index a025e346..cfc3613f 100644 --- a/src/api/crm/customer/index.ts +++ b/src/api/crm/customer/index.ts @@ -69,11 +69,23 @@ export const queryAllList = async () => { } // 查询客户操作日志 -export const getOperateLogPage = async (params: any) => { - return await request.get({ url: '/crm/customer/operate-log-page', params }) +export const getOperateLogPage = async (id: number) => { + return await request.get({ url: '/crm/customer/operate-log-page?id=' + id }) } +//======================= 业务操作 ======================= + // 锁定/解锁客户 export const lockCustomer = async (id: number, lockStatus: boolean) => { return await request.put({ url: `/crm/customer/lock`, data: { id, lockStatus } }) } + +// 领取公海客户 +export const receive = async (ids: any[]) => { + return await request.put({ url: '/crm/customer/receive', params: { ids: ids.join(',') } }) +} + +// 客户放入公海 +export const putPool = async (id: number) => { + return await request.put({ url: `/crm/customer/put-pool?id=${id}` }) +} diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts index c221b089..9a098b81 100644 --- a/src/api/crm/permission/index.ts +++ b/src/api/crm/permission/index.ts @@ -58,15 +58,3 @@ export const deletePermissionBatch = async (params) => { export const deleteSelfPermission = async (id) => { return await request.delete({ url: '/crm/permission/quit-team?id=' + id }) } - -// TODO @puhui999:调整下位置 -// 领取公海数据 -export const receive = async (data: { bizType: number; bizId: number }) => { - return await request.put({ url: `/crm/permission/receive`, data }) -} - -// TODO @puhui999:调整下位置 -// 数据放入公海 -export const putPool = async (data: { bizType: number; bizId: number }) => { - return await request.put({ url: `/crm/permission/put-pool`, data }) -} diff --git a/src/components/OperateLogV2/src/OperateLogV2.vue b/src/components/OperateLogV2/src/OperateLogV2.vue index e3409276..e3b00e2e 100644 --- a/src/components/OperateLogV2/src/OperateLogV2.vue +++ b/src/components/OperateLogV2/src/OperateLogV2.vue @@ -2,36 +2,14 @@
- - - ======================= - {{ log.userName }} - {{ log.title }} - ======================= - - - - + {{ log.userName }} + {{ log.action }}