detail.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="mainBox">
  3. <uni-nav-bar
  4. fixed="true"
  5. statusBar="true"
  6. left-icon="back"
  7. :title="title"
  8. @clickLeft="back"
  9. >
  10. </uni-nav-bar>
  11. <progressBox :list="tabList"/>
  12. <view class="view-container">
  13. <DetailView
  14. :baseInfo="baseInfo.conventionalStockTransferReq"
  15. :list="baseInfo.detailReqList"
  16. :showTab="showTab"
  17. />
  18. </view>
  19. <view
  20. class="footer"
  21. v-if="baseInfo.conventionalStockTransferReq.auditStatus === 1"
  22. >
  23. <div class="footer-content">
  24. <div class="content-top" @click="changeTab">
  25. <image :style="showTab?'transform: rotate(180deg)':''" src="~@/static/product/upp.svg"></image>
  26. </div>
  27. <div class="content-list" v-if="showTab">
  28. <div class="list-item" v-for="(item,index) in footerList" :key="index" @click="toNav(item.link_url)">
  29. <image :src="`../../../static/product/${item.icon}`"></image>
  30. <div class="name">{{item.name}}</div>
  31. </div>
  32. </div>
  33. </div>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
  39. import DetailView from './components/DetailView.vue'
  40. import progressBox from './components/progressBox.vue'
  41. import { post, postJ, get, getJ } from '@/utils/api.js'
  42. export default {
  43. components: { DetailView, baTreePicker , progressBox },
  44. data () {
  45. return {
  46. activeName: 1,
  47. baseInfo: {
  48. conventionalStockTransferReq: {}
  49. },
  50. deptList: [],
  51. userList: [],
  52. loading: false,
  53. title:'挤压成型',
  54. tabList:[
  55. {name:'挤压成型'},
  56. {name:'自然干燥'},
  57. {name:'升温干燥'},
  58. {name:'半加定长'}
  59. ],
  60. footerList:[
  61. {icon:'icon0.png',name:'准备',link_url: '/pages/production/order/prepare/preparation'},
  62. {icon:'icon1.png',name:'投料'},
  63. {icon:'icon2.png',name:'报工'},
  64. ],
  65. showTab:false
  66. }
  67. },
  68. onLoad ({ id }) {
  69. if (id) {
  70. this._getDetail(id)
  71. }
  72. },
  73. methods: {
  74. changeTab(){
  75. this.showTab = !this.showTab
  76. },
  77. toNav (url) {
  78. if(url){
  79. uni.navigateTo({
  80. url: url
  81. })
  82. }
  83. },
  84. async handleDraft () {
  85. const params = {
  86. handleResult: 3,
  87. handleStatus: 0,
  88. bizId: this.baseInfo.conventionalStockTransferReq.id
  89. }
  90. const res = await postJ(
  91. this.apiUrl + `/conventionalStockTransfer/changeStatus`,
  92. params
  93. )
  94. if (res?.success) {
  95. uni.showToast({
  96. title: '撤回成功!',
  97. icon: 'none'
  98. })
  99. uni.navigateBack({
  100. delta: 1
  101. })
  102. }
  103. },
  104. handleReCommit () {
  105. uni.navigateTo({
  106. url:
  107. '/pages/warehouse/inventoryAllocation/edit?id=' +
  108. this.baseInfo.conventionalStockTransferReq.id
  109. })
  110. },
  111. async _getDetail (id) {
  112. const res = await get(
  113. this.apiUrl +
  114. `/conventionalStockTransfer/details/conventionalStockTransfer/${id}`
  115. )
  116. if (res?.success) {
  117. res.data.stockTransferInfoList.forEach(item => {
  118. item.batchNum = item.batchNo
  119. })
  120. this.baseInfo.conventionalStockTransferReq =
  121. res.data.conventionalStockTransfer
  122. this.baseInfo.detailReqList = res.data.stockTransferInfoList
  123. console.log(this.baseInfo, '222')
  124. }
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .tabs {
  131. position: fixed;
  132. width: 100vw;
  133. background-color: rgba(242, 242, 242, 0.792156862745098);
  134. padding-top: 20rpx;
  135. display: flex;
  136. justify-content: flex-start;
  137. align-items: center;
  138. margin-bottom: 20rpx;
  139. .tab-item {
  140. width: 200rpx;
  141. display: flex;
  142. justify-content: center;
  143. align-items: center;
  144. &.active {
  145. background: linear-gradient(
  146. 180deg,
  147. rgba(75, 121, 2, 1) 0%,
  148. rgba(255, 255, 255, 1) 12%
  149. );
  150. }
  151. }
  152. }
  153. .view-container {
  154. // padding-bottom: 200rpx;
  155. }
  156. .footer {
  157. position: fixed;
  158. bottom: 0;
  159. width: 100vw;
  160. left: 0;
  161. background: #fff;
  162. .footer-content{
  163. width: 100%;
  164. .content-top{
  165. width: 100%;
  166. height: 40rpx;
  167. background: #157a2c;
  168. display: flex;
  169. align-items: center;
  170. justify-content: center;
  171. image{
  172. width: 20rpx;
  173. height: 20rpx;
  174. }
  175. }
  176. .content-list{
  177. display: flex;
  178. align-items: center;
  179. justify-content: flex-start;
  180. // flex-wrap: wrap;
  181. margin: 20px 0;
  182. .list-item{
  183. width: 200rpx;
  184. height: 160rpx;
  185. border: 1rpx solid #157a2c;
  186. border-radius: 10rpx;
  187. margin: 0 24rpx;
  188. image{
  189. width: 90rpx;
  190. height: 90rpx;
  191. display: block;
  192. margin: 15rpx auto;
  193. }
  194. .name{
  195. width: 100%;
  196. text-align: center;
  197. color: #157a2c;
  198. }
  199. }
  200. }
  201. }
  202. }
  203. </style>