From 31d8d1ff19018d624d3bf8e3b6b8bad41ce3c5cb Mon Sep 17 00:00:00 2001 From: "@QQNZX" Date: Mon, 4 Mar 2024 15:54:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/EventMarketing/activeNewlyweds.js | 2 +- .../src/api/EventMarketing/activeRecommend.js | 5 +- fuintAdmin/src/api/EventMarketing/yijian.js | 10 +- .../EventMarketing/activeNewlyweds/index.vue | 1 + .../EventMarketing/activeRecommend/index.vue | 574 +++++++++++++----- .../EventMarketing/yijiancoupon/index.vue | 204 +++++-- 6 files changed, 565 insertions(+), 231 deletions(-) diff --git a/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js b/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js index 478a908ff..3f2c7ea26 100644 --- a/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js +++ b/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js @@ -54,7 +54,7 @@ export function updateActiveNewlyweds(data) { // 删除新人有礼活动 export function delActiveNewlyweds(id) { return request({ - url: '/business/marketingActivity/activeNewlyweds/' + id, + url: '/business/marketingActivity/activeNewlyweds/delById/' + id, method: 'delete' }) } diff --git a/fuintAdmin/src/api/EventMarketing/activeRecommend.js b/fuintAdmin/src/api/EventMarketing/activeRecommend.js index a8bee6817..f3c4d298f 100644 --- a/fuintAdmin/src/api/EventMarketing/activeRecommend.js +++ b/fuintAdmin/src/api/EventMarketing/activeRecommend.js @@ -8,6 +8,7 @@ export function listActiveRecommend(query) { params: query }) } + //优惠券 export function listFavorable(query) { return request({ @@ -52,7 +53,7 @@ export function addActiveRecommend(data) { export function updateActiveRecommend(data) { return request({ url: 'business/marketingActivity/activeRecommend', - method: 'post', + method: 'put', data: data }) } @@ -60,7 +61,7 @@ export function updateActiveRecommend(data) { // 删除推荐有礼 export function delActiveRecommend(id) { return request({ - url: '/business/marketingActivity/activeRecommend/' + id, + url: '/business/marketingActivity/activeRecommend/delById/' + id, method: 'delete' }) } diff --git a/fuintAdmin/src/api/EventMarketing/yijian.js b/fuintAdmin/src/api/EventMarketing/yijian.js index 00caec967..d3c707cfe 100644 --- a/fuintAdmin/src/api/EventMarketing/yijian.js +++ b/fuintAdmin/src/api/EventMarketing/yijian.js @@ -3,7 +3,7 @@ import request from '@/utils/request' export function issueCardFavorable(data) { return request({ - url: 'business/marketingActivity/cardFavorableRecord/issueCardFavorable', + url: 'business/marketingActivity/oneActiveOneCoupon', method: 'post', data:data }) @@ -15,3 +15,11 @@ export function getCardFavorableLists(status) { params: status }) } +export function getAdaptUserList(data) { + + return request({ + url: 'business/marketingActivity/cardFavorableRecord/getAdaptUserList', + method: 'post', + data: data + }) +} diff --git a/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue b/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue index 7e45c4871..b2449058a 100644 --- a/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeNewlyweds/index.vue @@ -219,6 +219,7 @@ +
+ + + + + + + + + + + + + + + + + + + 搜索 - -
- 推荐有礼 + + + + + 新增 + + + + + + + + + + + + + + + + + + + + + + + + -
- + + + + + + +
+ + + + + + + + + + {{city.text}} -
赠送卡券
新增
- -
@@ -172,110 +272,15 @@
- - - 优惠券 - - + -
-
新用户获得
新增
-
- - - - - - - - - - - - - - - - - - - - - -
+
+
新用户获得
选择活动
+
+
活动名称:{{ruleForm.activeNewName}}
+ +
- - - - @@ -293,7 +298,95 @@ - + + + +
+ + 搜索 + +
+ + + + + + + + + + + + + +
+
+ +
+
+
优惠券数量统计
+
总数量: {{statisticsyou.count ||0}}
+
已使用数量: {{statisticsyou.countEd ||0}}
+
未使用数量: {{statisticsyou.countLd ||0}}
+
+
+
兑换券数量统计
+
总数量: {{statisticsyou.counts ||0}}
+
已使用数量: {{statisticsyou.countEds ||0}}
+
未使用数量: {{statisticsyou.countLds ||0}}
+
+
+ + + + + + + + + + +
@@ -487,7 +580,6 @@ -
@@ -495,10 +587,16 @@ import { listActiveRecommend, getActiveRecommend, delActiveRecommend, addActiveRecommend, updateActiveRecommend,listFavorable,listExchange } from "@/api/EventMarketing/activeRecommend"; import ImageUpload from '@/components/ImageUpload' import {getToken} from "@/utils/auth"; +import {getActiveNewlyweds, listActiveNewlyweds, updateActiveNewlyweds} from "@/api/EventMarketing/activeNewlyweds"; +import {looklook, looklooklook} from "@/api/EventMarketing/activeConsumption"; export default { name: "ActiveRecommend", data() { return { + opendetails:false, + looklist:[], + statisticsyou:{}, + xzshow:false, //请求优惠券 - 新人 列表时的参数 xyouhuiquan:{ name:'', @@ -520,6 +618,11 @@ export default { pageSize: 10, total:0 }, + zquerys: { + pageNum: 1, + pageSize: 10, + total:0 + }, dtotal:0, imagePath:process.env.VUE_APP_SERVER_URL, // 上传地址 @@ -533,8 +636,15 @@ export default { xdialogTableVisible:false, dialogTableVisible:false,//优惠券 dialogTableVisibledh:false,//兑换券 + huodonglist:[], + huodongname:'', + huodongquerys: { + pageNum: 1, + pageSize: 10, + }, + huodongshow:false, ruleForm: { - id:1, + id:null, activePictureUrl: '', titleUrl:'', ylist:[], @@ -546,6 +656,8 @@ export default { growthValue:'', region: '', activeConsumptionChildList:[], + activeNewName:'', + activeNewId:'', }, xylist:[], @@ -557,6 +669,7 @@ export default { ], ylist:[], dlist:[], + zList:[], // 遮罩层 loading: true, // 选中数组 @@ -577,9 +690,10 @@ export default { open: false, // 查询参数 queryParams: { + activeName:null, pageNum: 1, pageSize: 10, - id:1, + id:null, chainStoreId: null, storeId: null, activePictureUrl: null, @@ -595,12 +709,17 @@ export default { isonline: null, }, // 表单参数 - form: {}, + form: { + activeName:'', + }, // 表单校验 rules: { /*activePictureUrl: [ { required: true, message: '必填项不能为空', trigger: 'blur' }, ],*/ + activeName: [ + { required: true, message: '必填项不能为空', trigger: 'blur' }, + ], inviterGiftType: [ { required: true, message: '必填项不能为空', trigger: 'blur' }, ], @@ -626,13 +745,34 @@ export default { }; }, created() { - this.getList(); + this.getactivelist() + // this.getList(); }, components:{ ImageUpload }, methods: { + addActivef(){ + this.ruleForm ={ + id:null, + activePictureUrl: '', + titleUrl:'', + ylist:[], + dlist:[], + xylist:[], + inviterGiftType:[], + name: '', + points:'', + growthValue:'', + region: '', + activeConsumptionChildList:[], + activeNewName:'', + activeNewId:'', + + }, + this.xzshow = true + }, // 图片上传成功 handleUploadSuccess(file) { console.log('图片上传成功',file) @@ -644,10 +784,18 @@ export default { this.ruleForm.titleUrl = file.data.fileName }, - + getactivelist(){ + this.loading = true; + listActiveRecommend(this.queryParams).then(res=>{ + console.log(res) + this.zList = res.data.records + this.total = res.data.total + this.loading = false; + }) + }, /** 查询推荐有礼列表 */ getList() { - this.loading = true; + // this.loading = true; getActiveRecommend(1).then(response => { this.ruleForm = response.data this.ruleForm.xylist = response.data.activeRecommendChildList.filter(item => item.giftUserType == '1') @@ -656,7 +804,7 @@ export default { console.log( "1", this.ruleForm.xylist)//优惠券数组 新用户获得 console.log( "2",this.ruleForm.ylist)// 优惠券数组 console.log( "3",this.ruleForm.dlist)//兑换券数组 - this.loading = false; + }); }, @@ -671,6 +819,15 @@ export default { } }) }, + // 新人活动列表 + gethuodonglist(){ + listActiveNewlyweds(this.zquerys).then(res=>{ + this.huodongshow = true + this.huodonglist = res.data.records + + console.log(res) + }) + }, // 请求优惠券 getlistFavorable(){ this.ylist = [] @@ -726,6 +883,16 @@ export default { this.ruleForm.dlist.push(data) this.$message.success("新增成功") }, + huodongxz(row){ + console.log(row) + this.ruleForm.activeNewName = row.name + this.ruleForm.activeNewId = row.id + this.huodongshow = false + }, + scxrhd(){ + this.ruleForm.activeNewName = null + this.ruleForm.activeNewId = null + }, //优惠券 新用户 chosedataxyh(row){ this.xdialogTableVisible = false @@ -765,7 +932,6 @@ export default { } this.pdidlist.push(row.id) - let data ={ giftUserType:0,//邀请人获得 activeGift: 1, //活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物 @@ -837,6 +1003,21 @@ export default { } }, + lookDetail(row){ + this.opendetails = true + let data = { + id:row.id + } + looklook(data).then(res=>{ + this.looklist = res.data + + console.log('详情',res) + }) + looklooklook(row.id).then(resp=>{ + this.statisticsyou = resp.data + console.log('优惠券详情统计',resp) + }) + }, // 取消按钮 cancel() { this.open = false; @@ -844,8 +1025,10 @@ export default { }, // 表单重置 reset() { - this.form = { - id: 1, + + this.ruleForm = { + id: null, + activeName:null, chainStoreId: null, storeId: null, activePictureUrl: null, @@ -865,7 +1048,7 @@ export default { activeRecommendChildList:[], updateTime: null }; - this.resetForm("form"); + // this.resetForm("form"); }, /** 搜索按钮操作 */ handleQuery() { @@ -891,47 +1074,95 @@ export default { }, /** 修改按钮操作 */ handleUpdate(row) { - this.reset(); + this.ruleForm ={ + id:null, + activePictureUrl: '', + titleUrl:'', + ylist:[], + dlist:[], + xylist:[], + inviterGiftType:[], + name: '', + points:'', + growthValue:'', + region: '', + activeConsumptionChildList:[], + + } const id = row.id || this.ids + // getActiveRecommend(id).then(response => { + // this.form = response.data; + // this.xzshow = true; + // this.title = "修改推荐有礼"; + // }); getActiveRecommend(id).then(response => { - this.form = response.data; - this.open = true; - this.title = "修改推荐有礼"; + this.ruleForm = response.data + this.xzshow = true; + if(response.data.activeRecommendChildList){ + this.ruleForm.xylist = response.data.activeRecommendChildList.filter(item => item.giftUserType == '1') + this.ruleForm.ylist = response.data.activeRecommendChildList.filter(item => { return item.activeGift === '1' && item.giftUserType=== '0'; }) + this.ruleForm.dlist = response.data.activeRecommendChildList.filter(item => item.activeGift == '2') + } + + + + }); + }, + handleDeletexia(row){ + getActiveRecommend(row.id).then(response => { + + let data = response.data + data.isonline = 1 + updateActiveRecommend(data).then(response => { + this.$modal.msgSuccess("下线成功"); + + this.getactivelist() + }); + }); }, /** 提交按钮 */ submitForm() { this.ruleForm.activeRecommendChildList = this.ruleForm.ylist.concat(this.ruleForm.dlist,this.ruleForm.xylist); - console.log(this.ruleForm.activeRecommendChildList) - console.log(this.ruleForm) - this.ruleForm.id = 1 + + // this.ruleForm.id = 1 this.$refs["ruleForm"].validate(valid => { if (valid) { - if (this.ruleForm.id != null) { - updateActiveRecommend(this.ruleForm).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - addActiveRecommend(this.ruleForm).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } + if(this.ruleForm.id ){ + console.log(this.ruleForm.id,'修改') + updateActiveRecommend(this.ruleForm).then(response => { + this.$modal.msgSuccess("修改成功"); + this.xzshow = false; + this.getactivelist() + }); + }else { + console.log(this.ruleForm.id,'新增') + addActiveRecommend(this.ruleForm).then(response => { + this.$modal.msgSuccess("新增成功"); + this.xzshow = false; + this.getactivelist() + }); + } + // if (this.ruleForm.id != '') { + // console.log(this.ruleForm.id,'新增') + + // + // } else { + // console.log(this.ruleForm.id,'修改') + + // } } }); }, /** 删除按钮操作 */ - handleDelete(row) { + Deleteshan(row) { const ids = row.id || this.ids; this.$modal.confirm('是否确认删除推荐有礼编号为"' + ids + '"的数据项?').then(function() { return delActiveRecommend(ids); }).then(() => { - this.getList(); + this.getactivelist() this.$modal.msgSuccess("删除成功"); }).catch(() => {}); }, @@ -949,8 +1180,21 @@ export default { width: 100%; height: 100%; } +.box-bt{ + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; +} .appconter{ box-sizing: border-box; padding: 15px; } +.x-box{ + background: #f9f9f9; + border-radius: 6px; + box-sizing: border-box; + padding: 15px; + width: 45%; +} diff --git a/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue b/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue index a977c6c62..83536cb62 100644 --- a/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue +++ b/fuintAdmin/src/views/EventMarketing/yijiancoupon/index.vue @@ -2,7 +2,6 @@
- - - 搜索 @@ -55,7 +52,6 @@ - - + + + + + - - + + @@ -78,10 +78,37 @@
(查找最近N天未进行消费的用户)
- + +
+ + + + + + + + + + +
-
赠送卡券
新增
+
赠送优惠券
新增
+ > + >