You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

288 lines
5.7 KiB

9 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
6 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
  1. <template>
  2. <!-- 结算明细 -->
  3. <view class="pageBg">
  4. <view class="bgImg">
  5. <topNavbar title="结算明细"></topNavbar>
  6. <view class="pad">
  7. <searchRow placeholder="搜索学员姓名/学员手机号" @searchFn="searchFn"/>
  8. <view class="tabs">
  9. <view class="tab" v-for="(item,index) in tabData" :key="index" @click="changeTab(item)"
  10. :class="{active: params.payStep==item.id}" :id="'tab'+item.id">{{ item.text }}</view>
  11. </view>
  12. </view>
  13. <!-- <scroll-view class="scroll-view_w" scroll-x="true" scroll-with-animation
  14. :scroll-into-view="'tab'+params.payStep" scroll-left="140"> -->
  15. <!-- </scroll-view> -->
  16. </view>
  17. <view class="content pad">
  18. <view class="month_row" @click="showDatePicker=true">
  19. <view class="month">{{params.searchMonth}}</view>
  20. <!-- <view class="unit"></view> -->
  21. <view class="">{{ selectDate }}</view>
  22. <view class="iconFont">
  23. <u-icon name="arrow-down" color="#686B73" size="14"></u-icon>
  24. </view>
  25. </view>
  26. <view class="total">结算金额共计: {{ extend }} </view>
  27. <view class="record" v-if="list.length">
  28. <view class="card" v-for="(item,index) in list" :key="index"
  29. @click="$goPage('/pages/indexEntry/settlement/detail/detail')">
  30. <stage :item="item"/>
  31. </view>
  32. </view>
  33. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  34. </view>
  35. <u-datetime-picker :show="showDatePicker" v-model="searchMonth" mode="year-month" :visibleItemCount="4"
  36. :closeOnClickOverlay="false" @confirm="confirmDatePicker" @cancel="showDatePicker=false"></u-datetime-picker>
  37. </view>
  38. </template>
  39. <script>
  40. import stage from '../../tabbar/statistics/comp/stage.vue'
  41. import {
  42. settle_list
  43. } from '@/config/api.js'
  44. export default {
  45. components: {
  46. stage
  47. },
  48. data() {
  49. return {
  50. date3: '',
  51. date2: '',
  52. date1: '',
  53. searchMonth: '',
  54. showDatePicker: false,
  55. show: false,
  56. tabData: [{
  57. text: '全部',
  58. id: 0
  59. },
  60. {
  61. text: '阶段一',
  62. id: 1
  63. },
  64. {
  65. text: '阶段二',
  66. id: 2
  67. },
  68. {
  69. text: '阶段三',
  70. id: 3
  71. },
  72. {
  73. text: '阶段四',
  74. id: 4
  75. }
  76. ],
  77. currentPopTab: 2,
  78. currentBtnDate: 1,
  79. selectDate: '', //筛选日期
  80. params: {
  81. "pageNo": 1,
  82. "pageSize": 20,
  83. "queryCondition": "",
  84. // "coachId": '',
  85. "payStep": 0,
  86. "searchMonth": ''
  87. },
  88. list: [],
  89. status: 'loading',
  90. extend: 0,
  91. total: 0
  92. }
  93. },
  94. onLoad() {
  95. this.searchMonth = this.params.searchMonth = uni.$u.timeFormat(Date.now(), 'yyyy/mm');
  96. console.log(this.params.searchMonth)
  97. this.initList()
  98. },
  99. onPullDownRefresh() {
  100. this.initList()
  101. },
  102. onReachBottom() {
  103. if(this.total>this.list.length) {
  104. this.settle_listFn()
  105. }
  106. },
  107. methods: {
  108. searchFn(val) {
  109. this.params.queryCondition = val
  110. this.initList()
  111. },
  112. initList() {
  113. this.list = []
  114. this.params.pageNo = 1
  115. this.settle_listFn()
  116. },
  117. // tab切换
  118. changeTab(val) {
  119. if(this.params.payStep == val.id) return
  120. this.params.payStep = val.id
  121. this.initList()
  122. },
  123. // 选择时间选择器里的时间
  124. confirmDatePicker(val) {
  125. this.showDatePicker = false
  126. let date = uni.$u.date(val.value, 'yyyy/mm')
  127. this.searchMonth = this.params.searchMonth = date
  128. console.log(this.params.searchMonth)
  129. this.initList()
  130. },
  131. // 请求数据
  132. async settle_listFn() {
  133. let obj = Object.assign({},this.params)
  134. if(obj.payStep==0) delete obj.payStep
  135. obj.searchMonth = obj.searchMonth.replace('/','')
  136. // delete obj.searchMonth
  137. const {
  138. data: res
  139. } = await settle_list(obj)
  140. let list = res.list
  141. this.params.pageNo ++
  142. if(list&&list.length) {
  143. this.list.push(...list)
  144. }
  145. if(this.list.length>=res.total) {
  146. this.status='nomore'
  147. }
  148. this.total = res.total
  149. this.extend = res.extend
  150. }
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. .bgImg {
  156. height: 100%;
  157. }
  158. // .scroll-view_w {
  159. // width: 100%;
  160. // margin: 30rpx 0 0rpx 0;
  161. .tabs {
  162. display: flex;
  163. flex-wrap: nowrap;
  164. justify-content: space-between;
  165. padding: 30rpx 0;
  166. width: 100%;
  167. .tab {
  168. width: 118rpx;
  169. height: 60rpx;
  170. border-radius: 8rpx;
  171. border: 2rpx solid #FFFFFF;
  172. font-size: 28rpx;
  173. color: #fff;
  174. text-align: center;
  175. line-height: 60rpx;
  176. flex-shrink: 0;
  177. &.active {
  178. background-color: #fff;
  179. color: $themC;
  180. }
  181. &.all {
  182. width: 96rpx;
  183. }
  184. }
  185. }
  186. // }
  187. .month_row {
  188. display: flex;
  189. align-items: center;
  190. color: $themC;
  191. padding: 20rpx 0 0rpx 0;
  192. .month {
  193. font-size: 36rpx;
  194. margin-right: 10rpx;
  195. // font-weight: 600;
  196. }
  197. .unit {
  198. font-size: 30rpx;
  199. margin: 0 4rpx;
  200. }
  201. }
  202. .total {
  203. padding: 20rpx 0;
  204. }
  205. .card {
  206. margin-bottom: 24rpx;
  207. }
  208. .popupCon {
  209. height: 430rpx;
  210. .popTab {
  211. display: flex;
  212. padding: 40rpx 32rpx;
  213. .tabItem {
  214. font-size: 32rpx;
  215. color: #333;
  216. margin-right: 60rpx;
  217. &.active {
  218. color: $themC;
  219. position: relative;
  220. &::before {
  221. content: '';
  222. position: absolute;
  223. bottom: -20rpx;
  224. left: 50%;
  225. transform: translateX(-50%);
  226. width: 128rpx;
  227. height: 4rpx;
  228. background: #1989FA;
  229. border-radius: 3rpx;
  230. }
  231. }
  232. }
  233. }
  234. }
  235. .tabCon {
  236. display: flex;
  237. align-items: center;
  238. padding-left: 32rpx;
  239. padding-top: 20rpx;
  240. .dateBtn {
  241. width: 280rpx;
  242. height: 80rpx;
  243. border-radius: 10rpx;
  244. border: 2rpx solid #1989FA;
  245. line-height: 80rpx;
  246. text-align: center;
  247. color: $themC;
  248. font-size: 32rpx;
  249. &.hui {
  250. border: 2rpx solid #E8E9EC;
  251. }
  252. }
  253. .to {
  254. font-size: 32rpx;
  255. margin: 0 40rpx;
  256. }
  257. }
  258. .btnBg {
  259. width: 396rpx;
  260. margin: 34rpx auto 42rpx auto;
  261. }
  262. </style>