ソースを参照

fix:调整应付对账  新增自定义时间选项

shenjunjie 7 年 前
コミット
56f9a2419e

+ 71 - 27
pages/mobile/center/user/btobarCheck.vue

@@ -24,7 +24,7 @@
       <!--</div>-->
       <div v-show="activeType !== 'all'">
         <div class="search-content mi-search-content">
-          <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="单据编号/客户名称/物料名称">
+          <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="单据编号/供应商名称/物料名称">
           <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
         </div>
         <div class="btobapCheck-wrapper-scroll" id="btobapCheck-wrapper-scroll">
@@ -74,16 +74,33 @@
 
       <div v-show="activeType === 'all'">
         <div class="search-content mi-search-content">
-          <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="客户名称">
+          <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="供应商名称">
           <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
         </div>
-        <div class="timeLine-wrapper">
-          <div class="inline-block left" @click="addMonth('out', 'outTimeMonth', -1)">
-            <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
-          </div>
-          <div class="inline-block timeLine" style="text-indent: 0.12rem" @click="ShowMonthChoose('out', 'outTimeMonth')">{{outTimeMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
-          <div class="inline-block right" @click="addMonth('out', 'outTimeMonth', 1)" v-show="MouthOutShow">
-            <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
+        <div class="modal-h">
+          <div class="timeLine-wrapper clearfix" style="margin-bottom: 0.2rem;">
+            <div style="margin-left: 0.5rem">
+              <div class="inline-block left" @click="addMonth('out', 'outTimeMonth', -1)">
+                <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
+              </div>
+              <div class="inline-block timeLine" style="text-indent: 0.12rem" @click="ShowMonthChoose('out', 'outTimeMonth')">{{outTimeMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
+              <div class="inline-block right" @click="addMonth('out', 'outTimeMonth', 1)" v-show="MouthOutShow">
+                <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
+              </div>
+              </div>
+            <div style="clear:both"></div>
+            <base-filter
+              ref="baseFilterTwo"
+              v-for="filterOption in ApcheckfilterOptions"
+              :ShowTitle="ShowTitle"
+              :key="filterOption.selectOption"
+              :selectItems="filterOption.selectItems"
+              :defaultVal="filterOption.defaultVal"
+              :selectOption="filterOption.selectOption"
+              @selectAction="ApcheckonSelectAction"
+              @valueAction="ApcheckonValueAction"
+              :title="filterOption.title">
+            </base-filter>
           </div>
         </div>
         <div class="btobapCheck-wrapper-scroll btobapCheck-wrapper-scroll2" id="btobapCheck-wrapper-scroll2">
@@ -396,6 +413,7 @@
             defaultVal: 1
           }
         ],
+        ShowApcheckChooseTimeOUT: false,
         ShowApcheckChooseTime: false
       }
     },
@@ -441,8 +459,11 @@
           } else {
             this.MouthOutShow = true
           }
+          this.$monthClick = true
           this.outTimeMonth = this.$value
           this.filterParams.page = 1
+          this.$refs.baseFilterTwo[0].setSelect(1)
+          this.ShowApcheckChooseTimeOUT = false
           this.setSelect('', '', true)
         } else {
           let _time2 = this.computedTime(this.$value + '-01')
@@ -548,9 +569,14 @@
       },
       ApcheckonSelectAction(selectObj) {
         if (this.$monthClick) return
-        this.ShowApcheckChooseTime = true
         this.isShowApcheckList.objTime = selectObj
-        this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
+        if (this.isShowApcheckList.show) {
+          this.ShowApcheckChooseTime = true
+          this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
+        } else {
+          this.ShowApcheckChooseTimeOUT = true
+          this.setSelect(selectObj.key, selectObj.value, true)
+        }
       },
       ApcheckonValueAction(selectObj) {
         // if (this.$monthClick) return
@@ -886,6 +912,7 @@
           this.getApcheckDetailsinfo()
         } else {
           let _sp = new Date()
+          this.$monthClick = true
           let _d = this.computedTime(this[key] + '-01', val)
           let _m = Number(_d.getMonth() + 1) < 10 ? '0' + (_d.getMonth() + 1) : (_d.getMonth() + 1)
           this[key] = _d.getFullYear() + '-' + _m
@@ -895,6 +922,8 @@
             this.MouthOutShow = true
           }
           this.filterParams.page = 1
+          this.$refs.baseFilterTwo[0].setSelect(1)
+          this.ShowApcheckChooseTimeOUT = false
           this.setSelect('', '', true)
         }
       },
