transferDetails.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <!-- 调拨详情 -->
  3. <view>
  4. <u-navbar :title="transferTitle" autoBack placeholder></u-navbar>
  5. <view style="padding: 0rpx 30rpx;">
  6. <view class="card_transfer_details" v-if="type == 0">
  7. <view class="step_title">接收人信息</view>
  8. <view class="card_avatar" style="margin-top: 10rpx;">
  9. <view style="display: flex;align-items: center;">
  10. <image class="mine_image" src="../../static/portrait.png" mode=""></image>
  11. <view class="card_user_title">
  12. <view class="mine_phone">{{userList.acceptUser.nickName || '接收人姓名'}}</view>
  13. <view class="mine_phone">{{userList.acceptCompany.name || '接收人所属门店'}}</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="card_transfer_details" v-else>
  19. <view class="step_title">调拨人信息</view>
  20. <view class="card_avatar" style="margin-top: 10rpx;">
  21. <view style="display: flex;align-items: center;">
  22. <image class="mine_image" src="../../static/portrait.png" mode=""></image>
  23. <view class="card_user_title">
  24. <view class="mine_phone">{{userList.allotUser.nickName || '调拨人姓名'}}</view>
  25. <view class="mine_phone">{{userList.allotCompany.name || '调拨人所属门店'}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view style="margin-top: 20rpx;padding-bottom: 20rpx;" class="space_between frame">
  31. <view class="title_code_a">钢瓶编号</view>
  32. <view class="num_code">总数: {{userList.innerCodeList.length}}</view>
  33. </view>
  34. <view style="display: flex;flex-direction: column;">
  35. <view class="item_card_tran frame" v-for="(item,index) in userList.innerCodeList">
  36. <view style="width: 60rpx;margin-right: 10rpx;text-align: center;">{{index + 1}}</view>
  37. <span style="font-weight: 600;">{{item}}</span>
  38. </view>
  39. </view>
  40. </view>
  41. <view style="width: 100%;height: 120rpx;"></view>
  42. <view class="btn_transfer_details" v-if="type == 1">
  43. <view style="flex: 1;">
  44. <u-button style="width: 90%;" type="error" @click="cancelAllocation">取消</u-button>
  45. </view>
  46. <view style="flex: 1;">
  47. <u-button style="width: 90%;" type="primary" @click="submit">确定</u-button>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import {
  54. flowStep
  55. } from '@/static/js/blockSort.js'
  56. export default {
  57. data() {
  58. return {
  59. userList: {},
  60. type: null,
  61. transferTitle: '',
  62. }
  63. },
  64. onLoad(value) {
  65. this.type = Number(value.type)
  66. const data = uni.getStorageSync('transferData');
  67. if (data) {
  68. const userArr = JSON.parse(data)
  69. let array = flowStep()
  70. const filteredArray = array.filter(item => item.value === userArr.optType)
  71. if (filteredArray.length > 0) {
  72. this.transferTitle = filteredArray[0].label
  73. } else {
  74. this.transferTitle = '调拨详情'
  75. }
  76. this.userList = userArr
  77. }
  78. },
  79. methods: {
  80. cancelAllocation() {
  81. this.$api.post('/api/gas-cylinder-allot/cancel', {
  82. id: this.userList.id,
  83. }).then(res => {
  84. if (res.code == 200) {
  85. uni.navigateBack({
  86. delta: 1
  87. });
  88. } else {
  89. uni.$u.toast(res.data.msg)
  90. }
  91. })
  92. },
  93. submit() {
  94. this.$api.post('/api/gas-cylinder-allot/submit', {
  95. id: this.userList.id,
  96. optType: this.userList.optType,
  97. allotUserId: this.userList.allotUserId,
  98. acceptUserId: this.userList.acceptUserId,
  99. allotCompanyId: this.userList.allotCompanyId,
  100. acceptCompanyId: this.userList.acceptCompanyId,
  101. innerCodeList: this.userList.innerCodeList,
  102. }).then(res => {
  103. if (res.code == 200) {
  104. uni.navigateBack({
  105. delta: 1
  106. });
  107. } else {
  108. uni.$u.toast(res.data.msg)
  109. }
  110. })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .step_title {
  117. font-size: 30rpx;
  118. font-weight: 600;
  119. }
  120. .card_avatar {
  121. display: flex;
  122. align-items: center;
  123. justify-content: space-between;
  124. }
  125. .mine_image {
  126. width: 100rpx;
  127. height: 100rpx;
  128. border-radius: 50%;
  129. }
  130. .card_user_title {
  131. display: flex;
  132. flex-direction: column;
  133. align-items: flex-start;
  134. }
  135. .mine_phone {
  136. margin-left: 20rpx;
  137. font-size: 30rpx;
  138. }
  139. .card_transfer_details {
  140. border: 1rpx dashed #d7d7d7;
  141. margin-top: 20rpx;
  142. padding: 20rpx;
  143. background-color: #f4f4f5;
  144. }
  145. .item_card_tran {
  146. display: flex;
  147. align-items: center;
  148. padding: 30rpx 30rpx 30rpx 0rpx;
  149. }
  150. .title_code_a {
  151. font-size: 32rpx;
  152. font-weight: 600;
  153. }
  154. .num_code {
  155. color: #2979ff;
  156. font-size: 28rpx;
  157. }
  158. .btn_transfer_details {
  159. position: fixed;
  160. bottom: 0;
  161. left: 0;
  162. right: 0;
  163. background-color: #fff;
  164. display: flex;
  165. align-items: center;
  166. padding: 20rpx 0rpx;
  167. }
  168. </style>