breakdownofprofit.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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.show2) { //此处判断,上锁,防止重复请求
  111. this.pageSize += 1
  112. this.currentPage += 1
  113. this.getList()
  114. }
  115. // }
  116. },
  117. methods: {
  118. contractclick(status) {
  119. this.show=false
  120. this.contractList = []
  121. this.currentPage = 1
  122. this.agreementType = status
  123. this.getList()
  124. },
  125. getList() {
  126. uni.showLoading({
  127. title: '数据加载中'
  128. })
  129. this.$api.doRequest('get', '/contractManagementInfo/selectContractInfo', {
  130. searchContractType: this.searchContractType,
  131. currentPage: this.currentPage,
  132. pageSize: this.pageSize,
  133. }).then(res => {
  134. if (res.data.code) {
  135. uni.hideLoading()
  136. if (res.data.data.records.length > 0) {
  137. this.show = false
  138. if (this.currentPage == 1) {
  139. this.contractList = res.data.data.records
  140. } else {
  141. this.contractList = this.contractList.concat(res.data.data.records)
  142. }
  143. } else {
  144. this.show = true
  145. if (this.currentPage == 1) {
  146. this.contractList = []
  147. }
  148. }
  149. } else {
  150. uni.hideLoading()
  151. uni.showToast({
  152. title: "系统异常,请联系管理员",
  153. icon: 'none',
  154. duration: 2000
  155. })
  156. }
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang='scss' scoped>
  163. .fixedbox {
  164. position: fixed;
  165. width: 100%;
  166. top: 0;
  167. background: #fff;
  168. padding-top: 20rpx;
  169. }
  170. .contracttypewrap {
  171. display: flex;
  172. background: #fff;
  173. font-size: 32rpx;
  174. margin: 0 auto;
  175. width: 93%;
  176. .item {
  177. padding: 20rpx;
  178. color: #7A7A7A;
  179. width: 33.3333%;
  180. text-align: center;
  181. }
  182. .item.left {
  183. text-align: left;
  184. }
  185. .item.right {
  186. text-align: right;
  187. }
  188. .item.active {
  189. color: #262626;
  190. font-weight: 600;
  191. }
  192. }
  193. .contractwrap {
  194. background: #fff;
  195. margin: 20rpx;
  196. padding: 20rpx;
  197. border-radius: 20rpx;
  198. .contractwrap-title {
  199. font-size: 28rpx;
  200. padding: 20rpx;
  201. justify-content: space-between;
  202. border-bottom: 2rpx solid #eee;
  203. align-items: center;
  204. }
  205. .contractwrap-item {
  206. display: flex;
  207. justify-content: space-between;
  208. padding: 10rpx 20rpx;
  209. font-size: 28rpx;
  210. .title {
  211. font-size: 24rpx;
  212. color: #8F8F8F;
  213. }
  214. }
  215. }
  216. .search {
  217. width: 100vw;
  218. background: #fff;
  219. }
  220. .u-search {
  221. width: 94%;
  222. margin: 0 auto !important;
  223. }
  224. </style>