ysy hace 2 años
padre
commit
82ee468eb2

+ 12 - 1
api/pda/workOrder.js

@@ -295,7 +295,7 @@ export async function packingReportRepeat(params) {
 	return Promise.reject(data.message);
 }
 
-// // pda包装 外查询
+// pda包装 外查询
 export async function getPackingReportRepeat(params) {
 	const data = await postJ(
 		Vue.prototype.apiUrl + `/pda/mes/workreport/getPackingReportRepeat`, params, true,
@@ -308,7 +308,18 @@ export async function getPackingReportRepeat(params) {
 }
 
 
+// PDA抽样质检-周转车回显
 
+export async function sampleTurnoverReview(params) {
+	const data = await postJ(
+		Vue.prototype.apiUrl + `/pda/mes/feed/sampleTurnoverReview`, params, true,
+	);
+
+	if (data.code == 0) {
+		return data.data;
+	}
+	return Promise.reject(data.message);
+}
 
 
 

+ 194 - 0
pages/pda/feeding/components/productsBom.vue

@@ -0,0 +1,194 @@
+<template>
+	<view>
+
+		<view class="title_box rx-bc">
+			<view class="name">在制品</view>
+		</view>
+
+		<view class="material rx-ss">
+
+			<view class="content_table">
+             
+				<view class="item">
+					<view class="lable rx-cc">名称</view>
+					<view class="content"> {{  productsObj.taskNameLast  + '-在制品' }} </view>
+				</view>
+				
+				<view class="item">
+					<view class="lable rx-cc">牌号</view>
+					<view class="content"> {{  productsObj.brandNum }} </view>
+				</view>
+				
+				<view class="item">
+					<view class="lable rx-cc">型号</view>
+					<view class="content"> {{  productsObj.modelType }} </view>
+				</view>
+				
+				
+				<view class="item">
+					<view class="lable rx-cc">数量</view>
+					<view class="content"> {{  productsObj.feedQuantity  || 0  }} {{ productsObj.unit }} </view>
+				</view>
+			</view>
+
+
+
+		</view>
+	</view>
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			productsObj: {
+				type: Object,
+				default: () => {}
+			}
+
+		},
+
+	}
+</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;
+			}
+
+
+		}
+
+
+
+	}
+	
+	
+	.material {
+		margin-top: 10rpx;
+	
+		.left {
+			width: 40rpx;
+		}
+	
+		.zdy_check {
+			width: 30rpx;
+			height: 30rpx;
+			border: 2rpx solid #c8c9cc;
+			border-radius: 4rpx;
+	
+		}
+	
+		.check_active {
+			background: $theme-color;
+			border: 2rpx solid $theme-color;
+	
+			/deep/ .u-icon__icon {
+				color: #fff !important;
+			}
+		}
+	
+		.content_table {
+			width: 722rpx;
+			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;
+				}
+	
+				.content {
+					width: 518rpx;
+					min-height: 64rpx;
+					font-size: 28rpx;
+					line-height: 28rpx;
+					font-style: normal;
+					font-weight: 400;
+					padding: 18rpx 8rpx;
+					box-sizing: border-box;
+					word-wrap: break-word;
+					flex-grow: 1 !important;
+	
+				}
+	
+				.content_num {
+	
+					display: flex;
+					align-items: center;
+					padding: 0 4rpx;
+	
+					/deep/ .uni-input-input {
+						width: 200rpx;
+						border: 2rpx solid #F0F8F2;
+						background: #F0F8F2;
+						color: $theme-color;
+					}
+	
+					.unit {
+						padding: 0 4rpx;
+						font-size: 24rpx;
+						color: #404446;
+					}
+				}
+	
+				.ww400 {
+					/deep/ .uni-input-input {
+						width: 400rpx;
+					}
+				}
+	
+				.pd4 {
+					padding: 4rpx 8rpx;
+				}
+	
+	
+	
+				&:last-child {
+					border-bottom: none;
+				}
+			}
+	
+			.ww55 {
+				width: 55%;
+			}
+	
+			.ww45 {
+				width: 45%;
+			}
+		}
+	}
+</style>

+ 27 - 4
pages/pda/feeding/details.vue

