ysy 2 ani în urmă
părinte
comite
c0053b49ed

+ 2 - 2
pages/pda/feeding/details.vue

@@ -242,7 +242,7 @@
 						_arr = this.List
 						_arr.forEach((e, index) => {
 							if (e.workOrderId == id) {
-								console.log(res.fixCode)
+								
 								_arr[index].equipmentList = res
 							}
 						})
@@ -260,7 +260,7 @@
 						this.List = _arr
 						this.$forceUpdate()
 
-					} else if (res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) {
+					} else if (res.length >= 1 && ['1'].includes(res[0].rootCategoryLevelId)) { // 物料
 
 						_arr = this.List
 						_arr.forEach((e, index) => {

+ 22 - 19
pages/pda/jobBooking/components/byProductBom.vue

@@ -18,18 +18,18 @@
 						<view class="item ww30">{{item.code}}</view>
 						<view class="item ww30">{{item.name}}</view>
 						<view class="item ww40  content_num">
-							
-								<input class="uni-input" v-model="item.recycleQuantity" type="digit"></input>
-								<view class="unit">{{item.unit}}</view>
-								<view class="penalize">处置</view>
-								
+
+							<input class="uni-input" v-model="item.recycleQuantity" type="digit"></input>
+							<view class="unit">{{item.unit}}</view>
+							<view class="penalize">处置</view>
+
 						</view>
 					</view>
-					
-	
 
-				
-				
+
+
+
+
 
 				</view>
 
@@ -127,6 +127,7 @@
 					height: 64rpx;
 					line-height: 64rpx;
 					border-right: 2rpx solid #E3E5E5;
+					box-sizing: border-box;
 				}
 			}
 
@@ -143,7 +144,9 @@
 					display: flex;
 					align-items: center;
 					border-right: 2rpx solid #E3E5E5;
-
+					box-sizing: border-box;
+					white-space: normal;
+					word-break: break-all;
 
 				}
 
@@ -154,26 +157,26 @@
 				}
 			}
 		}
-		
+
 		.content_num {
 			display: flex;
 			align-items: center;
 			padding: 0 4rpx;
-		
+
 			/deep/ .uni-input-input {
 				border: 2rpx solid #F0F8F2;
 				background: #F0F8F2;
 				color: $theme-color;
 			}
-			
-			
-			
+
+
+
 			.unit {
-				padding: 0 4rpx;
+				width: 100rpx;
 				font-size: 24rpx;
 				color: #404446;
 			}
-			
+
 			.penalize {
 				width: 160rpx;
 				line-height: 60rpx;
@@ -182,8 +185,8 @@
 				text-align: center;
 				color: #fff;
 			}
-		
-		
+
+
 		}
 	}
 </style>

+ 319 - 0
pages/pda/jobBooking/components/turnoverBom.vue

