ysy 2 ani în urmă
părinte
comite
82235ccc3a
2 a modificat fișierele cu 214 adăugiri și 219 ștergeri
  1. 0 1
      pages/pda/picking/details.vue
  2. 214 218
      pages/pda/sample/index/index.vue

+ 0 - 1
pages/pda/picking/details.vue

@@ -178,7 +178,6 @@
 						let semiProductList2 = [] //半成品
 
                     
-					 console.log(selectList)
 
 
 						selectList.forEach(f => {

+ 214 - 218
pages/pda/sample/index/index.vue

@@ -1,11 +1,11 @@
 <template>
 	<view class="content-box">
-		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA"
-			color="#000" @clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" background-color="#F7F9FA" color="#000"
+			@clickLeft="back" right-icon="scan" @clickRight="HandlScanCode">
 		</uni-nav-bar>
 		<view class="list_box">
 			<u-list @scrolltolower="scrolltolower">
-				<view class="card_box" v-for="(item,index) in List" :key="index">
+				<view class="card_box" v-for="(item, index) in List" :key="index">
 
 					<workOrderBom :item='item' v-if='item' @handleScan='handleWordScan'></workOrderBom>
 
@@ -38,298 +38,294 @@
 			<view class="btn_box" @click="save">一键报工</view>
 		</view>
 
-	</view>
 
 	</view>
 </template>
 
 <script>
-	import {
-		workorderList,
-		scanLedger,
-		sampleTurnoverReview,
-		paramByTaskId
-	} 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 reuseTurnoverBom from '../components/reuseTurnoverBom.vue'
-	import {
-		batchSave
-	} from '@/api/pda/feeding.js'
-	import VConsole from 'vconsole'
-	export default {
-		components: {
-			workOrderBom,
-			sampleBom,
-			turnoverBom,
-			reuseTurnoverBom
-		},
-		data() {
-			return {
-				title: null,
-				id: null,
-				taskId: null,
-				List: [],
-				count: 0,
+import {
+	workorderList,
+	scanLedger,
+	sampleTurnoverReview,
+	paramByTaskId
+} 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 reuseTurnoverBom from '../components/reuseTurnoverBom.vue'
+import {
+	batchSave
+} from '@/api/pda/feeding.js'
+
+export default {
+	components: {
+		workOrderBom,
+		sampleBom,
+		turnoverBom,
+		reuseTurnoverBom
+	},
+	data() {
+		return {
+			title: null,
+			id: null,
+			taskId: null,
+			List: [],
+			count: 0,
+
+			isLastJob: true,
+
+			paramList: [],
+			showReuseTurnover: false
 
-				isLastJob: true,
+		}
+	},
 
-				paramList: [],
-				showReuseTurnover: false
+	onLoad(options) {
+		console.log(22, options)
 
-			}
-		},
+		this.title = options.taskName ? options.taskName : '质检'
+		this.id = options.workOrderId
+		this.taskId = options.taskId
+		this.getList()
 
-		onLoad(options) {
-			this.title = options.taskName ? options.taskName : '质检'
-			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)
-						turnover = [f]
-					}
-
-				})
-				this.$set(this.List[0], 'turnover', turnover)
-				this.$forceUpdate()
+	},
+	onShow() {
+		uni.$off("setSelectList");
+		uni.$on("setSelectList", (selectList, id) => {
 
+			let turnover = [] //周转车
+			selectList.forEach(f => {
+				if (f.rootCategoryLevelId == 7) {
+					// turnover = turnover.concat(f)
+					turnover = [f]
+				}
 
+			})
+			this.$set(this.List[0], 'turnover', turnover)
+			this.$forceUpdate()
 
 
 
-			});
-		},
-		methods: {
 
-			getList() {
-				workorderList({
-					ids: [this.id],
-					taskId: this.taskId
-				}).then(res => {
 
+		});
+	},
+	methods: {
 
+		getList() {
+			workorderList({
+				ids: [this.id],
+				taskId: this.taskId
+			}).then(res => {
 
-					this.List = res.map(m => {
-						m.workOrderId = m.id
-						if (m.quality) {
-							m.quality['sampleList'] = []
-							m['reuseTurnover'] = [],
-								m.quality['reuseNum'] = 0
-						} else {
-							this.isLastJob = false
-						}
+				this.List = res.map(m => {
+					m.workOrderId = m.id
+					if (m.quality) {
+						m.quality['sampleList'] = []
+						m['reuseTurnover'] = [],
+							m.quality['reuseNum'] = 0
+					} else {
+						this.isLastJob = false
+					}
 
 
-						if (Object.prototype.hasOwnProperty.call(m, 'turnover')) {
-							m['turnover'] = []
-							this.getSampleTurnover()
-						}
+					if (Object.prototype.hasOwnProperty.call(m, 'turnover')) {
+						m['turnover'] = []
+						this.getSampleTurnover()
+					}
 
-						this.getParam(res[0].currentTaskDiagram.sourceTaskId)
+					this.getParam(res[0].currentTaskDiagram.sourceTaskId)
 
-						m.feedType = 2
-						delete m.id
-						return {
-							...m
-						}
-					})
+					m.feedType = 2
+					delete m.id
+					return {
+						...m
+					}
 				})
+			})
 
 
-			},
+		},
 
 
-			getParam(sourceTaskId) {
-				paramByTaskId(sourceTaskId).then(res => {
-					this.paramList = res
-				})
-			},
+		getParam(sourceTaskId) {
+			paramByTaskId(sourceTaskId).then(res => {
+				this.paramList = res
+			})
+		},
 
 
-			getSampleTurnover() {
-				let param = {
-					workOrderId: this.id,
-					taskId: this.taskId
-				}
-				sampleTurnoverReview(param).then(res => {
-					this.List[0].turnover = res
-				})
-			},
+		getSampleTurnover() {
+			let param = {
+				workOrderId: this.id,
+				taskId: this.taskId
+			}
+			sampleTurnoverReview(param).then(res => {
+				this.List[0].turnover = res
+			})
+		},
 
-			scrolltolower() {},
+		scrolltolower() { },
 
-			handleWordScan() {
-				uni.showToast({
-					icon: 'none',
-					title: '不支持换工单'
-				})
-			},
+		handleWordScan() {
+			uni.showToast({
+				icon: 'none',
+				title: '不支持换工单'
+			})
+		},
 
-			// 相机扫码
-			HandlScanCode() {
+		// 相机扫码
+		HandlScanCode() {
+			uni.scanCode({
+				success: (res) => {
+					this.scanItAllData(res.result)
+				}
+			})
+
+		},
 
 
+		scanItAllData(result) {
+			scanLedger(result).then(res => {
+				if (res.length == 1 && res[0].rootCategoryLevelId == 7) { // 周转车
 
-		
-				uni.scanCode({
-				 success: (res) => {
-						this.scanItAllData(res.result)
+					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()
 
-			},
+				}
+			})
 
 
-			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() {
 
-					}
-				})
 
+			let _arr = []
+			_arr = JSON.parse(JSON.stringify(this.List))
 
-			},
-
-			save() {
-				
-				
-				let _arr = []
-				_arr =JSON.parse(JSON.stringify(this.List))
-	
-				_arr.forEach(f => {
-					f.turnover.forEach(o => {
-						o.extInfo.positionList.forEach(r => {
-							r.sampleNum = 0
-							r.reuseNum = 0
-						})
+			_arr.forEach(f => {
+				f.turnover.forEach(o => {
+					o.extInfo.positionList.forEach(r => {
+						r.sampleNum = 0
+						r.reuseNum = 0
 					})
-					f.reuseTurnover.forEach(o => {
-						o.extInfo.positionList.forEach(r => {
-							r.sampleNum = 0
-							r.reuseNum = 0
-						})
-					})
-					
-					
-					
 				})
-	
-				if (!this.isLastJob) {
-					uni.showToast({
-						icon: 'none',
-						title: '上道工序暂未报工'
+				f.reuseTurnover.forEach(o => {
+					o.extInfo.positionList.forEach(r => {
+						r.sampleNum = 0
+						r.reuseNum = 0
 					})
-					return false
+				})
 
-				}
 
 
-				if (this.List[0].quality.sampleNum != this.List[0].quality.sampleList.length) {
-					uni.showToast({
-						icon: 'none',
-						title: '处置数量和取样数量对应不上'
-					})
+			})
 
-					return false
-				}
+			if (!this.isLastJob) {
+				uni.showToast({
+					icon: 'none',
+					title: '上道工序暂未报工'
+				})
+				return false
 
+			}
 
-		
-				batchSave(this.List).then(res => {
-					uni.navigateBack()
 
+			if (this.List[0].quality.sampleNum != this.List[0].quality.sampleList.length) {
+				uni.showToast({
+					icon: 'none',
+					title: '处置数量和取样数量对应不上'
 				})
-			},
 
+				return false
+			}
 
-			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}`
-				})
-			},
 
-		}
+			batchSave(this.List).then(res => {
+				uni.navigateBack()
+
+			})
+		},
+
+
+		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>
 
 
 <style lang="scss" scoped>
-	.content-box {
-		height: 100vh;
-		overflow: hidden;
-		display: flex;
-		flex-direction: column;
+.content-box {
+	height: 100vh;
+	overflow: hidden;
+	display: flex;
+	flex-direction: column;
 
-	}
+}
 
-	.list_box {
-		flex: 1;
-		overflow: hidden;
-		padding: 4rpx 0;
+.list_box {
+	flex: 1;
+	overflow: hidden;
+	padding: 4rpx 0;
 
-		.u-list {
-			height: 100% !important;
-		}
+	.u-list {
+		height: 100% !important;
+	}
 
-		.card_box {
-			padding: 16rpx;
-		}
+	.card_box {
+		padding: 16rpx;
+	}
 
 
 
-	}
+}
 
-	.bottom-wrapper {
-		.btn_box {
-			width: 750rpx;
-			height: 88rpx;
-			line-height: 88rpx;
-			background: $theme-color;
-			text-align: center;
-			font-size: 36rpx;
-			font-style: normal;
-			font-weight: 400;
-			color: #fff;
-		}
+.bottom-wrapper {
+	.btn_box {
+		width: 750rpx;
+		height: 88rpx;
+		line-height: 88rpx;
+		background: $theme-color;
+		text-align: center;
+		font-size: 36rpx;
+		font-style: normal;
+		font-weight: 400;
+		color: #fff;
 	}
+}
 
 
-	.operate_box {
-		padding: 10rpx 160rpx;
+.operate_box {
+	padding: 10rpx 160rpx;
 
-		/deep/ .u-button {
-			width: 160rpx;
-		}
+	/deep/ .u-button {
+		width: 160rpx;
 	}
+}
 </style>