@@ -9,11 +9,16 @@
 					<workOrderBom :item='item' @handleScan='handleScan'></workOrderBom>
 
 
+
+
 					<paramBom v-if='item.paramDetailList.length != 0' :list='item.paramDetailList'></paramBom>
 
 					<deviceBom v-if='item.equipmentList.length != 0' :workOrderId='item.workOrderId'
 						:list='item.equipmentList' @scanIt='scanIt'></deviceBom>
 
+
+					<productsBom v-if="item.product != '{}'" :productsObj="item.product"></productsBom>
+
 					<modelBom v-if='item.modelList.length != 0' :workOrderId='item.workOrderId' :list='item.modelList'
 						@scanIt='scanIt'>
 					</modelBom>
@@ -33,8 +38,8 @@
 
 
 					<view class="operate_box rx-sc">
-						<u-button size="small" class="u-reset-button" type="success"
-							@click="handOutbound(item.workOrderId)">出库单</u-button>
+						<!--  <u-button size="small" class="u-reset-button" type="success"
+							@click="handOutbound(item.workOrderId)">出库单</u-button> -->
 
 						<u-button size="small" class="u-reset-button" type="success"
 							@click="handAdd(item.workOrderId)">手动添加</u-button>
@@ -64,11 +69,12 @@
 	import paramBom from './components/paramBom.vue'
 	import turnoverBom from '../jobBooking/components/turnoverBom.vue'
 	import packingBom from './components/packingBom.vue'
+	import productsBom from './components/productsBom.vue'
 
 	import {
 		workorderList,
 		getByCode,
-		scanLedger,
+		scanLedger
 
 	} from '@/api/pda/workOrder.js'
 
@@ -87,7 +93,8 @@
 			aridRegion,
 			paramBom,
 			turnoverBom,
-			packingBom
+			packingBom,
+			productsBom
 		},
 		data() {
 			return {
@@ -210,6 +217,22 @@
 
 						// 处理字段
 						m.quality == '' ? m.quality = {} : ''
+                          
+					
+						if (m.taskNameLast) {
+							m.product = {
+								taskNameLast: m.taskNameLast,
+								formedWeightLast: m.formedWeightLast,
+								feedQuantity: m.formedNumLast,
+								categoryId: m.categoryId,
+								brandNum: m.brandNo,
+								modelType: m.model,
+								unit: m.unit
+								
+							}
+						} else {
+							m.product = {}	
+						}
 
 
 

+ 3 - 1
pages/pda/feeding/index/index.vue

@@ -107,12 +107,14 @@
 		pickStatistics
 	} from '@/api/pda/picking.js'
 	import SearchPopup from '../../components/searchPopup.vue'
+	
 	let [isEnd] = [false]
 
 	export default {
 		components: {
 			feedCard,
-			SearchPopup
+			SearchPopup,
+		
 		},
 		data() {
 			return {

+ 5 - 2
pages/pda/jobBooking/index/index.vue

@@ -572,7 +572,7 @@
 
 
 
-				if (this.objData.currentTaskDiagram.isFirstTask == 0) { // isFirstTask 判断是否首工序
+				if (this.objData.currentTaskDiagram.isFirstTask == 0) { // isFirstTask  1是  判断是否首工序
 
 					const isFirstTask = await this.checkFirstTask()
 					if (!isFirstTask) {
@@ -581,7 +581,6 @@
 				}
 
 
-
 	
 
 				jobSave(this.objData).then(res => {
@@ -625,6 +624,8 @@
 						})
 
 
+					} else {
+							resolve(true)
 					}
 
 				})
@@ -652,6 +653,8 @@
 							}
 						})
 
+					} else {
+							resolve(true)
 					}
 
 				})

+ 38 - 5
pages/pda/sample/components/sampleBom.vue

@@ -42,9 +42,8 @@
 				<view class="item">
 					<view class="lable rx-cc">取样数量</view>
 					<view class="content content_num  rx-sc">