@@ -0,0 +1,319 @@
+<template>
+	<view>
+		<view class="title_box rx-bc" v-if='list.length > 0'>
+			<view class="name">周转车</view>
+		</view>
+
+		<view v-for="(item, index) in list" :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 class="btn_box rx-bc" @click="handleScan(index)">
+					<image class="scan" src="@/static/pda/ScanIt.svg"></image>
+					更换周转车
+				</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 ww35">工单编号</view>
+					<view class="item ww35">产品编码</view>
+					<view class="item ww20">数量(PCS)</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}">
+							{{ it.workOrderCode }}
+						</view>
+						<view class="item ww35" :class="{'color157': it.categoryCode === wordItem.productCode}">
+							{{it.categoryCode}}
+						</view>
+						<view class="item ww20  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>
+</template>
+
+<script>
+	export default {
+		props: {
+			list: {
+				type: Array,
+				default: () => []
+			},
+			wordItem: {
+				type: Object,
+				default: () => {}
+			}
+		},
+		data() {
+			return {
+				recycleQuantity: ''
+			}
+		},
+
+		methods: {
+
+			quantInt(index, idx, it) {
+				if (it.quantity >= 1) {
+					this.$set(this.list[index].extInfo.positionList[idx], 'workOrderCode', this.wordItem.code)
+					this.$set(this.list[index].extInfo.positionList[idx], 'categoryCode', this.wordItem.productCode)
+
+				} else {
+					this.$set(this.list[index].extInfo.positionList[idx], 'workOrderCode', '')
+					this.$set(this.list[index].extInfo.positionList[idx], 'categoryCode', '')
+					this.$set(this.list[index].extInfo.positionList[idx], 'quantity', 0)
+				}
+
+
+			},
+
+			handleScan(index) {
+				this.$emit('handleScan', index, 'turnover')
+			},
+
+			getDelete(index) {
+				this.list.splice(index, 1)
+				this.$forceUpdate()
+			
+			},
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.title_box {
+		margin-top: 20rpx;
+
+		.name {
+			font-size: 28rpx;
+			font-style: normal;
+			font-weight: 400;
+			color: $theme-color;
+			padding-left: 20rpx;
+
+			position: relative;
+
+			&:before {
+				position: absolute;
+				content: '';
+				left: 0rpx;
+				top: 0rpx;
+				bottom: 0rpx;
+				width: 4rpx;
+				height: 28rpx;
+				background: $theme-color;
+				margin: auto;
+			}
+
+
+		}
+
+		.left {
+			width: 40rpx;
+		}
+
+		.btn_box {
+			padding: 0 18rpx;
+			height: 60rpx;
+			background: $theme-color;
+			font-size: 26rpx;
+			font-style: normal;
+			font-weight: 400;
+			font-size: 24rpx;
+			color: #fff;
+			border-radius: 4rpx;
+
+			.scan {
+				width: 34rpx;
+				height: 34rpx;
+				margin-right: 12rpx;
+
+			}
+
+		}
+
+	}
+
+
+	.content_table {
+		margin-top: 8rpx;
+		width: 100%;
+		border: 2rpx solid $border-color;
+
+		.item {
+			display: flex;
+			border-bottom: 2rpx solid $border-color;
+
+			.lable {
+				width: 132rpx;
+				text-align: center;
+				background-color: #F7F9FA;
+				font-size: 26rpx;
+				border-right: 2rpx solid $border-color;
+				flex-shrink: 0;
+			}
+
+
+
+			.ww80 {
+				width: 80rpx;
+			}
+
+			.ww50 {
+				width: 50%;
+			}
+
+			.content {
+				width: 518rpx;
+				min-height: 64rpx;
+				font-size: 28rpx;
+				line-height: 28rpx;
+				font-style: normal;
+				font-weight: 400;
+				padding: 2rpx 8rpx;
+				box-sizing: border-box;
+				word-wrap: break-word;
+				flex-grow: 1 !important;
+				font-size: 24rpx;
+
+			}
+
+
+			&:last-child {
+				border-bottom: none;
+			}
+		}
+
+
+	}
+
+
+
+	.content_table2 {
+		width: 100%;
+
+
+		.row {
+			width: 100%;
+
+
+			.item {
+
+				color: #404446;
+				font-size: 28rpx;
+				padding-left: 12rpx;
+
+			}
+
+			.color157 {
+				color: $theme-color;
+			}
+
+			.ww20 {
+				width: 20%;
+			}
+
+			.ww35 {
+				width: 35%;
+
+			}
+
+			.ww10 {
+				width: 10%;
+			}
+		}
+
+		.head {
+			height: 64rpx;
+			background: #F7F9FA;
+			border-top: 2rpx solid #E3E5E5;
+			border-left: 2rpx solid #E3E5E5;
+
+			.item {
+				height: 64rpx;
+				line-height: 64rpx;
+				border-right: 2rpx solid #E3E5E5;
+				box-sizing: border-box;
+			}
+		}
+
+
+
+		.tr {
+			border-top: 2rpx solid #E3E5E5;
+			border-left: 2rpx solid #E3E5E5;
+
+
+			.item {
+				font-size: 24rpx;
+				min-height: 64rpx;
+				display: flex;
+				align-items: center;
+				border-right: 2rpx solid #E3E5E5;
+				box-sizing: border-box;
+				white-space: normal;
+				word-break: break-all;
+
+			}
+
+			&:last-child {
+				border-bottom: 2rpx solid #E3E5E5;
+
+			}
+		}
+	}
+
+
+	.content_num {
+		display: flex;
+		align-items: center;
+		padding: 0 4rpx;
+
+		/deep/ .uni-input-input {
+			border: 2rpx solid #F0F8F2;
+			background: #F0F8F2;
+			color: $theme-color;
+		}
+
+	}
+</style>

+ 130 - 15
pages/pda/jobBooking/index/index.vue

@@ -14,23 +14,33 @@
 
 					<modelBom v-if='objData.modelList.length != 0' :list='objData.modelList'>
 					</modelBom>
-					
+
 					<jobBom :item='objData'></jobBom>
-					
-					<byProductBom v-if='objData.productRecycleList != 0 ' :list='objData.productRecycleList'></byProductBom>
+
+					<byProductBom v-if='objData.productRecycleList.length != 0 ' :list='objData.productRecycleList'>
+					</byProductBom>
+
+					<turnoverBom v-if='objData.turnover.length != 0' :list='objData.turnover' :wordItem='objData' @handleScan='handleScan' >
+					</turnoverBom>
+
+
+					<view class="operate_box rx-sc">
+						<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
+
+					</view>
 
 				</view>
 
 			</u-list>
 		</view>
-		
-		
+
+
 		<view class="bottom-wrapper">
 			<view class="btn_box" @click="save">一键报工</view>
-		
+
 		</view>
-		
-		
+
+
 	</view>
 </template>
 
@@ -40,11 +50,17 @@
 		getByCodeReport
 	} from '@/api/pda/jobBooking.js'
 
+	import {
+		scanLedger
+	} from '@/api/pda/workOrder.js'
+
+
 	import workOrderBom from '../../feeding/components/workOrderBom.vue'
 	import deviceBom from '../../feeding/components/deviceBom.vue'
 	import modelBom from '../../feeding/components/modelBom.vue'
 	import jobBom from '../components/jobBom.vue'
 	import byProductBom from '../components/byProductBom'
+	import turnoverBom from '../components/turnoverBom.vue'
 
 
 	export default {
@@ -54,7 +70,8 @@
 			deviceBom,
 			modelBom,
 			jobBom,
-			byProductBom
+			byProductBom,
+			turnoverBom
 		},
 		data() {
 			return {
@@ -62,9 +79,13 @@
 
 				objData: {
 					equipmentList: [],
-					modelList: []
+					modelList: [],
+					turnover: [],
+					productRecycleList: []
 				},
 
+
+
 				id: null,
 				taskId: null,
 
@@ -77,20 +98,68 @@
 			this.getList()
 		},
 
+		onShow() {
+			uni.$off("setSelectList");
+
+			uni.$on("setSelectList", (selectList, id) => {
+				console.log(selectList)
+
+				selectList.forEach(f => {
+					if (f.rootCategoryLevelId == 7) { // 周转车
+
+						let isFals = this.objData.turnover.some(m => m.code == f.code)
+						if (isFals) {
+							return false
+						}
+						this.objData.turnover.push(f)
+						this.$forceUpdate()
+					}
+
+				})
+
+			});
+
+		},
+
 		methods: {
 
 
 			// 相机扫码
 			HandlScanCode() {
+				this.scanItAllData('w0300000003140004')
+				return false
+
 				let _this = this
 				uni.scanCode({
 					success: function(res) {
-						console.log(res)
+						_this.scanItAllData(res.result)
 					}
 				})
 
 			},
 
+			scanItAllData(result) {
+				scanLedger(result).then(res => {
+					console.log(this.objData.turnover)
+					if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
+
+						let isFals = this.objData.turnover.some(m => m.code == result)
+						if (isFals) {
+							uni.showToast({
+								title: '周转车已存在',
+								icon: 'none'
+							})
+							return false
+						}
+						this.objData.turnover.push(res[0])
+						this.$forceUpdate()
+						console.log(this.objData.turnover)
+
+					}
+
+				})
+			},
+
 			handleScan(id, type) {
 
 
@@ -107,19 +176,57 @@
 				if (type == 'wordOrder') {
 					getByCodeReport(result, this.taskId).then(res => {
 						this.objData = res
+
+						if (!this.objData.hasOwnProperty('turnover')) {
+							this.objData['turnover'] = []
+						}
+
 					})
+				} else if (type == 'turnover') {
+					
+					let isFals = this.objData.turnover.some(m => m.code == result)
+					if (isFals) {
+						uni.showToast({
+							title: '周转车已存在',
+							icon: 'none'
+						})
+						return false
+					}
+
+					getByCodeReport(result, this.taskId).then(res => {
+						this.objData.turnover[id] = res
+					})
+
 				}
+
 			},
+			
+
 
 			getList() {
 				getByIdReport(this.id, this.taskId).then(res => {
 					this.objData = res
+					if (!this.objData.hasOwnProperty('turnover')) {
+						this.objData['turnover'] = []
+					}
+					console.log(this.objData)
 				})
 			},
 
 			scrolltolower() {},
-			
-			save() {}
+
+			handAdd() {
+				const storageKey = Date.now() + "";
+				uni.setStorageSync(storageKey, this.objData || {});
+				uni.navigateTo({
+					url: `/pages/pda/workOrder/search/index?storageKey=${storageKey}&isType=job`
+				})
+			},
+
+
+			save() {
+				console.log(this.objData)
+			}
 		}
 	}
 </script>
