transferRecord.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <!-- 调拨记录 -->
  3. <view>
  4. <u-navbar title="调拨记录" autoBack placeholder></u-navbar>
  5. <view style="padding-bottom: 30rpx;" v-if="list.length > 0">
  6. <view class="transfer_card_item" v-for="(item,index) in list" :key="index">
  7. <view class="title_status" :style="{color:getColor(item.status)}">{{ getstatus(item.status) }}</view>
  8. <view class="item_title_record1">
  9. <span>调拨人:</span>
  10. {{item.allotUser.nickName}}
  11. </view>
  12. <view class="item_title_record">
  13. <span>接收人:</span>
  14. {{item.acceptUser.nickName}}
  15. </view>
  16. <view class="item_title_record">
  17. <span>调拨时间:</span>
  18. {{item.createdAt}}
  19. </view>
  20. <view class="item_title_record">
  21. <span>钢瓶编号:</span>
  22. <span class="examine_title" @click="clickToView(item)">点击查看</span>
  23. </view>
  24. </view>
  25. </view>
  26. <view style="margin-top: 40%;" v-else>
  27. <u-empty mode="list" text="暂无调拨记录"></u-empty>
  28. </view>
  29. <u-popup :show="innerCodeShow" round="10" @close="close">
  30. <view>
  31. <view class="headlinetitle">钢瓶编号</view>
  32. <view class="card_inner_item" v-for="(item,index) in innerCodeData" :key="index">
  33. <view class="title_index_item">{{index + 1}}</view>
  34. <view>{{item}}</view>
  35. </view>
  36. </view>
  37. </u-popup>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. list: [],
  45. Pagination: {
  46. PageIndex: 1,
  47. PageSize: 20,
  48. Total: 0,
  49. },
  50. loadingMore: true,
  51. innerCodeShow: false,
  52. innerCodeData: []
  53. }
  54. },
  55. onReachBottom() {
  56. if (!this.loadingMore) {
  57. this.getList()
  58. }
  59. },
  60. mounted() {
  61. this.getList()
  62. },
  63. methods: {
  64. getList() {
  65. this.loadingMore = true
  66. this.$api.get('/api/gas-cylinder-allot', {
  67. page: this.Pagination.PageIndex,
  68. pageSize: this.Pagination.PageSize,
  69. }).then(res => {
  70. if (res.code == 200) {
  71. const data = res.data.list
  72. if (this.loadingMore == true && data) {
  73. this.list = this.list.concat(data);
  74. }
  75. if (data.length < this.Pagination.PageSize) {
  76. this.loadingMore = true
  77. } else {
  78. this.loadingMore = false
  79. this.Pagination.PageIndex++
  80. }
  81. }
  82. })
  83. },
  84. // 点击查看
  85. clickToView(value) {
  86. this.innerCodeShow = true
  87. this.innerCodeData = value.innerCodeList
  88. },
  89. getstatus(value) {
  90. if (value == 1) {
  91. return '调拨中'
  92. } else if (value == 2) {
  93. return '调拨完成'
  94. } else if (value == 3) {
  95. return '取消调拨'
  96. } else if (value == 4) {
  97. return '超时取消'
  98. }
  99. },
  100. getColor(value) {
  101. if (value == 1) {
  102. return '#3c9cff'
  103. } else if (value == 2) {
  104. return '#5ac725'
  105. } else if (value == 3) {
  106. return '#909399'
  107. } else if (value == 4) {
  108. return '#909399'
  109. }
  110. },
  111. close() {
  112. this.innerCodeShow = false
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. page {
  119. background-color: #f4f4f5;
  120. }
  121. .transfer_card_item {
  122. position: relative;
  123. background-color: #fff;
  124. margin: 30rpx;
  125. padding: 30rpx;
  126. border-radius: 10rpx;
  127. }
  128. .title_status {
  129. position: absolute;
  130. right: 20rpx;
  131. top: 20rpx;
  132. display: flex;
  133. justify-content: flex-end;
  134. font-size: 28rpx;
  135. }
  136. .item_title_record1 {
  137. font-size: 30rpx;
  138. span {
  139. font-size: 28rpx;
  140. color: #909399;
  141. }
  142. .examine_title {
  143. cursor: pointer;
  144. color: #2979ff;
  145. }
  146. }
  147. .item_title_record {
  148. font-size: 30rpx;
  149. margin-top: 10rpx;
  150. span {
  151. font-size: 28rpx;
  152. color: #909399;
  153. }
  154. .examine_title {
  155. cursor: pointer;
  156. color: #2979ff;
  157. }
  158. }
  159. .title_index_item {
  160. color: #909399;
  161. margin-right: 20rpx;
  162. }
  163. .headlinetitle {
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. padding: 20rpx;
  168. font-size: 34rpx;
  169. font-weight: 600;
  170. border-bottom: 1rpx solid #d7d7d7;
  171. }
  172. .card_inner_item {
  173. display: flex;
  174. align-items: center;
  175. padding: 30rpx;
  176. border-bottom: 1rpx solid #d7d7d7;
  177. }
  178. </style>