detail.vue 3.8 KB

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