@@ -915,21 +944,33 @@
         let _url = '/purchase/arCheck'
         let itemL = {}
         if (this.activeType === 'all') {
-          let _fromDate = this.outTimeMonth + '-01 00:00:00'
-          let _d = this.computedTime(_fromDate)
-          let _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
-          _endDate = _endDate.replace(/-/g, '/')
-          _endDate = new Date(_endDate).getTime()
-          _fromDate = _fromDate.replace(/-/g, '/')
-          _fromDate = new Date(_fromDate).getTime()
-           _url = '/sale/arCheck/vendor'
-          itemL = {
-            params: {
-              count: 20,
-              page: this.filterParams.page,
-              keyword: this.filterParams.keyword,
-              searchFilter: {'fromDate': _fromDate, 'endDate': _endDate},
-              sorting: { 'recordDate': 'desc' }
+          _url = '/sale/arCheck/vendor'
+          if (!this.ShowApcheckChooseTimeOUT) {
+            let _fromDate = this.outTimeMonth + '-01 00:00:00'
+            let _d = this.computedTime(_fromDate)
+            let _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
+            _endDate = _endDate.replace(/-/g, '/')
+            _endDate = new Date(_endDate).getTime()
+            _fromDate = _fromDate.replace(/-/g, '/')
+            _fromDate = new Date(_fromDate).getTime()
+            itemL = {
+              params: {
+                count: 20,
+                page: this.filterParams.page,
+                keyword: this.filterParams.keyword,
+                searchFilter: { 'fromDate':  _fromDate, 'endDate': _endDate },
+                sorting: { 'recordDate': 'desc' }
+              }
+            }
+          } else {
+            itemL = {
+              params: {
+                count: 20,
+                page: this.filterParams.page,
+                keyword: this.filterParams.keyword,
+                searchFilter: { 'fromDate':  val[1].fromDate, 'endDate': val[1].toDate },
+                sorting: { 'recordDate': 'desc' }
+              }
             }
           }
         } else {
@@ -981,6 +1022,7 @@
         } else {
           this.resourceList.content = []
         }
+        this.$monthClick = false
         this.resourceList = data
       },
       // 选择月份
@@ -994,6 +1036,8 @@
           this.$picker.setSlotValue(0, this.isShowApcheckList.thisMonth.split('-')[0] + '年')
           this.$picker.setSlotValue(1, _m + '月')
         } else {
+          this.ShowApcheckChooseTimeOUT = false
+          this.$monthClick = true
           let _m = this[key].split('-')[1].length < 2 ? '0' + this[key].split('-')[1] : this[key].split('-')[1]
           this.$picker.setSlotValue(0, this[key].split('-')[0] + '年')
           this.$picker.setSlotValue(1, _m + '月')
@@ -1199,7 +1243,7 @@
       height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem);
       overflow-y: auto;
       &.btobapCheck-wrapper-scroll2 {
-        height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem - 1.3rem);
+        height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem - 1.6rem);
       }
     }
     .filter-wrapper{

+ 69 - 24
pages/mobile/center/vendor/btobapCheck.vue

@@ -77,13 +77,30 @@
           <input type="text" v-model="filterParams.keyword" @keyup.13="onFilter" placeholder="客户名称">
           <span @click="onFilter"><i class="iconfont icon-sousuo"></i></span>
         </div>
-        <div class="timeLine-wrapper">
-          <div class="inline-block left" @click="addMonth('out', 'outTimeMonth', -1)">
-            <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
-          </div>
-          <div class="inline-block timeLine" style="text-indent: 0.12rem" @click="ShowMonthChoose('out', 'outTimeMonth')">{{outTimeMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
-          <div class="inline-block right" @click="addMonth('out', 'outTimeMonth', 1)" v-show="MouthOutShow">
-            <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
+        <div class="modal-h">
+          <div class="timeLine-wrapper clearfix" style="margin-bottom: 0.2rem;">
+            <div style="margin-left: 0.5rem">
+              <div class="inline-block left" @click="addMonth('out', 'outTimeMonth', -1)">
+                <i class="iconfont icon-xiangzuo" style="font-size: 0.3rem"></i>
+              </div>
+              <div class="inline-block timeLine" style="text-indent: 0.12rem" @click="ShowMonthChoose('out', 'outTimeMonth')">{{outTimeMonth}}<i class="iconfont icon-arrow-down" style="font-size: 0.3rem"></i></div>
+              <div class="inline-block right" @click="addMonth('out', 'outTimeMonth', 1)" v-show="MouthOutShow">
+                <i class="iconfont icon-xiangyou" style="font-size: 0.3rem"></i>
+              </div>
+            </div>
+            <div style="clear:both"></div>
+            <base-filter
+              ref="baseFilterTwo"
+              v-for="filterOption in ApcheckfilterOptions"
+              :ShowTitle="ShowTitle"
+              :key="filterOption.selectOption"
+              :selectItems="filterOption.selectItems"
+              :defaultVal="filterOption.defaultVal"
+              :selectOption="filterOption.selectOption"
+              @selectAction="ApcheckonSelectAction"
+              @valueAction="ApcheckonValueAction"
+              :title="filterOption.title">
+            </base-filter>
           </div>
         </div>
         <div class="btobapCheck-wrapper-scroll btobapCheck-wrapper-scroll2" id="btobapCheck-wrapper-scroll2">
@@ -401,6 +418,7 @@
             defaultVal: 1
           }
         ],
+        ShowApcheckChooseTimeOUT: false,
         ShowApcheckChooseTime: false
       }
     },
