瀏覽代碼

git commit -a -m '前:交费查询年度筛选'

dubch 5 年之前
父節點
當前提交
cf68f12d5e
共有 1 個文件被更改,包括 17 次插入6 次删除
  1. 17 6
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentselect/index.vue

+ 17 - 6
src/dashoo.cn/frontend_web/src/pages/oilsupplier/paymentselect/index.vue

@@ -176,6 +176,7 @@
     created () {
       // 查询条件初始值备份
       Object.assign(this.searchFormReset, this.searchForm)
+      this.initYear()
       // 查询列表
       this.initDatas()
       // this.getDictOptions()
@@ -193,11 +194,16 @@
         let myCreateOn = []
         // 解析时间
         if (this.CreateOn !== null && this.CreateOn.length === 2) {
-          this.CreateOn[1].setHours(23)
-          this.CreateOn[1].setMinutes(59)
-          this.CreateOn[1].setSeconds(59)
-          myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
-          myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+          if (typeof(this.CreateOn[0]) == 'string') {
+            myCreateOn.push(this.CreateOn[0])
+            myCreateOn.push(this.CreateOn[1])
+          } else {
+            this.CreateOn[1].setHours(23)
+            this.CreateOn[1].setMinutes(59)
+            this.CreateOn[1].setSeconds(59)
+            myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+            myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+          }
         }
         // 查询条件
         Object.assign(params, this.searchForm)
@@ -215,7 +221,12 @@
           console.error(err)
         })
       },
-
+      initYear() {
+        let now = new Date()
+        let nowYear = now.getFullYear()
+        this.CreateOn.push(nowYear+'-01-01 00:00:00')
+        this.CreateOn.push(nowYear+'-12-31 23:59:59')
+      },
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true