breakdownofprofit.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view>
  3. <view class='fixedbox' :style='{"top":customBar+"px"}'>
  4. <view class='search'>
  5. <u-search placeholder='可按合同编号或买方、卖方名称查找' search-icon-color='#AFB3BF' bg-color='#F5F6F9' :shape='"round"'
  6. :clearabled="true" :show-action='false'></u-search>
  7. </view>
  8. <view style='background:#fff;'>
  9. <view class='contracttypewrap'>
  10. <view :class='searchContractType==1?"active":""' class='item left'>销售</view>
  11. <view :class='searchContractType==2?"active":""' class='item'>采购</view>
  12. <view :class='searchContractType==5?"active":""' class='item'>收购</view>
  13. <view :class='searchContractType==3?"active":""' class='item'>代收</view>
  14. <view :class='searchContractType==4?"active":""' class='item right'>代储</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view style='margin:184rpx 20rpx 20rpx;' v-if='contractList.length>0'>
  19. <view class='contractwrap' v-for='(item,index) in contractList'>
  20. <view class='flex contractwrap-title'>
  21. <view class='contractNo' style="font-weight: 700;">{{item.contractNo}}</view>
  22. </view>
  23. <view class='flex contractwrap-item'>
  24. <view class="title">买方</view>
  25. <view>{{item.buyer}}</view>
  26. </view>
  27. <view class='flex contractwrap-item'>
  28. <view class="title">卖方</view>
  29. <view>{{item.seller}}</view>
  30. </view>
  31. <view class='flex contractwrap-item'>
  32. <view class="title">最终完成量(吨)</view>
  33. <view>{{item.finalTradingVolume}}</view>
  34. </view>
  35. <view class='flex contractwrap-item'>
  36. <view class="title">利润(元)</view>
  37. <view>{{item.profit}}</view>
  38. </view>
  39. <view class='flex contractwrap-item'>
  40. <view class="title">结算日期</view>
  41. <view>{{item.settlementDate}}</view>
  42. </view>
  43. </view>
  44. </view>
  45. <view v-if='show' :style="{'margin-top':contractList.length==0?'184rpx':'0'}"
  46. style='text-align:center;background:#F2F6FA;'>暂无更多数据</view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. data() {
  52. return {
  53. customBar: 0,
  54. contractType: 1,
  55. searchContractType: 1,
  56. currentPage: 1,
  57. pageSize: 10,
  58. show: false,
  59. contractList: []
  60. }
  61. },
  62. onLoad() {
  63. uni.getSystemInfo({
  64. success: (e) => {
  65. // this.compareVersion(e.SDKVersion, '2.5.0')
  66. let statusBar = 0 //状态栏高度
  67. let customBar = 0 // 状态栏高度 + 导航栏高度
  68. let navbar = 0 // 自定义标题与胶囊对齐高度
  69. // #ifdef MP
  70. statusBar = e.statusBarHeight
  71. customBar = e.statusBarHeight + 45
  72. if (e.platform === 'android') {
  73. this.$store.commit('SET_SYSTEM_IOSANDROID', false)
  74. customBar = e.statusBarHeight + 50
  75. }
  76. // #endif
  77. // #ifdef MP-WEIXIN
  78. statusBar = e.statusBarHeight
  79. const custom = wx.getMenuButtonBoundingClientRect()
  80. customBar = custom.bottom + custom.top - e.statusBarHeight
  81. navbar = (custom.top - e.statusBarHeight) * 2 + custom.height
  82. // #endif
  83. // #ifdef MP-ALIPAY
  84. statusBar = e.statusBarHeight
  85. customBar = e.statusBarHeight + e.titleBarHeight
  86. // #endif
  87. // #ifdef APP-PLUS
  88. console.log('app-plus', e)
  89. statusBar = e.statusBarHeight
  90. customBar = e.statusBarHeight + 45
  91. // #endif
  92. // #ifdef H5
  93. statusBar = 0
  94. customBar = e.statusBarHeight + 45
  95. // #endif
  96. this.customBar = customBar
  97. }
  98. })
  99. },
  100. onShow() {
  101. this.getList()
  102. },
  103. onReachBottom() { //上拉触底函数
  104. // if (this.statusFlag == 3) {
  105. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  106. this.pageSize += 1
  107. this.currentPage += 1
  108. this.getList()
  109. }
  110. // }
  111. },
  112. methods: {
  113. getList() {
  114. uni.showLoading({
  115. title: '数据加载中'
  116. })
  117. this.$api.doRequest('get', '/contractManagementInfo/selectContractInfo', {
  118. searchContractType: this.searchContractType,
  119. currentPage: this.currentPage,
  120. pageSize: this.pageSize,
  121. }).then(res => {
  122. if (res.data.code) {
  123. uni.hideLoading()
  124. if (res.data.data.records.length > 0) {
  125. this.show = false
  126. if (this.currentPage == 1) {
  127. this.contractList = res.data.data.records
  128. } else {
  129. this.contractList = this.contractList.concat(res.data.data.records)
  130. }
  131. } else {
  132. this.show = true
  133. if (this.currentPage == 1) {
  134. this.contractList = []
  135. }
  136. }
  137. } else {
  138. uni.hideLoading()
  139. uni.showToast({
  140. title: "系统异常,请联系管理员",
  141. icon: 'none',
  142. duration: 2000
  143. })
  144. }
  145. })
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang='scss' scoped>
  151. .fixedbox {
  152. position: fixed;
  153. width: 100%;
  154. top: 0;
  155. background: #fff;
  156. padding-top: 20rpx;
  157. }
  158. .contracttypewrap {
  159. display: flex;
  160. background: #fff;
  161. font-size: 32rpx;
  162. margin: 0 auto;
  163. width: 93%;
  164. .item {
  165. padding: 20rpx;
  166. color: #7A7A7A;
  167. width: 33.3333%;
  168. text-align: center;
  169. }
  170. .item.left {
  171. text-align: left;
  172. }
  173. .item.right {
  174. text-align: right;
  175. }
  176. .item.active {
  177. color: #262626;
  178. font-weight: 600;
  179. }
  180. }
  181. .contractwrap {
  182. background: #fff;
  183. margin: 20rpx;
  184. padding: 20rpx;
  185. border-radius: 20rpx;
  186. .contractwrap-title {
  187. font-size: 28rpx;
  188. padding: 20rpx;
  189. justify-content: space-between;
  190. border-bottom: 2rpx solid #eee;
  191. align-items: center;
  192. }
  193. .contractwrap-item {
  194. display: flex;
  195. justify-content: space-between;
  196. padding: 10rpx 20rpx;
  197. font-size: 28rpx;
  198. .title {
  199. font-size: 24rpx;
  200. color: #8F8F8F;
  201. }
  202. }
  203. }
  204. .search {
  205. width: 100vw;
  206. background: #fff;
  207. }
  208. .u-search {
  209. width: 94%;
  210. margin: 0 auto !important;
  211. }
  212. </style>