-						<input class="uni-input" v-if="!isDetails" v-model="item.sampleNum" type='digit'
-							@blur='item.sampleNum > item.formedNum ?  item.sampleNum = item.formedNum : item.sampleNum'></input>
-						<view v-else>{{ item.sampleNum }}</view>
+
+						<view style='width: 300rpx;'>{{ item.sampleNum }}</view>
 						<view class="unit">{{item.unit}}</view>
 						<view class="penalize" v-if='!isDetails' @click="penalize">处置
 
@@ -175,10 +174,42 @@
 			isDetails: {
 				type: Boolean,
 				default: false
+			},
+			turnoverList: {
+				type: Array,
+				default: () => []
 			}
 
 
 		},
+		
+		
+		watch: {
+		
+			turnoverList: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+				console.log(newVal)
+				this.turnoverCount = 0
+				
+				newVal.forEach(f => {
+					if(f.extInfo && f.extInfo.positionList && f.extInfo.positionList.length > 0) {
+						f.extInfo.positionList.forEach(o => {
+						if (Object.prototype.hasOwnProperty.call(o, 'sampleNum')) { 
+								this.turnoverCount =  this.turnoverCount + Number(o.sampleNum)
+								this.$set(this.item, 'sampleNum', this.turnoverCount)
+							}
+							
+						})
+					}
+				})
+				 
+		
+				}
+			}
+		},
+		
 		data() {
 			return {
 				warehouseList: [],
@@ -193,7 +224,9 @@
 						value: 2,
 						text: "入库"
 					}
-				]
+				],
+				
+				turnoverCount: 0
 			}
 		},
 		created() {
@@ -216,7 +249,7 @@
 				if (Number(this.item.sampleNum <= 0)) {
 					uni.showToast({
 						icon: 'none',
-						title: '取样数量要大于0'
+						title: '取样数量要大于0, 请先选择周转车'
 					})
 					return false
 				}

+ 339 - 0
pages/pda/sample/components/turnoverBom.vue

@@ -0,0 +1,339 @@
+<template>
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">周转车</view>
+		</view>
+
+		<view v-for="(item, index) in newList" :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 ww25">工单编号</view>
+					<view class="item ww25">产品编码</view>
+					<view class="item ww20">数量PCS</view>
+					<view class="item ww20">取样PCS</view>
+				</view>
+
+				<view class="table">
+					<u-list @scrolltolower="scrolltolower" class="z_list">
+						<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 ww25" :class="{'color157': it.workOrderCode === wordItem.code}">
+								{{ it.workOrderCode }}
+							</view>
+							<view class="item ww25" :class="{'color157': it.categoryCode === wordItem.productCode}">
+								{{it.categoryCode}}
+							</view>
+
+							<view class="item ww20  ">
+								<text>{{it.quantity}}</text>
+							</view>
+
+							<view class="item ww20">
+							<input class="uni-input content_num" 
+								v-model="it.sampleNum" type="digit"  @blur="Number(it.sampleNum) > Number(it.quantity) ? it.sampleNum = Number(it.quantity) : ''"></input>
+							</view>
+						</view>
+					</u-list>
+
+				</view>
+
+
+			</view>
+
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			list: {
+				type: Array,
+				default: () => []
+			},
+			wordItem: {
+				type: Object,
+				default: () => {}
+			},
+
+
+
+
+		},
+
+
+		watch: {
+
+			list: {
+				immediate: true,
+				deep: true,
+				handler(newVal) {
+					this.newList = newVal
+
+				}
+			}
+		},
+
+		data() {
+			return {
+				recycleQuantity: '',
+				newList: []
+			}
+		},
+
+		methods: {
+
+
+
+
+			getDelete(index) {
+				this.list.splice(index, 1)
+
+
+			},
+			scrolltolower() {}
+		}
+	}
+</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%;
+			}
+
+			.ww25 {
+				width: 25%;
+			}
+
+
+
+			.ww30 {
+				width: 35%;
+
+			}
+
+			.ww15 {
+				width: 15%;
+
+			}
+
+			.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;
+				font-size: 24;
+			}
+		}
+
+
+
+		.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;
+		}
+
+	}
+
+	.z_list {
+		max-height: 500rpx;
+	}
+</style>

+ 109 - 6
pages/pda/sample/index/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="content-box">
 		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
-			color="#000" @clickLeft="back">
+			color="#000" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
 		</uni-nav-bar>
 		<view class="list_box">
 			<u-list @scrolltolower="scrolltolower">
