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