ysy 2 years ago
parent
commit
26f7f06512

+ 5 - 5
pages/pda/turnover/components/qualityTurnoverBom.vue

@@ -8,9 +8,10 @@
 
 			<view v-for="(item, index) in newList" :key='index'>
 				<view class="title_box rx-bc">
-					<view class="btn_box rx-bc" @click="handleTrade(index)" >
+					<view class="btn_box rx-bc" @click="handleTrade(index)">
 						换周转车
 					</view>
+					<view>*需要同类型车,货位一一对应</view>
 
 
 				</view>
@@ -62,8 +63,7 @@
 
 									<image class="check" v-if=' it.check' src='@/static/check.png'>
 									</image>
-									<image class="check" v-if='!it.check'
-										src='@/static/check_no.png'></image>
+									<image class="check" v-if='!it.check' src='@/static/check_no.png'></image>
 								</view>
 
 
@@ -116,6 +116,8 @@
 
 		},
 
+	
+
 
 		watch: {
 
@@ -146,7 +148,6 @@
 
 
 			handleCheck(index, idx, it) {
-				console.log(this.newList[index])
 				this.$set(this.newList[index].extInfo.positionList[idx], 'check', !it.check)
 				this.$forceUpdate()
 
@@ -180,7 +181,6 @@
 				let _this = this
 				uni.scanCode({
 					success: function(res) {
-
 						_this.$refs.turnoverRef.open(res.result, this.wordInfo, this.newList, this.wordItem,
 							index)
 					}

+ 33 - 4
pages/pda/turnover/components/qualityTurnoverPopup.vue

@@ -48,11 +48,11 @@
 										:key='idx'>
 										<view class="item ww10">{{it.code}}</view>
 										<view class="item ww30"
-											:class="{'color157': it.workOrderCode === wordItem.code}">
+											:class="{'color157': it.workOrderCode === wordItem.code && it.numAdd}">
 											{{ it.workOrderCode }}
 										</view>
 										<view class="item ww35"
-											:class="{'color157': it.categoryCode === wordItem.productCode}">
+											:class="{'color157': it.categoryCode === wordItem.productCode && it.numAdd}">
 											{{it.categoryCode}}
 										</view>
 										<view class="item ww25  content_num">
@@ -75,6 +75,8 @@
 
 
 						</view>
+						
+						<view class="hwDes">货位 {{ unmatched }} 已占用, 没有替换</view>
 
 					</view>
 
@@ -108,11 +110,13 @@
 				show: false,
 				wordInfo: {},
 				wordItem: {},
+
 				newTurnover: [],
 				idx: null,
 
 				sum: 0,
 				count: 0,
+				unmatched: []
 			}
 		},
 		methods: {
@@ -123,17 +127,18 @@
 				this.idx = index
 
 
+
 				this.count = 0
 				this.sum = 0;
 				newList[0].extInfo.positionList.forEach(e => {
 					if (e.check) {
-						this.sum += Number(e.newQuantity);
+						this.sum += Number(e.quantity);
 					}
 				})
 
 
 
-				let isFals = newList.some(m => m.code == result && m.isOld == 1)
+				let isFals = newList.some(m => m.code == result)
 				if (isFals) {
 					uni.showToast({
 						title: '周转车已存在',
@@ -145,12 +150,30 @@
 				scanLedger(result).then(res => {
 					this.newTurnover = res
 					this.show = true
+
+					this.allReplace(this.newTurnover[0].extInfo.positionList, newList[0].extInfo.positionList)
 				})
 
 
+			},
 
+			allReplace(newTurnover, newList) {
+                this.unmatched = []
+				newTurnover.forEach(item1 => {
+					newList.forEach(item2 => {
+						if (item2.code == item1.code && (item1.quantity == 0 && item2.quantity > 0)) {
+							item1.workOrderCode = item2.workOrderCode
+							item1.categoryCode = item2.categoryCode
+							item1.quantity = item2.quantity
+							item1.numAdd = true
+						} else if(item2.code == item1.code && (item1.quantity > 0 && item2.quantity > 0)) {
+							  this.unmatched.push(item2.code)
+						}
 
+					})
+				})
 
+				this.countFn()
 			},
 
 			quantInt(index, idx, it) {
@@ -422,6 +445,12 @@
 			}
 		}
 	}
+	
+	.hwDes{
+		margin-top: 18rpx;
+		color: #db1919;
+		font-size: 24rpx;
+	}
 
 
 	.content_num {