@@ -9,7 +9,20 @@
 
 					<workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
 
-					<sampleBom :item='item.quality' v-if='item.quality' :isDetails='false'></sampleBom>
+
+					<turnoverBom v-if='item.turnover.length != 0' :list='item.turnover' :wordItem='item' pattern='job'
+						@handleScan='handleScan'>
+					</turnoverBom>
+
+
+
+
+					<sampleBom :item='item.quality' v-if='item.quality' :isDetails='false' :turnoverList='item.turnover'></sampleBom>
+
+					<view class="operate_box rx-sc">
+						<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
+					</view>
+
 
 				</view>
 			</u-list>
@@ -27,19 +40,22 @@
 <script>
 	import {
 		workorderList,
-
+		scanLedger,
+		sampleTurnoverReview
 	} from '@/api/pda/workOrder.js'
 
 
 	import workOrderBom from '../../feeding/components/workOrderBom.vue'
 	import sampleBom from '../components/sampleBom.vue'
+	import turnoverBom from '../components/turnoverBom.vue'
 	import {
 		batchSave
 	} from '@/api/pda/feeding.js'
 	export default {
 		components: {
 			workOrderBom,
-			sampleBom
+			sampleBom,
+			turnoverBom
 		},
 		data() {
 			return {
@@ -58,6 +74,27 @@
 			this.id = options.workOrderId
 			this.taskId = options.taskId
 			this.getList()
+		
+		},
+		onShow() {
+			uni.$off("setSelectList");
+			uni.$on("setSelectList", (selectList, id) => {
+
+				let turnover = [] //周转车
+				selectList.forEach(f => {
+					if (f.rootCategoryLevelId == 7) {
+						turnover = turnover.concat(f)
+					}
+
+				})
+				this.$set(this.List[0], 'turnover', turnover)
+				this.$forceUpdate()
+
+
+
+
+
+			});
 		},
 		methods: {
 			getList() {
@@ -66,8 +103,7 @@
 					taskId: this.taskId
 				}).then(res => {
 
-					console.log(11)
-					console.log(res)
+
 
 					this.List = res.map(m => {
 						m.workOrderId = m.id
@@ -77,6 +113,12 @@
 							this.isLastJob = false
 						}
 
+
+						if (Object.prototype.hasOwnProperty.call(m, 'turnover')) {
+							m['turnover'] = []
+								this.getSampleTurnover()
+						}
+
 						m.feedType = 2
 						delete m.id
 						return {
@@ -85,6 +127,16 @@
 					})
 				})
 			},
+			
+			getSampleTurnover(){
+				let param = {
+					workOrderId: this.id,
+					taskId: this.taskId
+				}
+				sampleTurnoverReview(param).then(res => {
+					this.List[0].turnover = res
+				})
+			},
 
 			scrolltolower() {},
 
@@ -95,6 +147,44 @@
 				})
 			},
 
+			// 相机扫码
+			HandlScanCode() {
+
+
+				this.scanItAllData('w0300000003574001')
+				return false
+
+				let _this = this
+				uni.scanCode({
+					success: function(res) {
+						_this.scanItAllData(res.result)
+					}
+				})
+
+			},
+
+
+			scanItAllData(result) {
+				scanLedger(result).then(res => {
+					if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
+
+						let isFals = this.List[0].turnover.some(m => m.code == result)
+						if (isFals) {
+							uni.showToast({
+								title: '周转车已存在',
+								icon: 'none'
+							})
+							return false
+						}
+						this.List[0].turnover.push(res[0])
+						this.$forceUpdate()
+
+					}
+				})
+
+
+			},
+
 			save() {
 
 
@@ -131,6 +221,19 @@
 				})
 			},
 
+
+			handAdd() {
+				let param = {
+					turnover: this.List[0].turnover
+				}
+				const storageKey = Date.now() + "";
+
+				uni.setStorageSync(storageKey, param || {});
+				uni.navigateTo({
+					url: `/pages/pda/workOrder/search/index?storageKey=${storageKey}&isType=job&taskId=${this.taskId}`
+				})
+			},
+
 		}
 	}
 </script>