contractdetails.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  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 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. searchKeyWord:'',
  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.show) { //此处判断,上锁,防止重复请求
  135. this.pageSize += 1
  136. this.currentPage += 1
  137. this.getList()
  138. }
  139. // }
  140. },
  141. methods: {
  142. search(e){
  143. this.searchKeyWord=e
  144. this.show=false
  145. this.contractList=[]
  146. this.currentPage=1
  147. this.getList()
  148. },
  149. contractclick(status) {
  150. this.show=false
  151. this.currentPage = 1
  152. this.agreementType = status
  153. this.contractList=[]
  154. this.getList()
  155. },
  156. searchTypeclick(status) {
  157. this.show=false
  158. this.currentPage = 1
  159. this.searchType = status
  160. this.contractList=[]
  161. this.getList()
  162. },
  163. getList() {
  164. uni.showLoading({
  165. title: "正在加载"
  166. })
  167. this.$api.doRequest('get', '/contractManagementInfo/selectInfo', {
  168. compId: uni.getStorageSync('pcUserInfo').compId,
  169. goodsType: 1,
  170. agreementType: this.agreementType,
  171. currentPage: this.currentPage,
  172. pageSize: this.pageSize,
  173. searchType: this.searchType,
  174. searchKeyWord:this.searchKeyWord,
  175. appFlag: 1,
  176. }).then(res => {
  177. if (res.data.code) {
  178. uni.hideLoading()
  179. if (res.data.data.records.length > 0) {
  180. this.show = false
  181. if (this.currentPage == 1) {
  182. this.contractList = res.data.data.records
  183. } else {
  184. this.contractList = this.contractList.concat(res.data.data.records)
  185. }
  186. } else {
  187. this.show = true
  188. if (this.currentPage == 1) {
  189. this.contractList = []
  190. }
  191. }
  192. } else {
  193. uni.hideLoading()
  194. uni.showToast({
  195. title: "系统异常,请联系管理员",
  196. icon: 'none',
  197. duration: 2000
  198. })
  199. }
  200. })
  201. }
  202. }
  203. }
  204. </script>
  205. <style lang='scss' scoped>
  206. .fixedbox {
  207. position: fixed;
  208. width: 100%;
  209. top: 0;
  210. background: #fff;
  211. padding-top: 20rpx;
  212. }
  213. .contracttypewrap {
  214. display: flex;
  215. background: #fff;
  216. font-size: 32rpx;
  217. margin: 0 auto;
  218. width: 93%;
  219. .item {
  220. padding: 20rpx;
  221. color: #7A7A7A;
  222. width: 33.3333%;
  223. text-align: center;
  224. }
  225. .item.left {
  226. text-align: left;
  227. }
  228. .item.right {
  229. text-align: right;
  230. }
  231. .item.active {
  232. color: #262626;
  233. font-weight: 600;
  234. }
  235. }
  236. .costwrap {
  237. display: flex;
  238. margin: 10rpx 34rpx;
  239. .item {
  240. padding: 10rpx 20rpx;
  241. color: #333333;
  242. text-align: center;
  243. border-radius: 30rpx;
  244. }
  245. .item.active {
  246. color: #fff;
  247. background: #22C572;
  248. }
  249. }
  250. .contractwrap {
  251. background: #fff;
  252. margin: 20rpx;
  253. padding: 20rpx;
  254. border-radius: 20rpx;
  255. .contractwrap-title {
  256. font-size: 28rpx;
  257. padding: 20rpx;
  258. justify-content: space-between;
  259. border-bottom: 2rpx solid #eee;
  260. align-items: center;
  261. font-weight: 700;
  262. }
  263. .contractwrap-item {
  264. display: flex;
  265. justify-content: space-between;
  266. padding: 10rpx 20rpx;
  267. font-size: 28rpx;
  268. .title {
  269. font-size: 24rpx;
  270. color: #8F8F8F;
  271. }
  272. }
  273. }
  274. .search {
  275. width: 100vw;
  276. background: #fff;
  277. }
  278. .u-search {
  279. width: 94%;
  280. margin: 0 auto !important;
  281. }
  282. </style>