turnoverBom.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. <template>
  2. <view>
  3. <view class="title_box rx-bc">
  4. <view class="name">周转车</view>
  5. </view>
  6. <view v-for="(item, index) in newList" :key='index'>
  7. <view class="title_box rx-bc" v-if='!isDetails'>
  8. <view class="left rx-ss" @click="getDelete(index)">
  9. <uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  10. </view>
  11. <view class="btn_box rx-bc" @click="handleScan(index)" v-if="pattern == 'job'">
  12. <image class="scan" src="@/static/pda/ScanIt.svg"></image>
  13. 更换周转车
  14. </view>
  15. </view>
  16. <view class="content_table">
  17. <view class="item rx-sc">
  18. <view class="rx ww50 ">
  19. <view class="lable ww80 rx-cc ">编号</view>
  20. <view class="content rx-sc">
  21. <view>{{item.code}}</view>
  22. </view>
  23. </view>
  24. <view class="rx ww50">
  25. <view class="lable rx-cc ww80">名称</view>
  26. <view class="content rx-sc">
  27. <view>{{item.name}}</view>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="content_table2">
  33. <view class="head row rx-sc">
  34. <view class="item ww10">货位</view>
  35. <view class="item ww35">工单编号</view>
  36. <view class="item ww35">产品编码</view>
  37. <view class="item ww20">数量(PCS)</view>
  38. </view>
  39. <view class="table">
  40. <u-list @scrolltolower="scrolltolower" class="z_list">
  41. <view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
  42. <view class="item ww10">{{it.code}}</view>
  43. <view class="item ww35" :class="{'color157': it.workOrderCode === wordItem.code}">
  44. {{ it.workOrderCode }}
  45. </view>
  46. <view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
  47. {{it.categoryCode}}
  48. </view>
  49. <view class="item ww20 " :class="{'content_num' : pattern == 'job' }" v-if='!isDetails'>
  50. <input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
  51. v-model="it.quantity" type="digit"
  52. :disabled="(!Object.prototype.hasOwnProperty.call(it, 'isOccupy') && it.isOccupy) || pattern != 'job'"></input>
  53. <text v-else>{{it.quantity}}</text>
  54. </view>
  55. <view class="item ww20" v-if='isDetails'>
  56. {{ it.quantity }}
  57. </view>
  58. </view>
  59. </u-list>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. props: {
  68. list: {
  69. type: Array,
  70. default: () => []
  71. },
  72. wordItem: {
  73. type: Object,
  74. default: () => {}
  75. },
  76. pattern: {
  77. type: String,
  78. default: ''
  79. },
  80. isDetails: {
  81. type: Boolean,
  82. default: false
  83. }
  84. },
  85. watch: {
  86. list: {
  87. immediate: true,
  88. deep: true,
  89. handler(newVal) {
  90. this.newList = newVal
  91. }
  92. }
  93. },
  94. data() {
  95. return {
  96. recycleQuantity: '',
  97. newList: [],
  98. totalCount: 0,
  99. }
  100. },
  101. methods: {
  102. quantInt(index, idx, it) {
  103. if (it.quantity >= 1) {
  104. this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
  105. this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
  106. } else {
  107. this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', '')
  108. this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', '')
  109. this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
  110. }
  111. this.totalCount = 0
  112. this.newList.forEach(f => {
  113. f.extInfo.positionList.forEach(o => {
  114. if (o.workOrderCode == this.wordItem.code && (!Object.prototype.hasOwnProperty
  115. .call(o, 'isOccupy') || (o.isOccupy == 0 && o.quantity > 0))) {
  116. this.totalCount = Number(this.totalCount) + Number(o.quantity)
  117. }
  118. })
  119. })
  120. uni.showToast({
  121. icon: 'none',
  122. title: `已经放${this.totalCount}`
  123. })
  124. this.$emit('formedNumFn', this.totalCount)
  125. },
  126. handleScan(index) {
  127. this.$emit('handleScan', index, 'turnover')
  128. },
  129. getDelete(index) {
  130. this.list.splice(index, 1)
  131. },
  132. scrolltolower() {}
  133. }
  134. }
  135. </script>
  136. <style lang="scss" scoped>
  137. .title_box {
  138. margin-top: 20rpx;
  139. .name {
  140. font-size: 28rpx;
  141. font-style: normal;
  142. font-weight: 400;
  143. color: $theme-color;
  144. padding-left: 20rpx;
  145. position: relative;
  146. &:before {
  147. position: absolute;
  148. content: '';
  149. left: 0rpx;
  150. top: 0rpx;
  151. bottom: 0rpx;
  152. width: 4rpx;
  153. height: 28rpx;
  154. background: $theme-color;
  155. margin: auto;
  156. }
  157. }
  158. .left {
  159. width: 40rpx;
  160. }
  161. .btn_box {
  162. padding: 0 18rpx;
  163. height: 60rpx;
  164. background: $theme-color;
  165. font-size: 26rpx;
  166. font-style: normal;
  167. font-weight: 400;
  168. font-size: 24rpx;
  169. color: #fff;
  170. border-radius: 4rpx;
  171. .scan {
  172. width: 34rpx;
  173. height: 34rpx;
  174. margin-right: 12rpx;
  175. }
  176. }
  177. }
  178. .content_table {
  179. margin-top: 8rpx;
  180. width: 100%;
  181. border: 2rpx solid $border-color;
  182. .item {
  183. display: flex;
  184. border-bottom: 2rpx solid $border-color;
  185. .lable {
  186. width: 132rpx;
  187. text-align: center;
  188. background-color: #F7F9FA;
  189. font-size: 26rpx;
  190. border-right: 2rpx solid $border-color;
  191. flex-shrink: 0;
  192. }
  193. .ww80 {
  194. width: 80rpx;
  195. }
  196. .ww50 {
  197. width: 50%;
  198. }
  199. .content {
  200. width: 518rpx;
  201. min-height: 64rpx;
  202. font-size: 28rpx;
  203. line-height: 28rpx;
  204. font-style: normal;
  205. font-weight: 400;
  206. padding: 2rpx 8rpx;
  207. box-sizing: border-box;
  208. word-wrap: break-word;
  209. flex-grow: 1 !important;
  210. font-size: 24rpx;
  211. }
  212. &:last-child {
  213. border-bottom: none;
  214. }
  215. }
  216. }
  217. .content_table2 {
  218. width: 100%;
  219. .row {
  220. width: 100%;
  221. .item {
  222. color: #404446;
  223. font-size: 28rpx;
  224. padding-left: 12rpx;
  225. }
  226. .color157 {
  227. color: $theme-color;
  228. }
  229. .ww20 {
  230. width: 20%;
  231. }
  232. .ww35 {
  233. width: 35%;
  234. }
  235. .ww10 {
  236. width: 10%;
  237. }
  238. }
  239. .head {
  240. height: 64rpx;
  241. background: #F7F9FA;
  242. border-top: 2rpx solid #E3E5E5;
  243. border-left: 2rpx solid #E3E5E5;
  244. .item {
  245. height: 64rpx;
  246. line-height: 64rpx;
  247. border-right: 2rpx solid #E3E5E5;
  248. box-sizing: border-box;
  249. }
  250. }
  251. .tr {
  252. border-top: 2rpx solid #E3E5E5;
  253. border-left: 2rpx solid #E3E5E5;
  254. .item {
  255. font-size: 24rpx;
  256. min-height: 64rpx;
  257. display: flex;
  258. align-items: center;
  259. border-right: 2rpx solid #E3E5E5;
  260. box-sizing: border-box;
  261. white-space: normal;
  262. word-break: break-all;
  263. }
  264. &:last-child {
  265. border-bottom: 2rpx solid #E3E5E5;
  266. }
  267. }
  268. }
  269. .content_num {
  270. display: flex;
  271. align-items: center;
  272. padding: 0 4rpx;
  273. /deep/ .uni-input-input {
  274. border: 2rpx solid #F0F8F2;
  275. background: #F0F8F2;
  276. color: $theme-color;
  277. }
  278. }
  279. .z_list {
  280. max-height: 500rpx;
  281. }
  282. </style>