@@ -446,8 +464,11 @@
           } else {
             this.MouthOutShow = true
           }
+          this.$monthClick = true
           this.outTimeMonth = this.$value
           this.filterParams.page = 1
+          this.$refs.baseFilterTwo[0].setSelect(1)
+          this.ShowApcheckChooseTimeOUT = false
           this.setSelect('', '', true)
         } else {
           let _time2 = this.computedTime(this.$value + '-01')
@@ -555,7 +576,13 @@
         if (this.$monthClick) return
         this.ShowApcheckChooseTime = true
         this.isShowApcheckList.objTime = selectObj
-        this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
+        if (this.isShowApcheckList.show) {
+          this.ShowApcheckChooseTime = true
+          this.getApcheckDetailsinfo(selectObj.key, selectObj.value)
+        } else {
+          this.ShowApcheckChooseTimeOUT = true
+          this.setSelect(selectObj.key, selectObj.value, true)
+        }
       },
       ApcheckonValueAction(selectObj) {
         // if (this.$monthClick) return
@@ -890,6 +917,7 @@
           this.getApcheckDetailsinfo()
         } else {
           let _sp = new Date()
+          this.$monthClick = true
           let _d = this.computedTime(this[key] + '-01', val)
           let _m = Number(_d.getMonth() + 1) < 10 ? '0' + (_d.getMonth() + 1) : (_d.getMonth() + 1)
           this[key] = _d.getFullYear() + '-' + _m
@@ -899,6 +927,8 @@
             this.MouthOutShow = true
           }
           this.filterParams.page = 1
+          this.$refs.baseFilterTwo[0].setSelect(1)
+          this.ShowApcheckChooseTimeOUT = false
           this.setSelect('', '', true)
         }
       },
@@ -919,21 +949,33 @@
         let _url = '/sale/apCheck/info/search'
         let itemL = {}
         if (this.activeType === 'all') {
-          let _fromDate = this.outTimeMonth + '-01 00:00:00'
-          let _d = this.computedTime(_fromDate)
-          let _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
-          _endDate = _endDate.replace(/-/g, '/')
-          _endDate = new Date(_endDate).getTime()
-          _fromDate = _fromDate.replace(/-/g, '/')
-          _fromDate = new Date(_fromDate).getTime()
-           _url = '/sale/apCheck/customer'
-          itemL = {
-            params: {
-              count: 20,
-              page: this.filterParams.page,
-              keyword: this.filterParams.keyword,
-              searchFilter: {'fromDate': _fromDate, 'endDate': _endDate},
-              sorting: { 'recordDate': 'desc' }
+          _url = '/sale/arCheck/vendor'
+          if (!this.ShowApcheckChooseTimeOUT) {
+            let _fromDate = this.outTimeMonth + '-01 00:00:00'
+            let _d = this.computedTime(_fromDate)
+            let _endDate = _d.getFullYear() + '-' + (_d.getMonth() + 1) + '-' + _d.getDate() + ' 00:00:00'
+            _endDate = _endDate.replace(/-/g, '/')
+            _endDate = new Date(_endDate).getTime()
+            _fromDate = _fromDate.replace(/-/g, '/')
+            _fromDate = new Date(_fromDate).getTime()
+            itemL = {
+              params: {
+                count: 20,
+                page: this.filterParams.page,
+                keyword: this.filterParams.keyword,
+                searchFilter: { 'fromDate': _fromDate, 'endDate': _endDate },
+                sorting: { 'recordDate': 'desc' }
+              }
+            }
+          } else {
+            itemL = {
+              params: {
+                count: 20,
+                page: this.filterParams.page,
+                keyword: this.filterParams.keyword,
+                searchFilter: { 'fromDate':  val[1].fromDate, 'endDate': val[1].toDate },
+                sorting: { 'recordDate': 'desc' }
+              }
             }
           }
         } else {
@@ -985,6 +1027,7 @@
         } else {
           this.resourceList.content = []
         }
+        this.$monthClick = false
         this.resourceList = data
       },
       // 选择月份
@@ -998,6 +1041,8 @@
           this.$picker.setSlotValue(0, this.isShowApcheckList.thisMonth.split('-')[0] + '年')
           this.$picker.setSlotValue(1, _m + '月')
         } else {
+          this.ShowApcheckChooseTimeOUT = false
+          this.$monthClick = true
           let _m = this[key].split('-')[1].length < 2 ? '0' + this[key].split('-')[1] : this[key].split('-')[1]
           this.$picker.setSlotValue(0, this[key].split('-')[0] + '年')
           this.$picker.setSlotValue(1, _m + '月')
@@ -1204,7 +1249,7 @@
       height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem);
       overflow-y: auto;
       &.btobapCheck-wrapper-scroll2 {
-        height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem - 1.3rem);
+        height: calc(100vh - 1.26rem - 0.98rem - 1.06rem - 0.92rem - 1.6rem);
       }
     }
     .filter-wrapper{