breakdownofprofit.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view>
  3. <view class='fixedbox'>
  4. <view class='search'>
  5. <u-search @custom='search' placeholder='可按合同编号或买方、卖方名称查找' search-icon-color='#AFB3BF' bg-color='#F5F6F9' :shape='"round"'
  6. :clearabled="true"></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. searchKeyWord:'',
  64. show: false,
  65. contractList: []
  66. }
  67. },
  68. onLoad() {
  69. uni.getSystemInfo({
  70. success: (e) => {
  71. // this.compareVersion(e.SDKVersion, '2.5.0')
  72. let statusBar = 0 //状态栏高度
  73. let customBar = 0 // 状态栏高度 + 导航栏高度
  74. let navbar = 0 // 自定义标题与胶囊对齐高度
  75. // #ifdef MP
  76. statusBar = e.statusBarHeight
  77. customBar = e.statusBarHeight + 45
  78. if (e.platform === 'android') {
  79. this.$store.commit('SET_SYSTEM_IOSANDROID', false)
  80. customBar = e.statusBarHeight + 50
  81. }
  82. // #endif
  83. // #ifdef MP-WEIXIN
  84. statusBar = e.statusBarHeight
  85. const custom = wx.getMenuButtonBoundingClientRect()
  86. customBar = custom.bottom + custom.top - e.statusBarHeight
  87. navbar = (custom.top - e.statusBarHeight) * 2 + custom.height
  88. // #endif
  89. // #ifdef MP-ALIPAY
  90. statusBar = e.statusBarHeight
  91. customBar = e.statusBarHeight + e.titleBarHeight
  92. // #endif
  93. // #ifdef APP-PLUS
  94. console.log('app-plus', e)
  95. statusBar = e.statusBarHeight
  96. customBar = e.statusBarHeight + 45
  97. // #endif
  98. // #ifdef H5
  99. statusBar = 0
  100. customBar = e.statusBarHeight + 45
  101. // #endif
  102. this.customBar = customBar
  103. }
  104. })
  105. },
  106. onShow() {
  107. this.getList()
  108. },
  109. onReachBottom() { //上拉触底函数
  110. // if (this.statusFlag == 3) {
  111. if (!this.show2) { //此处判断,上锁,防止重复请求
  112. this.pageSize += 1
  113. this.currentPage += 1
  114. this.getList()
  115. }
  116. // }
  117. },
  118. methods: {
  119. search(e){
  120. this.searchKeyWord=e
  121. this.show=false
  122. this.contractList=[]
  123. this.currentPage=1
  124. this.getList()
  125. },
  126. contractclick(status) {
  127. this.show=false
  128. this.contractList = []
  129. this.currentPage = 1
  130. this.agreementType = status
  131. this.getList()
  132. },
  133. getList() {
  134. uni.showLoading({
  135. title: '数据加载中'
  136. })
  137. this.$api.doRequest('get', '/contractManagementInfo/selectContractInfo', {
  138. agreementType: this.agreementType,
  139. currentPage: this.currentPage,
  140. pageSize: this.pageSize,
  141. searchKeyWord:this.searchKeyWord,
  142. }).then(res => {
  143. if (res.data.code) {
  144. uni.hideLoading()
  145. if (res.data.data.records.length > 0) {
  146. this.show = false
  147. if (this.currentPage == 1) {
  148. this.contractList = res.data.data.records
  149. } else {
  150. this.contractList = this.contractList.concat(res.data.data.records)
  151. }
  152. } else {
  153. this.show = true
  154. if (this.currentPage == 1) {
  155. this.contractList = []
  156. }
  157. }
  158. } else {
  159. uni.hideLoading()
  160. uni.showToast({
  161. title: "系统异常,请联系管理员",
  162. icon: 'none',
  163. duration: 2000
  164. })
  165. }
  166. })
  167. }
  168. }
  169. }
  170. </script>
  171. <style lang='scss' scoped>
  172. .fixedbox {
  173. position: fixed;
  174. width: 100%;
  175. top: 0;
  176. background: #fff;
  177. padding-top: 20rpx;
  178. }
  179. .contracttypewrap {
  180. display: flex;
  181. background: #fff;
  182. font-size: 32rpx;
  183. margin: 0 auto;
  184. width: 93%;
  185. .item {
  186. padding: 20rpx;
  187. color: #7A7A7A;
  188. width: 33.3333%;
  189. text-align: center;
  190. }
  191. .item.left {
  192. text-align: left;
  193. }
  194. .item.right {
  195. text-align: right;
  196. }
  197. .item.active {
  198. color: #262626;
  199. font-weight: 600;
  200. }
  201. }
  202. .contractwrap {
  203. background: #fff;
  204. margin: 20rpx;
  205. padding: 20rpx;
  206. border-radius: 20rpx;
  207. .contractwrap-title {
  208. font-size: 28rpx;
  209. padding: 20rpx;
  210. justify-content: space-between;
  211. border-bottom: 2rpx solid #eee;
  212. align-items: center;
  213. }
  214. .contractwrap-item {
  215. display: flex;
  216. justify-content: space-between;
  217. padding: 10rpx 20rpx;
  218. font-size: 28rpx;
  219. .title {
  220. font-size: 24rpx;
  221. color: #8F8F8F;
  222. }
  223. }
  224. }
  225. .search {
  226. width: 100vw;
  227. background: #fff;
  228. }
  229. .u-search {
  230. width: 94%;
  231. margin: 0 auto !important;
  232. }
  233. </style>