PreInventory.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <uni-popup ref="popup" background-color="#fff" :is-mask-click="false">
  3. <view class="pre-container">
  4. <view class="title">货位:{{ title }}1</view>
  5. <view class="list-wrapper">
  6. <view class="kd-row" v-for="(item, index) in list" :key="index">
  7. <view class="kd-col">
  8. <text class="title">{{ item.assetName }}</text>
  9. <text
  10. >当前货位 :{{
  11. `${item.outWarehouseAreaName}-${item.outWarehouseAreaGoodsCode}-${item.outGoodsAllocationCode}`
  12. }}</text
  13. >
  14. </view>
  15. <view class="kd-col">物品编码:{{ item.assetCode }}</view>
  16. <view class="kd-col" v-if="!item.isUnpack"
  17. >最小包装单元:{{
  18. `${item.measurementUnit || ''}${item.unit}/${item.minPackUnit}`
  19. }}</view
  20. >
  21. <view class="kd-col">
  22. <text
  23. class="col-items"
  24. v-for="(itm, index) in tableHeader(item.assetType)"
  25. :key="index"
  26. >
  27. {{ itm.label }}:
  28. <template v-if="itm.formatter">{{
  29. itm.formatter(item)
  30. }}</template>
  31. <template v-else>{{ item[itm.prop] }}</template></text
  32. >
  33. <text class="col-items"
  34. >待调出数量:{{ item.amount
  35. }}{{ item.isUnpack ? item.unit : item.minPackUnit }}</text
  36. >
  37. <text class="col-items"
  38. >选中数量:{{
  39. item.takeStockPattern
  40. ? item.curAmount
  41. : item.curDetailReqList &&
  42. item.curDetailReqList.filter(i => i.checked).length
  43. }}</text
  44. >
  45. </view>
  46. <view class="delete-box text-danger" @click="handleDel(index)">
  47. 移除
  48. </view>
  49. </view>
  50. </view>
  51. <view class="footer">
  52. <u-button size="large" type="success" @click="confirm"
  53. >确认调入</u-button
  54. >
  55. <u-button size="large" @click="cancel">取消</u-button>
  56. </view>
  57. </view>
  58. </uni-popup>
  59. </template>
  60. <script>
  61. import { tableHeader } from '../../common'
  62. export default {
  63. data () {
  64. return {
  65. list: [],
  66. resolve: null,
  67. reject: null,
  68. title: ''
  69. }
  70. },
  71. methods: {
  72. tableHeader,
  73. open (list, warehouse) {
  74. this.list = uni.$u.deepClone(
  75. list.filter(item => {
  76. return (
  77. (item.takeStockPattern && item.curAmount > 0) ||
  78. (!item.takeStockPattern &&
  79. item.curDetailReqList.filter(p => p.checked)?.length)
  80. )
  81. })
  82. )
  83. this.title = `${warehouse.areaName}-${warehouse.shelfCode}-${warehouse.cargoSpaceCode}`
  84. this.$refs.popup.open('right')
  85. return new Promise((res, rej) => {
  86. this.resolve = res
  87. this.reject = rej
  88. })
  89. },
  90. handleDel (index) {
  91. uni.showModal({
  92. title: '提示',
  93. content: '是否移除当前调拨物品',
  94. success: res => {
  95. if (res.confirm) {
  96. this.list.splice(index, 1)
  97. }
  98. }
  99. })
  100. },
  101. confirm () {
  102. if (!this.list.length) {
  103. return uni.showToast({
  104. title: '无调拨数据!',
  105. icon: 'none'
  106. })
  107. }
  108. this.resolve && this.resolve()
  109. this.$refs.popup.close()
  110. },
  111. cancel () {
  112. this.reject && this.reject()
  113. this.$refs.popup.close()
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .pre-container {
  120. width: 100vw;
  121. height: 100vh;
  122. background-color: $page-bg;
  123. display: flex;
  124. flex-direction: column;
  125. }
  126. .list-wrapper {
  127. padding: 20rpx 20rpx 220rpx;
  128. overflow: auto;
  129. flex: 1;
  130. .delete-box {
  131. border-top: 1rpx solid #ccc;
  132. text-align: right;
  133. font-size: 32rpx;
  134. padding: 10rpx;
  135. }
  136. }
  137. .title {
  138. height: 80rpx;
  139. text-align: center;
  140. line-height: 80rpx;
  141. background: #fff;
  142. }
  143. .kd-row {
  144. font-size: 28rpx;
  145. padding: 14rpx 12rpx 6rpx;
  146. background-color: #fff;
  147. margin-bottom: 20rpx;
  148. .kd-col {
  149. display: flex;
  150. justify-content: space-between;
  151. align-items: center;
  152. flex-wrap: wrap;
  153. padding: 2rpx;
  154. color: #aaaaaa;
  155. margin-bottom: 8rpx;
  156. .col-items {
  157. width: 50%;
  158. }
  159. .status {
  160. background-color: $page-bg;
  161. display: inline-block;
  162. padding: 4rpx 10rpx;
  163. border-radius: 18rpx;
  164. }
  165. }
  166. .title {
  167. font-weight: bold;
  168. color: #333333;
  169. }
  170. }
  171. .center {
  172. text-align: center;
  173. margin-bottom: 10rpx;
  174. color: #999;
  175. }
  176. .no_data {
  177. position: fixed;
  178. top: 50%;
  179. left: 50%;
  180. transform: translate(-50%, -50%);
  181. color: #999;
  182. font-size: 28rpx;
  183. }
  184. .warehouse {
  185. display: flex;
  186. align-items: center;
  187. }
  188. .arrow {
  189. display: inline-block;
  190. position: relative;
  191. width: 50rpx;
  192. height: 10rpx;
  193. margin: 0 20rpx;
  194. &::after,
  195. &::before {
  196. content: '';
  197. position: absolute;
  198. }
  199. &::after {
  200. border-top: 4rpx solid #aaaaaa;
  201. border-right: 4rpx solid #aaaaaa;
  202. width: 12rpx;
  203. height: 12rpx;
  204. right: 0rpx;
  205. top: -6rpx;
  206. transform: rotate(45deg);
  207. }
  208. &::before {
  209. height: 4rpx;
  210. background-color: #aaaaaa;
  211. width: 50rpx;
  212. }
  213. }
  214. .num-box {
  215. display: flex;
  216. color: #aaaaaa;
  217. justify-content: space-between;
  218. .num {
  219. margin-bottom: 5rpx;
  220. display: inline-block;
  221. border: 1rpx solid $j-primary-green;
  222. padding: 8rpx 20rpx;
  223. border-radius: 10rpx;
  224. }
  225. }
  226. .footer {
  227. position: fixed;
  228. bottom: 0;
  229. left: 0;
  230. right: 0;
  231. }
  232. </style>