CustomerBalanceDetail.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view>
  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') }}</view>
  17. <view class="icon"><u-icon name="arrow-right"></u-icon></view>
  18. <view class="time-li" @click="timeShow('end_show')">{{ $u.timeFormat(end, 'yyyy-mm-dd') }}</view>
  19. </view>
  20. <view class="start-view clearfix">
  21. <text class="float_left">期初余额</text>
  22. <text class="float_right">{{ $utils.formattedNumber(openingBalance) }}</text>
  23. </view>
  24. </view>
  25. <view class="list-ul">
  26. <!-- <view class="list-li">
  27. <view class="title">416202103093535051261</view>
  28. <view class="list-cont">
  29. <view class="info-li type">应收单</view>
  30. <view class="info-li">源单号:31202103093505289333</view>
  31. <view class="money-ul">
  32. <view class="money-li"><text>销售金额:</text>¥100</view>
  33. <view class="money-li"><text>优惠金额:</text>¥100</view>
  34. <view class="money-li"><text>应收金额:</text>¥100</view>
  35. </view>
  36. <view class="money-ul">
  37. <view class="money-li"><text>实收金额:</text>¥100</view>
  38. <view class="money-li"><text>应收余额:</text><text class="money">¥100</text></view>
  39. </view>
  40. </view>
  41. <view class="remark">
  42. 应收单审核通过,本单据应收12299877.0000元
  43. </view>
  44. </view> -->
  45. <view class="list-li" v-for="(item, index) in order_list">
  46. <view class="title">{{ item.no }}</view>
  47. <view class="list-cont">
  48. <view class="info-li type">{{ item.financeType }}</view>
  49. <view class="info-li">源单号:{{ item.sourceNo }}</view>
  50. <view class="money-ul">
  51. <view class="money-li">
  52. <text>销售金额:</text>
  53. {{ $utils.formattedNumber(item.salesAmount) }}
  54. </view>
  55. <view class="money-li">
  56. <text>优惠金额:</text>
  57. {{ $utils.formattedNumber(item.discountMoney) }}
  58. </view>
  59. <view class="money-li">
  60. <text>应收金额:</text>
  61. {{ $utils.formattedNumber(item.receivableAmount) }}
  62. </view>
  63. </view>
  64. <view class="money-ul">
  65. <view class="money-li">
  66. <text>实收金额:</text>
  67. {{ $utils.formattedNumber(item.actualReceivableAmount) }}
  68. </view>
  69. <view class="money-li">
  70. <text>应收余额:</text>
  71. <text class="money">{{ $utils.formattedNumber(item.receivableBalance) }}</text>
  72. </view>
  73. </view>
  74. </view>
  75. <view class="remark">{{ item.remark }}</view>
  76. </view>
  77. <!-- <view v-if="!balance_list.length" class="empty-view"><u-empty text="暂无数据" mode="list"></u-empty></view> -->
  78. <u-loadmore :status="load_status" />
  79. </view>
  80. <view class="bottom-view">
  81. <view class="end-view clearfix">
  82. <text class="float_left">期末余额</text>
  83. <text class="float_right">{{ $utils.formattedNumber(endingBalance) }}</text>
  84. </view>
  85. <view class="clearfix total-view">
  86. <text class="float_left">合计</text>
  87. <view class="float_right">
  88. <view class="money-li">实收金额:{{ $utils.formattedNumber(actualReceiveTotal) }}</view>
  89. <view class="money-li">
  90. 应收余额:
  91. <text>{{ $utils.formattedNumber(shouldReceiveTotal) }}</text>
  92. </view>
  93. </view>
  94. </view>
  95. </view>
  96. <u-picker v-model="start_show" mode="time" :params="time_params" @confirm="startconfirm"></u-picker>
  97. <u-picker v-model="end_show" mode="time" :params="time_params" @confirm="endconfirm"></u-picker>
  98. <!-- <u-select v-model="show" :list="list" label-name='name' value-name='id' @confirm='confirm'></u-select> -->
  99. </view>
  100. </template>
  101. <script>
  102. export default {
  103. data() {
  104. return {
  105. load_status: 'nomore',
  106. balance_list: [],
  107. time_params: {
  108. year: true,
  109. month: true,
  110. day: true,
  111. hour: false,
  112. minute: false,
  113. second: false
  114. },
  115. start_show: false,
  116. end_show: false,
  117. tabs_current: 0,
  118. tabs_list: [
  119. {
  120. name: '有财务往来'
  121. },
  122. {
  123. name: '无财务往来'
  124. }
  125. ],
  126. keyword: '',
  127. page: 1,
  128. pageSize: 10,
  129. total: 0,
  130. list: [],
  131. show: false,
  132. customerId: '',
  133. start: '',
  134. end: '',
  135. order_list: [],
  136. openingBalance: 0,
  137. endingBalance: 0,
  138. actualReceiveTotal: 0,
  139. shouldReceiveTotal: 0,
  140. customerData: ''
  141. };
  142. },
  143. onLoad(options) {
  144. if(options.customerId){
  145. this.customerId = options.customerId
  146. this.getAllCustomerBalanceDetail()
  147. }
  148. },
  149. watch: {
  150. customerData(val) {
  151. if (val) {
  152. this.keyword = val.name;
  153. this.customerId = val.id;
  154. this.getAllCustomerBalanceDetail();
  155. }
  156. }
  157. },
  158. onReachBottom() {
  159. if (this.total / this.pageSize > this.page) {
  160. this.page += 1;
  161. this.getAllCustomerBalanceDetail();
  162. }
  163. },
  164. methods: {
  165. clearValue(){
  166. this.keyword = '';
  167. this.customerId = '';
  168. this.page = 1;
  169. this.getAllCustomerBalanceDetail()
  170. },
  171. tabsChange(index) {
  172. this.tabs_current = index;
  173. this.page = 1;
  174. },
  175. timeShow(params) {
  176. this[params] = true;
  177. },
  178. getAllCustomerBalanceDetail() {
  179. let params = {
  180. page: this.page,
  181. pageSize: this.pageSize,
  182. customerId: this.customerId,
  183. start: this.start,
  184. end: this.end
  185. };
  186. this.$u.api.getAllCustomerBalanceDetail(params).then(res => {
  187. if (this.page === 1) {
  188. this.order_list = res.data;
  189. } else {
  190. this.order_list = this.order_list.concat(res.data);
  191. }
  192. this.openingBalance = res.openingBalance;
  193. this.endingBalance = res.endingBalance;
  194. this.actualReceiveTotal = res.actualReceiveTotal;
  195. this.shouldReceiveTotal = res.shouldReceiveTotal;
  196. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  197. this.total = res.pageTotal;
  198. });
  199. },
  200. // getAllCustomer() {
  201. // let params = {
  202. // page: 1,
  203. // pageSize: 99,
  204. // enableStatus: 5,
  205. // status: 2,
  206. // }
  207. // this.$u.api.getAllCustomer(params).then(res => {
  208. // this.list = res.data
  209. // });
  210. // },
  211. // confirm(val) {
  212. // this.keyword = val[0].label
  213. // this.customerId = val[0].value
  214. // this.getAllCustomerBalanceDetail()
  215. // },
  216. startconfirm(val) {
  217. this.start = this.$utils.timeByTimestamp(val.year + '-' + val.month + '-' + val.day + ' 00:00:00');
  218. this.page = 1;
  219. },
  220. endconfirm(val) {
  221. this.end = this.$utils.timeByTimestamp(val.year + '-' + val.month + '-' + val.day + ' 23:59:59');
  222. this.page = 1;
  223. if (!this.customerId) {
  224. this.$u.toast('请选择客户');
  225. return;
  226. }
  227. this.getAllCustomerBalanceDetail();
  228. }
  229. }
  230. };
  231. </script>
  232. <style lang="scss" scoped>
  233. .tabs-view {
  234. position: fixed;
  235. top: 0;
  236. left: 0;
  237. width: 100%;
  238. background-color: #ffffff;
  239. z-index: 99;
  240. .keyword-view {
  241. padding: 20rpx 24rpx 0;
  242. }
  243. .time-search {
  244. line-height: 80rpx;
  245. text-align: center;
  246. border-bottom: 1px solid #eeeeee;
  247. .time-li {
  248. display: inline-block;
  249. width: 350rpx;
  250. }
  251. .icon {
  252. width: 50rpx;
  253. display: inline-block;
  254. }
  255. }
  256. .start-view {
  257. line-height: 80rpx;
  258. padding: 0 30rpx;
  259. background-color: #ffffff;
  260. .float_right {
  261. color: $uni-color-error;
  262. font-size: 32rpx;
  263. font-weight: bold;
  264. }
  265. }
  266. }
  267. .list-ul {
  268. padding-top: 240rpx;
  269. .list-li {
  270. width: 710rpx;
  271. margin: 20rpx auto;
  272. padding: 0 30rpx 24rpx;
  273. background-color: #ffffff;
  274. border-radius: 20rpx;
  275. .title {
  276. line-height: 80rpx;
  277. border-bottom: 1px solid #eeeeee;
  278. }
  279. .remark {
  280. line-height: 80rpx;
  281. border-top: 1px solid #eeeeee;
  282. margin-top: 20rpx;
  283. }
  284. .list-cont {
  285. margin-top: 10rpx;
  286. font-size: 24rpx;
  287. line-height: 40rpx;
  288. .type {
  289. font-weight: bold;
  290. font-size: 28rpx;
  291. padding: 10rpx 0;
  292. }
  293. .money-ul {
  294. margin-top: 10rpx;
  295. display: flex;
  296. .money-li {
  297. flex: 3;
  298. text-align: center;
  299. font-weight: bold;
  300. text {
  301. color: #999999;
  302. font-weight: normal;
  303. }
  304. .money {
  305. color: $uni-color-error;
  306. font-weight: bold;
  307. }
  308. &:last-child {
  309. text-align: right;
  310. }
  311. &:first-child {
  312. text-align: left;
  313. }
  314. }
  315. }
  316. }
  317. }
  318. }
  319. .bottom-view {
  320. box-shadow: 0px 2px 12rpx rgba(0, 0, 0, 0.2);
  321. position: fixed;
  322. bottom: 0;
  323. width: 100%;
  324. left: 0;
  325. background-color: #ffffff;
  326. padding: 20rpx 30rpx;
  327. z-index: 9;
  328. // line-height: 90rpx;
  329. .end-view {
  330. padding-bottom: 20rpx;
  331. border-bottom: 1px solid #eeeeee;
  332. margin-bottom: 20rpx;
  333. .float_right {
  334. color: $uni-color-error;
  335. font-size: 32rpx;
  336. font-weight: bold;
  337. }
  338. }
  339. .total-view {
  340. color: #6c6c6c;
  341. .float_right {
  342. font-size: 24rpx;
  343. .money-li {
  344. margin-left: 30rpx;
  345. display: inline-block;
  346. text {
  347. color: $uni-color-error;
  348. font-size: 32rpx;
  349. font-weight: bold;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. </style>