index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311
  1. <template>
  2. <view class="content-box">
  3. <uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
  4. color="#000" @clickLeft="back"></uni-nav-bar>
  5. <view class="list_box">
  6. <u-list @scrolltolower="scrolltolower" key="dataList" v-if='status == 1'>
  7. <view class="card_box cx-sc" v-for="(item, index) in dataList" :key="index">
  8. <view class="content_table">
  9. <view class="item">
  10. <view class="lable rx-cc" style="color:#157A2C ;">领料单号</view>
  11. <view class="content" style="color:#157A2C;">
  12. {{ item.code }}
  13. </view>
  14. </view>
  15. </view>
  16. <view v-for="(it,idx) in item.orderInfoList" :key='idx'>
  17. <view class="word_order ">工单编号:{{it.code}}</view>
  18. <view v-if='it.arr.length == 0' style='margin-top: 10px;'>
  19. <u-empty iconSize='80' textSize='32' text='未领料'>
  20. </u-empty>
  21. </view>
  22. <instanceBom :list='it.arr' :isDetails='true'></instanceBom>
  23. </view>
  24. </view>
  25. <u-list-item v-if="dataList.length === 0" style='margin-top: 20vh;'>
  26. <u-empty iconSize='150' textSize='32' text='暂无数据'>
  27. </u-empty>
  28. </u-list-item>
  29. </u-list>
  30. <u-list @scrolltolower="scrolltolower" key="dataList2" v-if='status == 2'>
  31. <view class="card_box cx-sc">
  32. <outInstanceBom :list='dataList' :isDetails='true'></outInstanceBom>
  33. </view>
  34. <u-list-item v-if="dataList.length === 0" style='margin-top: 20vh;'>
  35. <u-empty iconSize='150' textSize='32' text='暂无数据'>
  36. </u-empty>
  37. </u-list-item>
  38. </u-list>
  39. </view>
  40. <view class="bottom-wrapper">
  41. <!-- <view class="btn_box" @click="save">一键报工</view> -->
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. tableHeader
  48. } from '../../common.js'
  49. import {
  50. workorderPage
  51. } from '@/api/pda/workOrder.js'
  52. import {
  53. pickDetails,
  54. pickOutInOrder
  55. } from '@/api/pda/picking.js'
  56. import instanceBom from './components/instanceBom.vue'
  57. import outInstanceBom from './components/outInstanceBom.vue'
  58. export default {
  59. components: {
  60. instanceBom,
  61. outInstanceBom
  62. },
  63. data() {
  64. return {
  65. ids: [],
  66. dataList: [],
  67. title: null,
  68. status: 1,
  69. }
  70. },
  71. onLoad(option) {
  72. this.status = option.status || 1
  73. this.title = option.status == 1 ? '领料单' : option.status == 2 ? ' 出库单' : ''
  74. this.ids = [option.id]
  75. this.getList()
  76. },
  77. methods: {
  78. async getList() {
  79. let list = []
  80. if (this.status == 1) {
  81. const res = await pickDetails(this.ids)
  82. list = res
  83. list.forEach(m => {
  84. if (m.orderInfoList.length > 0) {
  85. m.orderInfoList.forEach(o => {
  86. let _arr = []
  87. _arr = [...o.bomDetailDTOS, ...o.instanceList]
  88. _arr = _arr.sort((a, b) => a.rootCategoryLevelId - b
  89. .rootCategoryLevelId)
  90. o['arr'] = _arr
  91. })
  92. }
  93. })
  94. this.dataList = list
  95. } else if (this.status == 2) {
  96. const res = await pickOutInOrder({
  97. workOrderIds: this.ids
  98. })
  99. this.dataList = res
  100. }
  101. },
  102. scrolltolower() {
  103. },
  104. tableH(type) {
  105. return tableHeader(type)
  106. },
  107. save() {},
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .content-box {
  113. height: 100vh;
  114. overflow: hidden;
  115. display: flex;
  116. flex-direction: column;
  117. }
  118. .list_box {
  119. flex: 1;
  120. overflow: hidden;
  121. padding: 16rpx 0;
  122. .u-list {
  123. height: 100% !important;
  124. }
  125. }
  126. .bottom-wrapper {
  127. .btn_box {
  128. width: 750rpx;
  129. height: 88rpx;
  130. line-height: 88rpx;
  131. background: $theme-color;
  132. text-align: center;
  133. font-size: 36rpx;
  134. font-style: normal;
  135. font-weight: 400;
  136. color: #fff;
  137. }
  138. }
  139. .card_box {
  140. margin-top: 10rpx;
  141. .word_order {
  142. height: 64rpx;
  143. width: 706rpx;
  144. background: $theme-color;
  145. font-size: 28rpx;
  146. color: #fff;
  147. line-height: 64rpx;
  148. padding-left: 40rpx;
  149. box-sizing: border-box;
  150. }
  151. .content_table {
  152. margin-top: 10rpx;
  153. width: 702rpx;
  154. border: 2rpx solid $border-color;
  155. .item {
  156. display: flex;
  157. border-bottom: 2rpx solid $border-color;
  158. .lable {
  159. width: 132rpx;
  160. text-align: center;
  161. background-color: #F7F9FA;
  162. font-size: 26rpx;
  163. border-right: 2rpx solid $border-color;
  164. flex-shrink: 0;
  165. }
  166. .ww80 {
  167. width: 80rpx;
  168. }
  169. .content {
  170. width: 518rpx;
  171. min-height: 64rpx;
  172. font-size: 28rpx;
  173. line-height: 28rpx;
  174. font-style: normal;
  175. font-weight: 400;
  176. padding: 18rpx 8rpx;
  177. box-sizing: border-box;
  178. word-wrap: break-word;
  179. flex-grow: 1 !important;
  180. }
  181. .content_num {
  182. display: flex;
  183. align-items: center;
  184. padding: 0 4rpx;
  185. /deep/ .uni-input-input {
  186. width: 480rpx;
  187. border: 2rpx solid #F0F8F2;
  188. background: #F0F8F2;
  189. color: $theme-color;
  190. }
  191. .unit {
  192. padding: 0 4rpx;
  193. font-size: 24rpx;
  194. color: #404446;
  195. }
  196. }
  197. .pd4 {
  198. padding: 4rpx 8rpx;
  199. }
  200. &:last-child {
  201. border-bottom: none;
  202. }
  203. }
  204. .ww55 {
  205. width: 55%;
  206. }
  207. .ww45 {
  208. width: 45%;
  209. }
  210. }
  211. }
  212. </style>