CustomerBalanceDetail.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <view class="tabs-view">
  4. <view class="time-search">
  5. <view class="time-li" @click="timeShow('start_show')">{{ $u.timeFormat(start, 'yyyy-mm-dd') }}</view>
  6. <view class="icon"><u-icon name="arrow-right"></u-icon></view>
  7. <view class="time-li" @click="timeShow('end_show')">{{ $u.timeFormat(end, 'yyyy-mm-dd') }}</view>
  8. </view>
  9. <view class="start-view clearfix">
  10. <text class="float_left">期初余额</text>
  11. <text class="float_right">{{ $_utils.formattedNumber(openingBalance) }}</text>
  12. </view>
  13. </view>
  14. <view class="list-ul">
  15. <view class="list-li" v-for="(item, index) in balance_list" :key="index">
  16. <view class="title">{{ item.no }}</view>
  17. <view class="list-cont">
  18. <view class="info-li type">{{ item.financeType }}</view>
  19. <view class="info-li">源单号:{{ item.sourceNo }}</view>
  20. <view class="money-ul">
  21. <view class="money-li">
  22. <text>销售金额:</text>
  23. {{ $_utils.formattedNumber(item.salesAmount) }}
  24. </view>
  25. <view class="money-li">
  26. <text>优惠金额:</text>
  27. {{ $_utils.formattedNumber(item.discountMoney) }}
  28. </view>
  29. <view class="money-li">
  30. <text>应收金额:</text>
  31. {{ $_utils.formattedNumber(item.receivableAmount) }}
  32. </view>
  33. </view>
  34. <view class="money-ul">
  35. <view class="money-li">
  36. <text>实收金额:</text>
  37. {{ $_utils.formattedNumber(item.actualReceivableAmount) }}
  38. </view>
  39. <view class="money-li">
  40. <text>应收余额:</text>
  41. <text class="money">{{ $_utils.formattedNumber(item.receivableBalance) }}</text>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="remark">{{ item.remark }}</view>
  46. </view>
  47. <Aempty v-if="!balance_list.length" text="暂无数据" src="https://onlineimg.qianniao.vip/data.png"></Aempty>
  48. <u-loadmore v-else :status="load_status" />
  49. </view>
  50. <view class="bottom-view">
  51. <view class="end-view clearfix">
  52. <text class="float_left">期末余额</text>
  53. <text class="float_right">{{ $_utils.formattedNumber(endingBalance) }}</text>
  54. </view>
  55. <view class="clearfix total-view">
  56. <text class="float_left">合计</text>
  57. <view class="float_right">
  58. <view class="money-li">实收金额:{{ $_utils.formattedNumber(actualReceiveTotal) }}</view>
  59. <view class="money-li">
  60. 应收余额:
  61. <text>{{ $_utils.formattedNumber(shouldReceiveTotal) }}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <u-picker v-model="start_show" mode="time" :params="time_params" @confirm="startconfirm"></u-picker>
  67. <u-picker v-model="end_show" mode="time" :params="time_params" @confirm="endconfirm"></u-picker>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. load_status: 'nomore',
  75. balance_list: [],
  76. time_params: {
  77. year: true,
  78. month: true,
  79. day: true,
  80. hour: false,
  81. minute: false,
  82. second: false
  83. },
  84. start_show: false,
  85. end_show: false,
  86. keyword: '',
  87. page: 1,
  88. pageSize: 10,
  89. total: 0,
  90. show: false,
  91. customerId: '',
  92. start: '',
  93. end: '',
  94. openingBalance: 0,
  95. endingBalance: 0,
  96. actualReceiveTotal: 0,
  97. shouldReceiveTotal: 0,
  98. customerData: ''
  99. };
  100. },
  101. computed:{
  102. userInfo(){
  103. return this.$store.state.userStatus
  104. }
  105. },
  106. onReachBottom() {
  107. if (this.total / this.pageSize > this.page) {
  108. this.page += 1;
  109. this.getAllCustomerBalanceDetail();
  110. }
  111. },
  112. onLoad() {
  113. // 开始时间本月第一天 结束时间当前时间
  114. this.start = this.$_utils.dateToStamp(this.$_utils.showMonthFirstDay())
  115. this.end = parseInt(new Date().getTime()/1000)
  116. this.getAllCustomerBalanceDetail();
  117. },
  118. methods: {
  119. clearValue(){
  120. this.keyword = '';
  121. this.customerId = '';
  122. this.page = 1;
  123. this.getAllCustomerBalanceDetail()
  124. },
  125. tabsChange(index) {
  126. this.tabs_current = index;
  127. this.page = 1;
  128. },
  129. timeShow(params) {
  130. this[params] = true;
  131. },
  132. getAllCustomerBalanceDetail() {
  133. this.load_status='loading'
  134. let params = {
  135. page: this.page,
  136. pageSize: this.pageSize,
  137. customerId: this.userInfo.id,
  138. start: this.start,
  139. end: this.end
  140. };
  141. this.$u.api.getAllCustomerBalanceDetail(params).then(res => {
  142. if (this.page === 1) {
  143. this.balance_list = res.data;
  144. } else {
  145. this.balance_list = this.balance_list.concat(res.data);
  146. }
  147. this.openingBalance = res.openingBalance;
  148. this.endingBalance = res.endingBalance;
  149. this.actualReceiveTotal = res.actualReceiveTotal;
  150. this.shouldReceiveTotal = res.shouldReceiveTotal;
  151. this.load_status = this.$_utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  152. this.total = res.pageTotal;
  153. });
  154. },
  155. startconfirm(val) {
  156. this.start = this.$_utils.dateToStamp(val.year + '-' + val.month + '-' + val.day + ' 00:00:00');
  157. this.page = 1;
  158. },
  159. endconfirm(val) {
  160. this.end = this.$_utils.dateToStamp(val.year + '-' + val.month + '-' + val.day + ' 23:59:59');
  161. this.page = 1;
  162. if (!this.customerId) {
  163. this.$u.toast('请选择客户');
  164. return;
  165. }
  166. this.getAllCustomerBalanceDetail();
  167. }
  168. }
  169. };
  170. </script>
  171. <style lang="scss" scoped>
  172. .tabs-view {
  173. position: fixed;
  174. top: 0;
  175. left: 0;
  176. width: 100%;
  177. background-color: #ffffff;
  178. z-index: 99;
  179. .time-search {
  180. line-height: 80rpx;
  181. text-align: center;
  182. border-bottom: 1px solid #eeeeee;
  183. .time-li {
  184. display: inline-block;
  185. width: 350rpx;
  186. }
  187. .icon {
  188. width: 50rpx;
  189. display: inline-block;
  190. }
  191. }
  192. .start-view {
  193. line-height: 80rpx;
  194. padding: 0 30rpx;
  195. background-color: #ffffff;
  196. .float_right {
  197. color: $uni-color-error;
  198. font-size: 32rpx;
  199. font-weight: bold;
  200. }
  201. }
  202. }
  203. .list-ul {
  204. padding-top: 160rpx;
  205. padding-bottom: 200rpx;
  206. .list-li {
  207. width: 710rpx;
  208. margin: 20rpx auto;
  209. padding: 0 30rpx 24rpx;
  210. background-color: #ffffff;
  211. border-radius: 20rpx;
  212. .title {
  213. line-height: 80rpx;
  214. border-bottom: 1px solid #eeeeee;
  215. }
  216. .remark {
  217. line-height: 80rpx;
  218. border-top: 1px solid #eeeeee;
  219. margin-top: 20rpx;
  220. }
  221. .list-cont {
  222. margin-top: 10rpx;
  223. font-size: 24rpx;
  224. line-height: 40rpx;
  225. .type {
  226. font-weight: bold;
  227. font-size: 28rpx;
  228. padding: 10rpx 0;
  229. }
  230. .money-ul {
  231. margin-top: 10rpx;
  232. display: flex;
  233. .money-li {
  234. flex: 3;
  235. text-align: center;
  236. font-weight: bold;
  237. text {
  238. color: #999999;
  239. font-weight: normal;
  240. }
  241. .money {
  242. color: $uni-color-error;
  243. font-weight: bold;
  244. }
  245. &:last-child {
  246. text-align: right;
  247. }
  248. &:first-child {
  249. text-align: left;
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. .bottom-view {
  257. box-shadow: 0px 2px 12rpx rgba(0, 0, 0, 0.2);
  258. position: fixed;
  259. bottom: 0;
  260. width: 100%;
  261. left: 0;
  262. background-color: #ffffff;
  263. padding: 20rpx 30rpx;
  264. z-index: 9;
  265. // line-height: 90rpx;
  266. .end-view {
  267. padding-bottom: 20rpx;
  268. border-bottom: 1px solid #eeeeee;
  269. margin-bottom: 20rpx;
  270. .float_right {
  271. color: $uni-color-error;
  272. font-size: 32rpx;
  273. font-weight: bold;
  274. }
  275. }
  276. .total-view {
  277. color: #6c6c6c;
  278. .float_right {
  279. font-size: 24rpx;
  280. .money-li {
  281. margin-left: 30rpx;
  282. display: inline-block;
  283. text {
  284. color: $uni-color-error;
  285. font-size: 32rpx;
  286. font-weight: bold;
  287. }
  288. }
  289. }
  290. }
  291. }
  292. </style>