contractdetails.vue 7.6 KB

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