reuseTurnoverBom.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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">
  7. <!-- <view class="title_box rx-bc">
  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> -->
  12. <view class="content_table">
  13. <view class="item rx-sc">
  14. <view class="rx ww50 ">
  15. <view class="lable ww80 rx-cc ">编号</view>
  16. <view class="content rx-sc">
  17. <view>{{item.code}}</view>
  18. </view>
  19. </view>
  20. <view class="rx ww50">
  21. <view class="lable rx-cc ww80">名称</view>
  22. <view class="content rx-sc">
  23. <view>{{item.name}}</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="content_table2">
  29. <view class="head row rx-sc">
  30. <view class="item ww10">货位</view>
  31. <view class="item ww25">工单编号</view>
  32. <view class="item ww25">产品编码</view>
  33. <view class="item ww20">数量PCS</view>
  34. <view class="item ww20">回用PCS</view>
  35. </view>
  36. <view class="table">
  37. <u-list @scrolltolower="scrolltolower" class="z_list">
  38. <view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
  39. <view class="item ww10">{{it.code}}</view>
  40. <view class="item ww25" :class="{'color157': it.workOrderCode === wordItem.code}">
  41. {{ it.workOrderCode }}
  42. </view>
  43. <view class="item ww25" :class="{'color157': it.categoryCode === wordItem.productCode}">
  44. {{it.categoryCode}}
  45. </view>
  46. <view class="item ww20 ">
  47. <text>{{Number(it.quantity) - Number(it.sampleNum) + Number((it.reuseNum || 0)) }}</text>
  48. </view>
  49. <view class="item ww20">
  50. <input class="uni-input content_num" v-model="it.reuseNum" type="digit"
  51. @input="handleCompute"></input>
  52. </view>
  53. </view>
  54. </u-list>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. props: {
  63. list: {
  64. type: Array,
  65. default: () => []
  66. },
  67. wordItem: {
  68. type: Object,
  69. default: () => {}
  70. },
  71. sampleList: {
  72. type: Array,
  73. default: () => []
  74. },
  75. reuseNum: {
  76. type: [String, Number],
  77. default: ''
  78. }
  79. },
  80. watch: {
  81. list: {
  82. immediate: true,
  83. deep: true,
  84. handler(newVal) {
  85. this.$set(this.wordItem, 'reuseTurnover', newVal)
  86. this.newList = newVal
  87. }
  88. },
  89. reuseNum: {
  90. immediate: true,
  91. deep: true,
  92. handler(val) {
  93. this.newReuseNum = val
  94. this.$forceUpdate()
  95. }
  96. },
  97. wordItem: {
  98. immediate: true,
  99. deep: true,
  100. handler(val) {
  101. }
  102. },
  103. sampleList: {
  104. immediate: true,
  105. deep: true,
  106. handler(newList, oldList) {
  107. this.reuseTurn(newList)
  108. }
  109. }
  110. },
  111. data() {
  112. return {
  113. }
  114. },
  115. created() {
  116. },
  117. methods: {
  118. scrolltolower() {},
  119. handleCompute() {
  120. let _count = 0
  121. this.newList.forEach(f => {
  122. if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
  123. f.extInfo.positionList.forEach(o => {
  124. if (Object.prototype.hasOwnProperty.call(o, 'reuseNum')) {
  125. _count = _count + Number(o.reuseNum)
  126. }
  127. })
  128. }
  129. })
  130. if (this.newReuseNum != _count) {
  131. uni.showToast({
  132. title: `还余 (${this.newReuseNum - _count})未回用`,
  133. icon: 'none'
  134. })
  135. }
  136. },
  137. reuseTurn(list) {
  138. list.forEach(a => {
  139. if (Object.prototype.hasOwnProperty.call(a, 'selectType') && a.selectType == 1 && !a.isSel) {
  140. console.log(this.newList)
  141. this.newList.forEach(f => {
  142. if (f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
  143. f.extInfo.positionList.forEach(o => {
  144. if (a.selectType == 1 && a.code == o.code) {
  145. a.isSel = 1
  146. o.reuseNum = Number(o.reuseNum) + 1
  147. }
  148. })
  149. }
  150. })
  151. }
  152. })
  153. },
  154. }
  155. }
  156. </script>
  157. <style lang="scss" scoped>
  158. .popup_box {
  159. width: 88vw;
  160. padding: 32rpx;
  161. }
  162. .operate_box {
  163. margin-top: 32rpx;
  164. padding: 10rpx 100rpx;
  165. /deep/ .u-button {
  166. width: 160rpx;
  167. }
  168. }
  169. .title_box {
  170. margin-top: 20rpx;
  171. .name {
  172. font-size: 28rpx;
  173. font-style: normal;
  174. font-weight: 400;
  175. color: $theme-color;
  176. padding-left: 20rpx;
  177. position: relative;
  178. &:before {
  179. position: absolute;
  180. content: '';
  181. left: 0rpx;
  182. top: 0rpx;
  183. bottom: 0rpx;
  184. width: 4rpx;
  185. height: 28rpx;
  186. background: $theme-color;
  187. margin: auto;
  188. }
  189. }
  190. .left {
  191. width: 40rpx;
  192. }
  193. .btn_box {
  194. padding: 0 18rpx;
  195. height: 60rpx;
  196. background: $theme-color;
  197. font-size: 26rpx;
  198. font-style: normal;
  199. font-weight: 400;
  200. font-size: 24rpx;
  201. color: #fff;
  202. border-radius: 4rpx;
  203. .scan {
  204. width: 34rpx;
  205. height: 34rpx;
  206. margin-right: 12rpx;
  207. }
  208. }
  209. }
  210. .content_table {
  211. margin-top: 8rpx;
  212. width: 100%;
  213. border: 2rpx solid $border-color;
  214. .item {
  215. display: flex;
  216. border-bottom: 2rpx solid $border-color;
  217. .lable {
  218. width: 132rpx;
  219. text-align: center;
  220. background-color: #F7F9FA;
  221. font-size: 26rpx;
  222. border-right: 2rpx solid $border-color;
  223. flex-shrink: 0;
  224. }
  225. .ww80 {
  226. width: 80rpx;
  227. }
  228. .ww50 {
  229. width: 50%;
  230. }
  231. .content {
  232. width: 518rpx;
  233. min-height: 64rpx;
  234. font-size: 28rpx;
  235. line-height: 28rpx;
  236. font-style: normal;
  237. font-weight: 400;
  238. padding: 2rpx 8rpx;
  239. box-sizing: border-box;
  240. word-wrap: break-word;
  241. flex-grow: 1 !important;
  242. font-size: 24rpx;
  243. }
  244. &:last-child {
  245. border-bottom: none;
  246. }
  247. }
  248. }
  249. .content_table2 {
  250. width: 100%;
  251. .row {
  252. width: 100%;
  253. .item {
  254. color: #404446;
  255. font-size: 28rpx;
  256. padding-left: 12rpx;
  257. }
  258. .color157 {
  259. color: $theme-color;
  260. }
  261. .ww20 {
  262. width: 20%;
  263. }
  264. .ww25 {
  265. width: 25%;
  266. }
  267. .ww30 {
  268. width: 35%;
  269. }
  270. .ww15 {
  271. width: 15%;
  272. }
  273. .ww10 {
  274. width: 10%;
  275. }
  276. }
  277. .head {
  278. height: 64rpx;
  279. background: #F7F9FA;
  280. border-top: 2rpx solid #E3E5E5;
  281. border-left: 2rpx solid #E3E5E5;
  282. .item {
  283. height: 64rpx;
  284. line-height: 64rpx;
  285. border-right: 2rpx solid #E3E5E5;
  286. box-sizing: border-box;
  287. font-size: 24;
  288. }
  289. }
  290. .tr {
  291. border-top: 2rpx solid #E3E5E5;
  292. border-left: 2rpx solid #E3E5E5;
  293. .item {
  294. font-size: 24rpx;
  295. min-height: 64rpx;
  296. display: flex;
  297. align-items: center;
  298. border-right: 2rpx solid #E3E5E5;
  299. box-sizing: border-box;
  300. white-space: normal;
  301. word-break: break-all;
  302. }
  303. &:last-child {
  304. border-bottom: 2rpx solid #E3E5E5;
  305. }
  306. }
  307. }
  308. .content_num {
  309. display: flex;
  310. align-items: center;
  311. padding: 0 4rpx;
  312. /deep/ .uni-input-input {
  313. border: 2rpx solid #F0F8F2;
  314. background: #F0F8F2;
  315. color: $theme-color;
  316. }
  317. }
  318. .z_list {
  319. max-height: 500rpx;
  320. }
  321. </style>