Browse Source

优化:优惠券新增状态显示,优惠券列表排序优化,优惠券列表不查询状态为未开始的优惠券

skyline 1 year ago
parent
commit
6272e9eae9

+ 7 - 3
admin-web/src/views/admin/activity/coupon/index.vue

@@ -106,6 +106,9 @@
             <template v-else-if="field.prop==='couponType'">
               <ext-d-label type="Activity.couponType" v-model="row[field.prop]"></ext-d-label>
             </template>
+            <template v-else-if="field.prop==='status'">
+              <ext-d-label type="Coupon.status" v-model="row[field.prop]"></ext-d-label>
+            </template>
             <template v-else-if="field.prop==='minServiceMoney'">
               {{u.fmt.fmtMoney(row.minServiceMoney)}}
             </template>
@@ -114,7 +117,7 @@
             </template>
             <template v-else-if="field.prop==='action'">
 <!--              <el-button v-auth="'coupon.list'" size="small" plain type="success" @click="onRowClick('view',row)">查看</el-button>-->
-              <el-button v-auth="'coupon.modify'"  size="small" plain type="danger" @click="onCouponDispatch(row)">发券</el-button>
+              <el-button v-show="row.receiveType==='Release'" v-auth="'coupon.modify'"  size="small" plain type="danger" @click="onCouponDispatch(row)">发券</el-button>
             </template>
             <template v-else>
               <div>{{ row[field.prop] }}</div>
@@ -173,9 +176,10 @@ const state = reactive({
       {
         label: '优惠券名称', prop: 'name', resizable: true, width: 170, fixed: 'left'
       },
-      {label: '券种', prop: 'couponType', resizable: true, width: 130},
+      {label: '状态', prop: 'status', resizable: true, width: 80},
+      {label: '券种', prop: 'couponType', resizable: true, width: 80},
       {label: '活动时间', prop: 'period', resizable: true, width: 350},
-      {label: '优惠券描述', prop: 'couponDesc', align: 'center', width: 330},
+      {label: '优惠券描述', prop: 'couponDesc', align: 'center', width: 200},
       {label: '服务费门槛(元)', prop: 'minServiceMoney', resizable: true, width: 180},
       {label: '折扣', prop: 'discount', resizable: true, width: 130},
       {label: '已领取/发放数量', prop: 'claimedQuantity', resizable: true, width: 140},

+ 3 - 2
service/src/main/java/com/kym/service/admin/impl/CouponServiceImpl.java

@@ -62,9 +62,10 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
     public PageBean<Coupon> listCoupon(CouponQueryParam params) {
         PageHelper.startPage(params.getPageNum(), params.getPageSize());
         var res = lambdaQuery()
-                .like(CommUtil.isNotEmptyAndNull(params.getCouponName()), Coupon::getName, params.getCouponName())
                 .eq(CommUtil.isNotEmptyAndNull(params.getCouponType()), Coupon::getCouponType, params.getCouponType())
-                .orderByAsc(Coupon::getEndTime)
+                .gt(Coupon::getStatus, Coupon.STATUS_未开始)
+                .like(CommUtil.isNotEmptyAndNull(params.getCouponName()), Coupon::getName, params.getCouponName())
+                .orderByDesc(Coupon::getStartTime)
                 .list();
         return new PageBean<>(res);
     }