ysy 2 лет назад
Родитель
Сommit
7b48ddef6f

+ 1 - 1
pages/pda/jobBooking/components/turnoverBom.vue

@@ -52,7 +52,7 @@
 						<view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
 							{{it.categoryCode}}
 						</view>
-						<view class="item ww20  content_num">
+						<view class="item ww20  " :class="{'content_num' : pattern == 'job' }">
 							<input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
 								v-model="it.quantity" type="digit" :disabled="pattern != 'job'"></input>
 							<text v-else>{{it.quantity}}</text>

+ 221 - 26
pages/pda/turnover/components/turnoverBom.vue

@@ -1,4 +1,6 @@
 <template>
+	
+	<view>
 	<view>
 		<view class="title_box rx-bc">
 			<view class="name">周转车</view>
@@ -6,10 +8,7 @@
 
 		<view v-for="(item, index) in newList" :key='index'>
 			<view class="title_box rx-bc">
-				<view class="left rx-ss" @click="getDelete(index)" v-if="pattern == 'new'">
-					<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
-				</view>
-				<view class="btn_box rx-bc" @click="handleTrade(index)" v-if="pattern == 'old'" >
+				<view class="btn_box rx-bc" @click="handleTrade(index)" >
 					工单换周转车
 				</view>
 			</view>
@@ -37,25 +36,31 @@
 			<view class="content_table2">
 				<view class="head row rx-sc">
 					<view class="item ww10">货位</view>
-					<view class="item ww35">工单编号</view>
-					<view class="item ww35">产品编码</view>
-					<view class="item ww20">数量(PCS)</view>
+					<view class="item ww30">工单编号</view>
+					<view class="item ww30">产品编码</view>
+					<view class="item ww15">数量</view>
+					<view class="item ww15"></view>
 				</view>
 
 				<view class="table">
 					<view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
 						<view class="item ww10">{{it.code}}</view>
-						<view class="item ww35" :class="{'color157': it.workOrderCode === wordItem.code}">
+						<view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
 							{{ it.workOrderCode }}
 						</view>
-						<view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
+						<view class="item ww30" :class="{'color157': it.categoryCode === wordItem.productCode}">
 							{{it.categoryCode}}
 						</view>
-						<view class="item ww20  content_num">
+						<view class="item ww15  ">
 							<input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
-								v-model="it.quantity" type="digit" :disabled="pattern != 'job'"></input>
+								v-model="it.quantity" type="digit" :disabled="true"></input>
 							<text v-else>{{it.quantity}}</text>
 						</view>
+
+						<view class="item ww15 rx-cc " @click="handleCheck(index, idx, it)">
+							<image class="check" v-if='it.check' src='@/static/check.png'></image>
+							<image class="check" v-else src='@/static/check_no.png'></image>
+						</view>
 					</view>
 
 
@@ -70,9 +75,89 @@
 
 		</view>
 	</view>
+	
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">更换后周转车</view>
+		</view>
+	
+		<view v-for="(item, index) in newTurnover" :key='index'>
+			<view class="title_box rx-bc">
+				<view class="left rx-ss" @click="getDelete(index)" >
+					<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20" color="#fa3534"></uni-icons>
+				</view>
+			
+			</view>
+	
+			<view class="content_table">
+				<view class="item rx-sc">
+					<view class="rx ww50 ">
+						<view class="lable ww80 rx-cc ">编号</view>
+						<view class="content rx-sc">
+							<view>{{item.code}}</view>
+						</view>
+					</view>
+	
+					<view class="rx ww50">
+						<view class="lable rx-cc ww80">名称</view>
+						<view class="content rx-sc">
+							<view>{{item.name}}</view>
+						</view>
+					</view>
+	
+				</view>
+			</view>
+	
+	
+			<view class="content_table2">
+				<view class="head row rx-sc">
+					<view class="item ww10">货位</view>
+					<view class="item ww30">工单编号</view>
+					<view class="item ww35">产品编码</view>
+					<view class="item ww25">数量</view>
+				
+				</view>
+	
+				<view class="table">
+					<view class="tr row rx-sc" v-for="(it, idx) in item.extInfo.positionList" :key='idx'>
+						<view class="item ww10">{{it.code}}</view>
+						<view class="item ww30" :class="{'color157': it.workOrderCode === wordItem.code}">
+							{{ it.workOrderCode }}
+						</view>
+						<view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
+							{{it.categoryCode}}
+						</view>
+						<view class="item ww25  content_num">
+							<input class="uni-input" v-if='it.isFull == 0' @input="quantInt(index, idx, it)"
+								v-model="it.quantity" type="digit" ></input>
+							<text v-else>{{it.quantity}}</text>
+						</view>
+	
+				
+					</view>
+	
+	
+	
+	
+	
+	
+				</view>
+	
+	
+			</view>
+	
+		</view>
+	</view>
+	</view>
 </template>
 
 <script>
+	import {
+	
+		scanLedger,
+		
+
+	} from '@/api/pda/workOrder.js'
 	export default {
 		props: {
 			list: {
@@ -83,11 +168,13 @@
 				type: Object,
 				default: () => {}
 			},
-			
-			pattern: {
-				type: String,
-				default: ''
-			}
+
+
+            newTurnover: {
+				type: Array,
+				default: () => []
+			},
+			  
 		},
 
 
@@ -98,7 +185,7 @@
 				deep: true,
 				handler(newVal) {
 					this.newList = newVal
-				
+
 				}
 			}
 		},
