Quellcode durchsuchen

Merge branch 'develop_yh41' of http://git.chelingzhu.com/jianguan-web/jg-ocs-html into develop_yh41

chenrui vor 1 Jahr
Ursprung
Commit
4935482558

+ 25 - 8
src/views/common/rangeDate.vue

@@ -1,7 +1,7 @@
 <template>
   <a-range-picker
     style="width:100%"
-    :ranges="ranges"
+    :ranges="rangesVal"
     :value="date"
     :size="size"
     :disabledDate="disabledDate"
@@ -27,18 +27,35 @@ export default {
     showTime: {
       type: Boolean,
       default: true
+    },
+    today: {
+      type: Boolean,
+      default: true
     }
   },
   data () {
     return {
       date: this.value,
       dateFormat: 'YYYY-MM-DD',
-      selectPriceDate: '',
-      ranges: {
-        '今天': [moment(), moment()],
-        '近一个月': [moment().subtract(1, 'months'), moment()],
-        '本月': [moment().startOf('month'), moment()],
-        '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] }
+      selectPriceDate: ''
+    }
+  },
+  computed: {
+    rangesVal () {
+      if (this.today) {
+        return {
+          '今天': [moment(), moment()],
+          '近一个月': [moment().subtract(1, 'months'), moment()],
+          '本月': [moment().startOf('month'), moment()],
+          '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')]
+        }
+      } else {
+        return {
+          '近一个月': [moment().subtract(1, 'months'), moment().subtract(1, 'days')],
+          '本月': [moment().startOf('month'), moment().subtract(1, 'days')],
+          '上月': [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')]
+        }
+      }
     }
   },
   methods: {
@@ -46,7 +63,7 @@ export default {
     disabledDate (current) {
       //  最早可倒推选择两年数据,最晚为今天
       const minYearVs = moment().subtract(2, 'years') //  两年前   负值
-      const maxYearVs = moment().endOf('day') //  今天,包含今天
+      const maxYearVs = this.today ? moment().endOf('day') : moment().subtract(1, 'days').endOf('day') //  今天,包含今天
       //  限制最多只能查一年区间的数据
       if (this.selectPriceDate) {
         const oMinYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').subtract(1, 'years') //  当前选中开始日期前推一年

+ 3 - 2
src/views/reportData/tireSalesReport/detailList.vue

@@ -13,7 +13,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :showTime="false" :today="false" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -105,7 +105,8 @@
           class="sTable fixPagination"
           ref="table"
           size="small"
-          :rowKey="(record) => record.id"
+          :rowKey="(record) => record.no"
+          rowKeyName="no"
           :style="{ height: tableHeight+70+'px' }"
           :columns="columns"
           :data="loadData"

+ 1 - 1
src/views/reportData/tireSalesReport/list.vue

@@ -13,7 +13,7 @@
           <a-row :gutter="15">
             <a-col :md="6" :sm="24">
               <a-form-model-item label="日期" prop="time">
-                <rangeDate ref="rangeDate" :showTime="false" :value="queryParam.time" @change="dateChange" />
+                <rangeDate ref="rangeDate" :showTime="false" :today="false" :value="queryParam.time" @change="dateChange" />
               </a-form-model-item>
             </a-col>
             <a-col :md="6" :sm="24">