settle-order.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="settle-page">
  3. <view class="settle-info">
  4. <view class="label">总收入</view>
  5. <view class="not-settle-price">¥{{moneyConverter(form.unSettleMoney)}}</view>
  6. </view>
  7. <view class="settle-tabs" style="padding-top: 20upx;">
  8. <view class="tabs-wrap" style="padding: 0 20upx;">
  9. <uni-datetime-picker v-model="range" type="daterange" @change="dateChange" />
  10. </view>
  11. <scroll-view class="settle-list" :scroll-y="true">
  12. <view class="line"></view>
  13. <view class="item" v-for="item in settleList" :key="item.accountDate" @click="handItemInfo(item)">
  14. <view class="label">{{ item.accountDate }}</view>
  15. <view class="value">
  16. <view class="price" :class="{ sr: item.actualIncom > 0 }">{{ item.actualIncom > 0 ? '+¥' : '-¥' }}{{ moneyConverter(Math.abs(item.actualIncom)) }}</view>
  17. <u-icon class="more" name="arrow-right" size="22" color="#6c6c6c"></u-icon>
  18. </view>
  19. </view>
  20. </scroll-view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {mapState} from 'vuex';
  26. export default {
  27. data () {
  28. return {
  29. listUrl: '/storeSettlementApi/getStoreStatementListForStore',
  30. active: 0,
  31. itemStyle: {
  32. width: 'calc(50vw - 20rpx)',
  33. height: '80rpx'
  34. },
  35. form: {
  36. settledMoney: 0,
  37. unSettleMoney: 0
  38. },
  39. settleList: [],
  40. range: []
  41. }
  42. },
  43. computed: {
  44. ...mapState(['storeInfo'])
  45. },
  46. methods: {
  47. handItemInfo (item) {
  48. uni.navigateTo({
  49. url: `/pages/tools/settle-info?time=${item.accountDate}&money=${item.actualIncom}&orderNum=${item.orderNum}`
  50. });
  51. },
  52. dateChange(dateRange) {
  53. this.range = dateRange;
  54. this.loadData()
  55. },
  56. activeChange(e) {
  57. this.active = e.index
  58. this.loadData()
  59. },
  60. loadData() {
  61. uni.showLoading({
  62. title: '加载中'
  63. });
  64. var dateStr = (new Date()).getTime();
  65. var sign = this.getSign(dateStr);
  66. let that = this;
  67. let startTime = "";
  68. let endTime = "";
  69. if (this.range.length > 0) {
  70. startTime = this.range[0];
  71. endTime = this.range[1];
  72. }
  73. this.requst({
  74. url: this.listUrl,
  75. data: {
  76. timestamp: dateStr,
  77. sign: sign,
  78. storeId: this.storeInfo.storeId,
  79. startTime: startTime,
  80. endTime: endTime
  81. },
  82. success: res => {
  83. if (res.data.rtnBean.rtnCode == 0) {
  84. uni.hideLoading();
  85. this.settleList = res.data.list;
  86. this.form = res.data.obj;
  87. } else {
  88. uni.hideLoading();
  89. if (res.data.rtnBean.rtnMsg != '') {
  90. this.$api.msg(res.data.rtnBean.rtnMsg);
  91. return;
  92. }
  93. }
  94. },
  95. fail: (e) => {
  96. console.log("接口调用失败:" + JSON.stringify(e));
  97. uni.hideLoading();
  98. },
  99. })
  100. }
  101. },
  102. onLoad () {
  103. this.loadData()
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. .settle-page {
  109. min-height: 100vh;
  110. background-color: #f5f5f5;
  111. }
  112. .settle-info {
  113. background-color: $theme-color;
  114. height: 324rpx;
  115. color: #fff;
  116. padding: 40rpx 40rpx 70rpx;
  117. box-sizing: border-box;
  118. border-radius: 0 0 20rpx 20rpx;
  119. .not-settle-price {
  120. font-weight: bold;
  121. font-size: 56rpx;
  122. text-align: center;
  123. margin: 10rpx 0 42rpx;
  124. }
  125. .yjs {
  126. font-size: $font-base;
  127. }
  128. }
  129. .settle-tabs {
  130. width: calc(100vw - 40rpx);
  131. height: calc(100vh - 324rpx - constant(safe-area-inset-bottom));
  132. height: calc(100vh - 324rpx - env(safe-area-inset-bottom));
  133. margin-left: 20rpx;
  134. border-radius: 10rpx;
  135. position: relative;
  136. top: -40rpx;
  137. background-color: #fff;
  138. }
  139. .settle-list {
  140. width: 100%;
  141. height: calc(100vh - 444rpx - constant(safe-area-inset-bottom));
  142. height: calc(100vh - 444rpx - env(safe-area-inset-bottom));
  143. padding: 0 20rpx;
  144. box-sizing: border-box;
  145. margin-top: -2rpx;
  146. .line {
  147. height: 2rpx;
  148. width: 100%;
  149. background-color: #ececec;
  150. }
  151. .item {
  152. border-bottom: 2rpx solid #ececec;
  153. height: 100rpx;
  154. @include between;
  155. }
  156. .value {
  157. @include between(flex-end);
  158. }
  159. .price {
  160. margin-right: 10rpx;
  161. }
  162. .price.sr {
  163. color: $uni-color-button;
  164. }
  165. }
  166. </style>