detail.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. title="调拨详情"
  8. @clickLeft="back"
  9. >
  10. </uni-nav-bar>
  11. <view class="view-container">
  12. <DetailView
  13. :baseInfo="baseInfo.conventionalStockTransferReq"
  14. :list="baseInfo.detailReqList"
  15. />
  16. </view>
  17. <view
  18. class="footer"
  19. v-if="baseInfo.conventionalStockTransferReq.auditStatus === 1"
  20. >
  21. <u-button type="primary" @tap="handleDraft">撤为草稿</u-button>
  22. </view>
  23. <view
  24. class="footer"
  25. v-if="baseInfo.conventionalStockTransferReq.auditStatus === 0"
  26. >
  27. <u-button type="primary" @tap="handleReCommit">重新提交</u-button>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  33. import DetailView from './components/DetailView.vue'
  34. import { post, postJ, get, getJ } from '@/utils/api.js'
  35. export default {
  36. components: { DetailView, baTreePicker },
  37. data () {
  38. return {
  39. activeName: 1,
  40. baseInfo: {
  41. conventionalStockTransferReq: {}
  42. },
  43. deptList: [],
  44. userList: [],
  45. loading: false
  46. }
  47. },
  48. onLoad ({ id }) {
  49. if (id) {
  50. this._getDetail(id)
  51. }
  52. },
  53. methods: {
  54. async handleDraft () {
  55. const params = {
  56. handleResult: 3,
  57. handleStatus: 0,
  58. bizId: this.baseInfo.conventionalStockTransferReq.id
  59. }
  60. const res = await postJ(
  61. this.apiUrl + `/conventionalStockTransfer/changeStatus`,
  62. params
  63. )
  64. if (res?.success) {
  65. uni.showToast({
  66. title: '撤回成功!',
  67. icon: 'none'
  68. })
  69. uni.navigateBack({
  70. delta: 1
  71. })
  72. }
  73. },
  74. handleReCommit () {
  75. uni.navigateTo({
  76. url:
  77. '/pages/warehouse/inventoryAllocation/edit?id=' +
  78. this.baseInfo.conventionalStockTransferReq.id
  79. })
  80. },
  81. async _getDetail (id) {
  82. const res = await get(
  83. this.apiUrl +
  84. `/conventionalStockTransfer/details/conventionalStockTransfer/${id}`
  85. )
  86. if (res?.success) {
  87. res.data.stockTransferInfoList.forEach(item => {
  88. item.batchNum = item.batchNo
  89. })
  90. this.baseInfo.conventionalStockTransferReq =
  91. res.data.conventionalStockTransfer
  92. this.baseInfo.detailReqList = res.data.stockTransferInfoList
  93. console.log(this.baseInfo, '222')
  94. }
  95. }
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .tabs {
  101. position: fixed;
  102. width: 100vw;
  103. background-color: rgba(242, 242, 242, 0.792156862745098);
  104. padding-top: 20rpx;
  105. display: flex;
  106. justify-content: flex-start;
  107. align-items: center;
  108. margin-bottom: 20rpx;
  109. .tab-item {
  110. width: 200rpx;
  111. display: flex;
  112. justify-content: center;
  113. align-items: center;
  114. &.active {
  115. background: linear-gradient(
  116. 180deg,
  117. rgba(75, 121, 2, 1) 0%,
  118. rgba(255, 255, 255, 1) 12%
  119. );
  120. }
  121. }
  122. }
  123. .view-container {
  124. padding-bottom: 200rpx;
  125. }
  126. .footer {
  127. position: fixed;
  128. bottom: 0;
  129. width: 100vw;
  130. left: 0;
  131. .verify-box {
  132. display: flex;
  133. justify-content: space-between;
  134. align-items: center;
  135. padding: 10rpx;
  136. /deep/.u-input {
  137. border: 1rpx solid #ccc;
  138. }
  139. .dept {
  140. margin-right: 30rpx;
  141. }
  142. }
  143. }
  144. </style>