breakdownofprofit.vue 5.9 KB

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