From 935b0058e95f085b2b2c9c15f84836af49606ffd Mon Sep 17 00:00:00 2001 From: 18650502300 <18650502300@163.com> Date: Mon, 26 Aug 2024 17:40:50 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E6=83=A0=E5=88=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/claimLog/index.vue | 2 +- src/views/system/coupon/index.vue | 14 +- src/views/user/user/index.vue | 212 ++++++++++++++++++++++------ 3 files changed, 176 insertions(+), 52 deletions(-) diff --git a/src/views/system/claimLog/index.vue b/src/views/system/claimLog/index.vue index b2f949c..f39d2ab 100644 --- a/src/views/system/claimLog/index.vue +++ b/src/views/system/claimLog/index.vue @@ -179,7 +179,7 @@ import { listCoupon } from '@/api/system/coupon' export default { name: "ClaimLog", - dicts: ['et_coupon_type', 'et_coupon_status','et_coupon_time_limit'], + dicts: ['et_coupon_type', 'et_coupon_status','et_coupon_time_limit','et_coupon_gain_method','sys_normal_disable'], data() { return { // 遮罩层 diff --git a/src/views/system/coupon/index.vue b/src/views/system/coupon/index.vue index fae9abe..bc73cfe 100644 --- a/src/views/system/coupon/index.vue +++ b/src/views/system/coupon/index.vue @@ -106,14 +106,14 @@ - - - + + + + + @@ -191,7 +191,7 @@ import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon } from "@/api export default { name: "Coupon", - dicts: ['et_coupon_type', 'et_coupon_status','et_coupon_time_limit'], + dicts: ['et_coupon_type', 'et_coupon_status','et_coupon_time_limit','sys_normal_disable'], data() { return { // 遮罩层 diff --git a/src/views/user/user/index.vue b/src/views/user/user/index.vue index 23d04f7..a04dac6 100644 --- a/src/views/user/user/index.vue +++ b/src/views/user/user/index.vue @@ -118,8 +118,8 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + + + + + + + + + + + + + + + + + + + + + + + { this.initPassword = response.msg; }); @@ -449,6 +514,31 @@ export default { }); }, methods: { + getAreaList() { + getAreaOptionselect().then(response => { + this.areaOptions = response.data; + }); + }, + formatValidity(row){ + let selectDictLabel = this.selectDictLabel(this.dict.type.et_validity_unit, row.validityUnit) + if (selectDictLabel != null) { + return selectDictLabel === '月' ? row.validityValue +"个"+ selectDictLabel:row.validityValue + selectDictLabel + } + return ""; + }, + formatDiscountPercent(row, column, cellValue){ + if (cellValue == null) { + return ''; + } + const formattedValue = (cellValue * 100).toFixed(0) + '%'; + return formattedValue; + }, + formatDiscountAmount(row){ + if (row.discountAmount === null || row.discountAmount === '') { + return ''; + } + return row.discountAmount + '元'; + }, /** 查询用户列表 */ getList() { this.loading = true; @@ -485,6 +575,11 @@ export default { this.open2 = false; this.reset(); }, + // 取消按钮 + cancel3() { + this.open3 = false; + this.reset(); + }, // 表单重置 reset() { this.form = { @@ -509,6 +604,14 @@ export default { this.queryParams.pageNum = 1; this.getList(); }, + handleQueryCoupon(){ + this.loading = true; + listCoupon(this.queryParams).then(response => { + this.couponList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, /** 重置按钮操作 */ resetQuery() { this.dateRange = []; @@ -523,6 +626,12 @@ export default { this.single = selection.length != 1; this.multiple = !selection.length; }, + // 多选框选中数据 + handleSelectionChange2(selection) { + this.ids = selection.map(item => item.couponId); + this.single = selection.length != 1; + this.multiple = !selection.length; + }, submitBand: function () { console.log(this.form.userId) console.log(this.userId) @@ -560,6 +669,16 @@ export default { }); }).catch(() => {}); }, + /** 派发优惠券 */ + distributeCoupons(row){ + this.userId = row.userId; + this.reset(); + this.open3 = true; + this.title3 = "派发优惠券"; + listCoupon(this.queryParams).then(response => { + this.couponList = response.rows; + }); + }, /** 绑定系统用户 */ handleBandSysUser(row){ this.reset(); @@ -594,23 +713,28 @@ export default { }, /** 提交按钮 */ submitForm: function() { - this.$refs["form"].validate(valid => { - if (valid) { - if (this.form.userId != undefined) { - updateUser(this.form).then(response => { - this.$modal.msgSuccess("修改成功"); - this.open = false; - this.getList(); - }); - } else { - addUser(this.form).then(response => { - this.$modal.msgSuccess("新增成功"); - this.open = false; - this.getList(); - }); - } - } - }); + const userId = this.ids; + console.log("userId==========",userId) + console.log("this.userId==========",this.userId) + + + // this.$refs["form"].validate(valid => { + // if (valid) { + // if (this.form.userId != undefined) { + // updateUser(this.form).then(response => { + // this.$modal.msgSuccess("修改成功"); + // this.open = false; + // this.getList(); + // }); + // } else { + // addUser(this.form).then(response => { + // this.$modal.msgSuccess("新增成功"); + // this.open = false; + // this.getList(); + // }); + // } + // } + // }); }, /** 删除按钮操作 */ handleDelete(row) {