qualityTurnoverBom.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  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>*需要同类型车,货位一一对应</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. transferVehicle,
  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('w0300000002816002', this.wordInfo, this.newList, this.wordItem, index)
  127. return false
  128. let _this = this
  129. uni.scanCode({
  130. success: function(res) {
  131. _this.$refs.turnoverRef.open(res.result, this.wordInfo, this.newList, this.wordItem,
  132. index)
  133. }
  134. })
  135. },
  136. saveTurn(index, newTurnover, unmatched) {
  137. let arr = this.newList[index].extInfo.positionList.filter(e => {
  138. return e.check
  139. })
  140. arr.forEach(f => {
  141. if(!unmatched.includes(f.code)) {
  142. f.isend = true
  143. f.quantity = 0
  144. f.categoryCode = null
  145. f.workOrderCode = null
  146. } else {
  147. f.check = false
  148. }
  149. })
  150. let turnoverArr = []
  151. newTurnover[0].isOld = 0 // 新的
  152. newTurnover[0].id = null
  153. this.newList[index].isOld = 1 // 老的
  154. turnoverArr = [this.newList[index], ...newTurnover]
  155. transferVehicle(turnoverArr).then(res => {
  156. this.$emit('refreshList')
  157. })
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .title_box {
  164. margin-top: 20rpx;
  165. .name {
  166. font-size: 28rpx;
  167. font-style: normal;
  168. font-weight: 400;
  169. color: $theme-color;
  170. padding-left: 20rpx;
  171. position: relative;
  172. &:before {
  173. position: absolute;
  174. content: '';
  175. left: 0rpx;
  176. top: 0rpx;
  177. bottom: 0rpx;
  178. width: 4rpx;
  179. height: 28rpx;
  180. background: $theme-color;
  181. margin: auto;
  182. }
  183. }
  184. .left {
  185. width: 40rpx;
  186. }
  187. .btn_box {
  188. padding: 0 18rpx;
  189. height: 60rpx;
  190. background: $theme-color;
  191. font-size: 26rpx;
  192. font-style: normal;
  193. font-weight: 400;
  194. font-size: 24rpx;
  195. color: #fff;
  196. border-radius: 4rpx;
  197. .scan {
  198. width: 34rpx;
  199. height: 34rpx;
  200. margin-right: 12rpx;
  201. }
  202. }
  203. }
  204. .content_table {
  205. margin-top: 8rpx;
  206. width: 100%;
  207. border: 2rpx solid $border-color;
  208. .item {
  209. display: flex;
  210. border-bottom: 2rpx solid $border-color;
  211. .lable {
  212. width: 132rpx;
  213. text-align: center;
  214. background-color: #F7F9FA;
  215. font-size: 26rpx;
  216. border-right: 2rpx solid $border-color;
  217. flex-shrink: 0;
  218. }
  219. .ww80 {
  220. width: 80rpx;
  221. }
  222. .ww50 {
  223. width: 50%;
  224. }
  225. .content {
  226. width: 518rpx;
  227. min-height: 64rpx;
  228. font-size: 28rpx;
  229. line-height: 28rpx;
  230. font-style: normal;
  231. font-weight: 400;
  232. padding: 2rpx 8rpx;
  233. box-sizing: border-box;
  234. word-wrap: break-word;
  235. flex-grow: 1 !important;
  236. font-size: 24rpx;
  237. }
  238. &:last-child {
  239. border-bottom: none;
  240. }
  241. }
  242. }
  243. .content_table2 {
  244. width: 100%;
  245. .row {
  246. width: 100%;
  247. .item {
  248. color: #404446;
  249. font-size: 28rpx;
  250. padding-left: 12rpx;
  251. }
  252. .color157 {
  253. color: $theme-color;
  254. }
  255. .ww20 {
  256. width: 20%;
  257. }
  258. .ww35 {
  259. width: 35%;
  260. }
  261. .ww15 {
  262. width: 15%;
  263. }
  264. .ww25 {
  265. width: 25%;
  266. }
  267. .ww30 {
  268. width: 30%;
  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. }
  288. }
  289. .tr {
  290. border-top: 2rpx solid #E3E5E5;
  291. border-left: 2rpx solid #E3E5E5;
  292. .item {
  293. font-size: 24rpx;
  294. min-height: 64rpx;
  295. display: flex;
  296. align-items: center;
  297. border-right: 2rpx solid #E3E5E5;
  298. box-sizing: border-box;
  299. white-space: normal;
  300. word-break: break-all;
  301. }
  302. &:last-child {
  303. border-bottom: 2rpx solid #E3E5E5;
  304. }
  305. }
  306. }
  307. .content_num {
  308. display: flex;
  309. align-items: center;
  310. padding: 0 4rpx;
  311. /deep/ .uni-input-input {
  312. border: 2rpx solid #F0F8F2;
  313. background: #F0F8F2;
  314. color: $theme-color;
  315. }
  316. }
  317. .check {
  318. width: 30rpx;
  319. height: 30rpx;
  320. }
  321. .isend {
  322. text-decoration: line-through;
  323. }
  324. .title_des {
  325. font-size: 28rpx;
  326. color: #FFA929;
  327. }
  328. .z_list {
  329. max-height: 500rpx;
  330. }
  331. </style>