breakdownofprofit.vue 5.5 KB

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