Przeglądaj źródła

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

chenrui 4 lat temu
rodzic
commit
a8e662a064
32 zmienionych plików z 484 dodań i 685 usunięć
  1. 12 23
      src/views/allocationManagement/chainTransferIn/list.vue
  2. 14 28
      src/views/allocationManagement/chainTransferOut/list.vue
  3. 12 24
      src/views/allocationManagement/storeTransferOut/list.vue
  4. 14 25
      src/views/allocationManagement/warehouseAllocation/list.vue
  5. 20 20
      src/views/basicData/processSettings/setup.vue
  6. 16 28
      src/views/bulkManagement/bulkReturnGoods/list.vue
  7. 12 29
      src/views/bulkManagement/bulkWarehousingOrder/list.vue
  8. 61 0
      src/views/common/rangeDate.vue
  9. 25 44
      src/views/customerManagement/customerInfo/list.vue
  10. 12 23
      src/views/financialManagement/companyCollectionPayment/list.vue
  11. 13 23
      src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue
  12. 14 23
      src/views/financialManagement/companyReceivablePayable/detail.vue
  13. 13 19
      src/views/financialManagement/expenseManagement/list.vue
  14. 11 9
      src/views/financialManagement/financialCollection/list.vue
  15. 11 9
      src/views/financialManagement/financialPayment/list.vue
  16. 15 3
      src/views/financialManagement/inventoryReview/list.vue
  17. 15 3
      src/views/financialManagement/ledgerRecord/list.vue
  18. 13 25
      src/views/financialManagement/warehousingAudit/list.vue
  19. 15 3
      src/views/financialManagement/withdrawalManagement/list.vue
  20. 12 25
      src/views/inventoryManagement/inventoryQuery/warehouseDetail.vue
  21. 2 1
      src/views/inventoryManagement/inventoryWarning/list.vue
  22. 12 24
      src/views/notice/list.vue
  23. 20 42
      src/views/productManagement/priceChangeRecord/list.vue
  24. 10 32
      src/views/purchasingManagement/purchaseOrder/list.vue
  25. 12 24
      src/views/purchasingManagement/purchaseReturn/list.vue
  26. 12 24
      src/views/salesManagement/giftRecord/list.vue
  27. 12 24
      src/views/salesManagement/outboundOrder/list.vue
  28. 12 14
      src/views/salesManagement/quotation/list.vue
  29. 12 24
      src/views/salesManagement/salesQuery/list.vue
  30. 25 50
      src/views/salesManagement/salesReturn/list.vue
  31. 13 16
      src/views/salesManagement/salesReturn/queryPart.vue
  32. 12 24
      src/views/salesManagement/urgentItemsOffset/list.vue

+ 12 - 23
src/views/allocationManagement/chainTransferIn/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="chainTransferInList-time"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -123,25 +117,25 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { allocLinkagePutList, allocLinkagePutAudit } from '@/api/allocLinkagePut'
 import { getTenantList } from '@/api/allocLinkageOut'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
-      time: [], //  入库时间
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         outTenantSn: undefined, //  调出对象
         allocationType: undefined, //  调拨产品类型
         state: undefined, //  业务状态
         settleState: undefined
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -162,14 +156,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 80
         }
-        // 入库时间
-        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 allocLinkagePutList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -184,17 +170,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]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.outTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     },
     //  详情

+ 14 - 28
src/views/allocationManagement/chainTransferOut/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="chainTransferOutList-createDate"
-                :disabledDate="disabledDate"
-                v-model="createDate"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+              <rangeDate ref="rangeDate" :value="createDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -140,27 +133,28 @@
 import moment from 'moment'
 import getDate from '@/libs/getDate.js'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import { allocLinkageOutList, allocLinkageAudit, allocLinkageOutDel, allocLinkageOutStock, getTenantList } from '@/api/allocLinkageOut'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       createDate: [
-        moment(getDate.getCurrMonthDays().starttime, this.dateFormat),
-        moment(getDate.getCurrMonthDays().endtime, this.dateFormat)
+        moment(getDate.getCurrMonthDays().starttime, 'YYYY-MM-DD'),
+        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  创建时间
       queryParam: { //  查询条件
+        beginDate: getDate.getCurrMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         putTenantSn: undefined, //  调往对象
         allocationType: undefined, //  调出产品类型
         state: undefined, //  业务状态
         settleState: undefined
-
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -181,14 +175,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 allocLinkageOutList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -205,20 +191,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]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.createDate)
+      this.queryParam.beginDate = getDate.getCurrMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.putTenantSn = undefined
       this.queryParam.allocationType = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
-      this.createDate = [
-        moment(getDate.getCurrMonthDays().starttime, this.dateFormat),
-        moment(getDate.getCurrMonthDays().endtime, this.dateFormat)
-      ]
       this.$refs.table.refresh(true)
     },
     //  基本信息  保存

+ 12 - 24
src/views/allocationManagement/storeTransferOut/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="storeTransferOutList-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">
@@ -126,26 +119,26 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import { storeCallOutList, storeCallOutAudit, storeCallOutDel, storeCallOutOut } from '@/api/storeCallOut'
 import { storeCallOutTypeAllList } from '@/api/storeCallOutType'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
-      createDate: [], //  创建时间
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         putPersonName: undefined, //  调往对象
         callOutType: undefined, //  调拨类型
         state: undefined, //  业务状态
         settleState: undefined //  财务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -166,14 +159,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 storeCallOutList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -190,17 +175,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]
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.putPersonName = undefined
       this.queryParam.callOutType = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
-      this.createDate = undefined
       this.$refs.table.refresh(true)
     },
     //  基本信息  保存

+ 14 - 25
src/views/allocationManagement/warehouseAllocation/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="warehouseAllocationList-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">
@@ -113,22 +106,22 @@ import { allocWarehouseList, allocWarehouseAudit, allocWarehouseDel } from '@/ap
 import { warehouseAllList } from '@/api/warehouse.js'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
