Selaa lähdekoodia

时间范围限制:最长可以查询一年区间的数据,最多可以查询倒推到2年的数据

chenrui 4 vuotta sitten
vanhempi
commit
91ff545889

+ 4 - 0
src/views/allocationManagement/transferOut/list.vue

@@ -126,6 +126,8 @@ export default {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         targetName: '', //  调往对象
         allocateTypeSn: undefined, //  调拨类型
         state: undefined, //  业务状态
@@ -170,12 +172,14 @@ export default {
     }
   },
   methods: {
+    //  创建时间  change
     dateChange (date) {
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.targetName = ''

+ 14 - 1
src/views/common/rangeDate.vue

@@ -1,6 +1,7 @@
 <template>
   <a-range-picker
     style="width:100%"
+    :value="date"
     :disabledDate="disabledDate"
     :format="dateFormat"
     @change="dateChange"
@@ -10,9 +11,17 @@
 <script>
 import moment from 'moment'
 export default {
-  props: {},
+  props: {
+    value: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
   data () {
     return {
+      date: this.value,
       dateFormat: 'YYYY-MM-DD',
       selectPriceDate: ''
     }
@@ -38,10 +47,14 @@ export default {
     // 日期  change
     dateChange (date, dateStrings) {
       this.selectPriceDate = ''
+      this.date = date
       this.$emit('change', dateStrings)
     },
     dateCalendarChange (date, dateStrings) {
       this.selectPriceDate = date[0]
+    },
+    resetDate (val) {
+      this.date = val || []
     }
   }
 }

+ 23 - 41
src/views/financialManagement/financialCollection/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="审核时间">
-              <a-range-picker
-                style="width:100%"
-                id="financialCollectionList-auditDate"
-                :disabledDate="disabledDate"
-                v-model="auditDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -72,13 +66,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="收款时间">
-                <a-range-picker
-                  style="width:100%"
-                  id="financialCollectionList-settleDate"
-                  :disabledDate="disabledDate"
-                  v-model="settleDate"
-                  :format="dateFormat"
-                  :placeholder="['开始时间', '结束时间']" />
+                <rangeDate ref="rangeSettleDate" @change="dateSettleChange" />
               </a-form-item>
             </a-col>
             <a-col :md="12" :sm="24">
@@ -157,14 +145,19 @@
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import subarea from '@/views/common/subarea.js'
 import { getArea } from '@/api/data'
 import { salesReceiptList, salesReceipt } from '@/api/sales'
 export default {
-  components: { STable, VSelect, subarea },
+  components: { STable, VSelect, subarea, rangeDate },
   data () {
     return {
       queryParam: { //  查询条件
+        beginAuditDate: getDate.getThreeMonthDays().starttime,
+        endAuditDate: getDate.getCurrMonthDays().endtime,
+        beginSettleDate: '',
+        endSettleDate: '',
         buyerName: '',
         dealerLevel: undefined,
         settleStyleSn: undefined,
@@ -181,8 +174,6 @@ export default {
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  审核时间
-      settleDate: [], //  收款时间
-      dateFormat: 'YYYY-MM-DD',
       advanced: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -205,22 +196,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 审核时间
-        if (this.auditDate && this.auditDate.length > 0) {
-          this.queryParam.beginAuditDate = moment(this.auditDate[0]).format(this.dateFormat)
-          this.queryParam.endAuditDate = moment(this.auditDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginAuditDate = undefined
-          this.queryParam.endAuditDate = undefined
-        }
-        // 收款时间
-        if (this.settleDate && this.settleDate.length > 0) {
-          this.queryParam.beginSettleDate = moment(this.settleDate[0]).format(this.dateFormat)
-          this.queryParam.endSettleDate = moment(this.settleDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginSettleDate = undefined
-          this.queryParam.endSettleDate = undefined
-        }
         return salesReceiptList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -239,12 +214,24 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  审核时间  change
+    dateAuditChange (date) {
+      this.queryParam.beginAuditDate = date[0]
+      this.queryParam.endAuditDate = date[1]
+    },
+    //  收款时间  change
+    dateSettleChange (date) {
+      this.queryParam.beginSettleDate = date[0]
+      this.queryParam.endSettleDate = date[1]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeAuditDate.resetDate(this.auditDate)
+      this.$refs.rangeSettleDate.resetDate()
+      this.queryParam.beginAuditDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endAuditDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.beginSettleDate = ''
+      this.queryParam.endSettleDate = ''
       this.queryParam.buyerName = ''
       this.queryParam.dealerLevel = undefined
       this.queryParam.settleStyleSn = undefined
@@ -254,11 +241,6 @@ export default {
       this.queryParam.dealerProvinceSn = undefined
       this.queryParam.dealerCitySn = undefined
       this.queryParam.dealerCountySn = undefined
-      this.auditDate = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
-      this.settleDate = []
       this.$refs.table.refresh(true)
     },
     // 详情

+ 12 - 23
src/views/financialManagement/returnConfirmation/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="returnConfirmationList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -92,16 +86,18 @@
 </template>
 
 <script>
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import confirmationDetailModal from './detailModal.vue'
 import { salesReturnFinancialList, salesReturnFinancial } from '@/api/salesReturn'
 export default {
-  components: { STable, VSelect, confirmationDetailModal, custList },
+  components: { STable, VSelect, confirmationDetailModal, custList, rangeDate },
   data () {
     return {
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         salesReturnBillNo: '', //  单号
         buyerSn: undefined,
         grabFlag: undefined,
@@ -109,8 +105,6 @@ export default {
       },
       tableHeight: 0,
       disabled: false, //  查询、重置按钮是否可操作
-      createDate: [], //  创建时间
-      dateFormat: 'YYYY-MM-DD',
       advanced: false,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -131,14 +125,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 创建时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return salesReturnFinancialList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -154,20 +140,23 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.salesReturnBillNo = ''
       this.queryParam.buyerSn = undefined
       this.queryParam.grabFlag = undefined
       this.queryParam.billStatus = undefined
-      this.createDate = []
       this.$refs.custList.resetForm()
       this.$refs.table.refresh(true)
     },

+ 12 - 25
src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue

@@ -43,14 +43,7 @@
             <template v-if="advanced">
               <a-col :md="6" :sm="24">
                 <a-form-item label="单据审核时间">
-                  <a-range-picker
-                    style="width:100%"
-                    id="inventoryQueryWarehouseDetail-createDate"
-                    :disabledDate="disabledDate"
-                    v-model="createDate"
-                    :format="dateFormat"
-                    :placeholder="['开始时间', '结束时间']" />
-                </a-form-item>
+                  <rangeDate ref="rangeDate" @change="dateChange" />
                 </a-form-item>
               </a-col>
               <a-col :md="6" :sm="24">
@@ -97,25 +90,24 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { stockFlowCount, stockFlowList } from '@/api/stock'
 import { warehouseAllList } from '@/api/warehouse'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         bizType: undefined,
         flowType: undefined,
         unitName: '',
         warehouseSn: undefined
       },
-      exportLoading: false, // 导出loading
       disabled: false, //  查询、重置按钮是否可操作
-      createDate: [],
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '产品编码', dataIndex: 'productCode', width: 220, align: 'center', fixed: 'left', customRender: function (text) { return text || '--' } },
@@ -134,14 +126,6 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 入库时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         const params = Object.assign(parameter, this.queryParam, { productSn: this.$route.params.sn })
         return stockFlowList(params).then(res => {
           const data = res.data
@@ -164,9 +148,10 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     // 合计
     getTotal (param) {
@@ -180,11 +165,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.bizType = undefined
       this.queryParam.flowType = undefined
       this.queryParam.unitName = ''
       this.queryParam.warehouseSn = undefined
-      this.createDate = []
       this.$refs.table.refresh(true)
     },
     //  返回列表

+ 20 - 42
src/views/productManagement/priceChangeRecord/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="变更时间">
-              <a-range-picker
-                style="width:100%"
-                id="productChangeRecordList-time"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -58,7 +52,13 @@
           <a-col :md="6" :sm="24">
             <a-button style="margin-bottom: 18px;" type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="productChangeRecordList-refresh">查询</a-button>
             <a-button style="margin: 0 0 18px 8px" @click="resetSearchForm" :disabled="disabled" id="productChangeRecordList-reset">重置</a-button>
-            <a-button style="margin: 0 0 18px 8px" type="danger" @click="handleExport" :loading="exportLoading" id="productChangeRecordList-export">导出</a-button>
+            <a-button
+              style="margin: 0 0 18px 8px"
+              type="primary"
+              class="button-warning"
+              @click="handleExport"
+              :loading="exportLoading"
+              id="productChangeRecordList-export">导出</a-button>
             <a @click="advanced=!advanced" style="margin-left: 8px">
               {{ advanced ? '收起' : '展开' }}
               <a-icon :type="advanced ? 'up' : 'down'"/>
@@ -117,18 +117,21 @@
 
 <script>
 import moment from 'moment'
-import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate.js'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { productPriceChangeList } from '@/api/product'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         name: '', //  产品名称
         code: '', //  产品编码
         brandSn: undefined, //  品牌
@@ -138,7 +141,6 @@ export default {
       },
       productType: [],
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
@@ -210,14 +212,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 430
         }
-        // 变更时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return productPriceChangeList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -235,22 +229,22 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.code = ''
       this.queryParam.name = ''
       this.queryParam.brandSn = undefined
       this.queryParam.productTypeSn1 = ''
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
-      this.time = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
       this.$refs.table.refresh(true)
     },
     // 审核
@@ -287,22 +281,6 @@ export default {
     //  导出
     handleExport () {
       const params = this.queryParam
-      if (this.time && this.time.length) {
-        params.beginDate = moment(this.time[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.time[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
-      if (!params.beginDate && !params.endDate) {
-        this.$message.error('请先选择变更时间后查询并导出!')
-        return
-      }
-      // 判断两个时间段是否相差m个月  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
-      if (moment(params.endDate).diff(moment(params.beginDate), 'months', true) > 12) {
-        this.$message.error('仅支持导出最多12个月的数据,请先修改变更时间再进行导出!')
-        return
-      }
       this.exportLoading = true
       // customerBundleExportDelay(params).then(res => {
       //   this.exportLoading = false

+ 12 - 25
src/views/promotionRulesManagement/orderStatistics/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="orderStatisticsList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -94,25 +88,23 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import promoList from '@/views/common/promoList.vue'
 import orderStatisticsDetailModal from './detailModal.vue'
 import { salesPromoList, salesPromoCount } from '@/api/sales'
 export default {
-  components: { STable, VSelect, orderStatisticsDetailModal, custList, promoList },
+  components: { STable, VSelect, orderStatisticsDetailModal, custList, promoList, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      supplierList: [], //  供应商列表数据
-      createDate: [], //  创建时间
-      dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         buyerSn: undefined,
         promoActiveSn: undefined,
         salesBillNo: '',
@@ -140,14 +132,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 440
         }
-        // 创建时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return salesPromoList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -171,9 +155,10 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     custChange (obj) {
       this.queryParam.buyerSn = obj.key
@@ -199,11 +184,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.buyerSn = undefined
       this.queryParam.promoActiveSn = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.billStatus = undefined
-      this.createDate = []
       this.$refs.table.refresh(true)
     },
     // 关闭弹框

+ 12 - 23
src/views/promotionRulesManagement/productStatistics/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="统计时间">
-              <a-range-picker
-                style="width:100%"
-                id="productStatisticsList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -99,22 +93,22 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import productStatisticsDetailModal from './detailModal.vue'
 import { productBrandQuery } from '@/api/productBrand'
 import { productTypeQuery } from '@/api/productType'
 import { salesDetailPromoList, salesDetailPromoCount } from '@/api/salesDetail'
 export default {
-  components: { STable, VSelect, productStatisticsDetailModal },
+  components: { STable, VSelect, productStatisticsDetailModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       productType: [],
-      createDate: [], //  统计时间
-      dateFormat: 'YYYY-MM-DD',
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         productCode: '', //  产品编码
         productName: '', //  产品名称
         productBrandSn: undefined, //  产品品牌
@@ -139,14 +133,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 统计时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return salesDetailPromoList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -167,12 +153,16 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       this.queryParam.productBrandSn = undefined
@@ -180,7 +170,6 @@ export default {
       this.queryParam.productTypeSn2 = ''
       this.queryParam.productTypeSn3 = ''
       this.productType = []
-      this.createDate = []
       this.$refs.table.refresh(true)
     },
     // 合计

+ 12 - 22
src/views/promotionRulesManagement/promotionRules/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="promotionRulesList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -100,16 +94,17 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import { promoActiveList, promoActiveEnable } from '@/api/promoActive'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
-      createDate: [], //  创建时间
-      dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         name: '', //  名称
         enabledFlag: undefined //  状态
       },
@@ -130,14 +125,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 450
         }
-        // 创建时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat) + ' 00:00:00'
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat) + ' 23:59:59'
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return promoActiveList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -162,15 +149,18 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0] ? date[0] + ' 00:00:00' : ''
+      this.queryParam.endDate = date[1] ? date[1] + ' 23:59:59' : ''
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.name = ''
       this.queryParam.enabledFlag = undefined
-      this.createDate = []
       this.$refs.table.refresh(true)
     },
     //  编辑

+ 12 - 24
src/views/salesManagement/backorder/list.vue

@@ -6,14 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="backorderList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -49,22 +42,22 @@
 </template>
 
 <script>
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import { STable, VSelect } from '@/components'
 import backorderDetailModal from './detailModal.vue'
 import { oosList } from '@/api/oos'
 export default {
-  components: { STable, VSelect, custList, backorderDetailModal },
+  components: { STable, VSelect, custList, backorderDetailModal, rangeDate },
   data () {
     return {
       tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         buyerSn: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -81,14 +74,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return oosList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -104,17 +89,20 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     custChange (obj) {
       this.queryParam.buyerSn = obj.key
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.buyerSn = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     },
     // 关闭

+ 12 - 25
src/views/salesManagement/examineVerify/list.vue

@@ -6,14 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="examineVerifyList-creatDate"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -112,11 +105,12 @@
 <script>
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import { dispatchlList, dispatchQueryCount, dispatchStockUpAduit } from '@/api/dispatch'
 export default {
-  components: { STable, VSelect, custList },
+  components: { STable, VSelect, custList, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -126,6 +120,8 @@ export default {
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ],
       queryParam: { //  查询条件
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         buyerSn: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         dispatchBillNo: '', // 备货单号
@@ -134,7 +130,6 @@ export default {
         billStatus: undefined //  业务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -163,14 +158,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 创建时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         // 查询总计
         dispatchQueryCount(Object.assign(parameter, this.queryParam)).then(res => {
           this.totalData = Object.assign(this.totalData, res.data || {})
@@ -191,12 +178,16 @@ export default {
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.buyerSn = undefined
       this.$refs.custList.resetForm()
       this.queryParam.salesBillNo = ''
@@ -204,10 +195,6 @@ export default {
       this.queryParam.stockOutNo = '' // 出库单号
       this.queryParam.billStatus = undefined
       this.queryParam.printStatus = undefined
-      this.time = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
       this.$refs.table.refresh(true)
     },
     //  审核

+ 12 - 24
src/views/salesManagement/outboundOrder/list.vue

@@ -6,14 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="审核时间">
-              <a-range-picker
-                style="width:100%"
-                id="outboundOrderList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -105,16 +98,18 @@
 </template>
 
 <script>
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import { stockOutList, stockOutOut } from '@/api/stockOut'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0, // 表格高度
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         demanderName: '', //  客户名称
         outBizType: undefined, //  出库类型
         stockOutNo: '',
@@ -122,8 +117,6 @@ export default {
         state: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  审核时间
       columns: [
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
         { title: '出库单号', scopedSlots: { customRender: 'stockOutNo' }, width: 220, align: 'center' },
@@ -145,14 +138,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 审核时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return stockOutList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -190,18 +175,21 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.demanderName = ''
       this.queryParam.outBizType = undefined
       this.queryParam.state = undefined
       this.queryParam.stockOutNo = ''
       this.queryParam.outBizNo = ''
-      this.time = []
       this.$refs.table.refresh(true)
     },
     //  详情

+ 13 - 24
src/views/salesManagement/pushOrderManagement/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="pushOrder-creatDate"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -87,22 +81,22 @@
 </template>
 
 <script>
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import custList from '@/views/common/custList.vue'
 import { dispatchlList, dispatchQueryCount } from '@/api/dispatch'
 export default {
   name: 'TableList',
-  components: { STable, VSelect, custList },
+  components: { STable, VSelect, custList, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         buyerSn: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         dispatchBillNo: '', //  备货单号
@@ -134,14 +128,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 440
         }
-        // 创建时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         // 查询总计
         dispatchQueryCount(Object.assign(parameter, this.queryParam)).then(res => {
           console.log(res)
@@ -160,13 +146,14 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
     // 详情
     handleDetail (row, type) {
       if (type == 0) {
@@ -177,6 +164,9 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.buyerSn = undefined
       this.$refs.custList.resetForm()
       this.queryParam.salesBillNo = ''
@@ -184,7 +174,6 @@ export default {
       this.queryParam.payType = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     }
   },

+ 13 - 24
src/views/salesManagement/salesQuery/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="salesManagementList-creatDate"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -191,7 +185,7 @@
 </template>
 
 <script>
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import custList from '@/views/common/custList.vue'
@@ -199,17 +193,17 @@ import { salesList, salesDel, salesWriteAudit, salesCount } from '@/api/sales'
 import { findBySalesBillSn } from '@/api/dispatch'
 export default {
   name: 'TableList',
-  components: { STable, VSelect, chooseCustomModal, custList },
+  components: { STable, VSelect, chooseCustomModal, custList, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       openModal: false, // 选择客户弹框是否显示
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         buyerSn: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         purchaseBillNo: '',
@@ -261,14 +255,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 440
         }
-        // 创建时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         // 查询总计
         salesCount(Object.assign(parameter, this.queryParam)).then(res => {
           console.log(res)
@@ -287,13 +273,14 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
     // 新增
     handleAdd () {
       this.openModal = true
@@ -373,6 +360,9 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.$refs.custList.resetForm()
       this.queryParam.buyerSn = undefined
       this.queryParam.salesBillNo = ''
@@ -380,7 +370,6 @@ export default {
       this.queryParam.printStatus = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     }
   },

+ 25 - 50
src/views/salesManagement/salesReturn/list.vue

@@ -6,24 +6,12 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="salesReturn-creatDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeCreateDate" :value="createDate" @change="dateCreateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="审核时间">
-              <a-range-picker
-                style="width:100%"
-                id="salesReturn-examineTime"
-                :disabledDate="disabledDate"
-                v-model="examineTime"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeExamineDate" @change="dateExamineChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -164,6 +152,7 @@
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import custList from '@/views/common/custList.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { salesReturnList, salesReturnQueryCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
@@ -173,7 +162,8 @@ export default {
     STable,
     VSelect,
     chooseCustomModal,
-    custList
+    custList,
+    rangeDate
   },
   data () {
     return {
@@ -181,24 +171,22 @@ export default {
       // 高级搜索 展开/关闭
       advanced: false,
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       createDate: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  创建时间
-      examineTime: [], //  审核时间
       openModal: false, // 选择客户弹框是否显示
       // 查询参数
       queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
+        beginAuditDate: '',
+        endAuditDate: '',
         buyerSn: undefined, //  客户名称
         salesReturnBillNo: undefined, //  总部销退单号
         purchaseReturnBillNo: '',
         billStatus: undefined, // 业务状态
         // financialStatus: undefined, // 财务状态
-        beginDate: undefined,
-        endDate: undefined,
-        beginAuditDate: undefined,
-        endAuditDate: undefined
       },
       countData: null, // 统计数据
       // 表头
@@ -225,22 +213,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 440
         }
-        // 创建时间
-        if (this.createDate && this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.createDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
-        // 审核时间
-        if (this.examineTime && this.examineTime.length > 0) {
-          this.queryParam.beginAuditDate = moment(this.examineTime[0]).format(this.dateFormat)
-          this.queryParam.endAuditDate = moment(this.examineTime[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginAuditDate = undefined
-          this.queryParam.endAuditDate = undefined
-        }
         // 查询总计
         this.getQueryCount(Object.assign(parameter, this.queryParam))
         return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
@@ -256,13 +228,19 @@ export default {
     }
   },
   methods: {
+    //  创建时间  change
+    dateCreateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
+    //  审核时间  change
+    dateExamineChange (date) {
+      this.queryParam.beginAuditDate = date[0]
+      this.queryParam.endAuditDate = date[1]
+    },
     custChange (val) {
       this.queryParam.buyerSn = val.key
     },
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
-    },
     // 列表统计
     getQueryCount (params) {
       salesReturnQueryCount(params).then(res => {
@@ -331,21 +309,18 @@ export default {
       this.$router.push({ name: 'salesReturnCheck', params: { sn: row.salesReturnBillSn } })
     },
     resetSearchForm () {
+      this.$refs.rangeCreateDate.resetDate(this.createDate)
+      this.$refs.rangeExamineDate.resetDate()
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
+      this.queryParam.beginAuditDate = ''
+      this.queryParam.endAuditDate = ''
       this.queryParam.buyerSn = undefined
       this.$refs.custList.resetForm()
       this.queryParam.salesReturnBillNo = ''
       this.queryParam.purchaseReturnBillNo = ''
       this.queryParam.billStatus = undefined
       // this.queryParam.financialStatus = undefined
-      this.queryParam.beginDate = undefined
-      this.endDate = undefined
-      this.beginAuditDate = undefined
-      this.endAuditDate = undefined
-      this.createDate = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
-      this.examineTime = []
       this.$refs.table.refresh(true)
     },
     filterOption (input, option) {

+ 12 - 24
src/views/salesManagement/shortageStatisticsC/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="shortageStatisticsCList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -115,17 +109,20 @@
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import custList from '@/views/common/custList.vue'
 import subarea from '@/views/common/subarea.js'
 import { productTypeQuery } from '@/api/productType'
 import { oosBuyerList, oosBuyerDetailCount, oosBuyerDetailPageCount, oosDetailExport } from '@/api/oos'
 export default {
-  components: { STable, VSelect, custList, subarea },
+  components: { STable, VSelect, custList, subarea, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         buyerSn: undefined,
         subareaSn: undefined, //  区域
         productName: '',
@@ -137,7 +134,6 @@ export default {
       },
       disabled: false, //  查询、重置按钮是否可操作
       exportLoading: false, // 导出loading
-      dateFormat: 'YYYY-MM-DD',
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
@@ -157,14 +153,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
         const params = Object.assign(parameter, this.queryParam) //  无分页
         return oosBuyerList(params).then(res => {
@@ -186,9 +174,10 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     custChange (obj) {
       this.queryParam.buyerSn = obj.key
@@ -215,6 +204,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.buyerSn = undefined
       this.queryParam.subareaSn = undefined
       this.queryParam.productName = ''
@@ -224,10 +216,6 @@ export default {
       this.queryParam.productTypeSn3 = ''
       this.queryParam.salesBillNo = ''
       this.productType = []
-      this.time = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
       this.$refs.table.refresh(true)
     },
     // 详情

+ 12 - 24
src/views/salesManagement/shortageStatisticsP/list.vue

@@ -6,13 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="shortageStatisticsPList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" :value="time" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -73,20 +67,22 @@
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { oosProductList, oosProductDetailCount, oosProductDetailPageCount } from '@/api/oos'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         productName: '',
         productCode: '',
         productOrigCode: ''
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       time: [
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
@@ -107,14 +103,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 时间
-        if (this.time && this.time.length > 0) {
-          this.queryParam.beginDate = moment(this.time[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.time[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         const paramsPage = Object.assign(this.queryParam, { pageNo: parameter.pageNo, pageSize: parameter.pageSize }) //  有分页
         const params = Object.assign(parameter, this.queryParam) //  无分页
         return oosProductList(params).then(res => {
@@ -136,9 +124,10 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  创建时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     // 合计
     getCount (params) {
@@ -162,13 +151,12 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.productName = ''
       this.queryParam.productCode = ''
       this.queryParam.productOrigCode = ''
-      this.time = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
       this.$refs.table.refresh(true)
     }
   },