Browse Source

修改bug

chenrui 1 year ago
parent
commit
0c4957fd33
1 changed files with 19 additions and 3 deletions
  1. 19 3
      src/views/productManagement/newProduct/list.vue

+ 19 - 3
src/views/productManagement/newProduct/list.vue

@@ -17,7 +17,7 @@
             </a-col>
             </a-col>
             <a-col :md="6" :sm="24">
             <a-col :md="6" :sm="24">
               <a-form-model-item :label="($route.params.onlineFalg=='1'?'上':'下')+'线时间'">
               <a-form-model-item :label="($route.params.onlineFalg=='1'?'上':'下')+'线时间'">
-                <rangeDate ref="rangeDate" @change="dateChange" />
+                <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
               </a-form-model-item>
               </a-form-model-item>
             </a-col>
             </a-col>
             <template v-if="advanced">
             <template v-if="advanced">
@@ -93,6 +93,8 @@ import { STable, VSelect } from '@/components'
 import ProductBrand from '@/views/common/productBrand.js'
 import ProductBrand from '@/views/common/productBrand.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import productTypeAll from '@/views/common/productTypeAll.js'
 import rangeDate from '@/views/common/rangeDate.vue'
 import rangeDate from '@/views/common/rangeDate.vue'
+import moment from 'moment'
+import getDate from '@/libs/getDate.js'
 export default {
 export default {
   name: 'NewProductList',
   name: 'NewProductList',
   mixins: [commonMixin],
   mixins: [commonMixin],
@@ -118,6 +120,10 @@ export default {
       },
       },
       disabled: false, //  查询、重置按钮是否可操作
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
       exportLoading: false, // 导出loading
+      time: [
+        moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
+      ],
       columns: [
       columns: [
         { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
         { title: '序号', dataIndex: 'no', width: 50, align: 'center' },
         { slots: { title: 'auditTimeTit' }, scopedSlots: { customRender: 'auditTime' }, width: 140, align: 'center' },
         { slots: { title: 'auditTimeTit' }, scopedSlots: { customRender: 'auditTime' }, width: 140, align: 'center' },
@@ -136,6 +142,8 @@ export default {
         const ajaxName = this.$route.params.type == 'onlineInfo' ? productList : queryNewProductPage
         const ajaxName = this.$route.params.type == 'onlineInfo' ? productList : queryNewProductPage
         if (this.$route.params.type == 'onlineInfo') {
         if (this.$route.params.type == 'onlineInfo') {
           this.queryParam.state = 'ONLINE'
           this.queryParam.state = 'ONLINE'
+          this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+          this.queryParam.endDate = getDate.getCurrMonthDays().endtime
           if (this.queryParam.beginDate || this.queryParam.endDate) {
           if (this.queryParam.beginDate || this.queryParam.endDate) {
             this.queryParam.onlineFalg = 1
             this.queryParam.onlineFalg = 1
             this.queryParam.newProductDateScope = 9999
             this.queryParam.newProductDateScope = 9999
@@ -173,8 +181,6 @@ export default {
     //  重置
     //  重置
     resetSearchForm () {
     resetSearchForm () {
       this.$refs.rangeDate.resetDate()
       this.$refs.rangeDate.resetDate()
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
       this.queryParam.code = ''
       this.queryParam.code = ''
       this.queryParam.name = ''
       this.queryParam.name = ''
       this.queryParam.origCode = ''
       this.queryParam.origCode = ''
@@ -184,6 +190,16 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.productTypeSn3 = ''
       this.queryParam.enabledFlag = undefined
       this.queryParam.enabledFlag = undefined
       this.productType = []
       this.productType = []
+      if (this.$route.params.type == 'onlineInfo') {
+        this.$refs.rangeDate.resetDate(this.time)
+        this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+        this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      } else {
+        this.queryParam.beginDate = ''
+        this.queryParam.endDate = ''
+        this.time = []
+        this.$refs.rangeDate.resetDate([])
+      }
       this.$refs.table.refresh(true)
       this.$refs.table.refresh(true)
     },
     },
     //  详情
     //  详情