reuseTurnoverBom.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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" @input="handleCompute"
  51. ></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. reuseNum: {
  72. type: [String, Number],
  73. default: ''
  74. }
  75. },
  76. watch: {
  77. list: {
  78. immediate: true,
  79. deep: true,
  80. handler(newVal) {
  81. this.$set(this.wordItem, 'reuseTurnover', newVal)
  82. this.newList = newVal
  83. }
  84. },
  85. reuseNum: {
  86. immediate: true,
  87. deep: true,
  88. handler(val) {
  89. this.newReuseNum = val
  90. this.$forceUpdate()
  91. }
  92. }
  93. },
  94. data() {
  95. return {
  96. }
  97. },
  98. created() {
  99. },
  100. methods: {
  101. scrolltolower() {},
  102. handleCompute() {
  103. let _count = 0
  104. this.newList.forEach(f => {
  105. if(f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
  106. f.extInfo.positionList.forEach(o => {
  107. if (Object.prototype.hasOwnProperty.call(o, 'reuseNum')) {
  108. _count = _count + Number(o.reuseNum)
  109. }
  110. })
  111. }
  112. })
  113. if(this.newReuseNum != _count) {
  114. uni.showToast({
  115. title: `还余 (${this.newReuseNum - _count})未回用`,
  116. icon: 'none'
  117. })
  118. }
  119. },
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .popup_box {
  125. width: 88vw;
  126. padding: 32rpx;
  127. }
  128. .operate_box {
  129. margin-top: 32rpx;
  130. padding: 10rpx 100rpx;
  131. /deep/ .u-button {
  132. width: 160rpx;
  133. }
  134. }
  135. .title_box {
  136. margin-top: 20rpx;
  137. .name {
  138. font-size: 28rpx;
  139. font-style: normal;
  140. font-weight: 400;
  141. color: $theme-color;
  142. padding-left: 20rpx;
  143. position: relative;
  144. &:before {
  145. position: absolute;
  146. content: '';
  147. left: 0rpx;
  148. top: 0rpx;
  149. bottom: 0rpx;
  150. width: 4rpx;
  151. height: 28rpx;
  152. background: $theme-color;
  153. margin: auto;
  154. }
  155. }
  156. .left {
  157. width: 40rpx;
  158. }
  159. .btn_box {
  160. padding: 0 18rpx;
  161. height: 60rpx;
  162. background: $theme-color;
  163. font-size: 26rpx;
  164. font-style: normal;
  165. font-weight: 400;
  166. font-size: 24rpx;
  167. color: #fff;
  168. border-radius: 4rpx;
  169. .scan {
  170. width: 34rpx;
  171. height: 34rpx;
  172. margin-right: 12rpx;
  173. }
  174. }
  175. }
  176. .content_table {
  177. margin-top: 8rpx;
  178. width: 100%;
  179. border: 2rpx solid $border-color;
  180. .item {
  181. display: flex;
  182. border-bottom: 2rpx solid $border-color;
  183. .lable {
  184. width: 132rpx;
  185. text-align: center;
  186. background-color: #F7F9FA;
  187. font-size: 26rpx;
  188. border-right: 2rpx solid $border-color;
  189. flex-shrink: 0;
  190. }
  191. .ww80 {
  192. width: 80rpx;
  193. }
  194. .ww50 {
  195. width: 50%;
  196. }
  197. .content {
  198. width: 518rpx;
  199. min-height: 64rpx;
  200. font-size: 28rpx;
  201. line-height: 28rpx;
  202. font-style: normal;
  203. font-weight: 400;
  204. padding: 2rpx 8rpx;
  205. box-sizing: border-box;
  206. word-wrap: break-word;
  207. flex-grow: 1 !important;
  208. font-size: 24rpx;
  209. }
  210. &:last-child {
  211. border-bottom: none;
  212. }
  213. }
  214. }
  215. .content_table2 {
  216. width: 100%;
  217. .row {
  218. width: 100%;
  219. .item {
  220. color: #404446;
  221. font-size: 28rpx;
  222. padding-left: 12rpx;
  223. }
  224. .color157 {
  225. color: $theme-color;
  226. }
  227. .ww20 {
  228. width: 20%;
  229. }
  230. .ww25 {
  231. width: 25%;
  232. }
  233. .ww30 {
  234. width: 35%;
  235. }
  236. .ww15 {
  237. width: 15%;
  238. }
  239. .ww10 {
  240. width: 10%;
  241. }
  242. }
  243. .head {
  244. height: 64rpx;
  245. background: #F7F9FA;
  246. border-top: 2rpx solid #E3E5E5;
  247. border-left: 2rpx solid #E3E5E5;
  248. .item {
  249. height: 64rpx;
  250. line-height: 64rpx;
  251. border-right: 2rpx solid #E3E5E5;
  252. box-sizing: border-box;
  253. font-size: 24;
  254. }
  255. }
  256. .tr {
  257. border-top: 2rpx solid #E3E5E5;
  258. border-left: 2rpx solid #E3E5E5;
  259. .item {
  260. font-size: 24rpx;
  261. min-height: 64rpx;
  262. display: flex;
  263. align-items: center;
  264. border-right: 2rpx solid #E3E5E5;
  265. box-sizing: border-box;
  266. white-space: normal;
  267. word-break: break-all;
  268. }
  269. &:last-child {
  270. border-bottom: 2rpx solid #E3E5E5;
  271. }
  272. }
  273. }
  274. .content_num {
  275. display: flex;
  276. align-items: center;
  277. padding: 0 4rpx;
  278. /deep/ .uni-input-input {
  279. border: 2rpx solid #F0F8F2;
  280. background: #F0F8F2;
  281. color: $theme-color;
  282. }
  283. }
  284. .z_list {
  285. max-height: 500rpx;
  286. }
  287. </style>