From a23ff27703d6d275c9356a8fea0eaad0d8fd3f04 Mon Sep 17 00:00:00 2001
From: 陶杰 <1378534974@qq.com>
Date: 星期三, 18 九月 2024 14:45:59 +0800
Subject: [PATCH] 1.优惠券-活动优惠券-修改-图片初始化的校验规则设置 2.优惠券-活动优惠券-发布-如果当前时间大于优惠券的领取结束时间,按钮隐藏

---
 pages/marketing/coupon/activity/index.vue |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/pages/marketing/coupon/activity/index.vue b/pages/marketing/coupon/activity/index.vue
index 265bbb3..71db735 100644
--- a/pages/marketing/coupon/activity/index.vue
+++ b/pages/marketing/coupon/activity/index.vue
@@ -9,6 +9,7 @@
   couponSearchForm,
   getActivityEffectiveTime,
   getActivityReceiveTime,
+  getImageUrlRules,
   couponColumn,
 } from '@/utils/coupon-form'
 export default {
@@ -39,7 +40,9 @@
           if (!isNew) {
             row.usageTypeStr = getActivityEffectiveTime(row)
             row.getStartDateStr = getActivityReceiveTime(row)
+            getImageUrlRules(row,this.tableConfig.form)
           }
+          
         },
         columns: [
           ...couponColumn(),
@@ -67,7 +70,6 @@
           { label: '已领取总数', prop: 'getNum', minWidth: 150 },
           { label: '剩余未领取总数', prop: 'unGetNum', minWidth: 150 },
           { label: '状态', prop: 'statusName', minWidth: 120 },
-          { label: '领取渠道', prop: 'getTypeName', minWidth: 120 },
           { label: '操作人', prop: 'createByName', minWidth: 120 },
         ],
         // 页面上要到分,后端要传到秒
@@ -267,8 +269,23 @@
         extraButtons: [
           {
             text: '发布',
-            show: (row) =>
-              row.status === 'inactive' || row.status === 'expired',
+            show: (row) =>{
+              // row.status === 'inactive' || row.status === 'expired'
+              // const now = new Date(); // 获取当前时间
+              // const startDate = new Date(row.getStartDate); // 获取开始时间
+              // const endDate = new Date(row.getEndDate); // 获取结束时间
+              // // 判断当前时间是否在开始时间和结束时间之间
+              // const isInTimeRange = now >= startDate && now <= endDate;
+              const now = new Date(); // 获取当前时间
+              const endDate = new Date(row.getEndDate); // 获取结束时间
+              // 判断当前时间是否已经超过领取结束时间
+              const isAfterEndDate = now <= endDate;
+              if (isAfterEndDate && (row.status === 'inactive' || row.status === 'expired')) {
+                  return true;
+              }
+              return false;
+          
+            },
             atClick: async (row) => {
               try {
                 await this.$elBusUtil.confirm('确定要发布吗?')

--
Gitblit v1.9.3