turnoverBom.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  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" :key='index'>
  7. <view class="title_box rx-bc" v-if='!isDetails'>
  8. <view class="left rx-ss" >
  9. <uni-icons @click="getDelete(index)" custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
  10. <view class="des" @click="handContract()">{{ isContract ? '收缩' : '展开'}}</view>
  11. </view>
  12. <view class="btn_box rx-bc" @click="handleScan(index)" v-if="pattern == 'job'">
  13. <image class="scan" src="@/static/pda/ScanIt.svg"></image>
  14. 更换周转车
  15. </view>
  16. </view>
  17. <view class="content_table">
  18. <view class="item rx-sc">
  19. <view class="rx ww50 ">
  20. <view class="lable ww80 rx-cc ">编码</view>
  21. <view class="content rx-sc">
  22. <view>{{item.code}}</view>
  23. </view>
  24. </view>
  25. <view class="rx ww50">
  26. <view class="lable rx-cc ww80">名称</view>
  27. <view class="content rx-sc">
  28. <view>{{item.name}}</view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="item rx-sc">
  33. <view class="rx ww50 ">
  34. <view class="lable ww80 rx-cc ">编号</view>
  35. <view class="content rx-sc">
  36. <view>{{item.codeNumber}}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="content_table2">
  42. <view class="head row rx-sc">
  43. <view class="item ww10">货位</view>
  44. <view class="item ww35">工单编号</view>
  45. <view class="item ww35">产品编码</view>
  46. <view class="item ww20">数量(PCS)</view>
  47. </view>
  48. <view class="table">
  49. <u-list @scrolltolower="scrolltolower" class="z_list">
  50. <view v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
  51. <view class="tr row rx-sc" v-if=" isContract || ( it.workOrderCode != '' && it.workOrderCode != null)">
  52. <view class="item ww10">{{it.code}}</view>
  53. <view class="item ww35" :class="{'color157': it.workOrderCode === wordItem.code}">
  54. {{ it.workOrderCode }}
  55. </view>
  56. <view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
  57. {{it.categoryCode}}
  58. </view>
  59. <view class="item ww20 " :class="{'content_num' : (pattern == 'job') }" v-if='!isDetails'>
  60. <!-- // it.workOrderCode!==itemValue.code 就是工单编号和 周转车编号相同就可以修改 it.isOccupy===0 是-->
  61. <input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
  62. :class="{'content_num_box': it.categoryCode !== wordItem.productCode}"
  63. v-model="it.quantity" type="digit"
  64. :disabled="(!Object.prototype.hasOwnProperty.call(it, 'isOccupy') && it.isOccupy) || pattern != 'job' || isDisabled(it)"></input>
  65. <text v-else>{{it.quantity}}</text>
  66. </view>
  67. <view class="item ww20" v-if='isDetails'>
  68. {{ it.quantity }}
  69. </view>
  70. </view>
  71. </view>
  72. </u-list>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. export default {
  80. props: {
  81. itemValue:{
  82. type: Object,
  83. default: () => {}
  84. },
  85. list: {
  86. type: Array,
  87. default: () => []
  88. },
  89. wordItem: {
  90. type: Object,
  91. default: () => {}
  92. },
  93. pattern: {
  94. type: String,
  95. default: ''
  96. },
  97. isDetails: {
  98. type: Boolean,
  99. default: false
  100. }
  101. },
  102. watch: {
  103. list: {
  104. immediate: true,
  105. deep: true,
  106. handler(newVal) {
  107. this.newList = newVal
  108. }
  109. }
  110. },
  111. data() {
  112. return {
  113. recycleQuantity: '',
  114. newList: [],
  115. totalCount: 0,
  116. isContract: false
  117. }
  118. },
  119. methods: {
  120. //条件判断
  121. isDisabled(it) {
  122. if(it.workOrderCode === this.itemValue.code){
  123. return false
  124. }else{
  125. if(it.isOccupy){
  126. return true
  127. }else{
  128. return false
  129. }
  130. }
  131. },
  132. quantInt(index, idx, it) {
  133. if (it.quantity >= 1) {
  134. this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
  135. this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
  136. if(it.quantity > this.itemValue.product[0].feedQuantity) {
  137. this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
  138. return uni.showToast({
  139. icon: 'none',
  140. title: `超出投料数量`
  141. })
  142. }
  143. } else {
  144. this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', '')
  145. this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', '')
  146. this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
  147. this.$set(this.newList[index].extInfo.positionList[idx], 'isOccupy', 0)
  148. }
  149. this.totalCount = 0
  150. this.newList.forEach(f => {
  151. f.extInfo.positionList.forEach(o => {
  152. if (o.workOrderCode == this.wordItem.code && (!Object.prototype.hasOwnProperty
  153. .call(o, 'isOccupy') || (o.isOccupy == 0 && o.quantity > 0))) {
  154. this.totalCount = Number(this.totalCount) + Number(o.quantity)
  155. }
  156. })
  157. })
  158. uni.showToast({
  159. icon: 'none',
  160. title: `已经放${this.totalCount}`
  161. })
  162. this.$emit('formedNumFn', this.totalCount)
  163. },
  164. handleScan(index) {
  165. this.$emit('handleScan', index, 'turnover')
  166. },
  167. getDelete(index) {
  168. this.list.splice(index, 1)
  169. },
  170. scrolltolower() {},
  171. handContract() {
  172. this.isContract = !this.isContract
  173. }
  174. }
  175. }
  176. </script>
  177. <style lang="scss" scoped>
  178. .title_box {
  179. margin-top: 20rpx;
  180. .name {
  181. font-size: 28rpx;
  182. font-style: normal;
  183. font-weight: 400;
  184. color: $theme-color;
  185. padding-left: 20rpx;
  186. position: relative;
  187. &:before {
  188. position: absolute;
  189. content: '';
  190. left: 0rpx;
  191. top: 0rpx;
  192. bottom: 0rpx;
  193. width: 4rpx;
  194. height: 28rpx;
  195. background: $theme-color;
  196. margin: auto;
  197. }
  198. }
  199. .des{
  200. font-size: 28rpx;
  201. font-style: normal;
  202. font-weight: 400;
  203. color: $theme-color;
  204. margin-left: 38rpx;
  205. }
  206. .left {
  207. width: 140rpx;
  208. }
  209. .btn_box {
  210. padding: 0 18rpx;
  211. height: 60rpx;
  212. background: $theme-color;
  213. font-size: 26rpx;
  214. font-style: normal;
  215. font-weight: 400;
  216. font-size: 24rpx;
  217. color: #fff;
  218. border-radius: 4rpx;
  219. .scan {
  220. width: 34rpx;
  221. height: 34rpx;
  222. margin-right: 12rpx;
  223. }
  224. }
  225. }
  226. .content_table {
  227. margin-top: 8rpx;
  228. width: 100%;
  229. border: 2rpx solid $border-color;
  230. .item {
  231. display: flex;
  232. border-bottom: 2rpx solid $border-color;
  233. .lable {
  234. width: 132rpx;
  235. text-align: center;
  236. background-color: #F7F9FA;
  237. font-size: 26rpx;
  238. border-right: 2rpx solid $border-color;
  239. flex-shrink: 0;
  240. }
  241. .ww80 {
  242. width: 80rpx;
  243. }
  244. .ww50 {
  245. width: 50%;
  246. }
  247. .content {
  248. width: 518rpx;
  249. min-height: 64rpx;
  250. font-size: 28rpx;
  251. line-height: 28rpx;
  252. font-style: normal;
  253. font-weight: 400;
  254. padding: 2rpx 8rpx;
  255. box-sizing: border-box;
  256. word-wrap: break-word;
  257. flex-grow: 1 !important;
  258. font-size: 24rpx;
  259. }
  260. &:last-child {
  261. border-bottom: none;
  262. }
  263. }
  264. }
  265. .content_table2 {
  266. width: 100%;
  267. .row {
  268. width: 100%;
  269. .item {
  270. color: #404446;
  271. font-size: 28rpx;
  272. padding-left: 12rpx;
  273. }
  274. .color157 {
  275. color: $theme-color;
  276. }
  277. .ww20 {
  278. width: 20%;
  279. }
  280. .ww35 {
  281. width: 35%;
  282. }
  283. .ww10 {
  284. width: 10%;
  285. }
  286. }
  287. .head {
  288. height: 64rpx;
  289. background: #F7F9FA;
  290. border-top: 2rpx solid #E3E5E5;
  291. border-left: 2rpx solid #E3E5E5;
  292. .item {
  293. height: 64rpx;
  294. line-height: 64rpx;
  295. border-right: 2rpx solid #E3E5E5;
  296. box-sizing: border-box;
  297. }
  298. }
  299. .tr {
  300. border-top: 2rpx solid #E3E5E5;
  301. border-left: 2rpx solid #E3E5E5;
  302. .item {
  303. font-size: 24rpx;
  304. min-height: 64rpx;
  305. display: flex;
  306. align-items: center;
  307. border-right: 2rpx solid #E3E5E5;
  308. box-sizing: border-box;
  309. white-space: normal;
  310. word-break: break-all;
  311. }
  312. &:last-child {
  313. border-bottom: 2rpx solid #E3E5E5;
  314. }
  315. }
  316. }
  317. .content_num {
  318. display: flex;
  319. align-items: center;
  320. padding: 0 4rpx;
  321. /deep/ .uni-input-input {
  322. border: 2rpx solid #F0F8F2;
  323. background: #F0F8F2;
  324. color: $theme-color;
  325. }
  326. }
  327. .content_num_box {
  328. /deep/ .uni-input-input {
  329. border: 2rpx solid #F0F8F2;
  330. background: #fafafa;
  331. color:#222;
  332. }
  333. }
  334. .z_list {
  335. max-height: 500rpx;
  336. }
  337. </style>