chenrui 4 tahun lalu
induk
melakukan
dcf0af16a7
1 mengubah file dengan 20 tambahan dan 20 penghapusan
  1. 20 20
      src/views/allocationManagement/transferOut/list.vue

+ 20 - 20
src/views/allocationManagement/transferOut/list.vue

@@ -194,26 +194,26 @@ export default {
     disabledDate (current) {
       const tYearVs = moment().subtract(2, 'years') //  两年前   负值
       //  限制最多只能查一年区间的数据
-      if (this.selectPriceDate) {
-        const yearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').subtract(1, 'years') //  去年   负值
-        const yearSVs = moment(this.selectPriceDate, 'YYYY-MM-DD').add(1, 'years') //  明年    正值
-        // 判断两个时间段是否相差m年  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
-        // console.log(tYearVs.diff(yearVs, 'days'), '---------比小') // 负
-        // console.log(yearSVs.diff(moment(), 'days'), '---------比大') // 正
-        // const beginDate = tYearVs.diff(yearVs, 'days') > 0 ? yearVs : tYearVs
-        // const endDate = moment().diff(yearSVs, 'days') > 0 ? yearSVs : moment()
-        // return current && current.valueOf() > beginDate || current && current.valueOf() < endDate
-        // console.log(moment().diff(tYearVs, 'days'), '---------两年前和今天相差天数')
-        // console.log(moment().diff(yearVs, 'days'), '---------去年和今天相差天数')
-        const tDiffV = moment().diff(tYearVs, 'days') // 两年前和今天相差天数
-        const oDiffV = moment().diff(yearVs, 'days') // 去年和今天相差天数
-        // console.log(tDiffV, '+++相差比值', oDiffV)
-        const beginDate = tDiffV > oDiffV ? tYearVs : yearVs
-        const endDate = moment().diff(yearSVs, 'days') > 0 ? yearSVs : moment()
-        return current && current.valueOf() > beginDate.valueOf() || current && current.valueOf() < endDate.valueOf()
-      } else {
-        return current && current.valueOf() > Date.now() || current && current.valueOf() < tYearVs
-      }
+      // if (this.selectPriceDate) {
+      //   const yearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').subtract(1, 'years') //  去年   负值
+      //   const yearSVs = moment(this.selectPriceDate, 'YYYY-MM-DD').add(1, 'years') //  明年    正值
+      //   // 判断两个时间段是否相差m年  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+      //   // console.log(tYearVs.diff(yearVs, 'days'), '---------比小') // 负
+      //   // console.log(yearSVs.diff(moment(), 'days'), '---------比大') // 正
+      //   // const beginDate = tYearVs.diff(yearVs, 'days') > 0 ? yearVs : tYearVs
+      //   // const endDate = moment().diff(yearSVs, 'days') > 0 ? yearSVs : moment()
+      //   // return current && current.valueOf() > beginDate || current && current.valueOf() < endDate
+      //   // console.log(moment().diff(tYearVs, 'days'), '---------两年前和今天相差天数')
+      //   // console.log(moment().diff(yearVs, 'days'), '---------去年和今天相差天数')
+      //   const tDiffV = moment().diff(tYearVs, 'days') // 两年前和今天相差天数
+      //   const oDiffV = moment().diff(yearVs, 'days') // 去年和今天相差天数
+      //   // console.log(tDiffV, '+++相差比值', oDiffV)
+      //   const beginDate = tDiffV > oDiffV ? tYearVs : yearVs
+      //   const endDate = moment().diff(yearSVs, 'days') > 0 ? yearSVs : moment()
+      //   return current && current.valueOf() > beginDate.valueOf() || current && current.valueOf() < endDate.valueOf()
+      // } else {
+      return current && current.valueOf() > Date.now() || current && current.valueOf() < tYearVs
+      // }
     },
     // 日期  change
     dateChange (date, dateStrings) {