index.vue 5.1 KB

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