@@ -106,7 +193,12 @@
 		data() {
 			return {
 				recycleQuantity: '',
-				newList: []
+				newList: [],
+				
+				wordInfo: {
+					workOrderCode: null,
+					categoryCode: null,
+				}
 			}
 		},
 
@@ -114,24 +206,105 @@
 
 			quantInt(index, idx, it) {
 				if (it.quantity >= 1) {
-					this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
-					this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
+					this.$set(this.newTurnover[index].extInfo.positionList[idx], 'workOrderCode', this.wordInfo.workOrderCode )
+					this.$set(this.newTurnover[index].extInfo.positionList[idx], 'categoryCode', this.wordInfo.categoryCode)
 
 				} else {
-					this.$set(this.newList[index].extInfo.positionList[idx], 'workOrderCode', '')
-					this.$set(this.newList[index].extInfo.positionList[idx], 'categoryCode', '')
-					this.$set(this.newList[index].extInfo.positionList[idx], 'quantity', 0)
+					this.$set(this.newTurnover[index].extInfo.positionList[idx], 'workOrderCode', '')
+					this.$set(this.newTurnover[index].extInfo.positionList[idx], 'categoryCode', '')
+					this.$set(this.newTurnover[index].extInfo.positionList[idx], 'quantity', 0)
 				}
 
 
 			},
 
-	  handleTrade(index) {},
+			handleCheck(index, idx, it) {
+
+
+
+				if (it.quantity <= 0) {
+					uni.showToast({
+						icon: 'none',
+						title: '数量为空不能勾选'
+					})
+
+					return false
+				}
+
+
+
+				let arr = this.newList[index].extInfo.positionList.filter(e => {
+					return e.check
+				})
+				let flag = arr.every((i) => {
+					return i.workOrderCode == it.workOrderCode && i.categoryCode == it.categoryCode
+				})
+
+				if (flag) {
+					this.$set(this.newList[index].extInfo.positionList[idx], 'check', !it.check)
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '一次只能转移同一工单产品'
+					})
+				}
+
 
-			getDelete(index) {
-				this.list.splice(index,1)
 
 			},
+
+			handleTrade(index) {
+				
+				let arr = this.newList[index].extInfo.positionList.filter(e => {
+					return e.check
+				})
+				if(arr.length == 0) {
+					uni.showToast({
+						icon: 'none',
+						title: '请先勾选需要转移的工单'
+					})
+					
+					return false
+				}
+				
+				this.wordInfo.workOrderCode = arr[0].workOrderCode
+				this.wordInfo.categoryCode = arr[0].categoryCode
+				
+				// 周转车 
+				this.scanData('w0300000004195005')
+				return false
+				
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						_this.scanData(res.result)
+					}
+				})
+				
+			},
+			scanData(result) {
+				let _turnover = [...this.newList, ...this.newTurnover]
+				let isFals = _turnover.some(m => m.code == result)
+				if (isFals) {
+					uni.showToast({
+						title: '周转车已存在',
+						icon: 'none'
+					})
+					return false
+				}
+				
+				scanLedger(result).then(res => {
+				
+		           this.newTurnover.push(res[0])
+				   console.log( this.newTurnover)
+				})
+				},
+				
+				getDelete(index) {
+					this.newTurnover.splice(index, 1)
+				},
+		
+		
 		}
 	}
 </script>
@@ -273,6 +446,23 @@
 				width: 35%;
 
 			}
+			
+			.ww15 {
+				width: 15%;
+			}
+			.ww25 {
+				width: 25%;
+			}
+			
+
+			.ww30 {
+				width: 30%;
+			}
+
+			.ww15 {
+				width: 15%;
+			}
+
 
 			.ww10 {
 				width: 10%;
@@ -332,4 +522,9 @@
 		}
 
 	}
+
+	.check {
+		width: 40rpx;
+		height: 40rpx;
+	}
 </style>

+ 14 - 6
pages/pda/turnover/index/index.vue

@@ -9,17 +9,13 @@
 					<workOrderBom :item='item' @handleScan='handleWordScan'></workOrderBom>
 
 
-					<turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='old'
+					<turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' :newTurnover='item.newTurnover'
 						@handleScan='handleScan'></turnoverBom>
 
 
 
 
-
-					<view class="operate_box rx-sc">
-						<u-button size="small" class="u-reset-button" type="success" @click="">手动添加</u-button>
-						<u-button size="small" class="u-reset-button" type="success" @click="">扫一扫</u-button>
-					</view>
+				
 				</view>
 			</u-list>
 
@@ -95,7 +91,19 @@
 					taskId: this.taskId
 				}).then(res => {
 					this.List = []
+
+					if (res.turnover && res.turnover.length) {
+						res.newTurnover = []
+						res.turnover.forEach(e => {
+							e.extInfo.positionList.length && e.extInfo.positionList.forEach(o => {
+								o['check'] = false
+							})
+						})
+					}
+
 					this.List.push(res)
+					console.log(this.List)
+
 				})
 			},
 

BIN
static/check.png


BIN
static/check_no.png