@@ -149,7 +256,7 @@
 
 
 	}
-	
+
 	.bottom-wrapper {
 		.btn_box {
 			width: 750rpx;
@@ -163,5 +270,13 @@
 			color: #fff;
 		}
 	}
-	
+
+
+	.operate_box {
+		padding: 10rpx 160rpx;
+
+		/deep/ .u-button {
+			width: 160rpx;
+		}
+	}
 </style>

+ 39 - 57
pages/pda/workOrder/search/index.vue

@@ -30,7 +30,7 @@
 					<label class="listBox rx-bs">
 
 						<view class="listBox-sel">
-						
+
 							<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
 								:checked="item.checked" />
 						</view>
@@ -157,8 +157,11 @@
 
 
 
-				} else {
+				} else if (this.isType == 'pick') {
 					this.memoList = (this.storageKey && uni.getStorageSync(this.storageKey)) || []
+				} else if (this.isType == 'job') {
+					let _obj = (this.storageKey && uni.getStorageSync(this.storageKey)) || {}
+					this.memoList  = [ ..._obj.turnover ]
 				}
 
 
@@ -216,10 +219,15 @@
 			},
 
 			getTreeList() {
-				let params = {
-					ids: [1, 5, 7, 8, 10, 14]
-
+				let params = {}
+				if (this.isType == 'feed') {
+					params.ids = [1, 5, 7, 8, 10, 14]
+				} else if (this.isType == 'pick') {
+					params.ids = [1, 5, 7, 8, 10, 14]
+				} else if (this.isType == 'job') {
+					params['ids'] = [7, 11]
 				}
+
 				treeByPid(params).then(res => {
 					this.classificationList = res
 					this.confirm([res[0].id], res[0].name)
@@ -228,7 +236,7 @@
 
 			confirm(id, name) {
 				this.categoryLevelId = id
-				
+
 				this.list = []
 				this.getList()
 			},
@@ -254,58 +262,36 @@
 
 				}
 				isEnd = false
-
-				if (this.isType == 'pick') {
+				let URL = null
+				if (this.isType == 'pick') { // 领料
 					param.dimension = 1
-					pageeLedgerMain(param).then(res => {
-						this.list.push(
-							...res.list.map(i => {
-								const checked =
-									this.memoList.findIndex(itm => itm.id === i.id) > -1
-
-								const warehouseId = i.pathIds && i.pathIds.split(',')[0]
-
-								return {
-									checked,
-									warehouseId,
-									...i,
-									instanceId: i.id,
-
-
-								}
-							})
-						)
-
-						isEnd = this.list.length >= res.count
-
-					})
-
-				} else if (this.isType == 'feed') {
-					assetPage(param).then(res => {
-						this.list.push(
-							...res.list.map(i => {
-								const checked =
-									this.memoList.findIndex(itm => itm.id === i.id) > -1
-
-								const warehouseId = i.pathIds && i.pathIds.split(',')[0]
-
-
+					URL = pageeLedgerMain
+				} else if (this.isType == 'feed') { // 投料
+					URL = assetPage
+				} else if (this.isType == 'job') { // 报工
+					URL = assetPage
+				}
 
-								return {
-									checked,
-									warehouseId,
-									...i,
-									instanceId: i.id,
+				URL(param).then(res => {
+					this.list.push(
+						...res.list.map(i => {
+							const checked =
+								this.memoList.findIndex(itm => itm.id === i.id) > -1
 
+							const warehouseId = i.pathIds && i.pathIds.split(',')[0]
 
-								}
-							})
-						)
+							return {
+								checked,
+								warehouseId,
+								...i,
+								instanceId: i.id,
+							}
+						})
+					)
 
-						isEnd = this.list.length >= res.count
-					})
+					isEnd = this.list.length >= res.count
 
-				}
+				})
 
 			},
 
@@ -334,10 +320,7 @@
 
 			//跳转回添加页面
 			jumpAdd() {
-				if (this.isType == 'pick') {
-					uni.$emit('setSelectList', this.memoList, this.pid)
-					uni.navigateBack()
-				} else if (this.isType == 'feed') {
+				if (this.isType == 'pick' || this.isType == 'feed' || this.isType == 'job') {
 					uni.$emit('setSelectList', this.memoList, this.pid)
 					uni.navigateBack()
 				}
@@ -428,5 +411,4 @@
 			}
 		}
 	}
-
 </style>