-      createDate: undefined, //  创建时间
       warehouseList: [], // 仓库列表
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         outWarehouseSn: undefined, //  调出仓库
         putWarehouseSn: undefined, //  调入仓库
         state: undefined //  审核状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -148,14 +141,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 allocWarehouseList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -170,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]
     },
     // 获取仓库列表
     getWarehouseList () {
@@ -186,10 +172,12 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.outWarehouseSn = undefined
       this.queryParam.putWarehouseSn = undefined
       this.queryParam.state = undefined
-      this.createDate = undefined
       this.$refs.table.refresh(true)
     },
     //  删除
@@ -240,7 +228,8 @@ export default {
       vm.queryParam.outWarehouseSn = undefined
       vm.queryParam.putWarehouseSn = undefined
       vm.queryParam.state = undefined
-      vm.createDate = undefined
+      vm.queryParam.beginDate = ''
+      vm.queryParam.endDate = ''
       vm.getWarehouseList()
     })
   }

+ 20 - 20
src/views/basicData/processSettings/setup.vue

@@ -52,28 +52,28 @@
 </template>
 
 <script>
-  export default{
-    data(){
-      return{
-        formItemLayout: {
-          labelCol: { span: 6 },
-          wrapperCol: { span: 16 }
-        },
-        form: {
-          productTypeName: [], // 费用类型名称
-        },
-        rules: {
-          productTypeName: [
-            { required: true, message: '请选择费用类型名称', trigger: 'change' }
-          ],
-        },
-      }
-    },
-    methods: {
-      //  保存
-      handleSave(){}
+export default{
+  data(){
+    return{
+      formItemLayout: {
+        labelCol: { span: 6 },
+        wrapperCol: { span: 16 }
+      },
+      form: {
+        productTypeName: [], // 费用类型名称
+      },
+      rules: {
+        productTypeName: [
+          { required: true, message: '请选择费用类型名称', trigger: 'change' }
+        ],
+      },
     }
+  },
+  methods: {
+    //  保存
+    handleSave(){}
   }
+}
 </script>
 
 <style lang="less">

+ 16 - 28
src/views/bulkManagement/bulkReturnGoods/list.vue

@@ -11,13 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                id="bulkReturnGoodsList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="time"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -89,25 +83,25 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { sparePartsRetList } from '@/api/sparePartsRet'
 import { STable, VSelect } from '@/components'
 import basicInfoModal from './basicInfoModal.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         sparePartsReturnNo: '', //  散件退货单号
         supplierSn: undefined, //  供应商
         settleState: undefined, //  结算状态
         state: undefined //  单据状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '散件退货单号', dataIndex: 'sparePartsReturnNo', width: 140, align: 'center' },
@@ -126,14 +120,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 275
         }
-        // 创建时间
-        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 sparePartsRetList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -149,9 +135,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]
     },
     filterOption (input, option) {
       return (
@@ -160,12 +147,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
-      this.queryParam.orderBundleNo = ''
-      this.queryParam.orderBundle.custMobile = ''
-      this.queryParam.bundleName = ''
-      this.queryParam.itemName = ''
-      this.oldTime = undefined
-      this.newTime = undefined
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.sparePartsReturnNo = ''
+      this.queryParam.supplierSn = undefined
+      this.queryParam.settleState = undefined
+      this.queryParam.state = undefined
       this.$refs.table.refresh(true)
     },
     //  基本信息  保存

+ 12 - 29
src/views/bulkManagement/bulkWarehousingOrder/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="bulkWarehousingOrderList-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">
@@ -141,11 +135,12 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import { sparePartsPurList, sparePartsPurCount, sparePartsPurDel, sparePartsPurPut, sparePartsPurExport } from '@/api/sparePartsPur'
 import { supplierAllList } from '@/api/supplier'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
@@ -153,11 +148,11 @@ export default {
       exportLoading: false, // 导出loading
       openModal: false, // 基本信息弹框是否显示
       supplierList: [], //  供应商列表数据
-      createDate: [], //  创建时间
-      dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         sparePartsPurchaseNo: '', //  散件单号
         supplierSn: undefined, //  供应商
         state: undefined, //  单据状态
@@ -182,14 +177,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 sparePartsPurList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -210,9 +197,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) {
@@ -280,11 +268,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.sparePartsPurchaseNo = ''
       this.queryParam.supplierSn = undefined
       this.queryParam.state = undefined
       this.queryParam.settleState = undefined
-      this.createDate = undefined
       this.$refs.table.refresh(true)
     },
     filterOption (input, option) {
@@ -295,13 +285,6 @@ export default {
     //  导出
     handleExport () {
       const params = this.queryParam
-      if (this.createDate && this.createDate.length) {
-        params.beginDate = moment(this.createDate[0]).format('YYYY-MM-DD')
-        params.endDate = moment(this.createDate[1]).format('YYYY-MM-DD')
-      } else {
-        params.beginDate = ''
-        params.endDate = ''
-      }
       this.exportLoading = true
       sparePartsPurExport(params).then(res => {
         this.exportLoading = false

+ 61 - 0
src/views/common/rangeDate.vue

@@ -0,0 +1,61 @@
+<template>
+  <a-range-picker
+    style="width:100%"
+    :value="date"
+    :disabledDate="disabledDate"
+    :format="dateFormat"
+    @change="dateChange"
+    @calendarChange="dateCalendarChange"
+    :placeholder="['开始时间', '结束时间']" />
+</template>
+<script>
+import moment from 'moment'
+export default {
+  props: {
+    value: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      date: this.value,
+      dateFormat: 'YYYY-MM-DD',
+      selectPriceDate: ''
+    }
+  },
+  methods: {
+    // 不可选日期
+    disabledDate (current) {
+      //  最早可倒推选择两年数据,最晚为今天
+      const minYearVs = moment().subtract(2, 'years') //  两年前   负值
+      const maxYearVs = moment().endOf('day') //  今天,包含今天
+      //  限制最多只能查一年区间的数据
+      if (this.selectPriceDate) {
+        const oMinYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').subtract(1, 'years') //  当前选中开始日期前推一年
+        const oMaxYearVs = moment(this.selectPriceDate, 'YYYY-MM-DD').add(1, 'years') //  当前选中开始日期后推一年
+        // 判断两个时间段是否相差m天  第二个参数指相差单位,第三个参数指是否返回浮点形式(小数)
+        const beginDate = minYearVs.diff(oMinYearVs, 'days') > 0 ? minYearVs : oMinYearVs // 若当前选中开始日期前推一年超出最多倒推两年数据时,则以两年为标准
+        const endDate = maxYearVs.diff(oMaxYearVs, 'days') > 0 ? oMaxYearVs : maxYearVs // 若当前选中开始日期后推一年超出今天时,则以今天为标准
+        return current && current < beginDate || current && current > endDate
+      } else {
+        return current && current > maxYearVs || current && current < minYearVs
+      }
+    },
+    // 日期  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 || []
+    }
+  }
+}
+</script>

+ 25 - 44
src/views/customerManagement/customerInfo/list.vue

@@ -6,15 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker
-                style="width:100%"
-                allowClear
-                id="customerManagementList-creatTime"
-                :disabledDate="disabledDate"
-                v-model="creatTime"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
-            </a-form-item>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -30,15 +22,7 @@
           <template v-if="advanced">
             <a-col :md="6" :sm="24">
               <a-form-item label="最后销售时间">
-                <a-range-picker
-                  style="width:100%"
-                  allowClear
-                  id="customerManagementList-lastSaleTime"
-                  :disabledDate="disabledDate"
-                  v-model="lastSaleTime"
-                  :format="dateFormat"
-                  :placeholder="['开始时间', '结束时间']" />
-              </a-form-item>
+                <rangeDate ref="rangeSaleDate" @change="dateSaleChange" />
               </a-form-item>
             </a-col>
             <a-col :md="12" :sm="24">
@@ -142,19 +126,23 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { getArea } from '@/api/data'
 import { custList, custDel, updateEnableStatus } from '@/api/customer'
 import { custTypeFindAllList } from '@/api/custType'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import customerManagementDetailModal from './detailModal.vue'
 export default {
-  components: { STable, VSelect, customerManagementDetailModal },
+  components: { STable, VSelect, customerManagementDetailModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       tableHeight: 0,
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
+        saleBeginDate: '',
+        saleEndDate: '',
         customerName: undefined, //  客户名称
         contactName: '', //  联系人
         provinceSn: undefined, //  省
@@ -164,9 +152,6 @@ export default {
         customerTypeSn: undefined //  客户类型
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      creatTime: [], //  创建时间
-      lastSaleTime: [], //  最后销售时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -184,22 +169,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 380
         }
-        // 创建时间
-        if (this.creatTime && this.creatTime.length > 0) {
-          this.queryParam.beginDate = moment(this.creatTime[0]).format(this.dateFormat) + ' 00:00:00'
-          this.queryParam.endDate = moment(this.creatTime[1]).format(this.dateFormat) + ' 23:59:59'
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
-        // 最后销售时间
-        if (this.lastSaleTime && this.lastSaleTime.length > 0) {
-          this.queryParam.saleBeginDate = moment(this.lastSaleTime[0]).format(this.dateFormat) + ' 00:00:00'
-          this.queryParam.saleEndDate = moment(this.lastSaleTime[1]).format(this.dateFormat) + ' 23:59:59'
-        } else {
-          this.queryParam.saleBeginDate = undefined
-          this.queryParam.saleEndDate = undefined
-        }
         return custList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -220,12 +189,26 @@ 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' : ''
+    },
+    //  时间  change
+    dateSaleChange (date) {
+      this.queryParam.saleBeginDate = date[0] ? date[0] + ' 00:00:00' : ''
+      this.queryParam.saleEndDate = date[1] ? date[1] + ' 23:59:59' : ''
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      if (this.advanced) {
+        this.$refs.rangeSaleDate.resetDate()
+      }
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.queryParam.saleBeginDate = ''
+      this.queryParam.saleEndDate = ''
       this.queryParam.customerName = undefined
       this.queryParam.contactName = ''
       this.queryParam.provinceSn = undefined
@@ -233,8 +216,6 @@ export default {
       this.queryParam.countySn = undefined
       this.queryParam.satelliteFlag = undefined
       this.queryParam.customerTypeSn = undefined
-      this.creatTime = []
-      this.lastSaleTime = []
       this.addrCityList = []
       this.addrDistrictList = []
       this.$refs.table.refresh(true)

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

@@ -39,13 +39,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="结算时间">
-                <a-range-picker
-                  style="width:100%"
-                  id="companyCollectionPaymentList-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,21 +86,21 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { settleStyleQueryAll } from '@/api/settleStyle'
 import { settleUnitList, settleUnitQuerySum } from '@/api/settle'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      createDate: [], //  创建时间
-      dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         settleClientName: '',
         settleClientType: undefined,
         settleType: undefined,
@@ -131,14 +125,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 settleUnitList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -157,9 +143,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]
     },
     //  详情
     handleDetail (row) {
@@ -177,12 +164,14 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.settleClientName = ''
       this.queryParam.settleClientType = undefined
       this.queryParam.settleType = undefined
       this.queryParam.unitSettleNo = ''
       this.queryParam.settleStyleSn = undefined
-      this.createDate = []
       this.$refs.table.refresh(true)
     },
     //  结算方式

+ 13 - 23
src/views/financialManagement/companyReceivablePayable/chooseBillModal.vue

@@ -30,13 +30,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="审核时间">
-              <a-range-picker
-                style="width:100%"
-                id="chooseBillModal-auditTime"
-                :disabledDate="disabledDate"
-                v-model="auditTime"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -68,12 +62,12 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { settleInfoAllList } from '@/api/settle'
 export default {
   name: 'ChooseBillModal',
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   props: {
     openModal: { //  弹框显示状态
       type: Boolean,
@@ -94,9 +88,9 @@ export default {
     return {
       isShow: this.openModal, //  是否打开弹框
       disabled: false,
-      auditTime: [], //  审核时间
-      dateFormat: 'YYYY-MM-DD',
       queryParam: {
+        auditBeginDate: '',
+        auditEndDate: '',
         bizNo: '',
         bizType: undefined
       },
@@ -112,14 +106,6 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 审核时间
-        if (this.auditTime && this.auditTime.length > 0) {
-          this.queryParam.auditBeginDate = moment(this.auditTime[0]).format(this.dateFormat) + '00:00:00'
-          this.queryParam.auditEndDate = moment(this.auditTime[1]).format(this.dateFormat) + '23:59:59'
-        } else {
-          this.queryParam.auditBeginDate = undefined
-          this.queryParam.auditEndDate = undefined
-        }
         return settleInfoAllList(Object.assign(this.queryParam, { settleClientSn: this.settleClientSn })).then(res => {
           const data = res.data
           this.selectedRowKeys = []
@@ -147,9 +133,10 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
     },
     // 确定
     handleSave () {
@@ -158,9 +145,12 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
       this.queryParam.bizNo = ''
       this.queryParam.bizType = undefined
-      this.auditTime = []
+      this.$refs.table.refresh(true)
     },
     onSelectChange (selectedRowKeys, selectedRows) {
       console.log('selectedRowKeys changed: ', selectedRowKeys, selectedRows)

+ 14 - 23
src/views/financialManagement/companyReceivablePayable/detail.vue

@@ -24,13 +24,7 @@
             </a-col>
             <a-col :md="6" :sm="24">
               <a-form-item label="审核时间">
-                <a-range-picker
-                  style="width:100%"
-                  id="companyCollectionPaymentDetail-auditTime"
-                  :disabledDate="disabledDate"
-                  v-model="auditTime"
-                  :format="dateFormat"
-                  :placeholder="['开始时间', '结束时间']" />
+                <rangeDate ref="rangeDate" @change="dateChange" />
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -79,18 +73,19 @@
 <script>
 import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { settleInfoList, settleInfoQueryReceiptOrPaySum } from '@/api/settle'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
       queryParam: {
+        auditBeginDate: '',
+        auditEndDate: '',
         bizNo: ''
       },
-      auditTime: [], //  审核时间
-      dateFormat: 'YYYY-MM-DD',
       exportLoading: false, // 导出loading
       // 表头
       columns: [
@@ -104,14 +99,6 @@ export default {
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         this.disabled = true
-        // 审核时间
-        if (this.auditTime && this.auditTime.length > 0) {
-          this.queryParam.auditBeginDate = moment(this.auditTime[0]).format(this.dateFormat) + '00:00:00'
-          this.queryParam.auditEndDate = moment(this.auditTime[1]).format(this.dateFormat) + '23:59:59'
-        } else {
-          this.queryParam.auditBeginDate = undefined
-          this.queryParam.auditEndDate = undefined
-        }
         const params = Object.assign(parameter, this.queryParam, { settleClientSn: this.$route.params.sn })
         return settleInfoList(params).then(res => {
           const data = res.data
@@ -131,9 +118,10 @@ export default {
     }
   },
   methods: {
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
     },
     //  返回列表
     handleBack () {
@@ -151,8 +139,11 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
       this.queryParam.bizNo = ''
-      this.auditTime = []
+      this.$refs.table.refresh(true)
     },
     //  导出
     handleExport () {
@@ -170,7 +161,7 @@ export default {
       link.style.display = 'none'
       link.href = url
       const a = moment().format('YYYYMMDDHHmmss')
-      const fname = '仓库调拨' + a
+      const fname = '单位应收应付' + a
       link.setAttribute('download', fname + '.xlsx')
       document.body.appendChild(link)
       link.click()

+ 13 - 19
src/views/financialManagement/expenseManagement/list.vue

@@ -11,7 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="创建时间">
-              <a-range-picker v-model="createDate" :disabledDate="disabledDate" id="expenseManagementList-creatDate"/>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -113,12 +113,12 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { settleExpenseQuery, delExpense, settleExpenseQuerySum, auditExpense } from '@/api/settleExpense'
 import { costTypeAllQuery } from '@/api/costType'
 import expenseManagementDetailModal from './detailModal.vue'
-import moment from 'moment'
 export default {
-  components: { STable, VSelect, expenseManagementDetailModal },
+  components: { STable, VSelect, expenseManagementDetailModal, rangeDate },
   data () {
     return {
       tableHeight: 0,
@@ -126,17 +126,16 @@ export default {
       advanced: false, //  高级搜索 展开/关闭
       costTypeList: [], // 费用类型
       costType: [],
-      createDate: [],
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         accountExpensesNo: '',
         expensesTypeSn1: '',
         expensesTypeSn2: '',
         expensesTypeSn3: '',
         state: '',
-        settleState: '',
-        beginDate: '',
-        endDate: ''
+        settleState: ''
       },
       // 汇总
       totalData: {
@@ -159,14 +158,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 300
         }
-        console.log(this.createDate)
-        if (this.createDate.length > 0) {
-          this.queryParam.beginDate = moment(this.createDate[0]).format('YYYY-MM-DD')
-          this.queryParam.endDate = moment(this.createDate[1]).format('YYYY-MM-DD')
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         return settleExpenseQuery(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -189,9 +180,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]
     },
     //  递归函数
     recursionFun (data) {
@@ -281,6 +273,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.accountExpensesNo = ''
       this.queryParam.expensesTypeSn1 = ''
       this.queryParam.expensesTypeSn2 = ''
@@ -290,7 +285,6 @@ export default {
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.costType = []
-      this.createDate = []
       this.$refs.table.refresh(true)
     }
   }

+ 11 - 9
src/views/financialManagement/financialCollection/list.vue

@@ -35,7 +35,9 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="审核时间"><a-range-picker v-model="queryParam.auditDate" id="financialCollectionList-auditDate" /></a-form-item>
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
@@ -111,10 +113,10 @@
 <script>
 import { STable, VSelect } from '@/components'
 import detailModal from './detailModal.vue'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { settleReceiptQuery, queryByTypeSum, settleReceiptMoney, settleReceiptQuerySum } from '@/api/settleReceipt'
-import moment from 'moment'
 export default {
-  components: { STable, VSelect, detailModal },
+  components: { STable, VSelect, detailModal, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
@@ -128,7 +130,6 @@ export default {
         bizNo: '',
         settleClientName: '',
         billState: '',
-        auditDate: [],
         auditBeginDate: '',
         auditEndDate: ''
       },
@@ -223,10 +224,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 450
         }
-        if (this.queryParam.auditDate.length > 0) {
-          this.queryParam.auditBeginDate = moment(this.queryParam.auditDate[0]).format('YYYY-MM-DD HH:mm:ss')
-          this.queryParam.auditEndDate = moment(this.queryParam.auditDate[1]).format('YYYY-MM-DD HH:mm:ss')
-        }
         return settleReceiptQuery(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -267,6 +264,11 @@ export default {
     })
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
     // 总计
     settleReceiptQuerySum (params) {
       settleReceiptQuerySum(params).then(res => {
@@ -326,13 +328,13 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
       this.queryParam = {
         bizType: this.curBizType,
         settleNo: '',
         bizNo: '',
         settleClientName: '',
         billState: '',
-        auditDate: [],
         auditBeginDate: '',
         auditEndDate: ''
       }

+ 11 - 9
src/views/financialManagement/financialPayment/list.vue

@@ -34,7 +34,9 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="审核时间"><a-range-picker v-model="queryParam.auditDate" id="finacialPay-auditDate" /></a-form-item>
+              <a-form-item label="审核时间">
+                <rangeDate ref="rangeDate" @change="dateChange" />
+              </a-form-item>
             </a-col>
           </template>
           <a-col :md="6" :sm="24">
@@ -111,9 +113,9 @@
 import { STable, VSelect } from '@/components'
 import detailModal from './detailModal.vue'
 import { settlePayQuery, queryByTypeSum, settlePayMoney, settlePayQuerySum } from '@/api/settlePay.js'
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
-  components: { STable, VSelect, detailModal },
+  components: { STable, VSelect, detailModal, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
@@ -128,7 +130,6 @@ export default {
         bizNo: '',
         settleClientName: '',
         billState: '',
-        auditDate: [],
         auditBeginDate: '',
         auditEndDate: ''
       },
@@ -223,10 +224,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 450
         }
-        if (this.queryParam.auditDate.length > 0) {
-          this.queryParam.auditBeginDate = moment(this.queryParam.auditDate[0]).format('YYYY-MM-DD HH:mm:ss')
-          this.queryParam.auditEndDate = moment(this.queryParam.auditDate[1]).format('YYYY-MM-DD HH:mm:ss')
-        }
         return settlePayQuery(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -267,6 +264,11 @@ export default {
     })
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
+    },
     // 总计
     settlePayQuerySum (params) {
       settlePayQuerySum(params).then(res => {
@@ -326,13 +328,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
       this.queryParam = {
         bizType: this.curBizType,
         settleNo: '',
         bizNo: '',
         settleClientName: '',
         billState: '',
-        auditDate: [],
         auditBeginDate: '',
         auditEndDate: ''
       }

+ 15 - 3
src/views/financialManagement/inventoryReview/list.vue

@@ -11,7 +11,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="盘点审核时间">
-              <a-range-picker v-model="queryParam.creatDate" id="inventoryReviewList-creatDate"/>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -72,14 +72,18 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 // import { getRoleList, getServiceList } from '@/api/manage'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        beginDate: '',
+        endDate: ''
+      },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -126,6 +130,11 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ path: `/financialManagement/inventoryReview/detail/${row.id}` })
@@ -152,6 +161,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.orderBundleNo = ''
       this.queryParam.orderBundle.custMobile = ''
       this.queryParam.bundleName = ''

+ 15 - 3
src/views/financialManagement/ledgerRecord/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="分账时间">
-              <a-range-picker v-model="queryParam.creatDate" id="ledgerRecordList-creatDate"/>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -71,15 +71,19 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 // import { getRoleList, getServiceList } from '@/api/manage'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        beginDate: '',
+        endDate: ''
+      },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -127,6 +131,11 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ path: `/financialManagement/ledgerRecord/detail/${row.id}` })
@@ -153,6 +162,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.orderBundleNo = ''
       this.queryParam.orderBundle.custMobile = ''
       this.queryParam.bundleName = ''

+ 13 - 25
src/views/financialManagement/warehousingAudit/list.vue

@@ -16,13 +16,7 @@
           </a-col>
           <a-col :md="6" :sm="24">
             <a-form-item label="入库时间">
-              <a-range-picker
-                style="width:100%"
-                id="warehousingAuditList-creatDate"
-                :disabledDate="disabledDate"
-                v-model="auditTime"
-                :format="dateFormat"
-                :placeholder="['开始时间', '结束时间']" />
+              <rangeDate ref="rangeDate" :value="auditTime" @change="dateChange" />
             </a-form-item>
           </a-col>
           <template v-if="advanced">
@@ -94,11 +88,12 @@
 
 <script>
 import moment from 'moment'
-import { STable, VSelect } from '@/components'
 import getDate from '@/libs/getDate'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { receivingList, receivingStockInAudit, receivingCount } from '@/api/receiving'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
@@ -107,10 +102,11 @@ export default {
         moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
         moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
       ], //  入库时间
-      dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       // 查询参数
       queryParam: {
+        beginDate: getDate.getThreeMonthDays().starttime,
+        endDate: getDate.getCurrMonthDays().endtime,
         purchaseBillNo: '',
         receivingBillNo: '',
         auditState: undefined
@@ -134,14 +130,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 370
         }
-        // 入库时间
-        if (this.auditTime && this.auditTime.length > 0) {
-          this.queryParam.beginDate = moment(this.auditTime[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.auditTime[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         const params = Object.assign(parameter, this.queryParam)
         return receivingList(params).then(res => {
           const data = res.data
@@ -158,9 +146,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) {
@@ -195,13 +184,12 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.auditTime)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.purchaseBillNo = ''
       this.queryParam.receivingBillNo = ''
       this.queryParam.auditState = undefined
-      this.auditTime = [
-        moment(getDate.getThreeMonthDays().starttime, 'YYYY-MM-DD'),
-        moment(getDate.getCurrMonthDays().endtime, 'YYYY-MM-DD')
-      ]
       this.$refs.table.refresh(true)
     }
   }

+ 15 - 3
src/views/financialManagement/withdrawalManagement/list.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="提现时间">
-              <a-range-picker v-model="queryParam.creatDate" id="withdrawalManagementList-creatDate"/>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -64,15 +64,19 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 // import { getRoleList, getServiceList } from '@/api/manage'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       // 查询参数
-      queryParam: {},
+      queryParam: {
+        beginDate: '',
+        endDate: ''
+      },
       // 表头
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
@@ -117,6 +121,11 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     //  详情
     handleDetail (row) {
       this.$router.push({ path: `/financialManagement/withdrawalManagement/detail/${row.id}` })
@@ -143,6 +152,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.orderBundleNo = ''
       this.queryParam.orderBundle.custMobile = ''
       this.queryParam.bundleName = ''

+ 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 { stockFlowList, stockFlowCount } from '@/api/stockFlow'
 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: 'product.code', width: 140, 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)
     },
     //  返回列表

+ 2 - 1
src/views/inventoryManagement/inventoryWarning/list.vue

@@ -66,7 +66,8 @@
             <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="inventoryWarningList-reset">重置</a-button>
             <a-button
               style="margin-left: 8px"
-              type="danger"
+              type="primary"
+              class="button-warning"
               @click="handleExport"
               :disabled="disabled"
               :loading="exportLoading"

+ 12 - 24
src/views/notice/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="noticeList-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">
@@ -52,22 +45,22 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { mapActions } from 'vuex'
 import noticeDetailModal from './detailModal.vue'
 export default {
-  components: { STable, noticeDetailModal },
+  components: { STable, noticeDetailModal, rangeDate },
   data () {
     return {
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         notice: {
           title: ''
         }
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '发布时间', dataIndex: 'realseDate', align: 'center', customRender: function (text) { return text || '--' } },
@@ -111,22 +104,15 @@ export default {
       'getMessageList', // 查询列表
       'hasRead' // 设置已读
     ]),
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     // 查询列表
     handelSearch (pageNo) {
       this.pageNo = pageNo || this.pageNo
       this.disabled = true
-      // 创建时间
-      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 params = {
         pageNo: this.pageNo,
         pageSize: this.pageSize,
@@ -170,8 +156,10 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.notice.title = undefined
-      this.time = []
       this.pageNo = 1
       this.pageSize = 10
       this.paginationProps.total = 0

+ 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, getCurrentDealer } 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,
         productName: '', //  产品名称
         productCode: '', //  产品编码
         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')
@@ -150,14 +152,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
@@ -176,9 +170,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]
     },
     // 设置表头
     getColumns () {
@@ -267,16 +262,15 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate(this.time)
+      this.queryParam.beginDate = getDate.getThreeMonthDays().starttime
+      this.queryParam.endDate = getDate.getCurrMonthDays().endtime
       this.queryParam.productCode = ''
       this.queryParam.productName = ''
       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)
     },
     // 审核
@@ -313,22 +307,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

+ 10 - 32
src/views/purchasingManagement/purchaseOrder/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="purchaseOrderList-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">
@@ -108,12 +102,6 @@
           v-if="record.billStatus == 'WAIT_SUBMIT'||record.billStatus == 'AUDIT_REJECT'"
           @click="handleEdit(record)"
         >编辑</a-button>
-        <!-- <a-button
-          size="small"
-          type="link"
-          class="button-success"
-          @click="handleDetail(record)"
-          >详情</a-button> -->
         <a-button
           size="small"
           type="link"
@@ -138,20 +126,17 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 import { purchaseList, purchaseDel, purchaseCount, getParentDealer } from '@/api/purchase'
-// import { supplierAllList } from '@/api/supplier'
-import moment from 'moment'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       advanced: false, //  高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
       openModal: false, // 基本信息弹框是否显示
       supplierList: [],
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       tableHeight: 0,
       // 查询参数
       queryParam: {
@@ -187,14 +172,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
-        }
         // 获取统计数据
         this.getTotalData(Object.assign(parameter, this.queryParam))
         return purchaseList(Object.assign(parameter, this.queryParam)).then(res => {
@@ -215,9 +192,10 @@ export default {
         this.totalData = res.data || null
       })
     },
-    // 不可选日期
-    disabledDate (date, dateStrings) {
-      return date && date.valueOf() > Date.now()
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     //  新增
     handleAdd () {
@@ -260,14 +238,14 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.orderBundleNo = ''
       this.queryParam.purchaseBillNo = ''
       this.queryParam.dealerSn = ''
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
-      this.queryParam.beginDate = ''
-      this.queryParam.endDate = ''
-      this.time = []
       this.$refs.table.refresh(true)
     },
     filterOption (input, option) {

+ 12 - 24
src/views/purchasingManagement/purchaseReturn/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="purchaseReturnList-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">
@@ -102,21 +95,21 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { purchaseReturnList, purchaseReturnSave, purchaseReturnDel } from '@/api/purchaseReturn'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
-      createDate: [], //  创建时间
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         purchaseReturnNo: '', //  退货单号
         state: undefined //  业务状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
       tableHeight: 0,
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -135,14 +128,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 purchaseReturnList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -156,15 +141,18 @@ 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.purchaseReturnNo = ''
       this.queryParam.state = undefined
-      this.createDate = undefined
       this.$refs.table.refresh(true)
     },
     //  删除

+ 12 - 24
src/views/salesManagement/giftRecord/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="giftRecordList-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">
@@ -73,25 +66,25 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { custAllList } from '@/api/customer'
 import { giftsDetailList } from '@/api/dealerProduct'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         productCode: '', //  产品编码
         productOrigCode: '', //  原厂编码
         salesBillNo: '', //  关联销售单号
         customerSn: undefined //  赠送客户
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center', fixed: 'left' },
         { title: '创建时间', dataIndex: 'createDate', width: 160, align: 'center' },
@@ -110,14 +103,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 260
         }
-        // 创建时间
-        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 giftsDetailList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -132,9 +117,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]
     },
     // 客户无分页列表数据
     getCustAllList () {
@@ -154,11 +140,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.productCode = ''
       this.queryParam.productOrigCode = ''
       this.queryParam.salesBillNo = ''
       this.queryParam.customerSn = undefined
-      this.time = []
       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">
@@ -114,24 +107,24 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import { custAllList } from '@/api/customer'
 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: undefined, //  客户名称
         outBizType: undefined, //  出库类型
         state: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  审核时间
       custAllList: [], //  客户下拉数据
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -155,14 +148,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 260
         }
-        // 审核时间
-        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
@@ -194,9 +179,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]
     },
     filterOption (input, option) {
       return (
@@ -205,10 +191,12 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.demanderName = undefined
       this.queryParam.outBizType = undefined
       this.queryParam.state = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     },
     //  详情

+ 12 - 14
src/views/salesManagement/quotation/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="quotationList-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">
@@ -87,19 +80,20 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import basicInfoModal from './basicInfoModal.vue'
 export default {
-  components: { STable, VSelect, basicInfoModal },
+  components: { STable, VSelect, basicInfoModal, rangeDate },
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         bundleName: '', //  供应商名称
         state: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
         { title: '创建时间', dataIndex: 'inventoryMoney', width: 160, align: 'center' },
@@ -146,9 +140,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]
     },
     filterOption (input, option) {
       return (
@@ -157,6 +152,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.orderBundleNo = ''
       this.queryParam.orderBundle.custMobile = ''
       this.queryParam.bundleName = ''

+ 12 - 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">
@@ -181,27 +175,27 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { STable, VSelect } from '@/components'
 import chooseCustomModal from './chooseCustomModal.vue'
 import { custAllList } from '@/api/customer'
 import { salesList, salesDel, salesWriteAudit, salesWriteStockOut, salesCount } from '@/api/sales'
 import { settleStyleQueryAll } from '@/api/settleStyle'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
   name: 'TableList',
-  components: { STable, VSelect, chooseCustomModal },
+  components: { STable, VSelect, chooseCustomModal, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       openModal: false, // 选择客户弹框是否显示
       custAllList: [], //  客户 下拉数据
       settleStyleList: [], // 收款方式
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
         buyerName: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         purchaseBillNo: '', //  采购单号
@@ -240,17 +234,8 @@ 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)
           this.totalData = Object.assign(this.totalData, res.data || {})
         })
         return salesList(Object.assign(parameter, this.queryParam)).then(res => {
@@ -266,9 +251,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]
     },
     // 新增
     handleAdd () {
@@ -373,6 +359,9 @@ export default {
     },
     // 重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.buyerName = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.purchaseBillNo = ''
@@ -380,7 +369,6 @@ export default {
       this.queryParam.settleStyleSn = undefined
       this.queryParam.billStatus = undefined
       this.queryParam.financialStatus = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     },
     filterOption (input, option) {

+ 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="rangeDate" @change="dateChange" />
             </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">
@@ -135,16 +123,17 @@
 
 <script>
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 import chooseCustomModal from './chooseCustomModal.vue'
 import { custAllList } from '@/api/customer'
 import { salesReturnList, salesReturnQueryCount, salesReturnAudit, salesReturnDel } from '@/api/salesReturn'
-import moment from 'moment'
 export default {
   name: 'TableList',
   components: {
     STable,
     VSelect,
-    chooseCustomModal
+    chooseCustomModal,
+    rangeDate
   },
   data () {
     return {
@@ -152,20 +141,17 @@ export default {
       // 高级搜索 展开/关闭
       advanced: false,
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      createDate: [], //  创建时间
-      examineTime: [], //  审核时间
       openModal: false, // 选择客户弹框是否显示
       custAllList: [], //  客户下拉数据
       // 查询参数
       queryParam: {
+        beginDate: '',
+        endDate: '',
+        auditBeginDate: '',
+        auditEndDate: '',
         buyerSn: undefined, //  客户名称
         salesReturnNo: undefined, //  销售退货单号
-        billStatus: undefined, // 业务状态
-        beginDate: undefined,
-        endDate: undefined,
-        auditBeginDate: undefined,
-        auditEndDate: undefined
+        billStatus: undefined // 业务状态
       },
       countData: null, // 统计数据
       // 表头
@@ -189,22 +175,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.auditBeginDate = moment(this.examineTime[0]).format(this.dateFormat)
-          this.queryParam.auditEndDate = moment(this.examineTime[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.auditBeginDate = undefined
-          this.queryParam.auditEndDate = undefined
-        }
         // 查询总计
         this.getQueryCount(Object.assign(parameter, this.queryParam))
         return salesReturnList(Object.assign(parameter, this.queryParam)).then(res => {
@@ -220,9 +190,15 @@ 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]
+    },
+    //  审核时间  change
+    dateExamineChange (date) {
+      this.queryParam.auditBeginDate = date[0]
+      this.queryParam.auditEndDate = date[1]
     },
     // 列表统计
     getQueryCount (params) {
@@ -232,7 +208,6 @@ export default {
     },
     // 编辑
     handleEdit (row) {
-      console.log(row)
       this.$router.push({ name: row.grabFlag == 1 ? 'salesReturnGrabEdit' : 'salesReturnEdit', params: { id: row.id, sn: row.salesReturnSn, buyerSn: row.buyerSn } })
     },
     // 详情
@@ -276,15 +251,15 @@ export default {
       })
     },
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
+      this.$refs.rangeExamineDate.resetDate()
+      this.queryParam.auditBeginDate = ''
+      this.queryParam.auditEndDate = ''
       this.queryParam.buyerSn = undefined
       this.queryParam.salesReturnNo = ''
       this.queryParam.billStatus = ''
-      this.queryParam.beginDate = undefined
-      this.endDate = undefined
-      this.auditBeginDate = undefined
-      this.auditEndDate = undefined
-      this.createDate = []
-      this.examineTime = []
       this.$refs.table.refresh(true)
     },
     // 客户无分页列表数据

+ 13 - 16
src/views/salesManagement/salesReturn/queryPart.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="15">
           <a-col :md="6" :sm="24">
             <a-form-item label="审核时间">
-              <a-range-picker v-model="shDate" id="salesReturn-shDate"/>
+              <rangeDate ref="rangeDate" @change="dateChange" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
@@ -80,10 +80,10 @@
 import { salesReturnProductList } from '@/api/salesReturn'
 import { querySumByProductLocation } from '@/api/stock'
 import { STable, VSelect } from '@/components'
-import moment from 'moment'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
   name: 'QueryPart',
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   props: {
     buyerSn: {
       type: [Number, String],
@@ -96,17 +96,14 @@ export default {
   data () {
     return {
       advanced: false, // 高级搜索 展开/关闭
-      shDate: [],
-      dateFormat: 'YYYY-MM-DD',
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         salesBillNo: '', //  销售单号
         productName: '', // 产品名称
         productCode: '' //  产品编码
       },
       disabled: false, //  查询、重置按钮是否可操作
-      exportLoading: false, // 导出loading
-      brandData: [], //  下拉数据
-      typeData: [], //  产品类别  下拉数据
       columns: [],
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
@@ -115,14 +112,6 @@ export default {
         if (this.grabFlag == 1) {
           this.queryParam.buyerSn = this.buyerSn
         }
-        // 创建时间
-        if (this.shDate && this.shDate.length > 0) {
-          this.queryParam.beginDate = moment(this.shDate[0]).format(this.dateFormat)
-          this.queryParam.endDate = moment(this.shDate[1]).format(this.dateFormat)
-        } else {
-          this.queryParam.beginDate = undefined
-          this.queryParam.endDate = undefined
-        }
         const fun = [querySumByProductLocation, salesReturnProductList]
         if (this.grabFlag == 0) {
           this.queryParam.salePriceType = this.priceType
@@ -166,6 +155,11 @@ export default {
     }
   },
   methods: {
+    //  时间  change
+    dateChange (date) {
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
+    },
     // 双击列表选择配件
     handleClickRow (record) {
       const _this = this
@@ -180,6 +174,9 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.salesBillNo = ''
       this.queryParam.productName = ''
       this.queryParam.productCode = ''

+ 12 - 24
src/views/salesManagement/urgentItemsOffset/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="urgentItemsOffsetList-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">
@@ -83,25 +76,25 @@
 </template>
 
 <script>
-import moment from 'moment'
 import { custAllList } from '@/api/customer'
 import { urgentList } from '@/api/urgent'
 import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
 export default {
-  components: { STable, VSelect },
+  components: { STable, VSelect, rangeDate },
   data () {
     return {
       tableHeight: 0,
       advanced: false, // 高级搜索 展开/关闭
       queryParam: { //  查询条件
+        beginDate: '',
+        endDate: '',
         buyerName: undefined, //  客户名称
         salesBillNo: '', //  销售单号
         urgentBillNo: '', //  急件单号
         status: undefined //  状态
       },
       disabled: false, //  查询、重置按钮是否可操作
-      dateFormat: 'YYYY-MM-DD',
-      time: [], //  创建时间
       custAllList: [], //  客户下拉数据
       columns: [
         { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
@@ -120,14 +113,6 @@ export default {
         if (this.tableHeight == 0) {
           this.tableHeight = window.innerHeight - 260
         }
-        // 创建时间
-        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 urgentList(Object.assign(parameter, this.queryParam)).then(res => {
           const data = res.data
           const no = (data.pageNo - 1) * data.pageSize
@@ -141,9 +126,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]
     },
     filterOption (input, option) {
       return (
@@ -152,11 +138,13 @@ export default {
     },
     //  重置
     resetSearchForm () {
+      this.$refs.rangeDate.resetDate()
+      this.queryParam.beginDate = ''
+      this.queryParam.endDate = ''
       this.queryParam.buyerName = undefined
       this.queryParam.salesBillNo = ''
       this.queryParam.urgentBillNo = ''
       this.queryParam.status = undefined
-      this.time = []
       this.$refs.table.refresh(true)
     },
     //  详情