CustomerBalance.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view v-if="$accessCheck($Access.CustomerBalanceGetAllCustomerBalance)">
  3. <view class="tabs-view">
  4. <view class="keyword-view clearfix">
  5. <u-search
  6. disabled
  7. @custom="clearValue"
  8. action-text="重置"
  9. :clearabled="true"
  10. placeholder="请选择客户"
  11. v-model="keyword"
  12. @click="goPage('/pagesT/customer/selCustomer')"
  13. ></u-search>
  14. </view>
  15. <view class="time-search">
  16. <view class="time-li" @click="timeShow('start_show')">{{$u.timeFormat(start, 'yyyy-mm-dd') || '开始时间'}}
  17. </view>
  18. <view class="icon">
  19. <u-icon name="arrow-right"></u-icon>
  20. </view>
  21. <view class="time-li" @click="timeShow('end_show')">{{$u.timeFormat(end, 'yyyy-mm-dd') || '结束时间'}}
  22. </view>
  23. </view>
  24. <u-tabs-swiper ref="tabs" font-size="28" :current="tabs_current" :list="tabs_list" @change="tabsChange"
  25. :is-scroll="false"></u-tabs-swiper>
  26. </view>
  27. <view class="list-ul">
  28. <!-- <view class="list-li" @click="goPage('/pagesT/Finance/CustomerBalanceDetail')">
  29. <view class="title clearfix">康</view>
  30. <view class="list-cont">
  31. <view class="list-cont-li">期初:¥12,299,077.00</view>
  32. <view class="list-cont-li">期中:¥0.00</view>
  33. <view class="list-cont-li">期末:¥12,299,077.00</view>
  34. <view class="icon">
  35. <u-icon name="arrow-right"></u-icon>
  36. </view>
  37. </view>
  38. </view> -->
  39. <view class="list-li" @click="goPage(`/pagesT/Finance/CustomerBalanceDetail?customerId=${item.customerId}`)"
  40. v-for="item,index in order_list" :key='index'>
  41. <view class="title clearfix">{{item.name}}</view>
  42. <view class="list-cont">
  43. <view class="list-cont-li">期初:{{$utils.formattedNumber(item.openingBalance)}}</view>
  44. <view class="list-cont-li">期中:{{$utils.formattedNumber(item.interimBalance)}}</view>
  45. <view class="list-cont-li">期末:{{$utils.formattedNumber(item.endingBalance)}}</view>
  46. <view class="icon">
  47. <u-icon name="arrow-right"></u-icon>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- <view v-if="!balance_list.length" class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view> -->
  52. <u-loadmore :status="load_status" />
  53. </view>
  54. <u-picker v-model="start_show" mode="time" :params="time_params" @confirm='startconfirm'></u-picker>
  55. <u-picker v-model="end_show" mode="time" :params="time_params" @confirm='endconfirm'></u-picker>
  56. <!-- <u-select v-model="show" :list="list" label-name='name' value-name='id' @confirm='confirm'></u-select> -->
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. load_status: 'nomore',
  64. time_params: {
  65. year: true,
  66. month: true,
  67. day: true,
  68. hour: false,
  69. minute: false,
  70. second: false
  71. },
  72. start_show: false,
  73. end_show: false,
  74. tabs_current: 0,
  75. tabs_list: [{
  76. name: '有财务往来'
  77. }, {
  78. name: '无财务往来'
  79. }],
  80. keyword: '',
  81. page: 1,
  82. pageSize: 10,
  83. total: 0,
  84. tag: 5,
  85. start: '',
  86. end: '',
  87. order_list: [],
  88. list: [],
  89. show: false,
  90. customerId: '',
  91. customerData: ''
  92. };
  93. },
  94. watch:{
  95. customerData(val) {
  96. if (val) {
  97. this.keyword = val.name;
  98. this.customerId = val.id;
  99. this.getAllCustomerBalance()
  100. }
  101. },
  102. },
  103. onLoad() {
  104. this.getAllCustomerBalance()
  105. // this.getAllCustomer()
  106. },
  107. onReachBottom() {
  108. if (this.total / this.pageSize > this.page) {
  109. this.page += 1;
  110. this.getAllCustomerBalance()
  111. }
  112. },
  113. methods: {
  114. clearValue(){
  115. this.keyword = '';
  116. this.customerId = '';
  117. this.page = 1;
  118. this.getAllCustomerBalance()
  119. },
  120. tabsChange(index) {
  121. this.tabs_current = index;
  122. if (!this.tabs_current) {
  123. this.tag = 5
  124. } else {
  125. this.tag = 4
  126. }
  127. this.page = 1;
  128. this.getAllCustomerBalance()
  129. },
  130. timeShow(params) {
  131. this[params] = true;
  132. },
  133. getAllCustomerBalance() {
  134. let params = {
  135. page: this.page,
  136. pageSize: this.pageSize,
  137. customerId: this.customerId,
  138. start: this.start,
  139. end: this.end,
  140. tag: this.tag,
  141. };
  142. this.$u.api.getAllCustomerBalance(params).then(res => {
  143. if (this.page === 1) {
  144. this.order_list = res.data;
  145. } else {
  146. this.order_list = this.order_list.concat(res.data);
  147. }
  148. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  149. this.total = res.pageTotal;
  150. });
  151. },
  152. startconfirm(val) {
  153. this.start = this.$utils.timeByTimestamp(val.year + '-' + val.month + '-' + val.day + ' 00:00:00')
  154. this.page = 1
  155. },
  156. endconfirm(val) {
  157. this.end = this.$utils.timeByTimestamp(val.year + '-' + val.month + '-' + val.day + ' 23:59:59')
  158. this.page = 1
  159. if (!this.customerId) {
  160. this.$u.toast('请选择客户')
  161. return
  162. }
  163. this.getAllCustomerBalance()
  164. },
  165. // getAllCustomer() {
  166. // let params = {
  167. // page: 1,
  168. // pageSize: 99,
  169. // enableStatus: 5,
  170. // status: 2,
  171. // }
  172. // this.$u.api.getAllCustomer(params).then(res => {
  173. // this.list = res.data
  174. // });
  175. // },
  176. // confirm(val) {
  177. // this.keyword = val[0].label
  178. // this.customerId = val[0].value
  179. // this.getAllCustomerBalance()
  180. // }
  181. }
  182. };
  183. </script>
  184. <style lang="scss" scoped>
  185. .tabs-view {
  186. position: fixed;
  187. top: 0;
  188. left: 0;
  189. width: 100%;
  190. background-color: #ffffff;
  191. z-index: 99;
  192. .keyword-view {
  193. padding: 20rpx 24rpx 0;
  194. }
  195. .time-search {
  196. line-height: 80rpx;
  197. text-align: center;
  198. border-bottom: 1px solid #eeeeee;
  199. .time-li {
  200. display: inline-block;
  201. width: 350rpx;
  202. }
  203. .icon {
  204. width: 50rpx;
  205. display: inline-block;
  206. }
  207. }
  208. }
  209. .list-ul {
  210. padding-top: 240rpx;
  211. .list-li {
  212. width: 710rpx;
  213. margin: 20rpx auto;
  214. padding: 0 30rpx 24rpx;
  215. background-color: #ffffff;
  216. border-radius: 20rpx;
  217. .title {
  218. line-height: 80rpx;
  219. border-bottom: 1px solid #eeeeee;
  220. font-weight: bold;
  221. }
  222. .list-cont {
  223. margin-top: 10rpx;
  224. position: relative;
  225. .list-cont-li {
  226. line-height: 50rpx;
  227. }
  228. .icon {
  229. position: absolute;
  230. top: 50%;
  231. right: 24rpx;
  232. transform: translateY(-50%);
  233. }
  234. }
  235. }
  236. }
  237. </style>