contract-list.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!-- 选择合同 -->
  2. <template>
  3. <view class="container-wrap">
  4. <uni-nav-bar title="选择合同" :status-bar="true" background-color="#3F92F9" color="#FFF">
  5. <view slot="left">
  6. <u-icon name="account-fill" color="#FFF" size="35"></u-icon>
  7. <span style="padding: 0 5rpx;color: #FFFFFF;">{{ userInfo.name }}</span>
  8. </view>
  9. <view slot="right" @tap="$utils.back()">
  10. <span style="color: #FFFFFF;">返回</span>
  11. </view>
  12. </uni-nav-bar>
  13. <view class="container">
  14. <scroll-view scroll-y style="height: 100%;width: 100%;" @scrolltolower="loadMore()">
  15. <view class="list">
  16. <view class="item" v-for="(item, index) in data" :key="index" @tap="chooseContract(item)">
  17. <view class="row">
  18. <view class="col">
  19. <view class="label">供应商:</view>
  20. <view class="value">{{ item.supplierName }}</view>
  21. </view>
  22. </view>
  23. <view class="row">
  24. <view class="col">
  25. <view class="label">合同编号:</view>
  26. <view class="value">{{ item.purchaseBillNo }}</view>
  27. </view>
  28. <view class="col" style="flex: 0;width: 200rpx;">
  29. <view class="label" style="width: 100rpx;">批次:</view>
  30. <view class="value">{{ item.batchNo.split('-')[item.batchNo.split('-').length - 1] }}</view>
  31. </view>
  32. </view>
  33. <view class="row">
  34. <view class="col">
  35. <view class="label">发货时间:</view>
  36. <view class="value">{{ item.shipTime }}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <u-loadmore :status="loadStatus" @loadmore="loadMore" />
  42. </scroll-view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. // #ifdef APP-PLUS
  48. // #endif
  49. export default {
  50. data() {
  51. return {
  52. materialCode: '',
  53. isReading: false,
  54. data: []
  55. };
  56. },
  57. methods: {
  58. /* 选择合同 */
  59. chooseContract(item) {
  60. uni.$emit('chooseContract', {
  61. purchaseBillNo: item.purchaseBillNo,
  62. batchNo: item.batchNo
  63. })
  64. this.$utils.back()
  65. },
  66. getList() {
  67. console.log(this.materialCode)
  68. this.$http.GetContractBatchPageList({
  69. pageIndex: this.pageIndex,
  70. pageSize: this.pageSize,
  71. materialCode: this.materialCode
  72. }).then(res => {
  73. console.log(res)
  74. if (res.code === 0) {
  75. this.data.push(...res.result.list)
  76. if(res.result.isLastPage) {
  77. this.loadStatus = 'nomore'
  78. }else {
  79. this.loadStatus = 'loadmore'
  80. }
  81. }
  82. })
  83. }
  84. },
  85. onLoad(option) {
  86. this.materialCode = option.materialCode
  87. this.getList()
  88. },
  89. onUnload() {}
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .container-wrap {
  94. overflow: hidden;
  95. .container {
  96. padding: 10rpx;
  97. height: calc(100vh - var(--status-bar-height) - 44px);
  98. overflow: auto;
  99. .info {
  100. padding: 10rpx 20rpx;
  101. font-size: 32rpx;
  102. }
  103. .list {
  104. .item {
  105. padding: 20rpx;
  106. margin-bottom: 10rpx;
  107. background-color: #FFFFFF;
  108. border: 1rpx solid rgba(215, 215, 215, 1);
  109. border-radius: 10rpx;
  110. .row {
  111. &.border {
  112. border-bottom: 1px solid rgba(215, 215, 215, 1);
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. </style>