contractdetails.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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='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 class='costwrap'>
  23. <view :class='searchType==""?"active":""' @click='searchTypeclick("")' class='item'>全部</view>
  24. <view :class='searchType==5?"active":""' @click='searchTypeclick(5)' class='item'>待执行</view>
  25. <view :class='searchType==6?"active":""' @click='searchTypeclick(6)' class='item'>执行中</view>
  26. <view :class='searchType==2?"active":""' @click='searchTypeclick(2)' class='item'>已完成</view>
  27. </view>
  28. </view>
  29. <view style='margin:260rpx 20rpx 20rpx;' v-if='contractList.length>0'>
  30. <view class='contractwrap' v-for='(item,index) in contractList'>
  31. <view class='flex contractwrap-title'>
  32. <view class='contractNo'>{{item.contractNo}}</view>
  33. <view v-if='item.status=="待执行"' style='color:#FE6430;' class='status'>{{item.status}}</view>
  34. <view v-if='item.status=="已完成"' style='color:#AFB3BF;' class='status'>{{item.status}}</view>
  35. <view v-if='item.status=="执行中"' style='color:#22C572;' class='status'>{{item.status}}</view>
  36. </view>
  37. <view class='flex contractwrap-item'>
  38. <view class="title">买方</view>
  39. <view>{{item.buyer}}</view>
  40. </view>
  41. <view class='flex contractwrap-item'>
  42. <view class="title">卖方</view>
  43. <view>{{item.seller}}</view>
  44. </view>
  45. <view class='flex contractwrap-item'>
  46. <view class="title">合同重量(吨)</view>
  47. <view>{{item.weight}}</view>
  48. </view>
  49. <view class='flex contractwrap-item'>
  50. <view class="title">合同单价(元/吨)</view>
  51. <view v-if="item.priceType='随行就市'">随行就市</view>
  52. <view v-else>{{item.unitContractPrice?item.unitContractPrice:0}}</view>
  53. </view>
  54. <view class='flex contractwrap-item'>
  55. <view class="title">合同总价(元)</view>
  56. <view v-if="item.priceType='随行就市'"></view>
  57. <view v-else>{{item.totalContractPrice?item.totalContractPrice:0}}</view>
  58. </view>
  59. <view class='flex contractwrap-item'>
  60. <view class="title">已付款(元)</view>
  61. <view>{{item.mildewGrain}}</view>
  62. </view>
  63. <view class='flex contractwrap-item'>
  64. <view class="title">已开发票(元)</view>
  65. <view>{{item.invoiced?item.invoiced:0}}</view>
  66. </view>
  67. <view class='flex contractwrap-item'>
  68. <view class="title">签订日期</view>
  69. <view>{{item.signingDate}}</view>
  70. </view>
  71. </view>
  72. </view>
  73. <view v-if='show' :style="{'margin-top':contractList.length==0?'260rpx':'0'}"
  74. style='text-align:center;background:#F2F6FA;'>暂无更多数据</view>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. data() {
  80. return {
  81. customBar: 0,
  82. // contractType:1,
  83. agreementType: '销售合同',
  84. currentPage: 1,
  85. pageSize: 10,
  86. searchType: '',
  87. show: false,
  88. contractList: []
  89. }
  90. },
  91. onLoad() {
  92. uni.getSystemInfo({
  93. success: (e) => {
  94. // this.compareVersion(e.SDKVersion, '2.5.0')
  95. let statusBar = 0 //状态栏高度
  96. let customBar = 0 // 状态栏高度 + 导航栏高度
  97. let navbar = 0 // 自定义标题与胶囊对齐高度
  98. // #ifdef MP
  99. statusBar = e.statusBarHeight
  100. customBar = e.statusBarHeight + 45
  101. if (e.platform === 'android') {
  102. this.$store.commit('SET_SYSTEM_IOSANDROID', false)
  103. customBar = e.statusBarHeight + 50
  104. }
  105. // #endif
  106. // #ifdef MP-WEIXIN
  107. statusBar = e.statusBarHeight
  108. const custom = wx.getMenuButtonBoundingClientRect()
  109. customBar = custom.bottom + custom.top - e.statusBarHeight
  110. navbar = (custom.top - e.statusBarHeight) * 2 + custom.height
  111. // #endif
  112. // #ifdef MP-ALIPAY
  113. statusBar = e.statusBarHeight
  114. customBar = e.statusBarHeight + e.titleBarHeight
  115. // #endif
  116. // #ifdef APP-PLUS
  117. console.log('app-plus', e)
  118. statusBar = e.statusBarHeight
  119. customBar = e.statusBarHeight + 45
  120. // #endif
  121. // #ifdef H5
  122. statusBar = 0
  123. customBar = e.statusBarHeight + 45
  124. // #endif
  125. this.customBar = customBar
  126. }
  127. })
  128. },
  129. onShow() {
  130. this.getList()
  131. },
  132. onReachBottom() { //上拉触底函数
  133. // if (this.statusFlag == 3) {
  134. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  135. this.pageSize += 1
  136. this.currentPage += 1
  137. this.getList()
  138. }
  139. // }
  140. },
  141. methods: {
  142. contractclick(status) {
  143. this.currentPage = 1
  144. this.agreementType = status
  145. this.getList()
  146. },
  147. searchTypeclick(status) {
  148. this.currentPage = 1
  149. this.searchType = status
  150. this.getList()
  151. },
  152. getList() {
  153. uni.showLoading({
  154. title: "正在加载"
  155. })
  156. this.$api.doRequest('get', '/contractManagementInfo/selectInfo', {
  157. compId: uni.getStorageSync('pcUserInfo').compId,
  158. goodsType: 1,
  159. agreementType: this.agreementType,
  160. currentPage: this.currentPage,
  161. pageSize: this.pageSize,
  162. searchType: this.searchType,
  163. appFlag: 1,
  164. }).then(res => {
  165. if (res.data.code) {
  166. uni.hideLoading()
  167. if (res.data.data.records.length > 0) {
  168. this.show = false
  169. if (this.currentPage == 1) {
  170. this.contractList = res.data.data.records
  171. } else {
  172. this.contractList = this.contractList.concat(res.data.data.records)
  173. }
  174. } else {
  175. this.show = true
  176. if (this.currentPage == 1) {
  177. this.contractList = []
  178. }
  179. }
  180. } else {
  181. uni.hideLoading()
  182. uni.showToast({
  183. title: "系统异常,请联系管理员",
  184. icon: 'none',
  185. duration: 2000
  186. })
  187. }
  188. })
  189. }
  190. }
  191. }
  192. </script>
  193. <style lang='scss' scoped>
  194. .fixedbox {
  195. position: fixed;
  196. width: 100%;
  197. top: 0;
  198. background: #fff;
  199. padding-top: 20rpx;
  200. }
  201. .contracttypewrap {
  202. display: flex;
  203. background: #fff;
  204. font-size: 32rpx;
  205. margin: 0 auto;
  206. width: 93%;
  207. .item {
  208. padding: 20rpx;
  209. color: #7A7A7A;
  210. width: 33.3333%;
  211. text-align: center;
  212. }
  213. .item.left {
  214. text-align: left;
  215. }
  216. .item.right {
  217. text-align: right;
  218. }
  219. .item.active {
  220. color: #262626;
  221. font-weight: 600;
  222. }
  223. }
  224. .costwrap {
  225. display: flex;
  226. margin: 10rpx 34rpx;
  227. .item {
  228. padding: 10rpx 20rpx;
  229. color: #333333;
  230. text-align: center;
  231. border-radius: 30rpx;
  232. }
  233. .item.active {
  234. color: #fff;
  235. background: #22C572;
  236. }
  237. }
  238. .contractwrap {
  239. background: #fff;
  240. margin: 20rpx;
  241. padding: 20rpx;
  242. border-radius: 20rpx;
  243. .contractwrap-title {
  244. font-size: 28rpx;
  245. padding: 20rpx;
  246. justify-content: space-between;
  247. border-bottom: 2rpx solid #eee;
  248. align-items: center;
  249. font-weight: 700;
  250. }
  251. .contractwrap-item {
  252. display: flex;
  253. justify-content: space-between;
  254. padding: 10rpx 20rpx;
  255. font-size: 28rpx;
  256. .title {
  257. font-size: 24rpx;
  258. color: #8F8F8F;
  259. }
  260. }
  261. }
  262. .search {
  263. width: 100vw;
  264. background: #fff;
  265. }
  266. .u-search {
  267. width: 94%;
  268. margin: 0 auto !important;
  269. }
  270. </style>