index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <view>
  3. <view v-for='item in dataInfo'>
  4. <view>
  5. 买方{{item.compName}}
  6. </view>
  7. <view>
  8. 卖方{{item.customerName}}
  9. </view>
  10. <view>{{item.paymentNo}}</view>
  11. <view>
  12. <view>{{item.goodsName}}{{item.netWeight}}</view>
  13. <view>单价{{item.tidalGrainPrice}}</view>
  14. </view>
  15. <view>
  16. <view>应付{{item.amountIngPayable}}</view>
  17. <view>单价{{item.amountEdPayable}}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import {
  24. mapState
  25. } from 'vuex';
  26. export default {
  27. name: "business",
  28. data() {
  29. return {
  30. pageSize:10,
  31. currentPage:1,
  32. isLoadMore:false,
  33. searchKeyWord:'',
  34. searchType:'',
  35. dataInfo:[]
  36. }
  37. },
  38. onShow() {
  39. },
  40. onLoad(options) {
  41. this.loadData();
  42. },
  43. computed: {
  44. ...mapState(['hasLogin', 'userInfo']),
  45. },
  46. // onPageScroll(e) {
  47. // this.scrollTop = e.scrollTop;
  48. // },
  49. //下拉刷新
  50. onPullDownRefresh() {
  51. this.currentPage = 1
  52. this.isLoadMore = false
  53. this.loadStatus = 'loading'
  54. this.loadData()
  55. setTimeout(function() {
  56. uni.stopPullDownRefresh();
  57. }, 1000);
  58. },
  59. onReachBottom() { //上拉触底函数
  60. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  61. this.isLoadMore = true
  62. this.currentPage += 1
  63. this.getIndexBuyData()
  64. }
  65. },
  66. methods: {
  67. top() { //回到顶部
  68.     uni.pageScrollTo({
  69.       scrollTop: 0, duration: 300
  70.     });
  71. },
  72. naviageToPage(page) {
  73. page = page + this.TabCur
  74. uni.navigateTo({
  75. url: page,
  76. fail() {
  77. uni.switchTab({
  78. url: page
  79. })
  80. }
  81. })
  82. },
  83. locationChange(e) {
  84. console.log(e)
  85. this.location = this.locationType[e[0]]
  86. this.receivePrivate = this.locationType[e[0]]
  87. this.currentPage = 1
  88. this.loadData()
  89. },
  90. tabSelect(e) {
  91. this.TabCur = e.currentTarget.dataset.id;
  92. this.category = this.TabCur
  93. this.currentPage = 1
  94. this.loadData()
  95. },
  96. //加载商品 ,带下拉刷新和上滑加载
  97. async loadData(type = 'add', loading) {
  98. if(!this.hasLogin){
  99. ni.showModal({
  100. title: '登录提示',
  101. content: '您尚未登录,是否立即登录?',
  102. showCancel: true,
  103. confirmText: '登录',
  104. success: (e) => {
  105. if (e.confirm) {
  106. uni.navigateTo({
  107. url: '/pages/public/login'
  108. })
  109. }
  110. },
  111. fail: () => {},
  112. complete: () => {}
  113. })
  114. }else{
  115. const that = this
  116. uni.showLoading({
  117. title: '正在加载'
  118. })
  119. var param1 = ''
  120. this.$api.doRequest('get', '/paymentManagement/selectPaymentManagement', {
  121. pageSize: this.pageSize,
  122. currentPage: this.currentPage,
  123. searchKeyWord: this.searchKeyWord,
  124. searchType: this.searchType,
  125. managementType:1,
  126. customerPhone:this.userInfo.phone,
  127. pcFlag:1
  128. // warehouseName:'',
  129. }).then(res => {
  130. uni.hideLoading()
  131. this.dataInfo = res.data.data.records
  132. })
  133. .catch(res => {
  134. uni.hideLoading()
  135. if (res.errmsg) {
  136. uni.showToast({
  137. title: res.errmsg,
  138. icon: 'none',
  139. duration: 2000
  140. })
  141. } else {
  142. uni.showToast({
  143. title: "系统异常,请联系管理员",
  144. icon: 'none',
  145. duration: 2000
  146. })
  147. }
  148. });
  149. }
  150. },
  151. }
  152. }
  153. </script>
  154. <style>
  155. </style>