qualityTurnoverBom.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <template>
  2. <view>
  3. <view>
  4. <view class="title_box rx-bc">
  5. <view class="name">周转车</view>
  6. </view>
  7. <view v-for="(item, index) in newList" :key='index'>
  8. <view class="title_box rx-bc">
  9. <view class="btn_box rx-bc" @click="handleTrade(index)">
  10. 换周转车
  11. </view>
  12. <view style="font-size: 28rpx;">*需要同类型车,货位一一对应</view>
  13. </view>
  14. <view class="content_table">
  15. <view class="item rx-sc">
  16. <view class="rx ww50 ">
  17. <view class="lable ww80 rx-cc ">编号</view>
  18. <view class="content rx-sc">
  19. <view>{{item.code}}</view>
  20. </view>
  21. </view>
  22. <view class="rx ww50">
  23. <view class="lable rx-cc ww80">名称</view>
  24. <view class="content rx-sc">
  25. <view>{{item.name}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="content_table2">
  31. <view class="head row rx-sc">
  32. <view class="item ww10">货位</view>
  33. <view class="item ww30">工单编号</view>
  34. <view class="item ww30">产品编码</view>
  35. <view class="item ww15">数量</view>
  36. <view class="item ww15"></view>
  37. </view>
  38. <view class="table">
  39. <u-list @scrolltolower="scrolltolower" class="z_list">
  40. <view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
  41. <view class="item ww10">{{it.code}}</view>
  42. <view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
  43. {{ it.workOrderCode }}
  44. </view>
  45. <view class="item ww30" :class="{'color157': it.categoryCode === wordItem.productCode}">
  46. {{it.categoryCode}}
  47. </view>
  48. <view class="item ww15 ">
  49. <text :class="{ 'isend' : it.quantity > 0 }">{{it.quantity}}</text>
  50. </view>
  51. <view class="item ww15 rx-cc " v-if='!it.isend' @click="handleCheck(index, idx, it)">
  52. <image class="check" v-if=' it.check' src='@/static/check.png'>
  53. </image>
  54. <image class="check" v-if='!it.check' src='@/static/check_no.png'></image>
  55. </view>
  56. </view>
  57. </u-list>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <qualityTurnoverPopup ref='turnoverRef' @saveTurn='saveTurn'></qualityTurnoverPopup>
  63. </view>
  64. </template>
  65. <script>
  66. import {
  67. qualityTransferVehicle,
  68. } from '@/api/pda/workOrder.js'
  69. import qualityTurnoverPopup from './qualityTurnoverPopup.vue'
  70. export default {
  71. components: {
  72. qualityTurnoverPopup
  73. },
  74. props: {
  75. list: {
  76. type: Array,
  77. default: () => []
  78. },
  79. wordItem: {
  80. type: Object,
  81. default: () => {}
  82. },
  83. newTurnover: {
  84. type: Array,
  85. default: () => []
  86. },
  87. },
  88. watch: {
  89. list: {
  90. immediate: true,
  91. deep: true,
  92. handler(newVal) {
  93. this.newList = newVal
  94. }
  95. }
  96. },
  97. data() {
  98. return {
  99. recycleQuantity: '',
  100. newList: [],
  101. wordInfo: {
  102. workOrderCode: null,
  103. categoryCode: null,
  104. }
  105. }
  106. },
  107. methods: {
  108. scrolltolower() {},
  109. handleCheck(index, idx, it) {
  110. this.$set(this.newList[index].extInfo.positionList[idx], 'check', !it.check)
  111. this.$forceUpdate()
  112. },
  113. handleTrade(index) {
  114. let arr = this.newList[index].extInfo.positionList.filter(e => {
  115. return e.check
  116. })
  117. if (arr.length == 0) {
  118. uni.showToast({
  119. icon: 'none',
  120. title: '请先勾选需要转移的工单'
  121. })
  122. return false
  123. }
  124. this.wordInfo.workOrderCode = arr[0].workOrderCode
  125. this.wordInfo.categoryCode = arr[0].categoryCode
  126. // this.$refs.turnoverRef.open('SL-020-SB-001011003', this.wordInfo, this.newList, this.wordItem, index)
  127. // return false
  128. uni.scanCode({
  129. success: (res) => {
  130. this.$refs.turnoverRef.open(res.result, this.wordInfo, this.newList, this.wordItem, index)
  131. }
  132. })
  133. },
  134. saveTurn(index, newTurnover, unmatched) {
  135. let arr = this.newList[index].extInfo.positionList.filter(e => {
  136. return e.check
  137. })
  138. arr.forEach(f => {
  139. if(!unmatched.includes(f.code)) {
  140. f.isend = true
  141. f.quantity = 0
  142. f.categoryCode = null
  143. f.workOrderCode = null
  144. } else {
  145. f.check = false
  146. }
  147. })
  148. let turnoverArr = []
  149. newTurnover[0].isOld = 0 // 新的
  150. newTurnover[0].id = null
  151. this.newList[index].isOld = 1 // 老的
  152. turnoverArr = [this.newList[index], ...newTurnover]
  153. qualityTransferVehicle(turnoverArr).then(res => {
  154. this.$emit('refreshList')
  155. })
  156. }
  157. }
  158. }
  159. </script>
  160. <style lang="scss" scoped>
  161. .title_box {
  162. margin-top: 20rpx;
  163. .name {
  164. font-size: 28rpx;
  165. font-style: normal;
  166. font-weight: 400;
  167. color: $theme-color;
  168. padding-left: 20rpx;
  169. position: relative;
  170. &:before {
  171. position: absolute;
  172. content: '';
  173. left: 0rpx;
  174. top: 0rpx;
  175. bottom: 0rpx;
  176. width: 4rpx;
  177. height: 28rpx;
  178. background: $theme-color;
  179. margin: auto;
  180. }
  181. }
  182. .left {
  183. width: 40rpx;
  184. }
  185. .btn_box {
  186. padding: 0 18rpx;
  187. height: 60rpx;
  188. background: $theme-color;
  189. font-size: 26rpx;
  190. font-style: normal;
  191. font-weight: 400;
  192. font-size: 24rpx;
  193. color: #fff;
  194. border-radius: 4rpx;
  195. .scan {
  196. width: 34rpx;
  197. height: 34rpx;
  198. margin-right: 12rpx;
  199. }
  200. }
  201. }
  202. .content_table {
  203. margin-top: 8rpx;
  204. width: 100%;
  205. border: 2rpx solid $border-color;
  206. .item {
  207. display: flex;
  208. border-bottom: 2rpx solid $border-color;
  209. .lable {
  210. width: 132rpx;
  211. text-align: center;
  212. background-color: #F7F9FA;
  213. font-size: 26rpx;
  214. border-right: 2rpx solid $border-color;
  215. flex-shrink: 0;
  216. }
  217. .ww80 {
  218. width: 80rpx;
  219. }
  220. .ww50 {
  221. width: 50%;
  222. }
  223. .content {
  224. width: 518rpx;
  225. min-height: 64rpx;
  226. font-size: 28rpx;
  227. line-height: 28rpx;
  228. font-style: normal;
  229. font-weight: 400;
  230. padding: 2rpx 8rpx;
  231. box-sizing: border-box;
  232. word-wrap: break-word;
  233. flex-grow: 1 !important;
  234. font-size: 24rpx;
  235. }
  236. &:last-child {
  237. border-bottom: none;
  238. }
  239. }
  240. }
  241. .content_table2 {
  242. width: 100%;
  243. .row {
  244. width: 100%;
  245. .item {
  246. color: #404446;
  247. font-size: 28rpx;
  248. padding-left: 12rpx;
  249. }
  250. .color157 {
  251. color: $theme-color;
  252. }
  253. .ww20 {
  254. width: 20%;
  255. }
  256. .ww35 {
  257. width: 35%;
  258. }
  259. .ww15 {
  260. width: 15%;
  261. }
  262. .ww25 {
  263. width: 25%;
  264. }
  265. .ww30 {
  266. width: 30%;
  267. }
  268. .ww15 {
  269. width: 15%;
  270. }
  271. .ww10 {
  272. width: 10%;
  273. }
  274. }
  275. .head {
  276. height: 64rpx;
  277. background: #F7F9FA;
  278. border-top: 2rpx solid #E3E5E5;
  279. border-left: 2rpx solid #E3E5E5;
  280. .item {
  281. height: 64rpx;
  282. line-height: 64rpx;
  283. border-right: 2rpx solid #E3E5E5;
  284. box-sizing: border-box;
  285. }
  286. }
  287. .tr {
  288. border-top: 2rpx solid #E3E5E5;
  289. border-left: 2rpx solid #E3E5E5;
  290. .item {
  291. font-size: 24rpx;
  292. min-height: 64rpx;
  293. display: flex;
  294. align-items: center;
  295. border-right: 2rpx solid #E3E5E5;
  296. box-sizing: border-box;
  297. white-space: normal;
  298. word-break: break-all;
  299. }
  300. &:last-child {
  301. border-bottom: 2rpx solid #E3E5E5;
  302. }
  303. }
  304. }
  305. .content_num {
  306. display: flex;
  307. align-items: center;
  308. padding: 0 4rpx;
  309. /deep/ .uni-input-input {
  310. border: 2rpx solid #F0F8F2;
  311. background: #F0F8F2;
  312. color: $theme-color;
  313. }
  314. }
  315. .check {
  316. width: 30rpx;
  317. height: 30rpx;
  318. }
  319. .isend {
  320. text-decoration: line-through;
  321. }
  322. .title_des {
  323. font-size: 28rpx;
  324. color: #FFA929;
  325. }
  326. .z_list {
  327. max-height: 500rpx;
  328. }
  329. </style>