Parcourir la source

手持-收货设置时间区间

zhaohuanhuan il y a 8 mois
Parent
commit
224a865a5d
1 fichiers modifiés avec 8 ajouts et 7 suppressions
  1. 8 7
      src/views/inbound/takeDelivery/components/LotDate.vue

+ 8 - 7
src/views/inbound/takeDelivery/components/LotDate.vue

@@ -5,6 +5,7 @@
             v-model="currentDate"
             :title="title"
             :min-date="minDate"
+            :max-date="maxDate"
             @cancel="lotDateTrueFalseBy = false"
             @confirm="onConfirm"
             format="yyyy-MM-dd"
@@ -23,15 +24,15 @@ const currentDate = ref([today.getFullYear(), today.getMonth() + 1, today.getDat
 // 最小日期为当前日期前三年
 const minDate = computed(() => {
   const date = new Date(today)
-  date.setFullYear(today.getFullYear() - 3) // 当前日期减去3年
+  date.setFullYear(today.getFullYear() - 20) // 当前日期减去3年
+  return date
+})
+// 最大日期为当前日期后8年
+const maxDate = computed(() => {
+  const date = new Date(today)
+  date.setFullYear(today.getFullYear() + 100) // 当前日期加上8年
   return date
 })
-// // 最大日期为当前日期后8年
-// const maxDate = computed(() => {
-//   const date = new Date(today)
-//   date.setFullYear(today.getFullYear() + 10) // 当前日期加上8年
-//   return date
-// })
 
 const show = (label,date) => {
   title.value = label