qualityTurnoverBom.vue 7.1 KB

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