From fac484b6752e5c4c89a951024090a86e772cebfe Mon Sep 17 00:00:00 2001 From: Enzo <1284707383@qq.com> Date: Thu, 12 Aug 2021 15:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=91=E8=B5=B7=E9=87=87?= =?UTF-8?q?=E8=B4=AD/=E5=8F=91=E8=B5=B7=E6=8A=A5=E4=BB=B7=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- canteen/pages/purchase/launch.vue | 11 +++++++++-- supplier/pages/offer/index.vue | 23 ++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/canteen/pages/purchase/launch.vue b/canteen/pages/purchase/launch.vue index f620f69..5fd6efa 100644 --- a/canteen/pages/purchase/launch.vue +++ b/canteen/pages/purchase/launch.vue @@ -254,8 +254,15 @@ }, // 时间选择 pickerChange(event){ - this.date = event.detail.value; - this.first_time = false + var nowTime = new Date() + var today = this.$shared.recordTime(nowTime, '-', 'date') + if(today>event.detail.value) { + this.$msg('请选择今天之后的时间') + return + }else { + this.date = event.detail.value; + this.first_time = false + } }, // 移除供应商 removeSupplier(key){ diff --git a/supplier/pages/offer/index.vue b/supplier/pages/offer/index.vue index 388d19c..e30a7cd 100644 --- a/supplier/pages/offer/index.vue +++ b/supplier/pages/offer/index.vue @@ -208,17 +208,30 @@ }, // 日期选择器值被改变 pickerChange(event, current_name){ - console.log(current_name) if(current_name == 'deadline_start') { // PS 获取30天后日期 var date1 = new Date(event.detail.value); var date2 = new Date(date1); date2.setDate(date1.getDate() + 30); - console.log(this.$shared.recordTime(date2, '-', 'date')) - this[current_name] = event.detail.value; - this.deadline_end = this.$shared.recordTime(date2, '-', 'date') + var nowTime = new Date() + var today = this.$shared.recordTime(nowTime, '-', 'date') + if(today>event.detail.value) { + this.$msg('请选择今天或未来的时间') + return + }else { + this[current_name] = event.detail.value; + this.deadline_end = this.$shared.recordTime(date2, '-', 'date') + } + }else { - this[current_name] = event.detail.value; + var nowTime = new Date() + var today = this.$shared.recordTime(nowTime, '-', 'date') + if(today>event.detail.value) { + this.$msg('请选择今天之后的时间') + return + }else { + this[current_name] = event.detail.value; + } } },