contractdetails.vue 7.7 KB

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