From 182b95d5229cc97e5a67d3166d8936c33bab5778 Mon Sep 17 00:00:00 2001 From: cun-nan <19819293608@163.com> Date: Thu, 29 Aug 2024 09:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/EventMarketing/activeNewlyweds.js | 8 + .../activeConsumption/index.vue | 4 +- .../EventMarketing/activeNewlyweds/index.vue | 1439 ++++++++++------- 3 files changed, 837 insertions(+), 614 deletions(-) diff --git a/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js b/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js index 3222b39d5..21e384389 100644 --- a/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js +++ b/fuintAdmin/src/api/EventMarketing/activeNewlyweds.js @@ -68,3 +68,11 @@ export function delActiveNewlyweds(id) { method: 'delete' }) } + +// 删除新人有礼活动 +export function getInfoActiveNewlyweds() { + return request({ + url: '/business/marketingActivity/activeNewlyweds/getInfo', + method: 'get' + }) +} diff --git a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue index 1896be5a1..d9af066c9 100644 --- a/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue +++ b/fuintAdmin/src/views/EventMarketing/activeConsumption/index.vue @@ -681,7 +681,7 @@ type="date" placeholder="开始日期"> - 至 + - +
- - - 首页 - 活动中心 - 新人有礼 - - +
+ + + + + + + + - -
+ + + + + + + + + -
- - - - - - - - - - - - - - 搜索 - 重置 + + + + + + + + + + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ -
- + + + +
+
+ + + {{ item }} +
+ + + + +
-
- - - - - - - - - - - - - - - - - 赠送优惠券 - 赠送兑换券 - - - -
-
赠送卡券
新增
-
- - - - - - - - - - - - - - - - - - - - - + +
+ 编辑
-
- -
-
选择兑换券
新增
-
+ + + + + + +
+
+ +
+ 赠送积分 +
+
+ 赠送成长值 +
+
+ 赠送优惠券 + +
+
+
+
+
+
赠送
+ + + +
- - - - - - - - - - - - - - - - - - - - - +
+
赠送
+ + + +
+
+ 赠送 + + + + + + + + + +
+
-
- - - - + + 重置 + 保存 - -
- -
- -
- - - - -
- 保存 - -
- - - - - - 新增 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - 搜索 -
- - - - - - - - - - - - - - - - - -
-
- - -
- - 搜索 -
- - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
优惠券数量统计
-
总数量: {{statisticsyou.count ||0}}
-
已使用数量: {{statisticsyou.countEd ||0}}
-
未使用数量: {{statisticsyou.countLd ||0}}
-
-
-
兑换券数量统计
-
总数量: {{statisticsyou.counts ||0}}
-
已使用数量: {{statisticsyou.countEds ||0}}
-
未使用数量: {{statisticsyou.countLds ||0}}
-
-
- - - - - - - - - - -
- -
-
-
- - - 取 消 - 确 定 - -
+
@@ -535,7 +646,7 @@ import { addActiveNewlyweds, updateActiveNewlyweds, huiActiveNewlyweds, - editActiveNewlyweds + editActiveNewlyweds, getInfoActiveNewlyweds } from "@/api/EventMarketing/activeNewlyweds"; import {getoilName, listExchange, listFavorable, looklook, looklooklook} from "@/api/EventMarketing/activeConsumption"; import QRCode from "qrcodejs2"; @@ -550,34 +661,34 @@ export default { name: "ActiveNewlyweds", data() { return { - opendetails:false, - looklist:[], - statisticsyou:{}, - labelPosition:'left', - loadingdialog:false, - centerDialogVisible:false, - pdidlist:[],//判断优惠券id - pddhidlist:[],//判断兑换券id + opendetails: false, + looklist: [], + statisticsyou: {}, + labelPosition: 'left', + loadingdialog: false, + centerDialogVisible: false, + pdidlist: [],//判断优惠券id + pddhidlist: [],//判断兑换券id tableData: [],//优惠券 - tableDatadh:[],//兑换券 - dialogTableVisible:false,//优惠券 - dialogTableVisibledh:false,//兑换券 - tableDatas:[], + tableDatadh: [],//兑换券 + dialogTableVisible: false,//优惠券 + dialogTableVisibledh: false,//兑换券 + tableDatas: [], //请求优惠券列表时的参数 - youhuiquan:{ - name:'', + youhuiquan: { + name: '', pageNum: 1, pageSize: 10, }, - ytotal:0, + ytotal: 0, //请求兑换券列表时的参数 - duihuanquan:{ - name:'', + duihuanquan: { + name: '', pageNum: 1, pageSize: 10, - total:0 + total: 0 }, - dtotal:0, + dtotal: 0, // 遮罩层 loading: true, // 选中数组 @@ -616,49 +727,119 @@ export default { activeFullminusList: [], // 表单参数 form: { - id:"", - tableDatas:[], - courtesyReward:[], - activeNewlywedsChildList:[], + id: "", + tableDatas: [], + courtesyReward: [], + activeNewlywedsChildList: [], }, + + ruleForm: { + name: '', + region: '', + date1: '', + date2: '', + delivery: false, + type: [], + resource: '', + desc: '' + }, + ifWrite: true, + tindex1: 0, + activityTimeTypeList: [ + "永久有效", "自定义" + ], + couponList: [], // 表单校验 rules: { name: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], activeStartTime: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], activeEndTime: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], courtesyReward: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], points: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], growthValue: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], remark: [ - { required: true, message: '必填项不能为空', trigger: 'blur' }, + {required: true, message: '必填项不能为空', trigger: 'blur'}, ], } }; }, created() { - this.getList() + // this.getList() + this.getInfo() }, methods: { + getInfo(){ + getInfoActiveNewlyweds().then(res => { + if (res.data) { + this.ruleForm = res.data + if (res.data.courtesyReward) this.ruleForm.courtesyReward = res.data.courtesyReward.split(",") + if (res.data.activeTimeType) this.tindex1 = res.data.activeTimeType + if (res.data.couponList) this.couponList = res.data.couponList + }else { + this.ruleForm = { + courtesyReward:[] + } + } + }) + }, + addCoupons() { + let data = { + activeGift: 0, + vouchersId: "", + giftCardTotal: "", + } + this.couponList.push(data) + }, + deleteCoupons(index) { + this.couponList.splice(index, 1); + }, + Typeindex1(index) { + this.tindex1 = index + this.ruleForm.activeTimeType = index + }, + submitRuleForm(formName) { + this.$refs[formName].validate((valid) => { + if (valid) { + if (this.ruleForm.courtesyReward) this.ruleForm.courtesyReward = this.ruleForm.courtesyReward.toString() + if (this.couponList) this.ruleForm.couponList = this.couponList + if (this.ruleForm.id) { + updateActiveNewlyweds(this.form).then(response => { + this.$modal.msgSuccess("修改成功"); + this.getInfo() + }); + }else { + addActiveNewlyweds(this.form).then(response => { + this.$modal.msgSuccess("新增成功"); + this.getInfo() + }); + } + } + }); + }, + resetForm(formName) { + this.$refs[formName].resetFields(); + this.getInfo() + }, /** 查询新人有礼活动列表 */ getList() { this.loading = true; - listActiveNewlyweds(this.queryParams).then(res=>{ + listActiveNewlyweds(this.queryParams).then(res => { this.activeFullminusList = res.data.records this.ztotal = res.data.total; - console.log('wwwwwc',res) + console.log('wwwwwc', res) this.loading = false; }) // this.loading = true; @@ -668,21 +849,21 @@ export default { // this.loading = false; // }); }, - getoilName(){ - getoilName().then(res=>{ + getoilName() { + getoilName().then(res => { console.log(res) this.oillist = res.data }) }, - addDatas(){ + addDatas() { this.open = true this.form = { - id:"", - tableDatas:[], - courtesyReward:[], - activeNewlywedsChildList:[], + id: "", + tableDatas: [], + courtesyReward: [], + activeNewlywedsChildList: [], } this.form.tableDatas = [] this.tableDatas = [] @@ -723,8 +904,8 @@ export default { activeStartTime: null, activeEndTime: null, courtesyReward: [], - tableDatas:[], - activeNewlywedsChildList:[], + tableDatas: [], + activeNewlywedsChildList: [], activeCode: null, isonline: null, status: null, @@ -745,24 +926,24 @@ export default { }, // 请求兑换券 - getlistExchange(){ + getlistExchange() { this.tableDatadh = [] - listExchange(this.duihuanquan).then(res=>{ - if(res.code==200){ + listExchange(this.duihuanquan).then(res => { + if (res.code == 200) { this.dialogTableVisibledh = true - this.tableDatadh = res.data.records + this.tableDatadh = res.data.records this.dtotal = res.data.total } }) }, // 请求优惠券 - getlistFavorable(){ + getlistFavorable() { this.tableData = [] - listFavorable(this.youhuiquan).then(res=>{ - if(res.code == 200){ + listFavorable(this.youhuiquan).then(res => { + if (res.code == 200) { this.dialogTableVisible = true - this.tableData = res.data.records + this.tableData = res.data.records this.ytotal = res.data.total } @@ -770,28 +951,28 @@ export default { }, // 兑换券券列表选择 - Favorabledata(row){ + Favorabledata(row) { this.dialogTableVisibledh = false - if(this.pddhidlist.indexOf(row.id)>-1 ){ + if (this.pddhidlist.indexOf(row.id) > -1) { this.$message.error("该兑换卡券已存在") return } this.pddhidlist.push(row.id) console.log(row) - let data ={ + let data = { activeGift: 2, //活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物 goodsIds: "", //商品id - goodsName:"" , //商品名称 + goodsName: "", //商品名称 goodsTotal: "", //商品数量 - vouchersId:row.id, //券id - giftCardName:row.name, //赠送卡券名称 + vouchersId: row.id, //券id + giftCardName: row.name, //赠送卡券名称 giftCardType: row.type, //券类型 validityZero: null, validityOne: null, - validityTwo:null, - validity:row.validity, - giftCardDetail: row.cardDetail , //券详情 + validityTwo: null, + validity: row.validity, + giftCardDetail: row.cardDetail, //券详情 giftCardTime: row.validity, //券有效期 giftCardTotal: 1, //券数量 instruction: row.useInstructions, //使用说明 @@ -801,28 +982,28 @@ export default { this.$message.success("新增成功") }, // 优惠券列表选择 - chosedata(row){ + chosedata(row) { this.dialogTableVisible = false - if(this.pdidlist.indexOf(row.id)>-1 ){ + if (this.pdidlist.indexOf(row.id) > -1) { this.$message.error("该优惠卡券已存在") return } this.pdidlist.push(row.id) - let data ={ + let data = { activeGift: 1, //活动奖品 0:赠送积分1:赠送优惠券 2. 赠送兑换券 3:赠送成长值 4. 赠送实物 goodsIds: "", //商品id - goodsName:"" , //商品名称 + goodsName: "", //商品名称 goodsTotal: "", //商品数量 - vouchersId:row.id, //券id - giftCardName:row.name, //赠送卡券名称 + vouchersId: row.id, //券id + giftCardName: row.name, //赠送卡券名称 giftCardType: row.discountType, //券类型 timeType: row.timeType, validityZero: row.validityZero, validityOne: row.validityOne, - validityTwo:row.validityTwo, - giftCardDetail: row.cardDetail , //券详情 + validityTwo: row.validityTwo, + giftCardDetail: row.cardDetail, //券详情 giftCardTime: "", //券有效期 giftCardTotal: 1,//券数量 instruction: row.instruction,//使用说明 @@ -834,61 +1015,62 @@ export default { }, // 优惠券删除 - deletedata(row){ - if(this.form.tableDatas&&this.form.tableDatas.length>0){ - let delIdx=-1; - for ( let item of this.form.tableDatas) { + deletedata(row) { + if (this.form.tableDatas && this.form.tableDatas.length > 0) { + let delIdx = -1; + for (let item of this.form.tableDatas) { delIdx++; - if (item.id===row.id){ + if (item.id === row.id) { break } } - this.pdidlist.splice(delIdx,1); - this.form.tableDatas.splice(delIdx,1); + this.pdidlist.splice(delIdx, 1); + this.form.tableDatas.splice(delIdx, 1); } }, // 兑换券删除 - deletedhdata(row){ - if(this.tableDatas&&this.tableDatas.length>0){ - let delIdx=-1; - for ( let item of this.tableDatas) { + deletedhdata(row) { + if (this.tableDatas && this.tableDatas.length > 0) { + let delIdx = -1; + for (let item of this.tableDatas) { delIdx++; - if (item.id===row.id){ + if (item.id === row.id) { break } } - this.pddhidlist.splice(delIdx,1); - this.tableDatas.splice(delIdx,1); + this.pddhidlist.splice(delIdx, 1); + this.tableDatas.splice(delIdx, 1); } }, - lookDetail(row){ + lookDetail(row) { this.opendetails = true let data = { - id:row.id, - exchangeFrom:"新人有礼" + id: row.id, + exchangeFrom: "新人有礼" } - looklook(data).then(res=>{ + looklook(data).then(res => { this.looklist = res.data - console.log('详情',res) + console.log('详情', res) }) - looklooklook(row.id).then(resp=>{ + looklooklook(row.id).then(resp => { this.statisticsyou = resp.data - console.log('优惠券详情统计',resp) + console.log('优惠券详情统计', resp) }) }, - Deleteshan(row){ + Deleteshan(row) { const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除此条新人有礼活动的信息?').then(function() { + this.$modal.confirm('是否确认删除此条新人有礼活动的信息?').then(function () { return delActiveNewlyweds(ids); }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + }).catch(() => { + }); }, /** 搜索按钮操作 */ @@ -904,7 +1086,7 @@ export default { // 多选框选中数据 handleSelectionChange(selection) { this.ids = selection.map(item => item.id) - this.single = selection.length!==1 + this.single = selection.length !== 1 this.multiple = !selection.length }, /** 新增按钮操作 */ @@ -914,11 +1096,11 @@ export default { this.title = "添加新人有礼活动"; }, /** 修改按钮操作 */ - handleUpdate(row){ + handleUpdate(row) { this.reset() getActiveNewlyweds(row.id).then(response => { this.form = response.data; - if(response.data.activeNewlywedsChildList){ + if (response.data.activeNewlywedsChildList) { this.form.tableDatas = response.data.activeNewlywedsChildList.filter(item => item.activeGift == '1') this.tableDatas = response.data.activeNewlywedsChildList.filter(item => item.activeGift == '2') } @@ -926,7 +1108,7 @@ export default { this.title = "编辑"; }); }, - handleDeletexia(row,isonline){ + handleDeletexia(row, isonline) { // getActiveNewlyweds(row.id).then(response => { // // let data = response.data @@ -938,13 +1120,14 @@ export default { // }); // // }); - this.$modal.confirm('确定上线此条新人有礼活动信息?').then(function() { - return editActiveNewlyweds({id:row.id,isonline:isonline}); + this.$modal.confirm('确定上线此条新人有礼活动信息?').then(function () { + return editActiveNewlyweds({id: row.id, isonline: isonline}); }).then(() => { this.$modal.msgSuccess("上线成功"); this.open = false; this.getList(); - }).catch(() => {}); + }).catch(() => { + }); }, submitForm() { // this.form.activeNewlywedsChildList @@ -959,7 +1142,7 @@ export default { this.open = false; this.getList(); }); - }else { + } else { addActiveNewlyweds(this.form).then(response => { this.$modal.msgSuccess("新增成功"); this.open = false; @@ -996,12 +1179,13 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const ids = row.id || this.ids; - this.$modal.confirm('是否确认删除此条新人有礼活动信息?').then(function() { + this.$modal.confirm('是否确认删除此条新人有礼活动信息?').then(function () { return delActiveNewlyweds(ids); }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + }).catch(() => { + }); }, /** 导出按钮操作 */ handleExport() { @@ -1013,18 +1197,49 @@ export default { };