detail.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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. />
  17. </view>
  18. <view class="bottom" @click="goReport">报工</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 },
  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. goReport(){
  75. uni.navigateTo({
  76. url: '/pages/production/execute/extrusion/report'
  77. })
  78. },
  79. changeTab(){
  80. this.showTab = !this.showTab
  81. },
  82. toNav (url) {
  83. if(url){
  84. uni.navigateTo({
  85. url: url
  86. })
  87. }
  88. },
  89. async handleDraft () {
  90. const params = {
  91. handleResult: 3,
  92. handleStatus: 0,
  93. bizId: this.baseInfo.conventionalStockTransferReq.id
  94. }
  95. const res = await postJ(
  96. this.apiUrl + `/conventionalStockTransfer/changeStatus`,
  97. params
  98. )
  99. if (res?.success) {
  100. uni.showToast({
  101. title: '撤回成功!',
  102. icon: 'none'
  103. })
  104. uni.navigateBack({
  105. delta: 1
  106. })
  107. }
  108. },
  109. handleReCommit () {
  110. uni.navigateTo({
  111. url:
  112. '/pages/warehouse/inventoryAllocation/edit?id=' +
  113. this.baseInfo.conventionalStockTransferReq.id
  114. })
  115. },
  116. async _getDetail (id) {
  117. const res = await get(
  118. this.apiUrl +
  119. `/conventionalStockTransfer/details/conventionalStockTransfer/${id}`
  120. )
  121. if (res?.success) {
  122. res.data.stockTransferInfoList.forEach(item => {
  123. item.batchNum = item.batchNo
  124. })
  125. this.baseInfo.conventionalStockTransferReq =
  126. res.data.conventionalStockTransfer
  127. this.baseInfo.detailReqList = res.data.stockTransferInfoList
  128. console.log(this.baseInfo, '222')
  129. }
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .tabs {
  136. position: fixed;
  137. width: 100vw;
  138. background-color: rgba(242, 242, 242, 0.792156862745098);
  139. padding-top: 20rpx;
  140. display: flex;
  141. justify-content: flex-start;
  142. align-items: center;
  143. margin-bottom: 20rpx;
  144. .tab-item {
  145. width: 200rpx;
  146. display: flex;
  147. justify-content: center;
  148. align-items: center;
  149. &.active {
  150. background: linear-gradient(
  151. 180deg,
  152. rgba(75, 121, 2, 1) 0%,
  153. rgba(255, 255, 255, 1) 12%
  154. );
  155. }
  156. }
  157. }
  158. .view-container {
  159. // padding-bottom: 200rpx;
  160. }
  161. .bottom{
  162. width: 100%;
  163. height: 90rpx;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. position: fixed;
  168. bottom: 0;
  169. left: 0;
  170. font-size: 36rpx;
  171. color: #fff;
  172. background: #4B7902;
  173. }
  174. .footer {
  175. position: fixed;
  176. bottom: 0;
  177. width: 100vw;
  178. left: 0;
  179. background: #fff;
  180. .footer-content{
  181. width: 100%;
  182. .content-top{
  183. width: 100%;
  184. height: 40rpx;
  185. background: #157a2c;
  186. display: flex;
  187. align-items: center;
  188. justify-content: center;
  189. image{
  190. width: 20rpx;
  191. height: 20rpx;
  192. }
  193. }
  194. .content-list{
  195. display: flex;
  196. align-items: center;
  197. justify-content: flex-start;
  198. // flex-wrap: wrap;
  199. margin: 20px 0;
  200. .list-item{
  201. width: 200rpx;
  202. height: 160rpx;
  203. border: 1rpx solid #157a2c;
  204. border-radius: 10rpx;
  205. margin: 0 24rpx;
  206. image{
  207. width: 90rpx;
  208. height: 90rpx;
  209. display: block;
  210. margin: 15rpx auto;
  211. }
  212. .name{
  213. width: 100%;
  214. text-align: center;
  215. color: #157a2c;
  216. }
  217. }
  218. }
  219. }
  220. }
  221. </style>