ysy il y a 2 ans
Parent
commit
123f94bd5a

+ 18 - 2
pages/pda/components/bottomOperate.vue

@@ -98,7 +98,24 @@
 					3: [{
 						name: '报工',
 						type: 'inspection'
-					}, ]
+					}, ],
+					
+					4: [{
+							name: '领料',
+							type: 'picking'
+						},
+						{
+							name: '投料',
+							type: 'feeding'
+						},
+						{
+							name: '报工',
+							type: 'jobBooking'
+						},
+			
+					
+					],
+					
 				}
 			}
 		},
@@ -135,7 +152,6 @@
 			},
 
 			operate(type, item) {
-		
 				this.$emit('operate', type, item)
 			},
 		}

+ 60 - 50
pages/pda/jobBooking/components/packingBom.vue

@@ -55,7 +55,7 @@
 				<view class="table">
 					<u-list @scrolltolower="scrolltolower" class="z_list">
 						<view class="tr row rx-sc" v-for="(it, idx) in splitList" :key='idx'>
-							<view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
+							<view class="item ww10 rx-cc ">{{ it.computeSize }}</view>
 							<view class="item ww30 content_num rx-sc">
 								<input class="uni-input" v-model="it.quantity" type="digit"></input>
 								<view style="width: 260rpx; font-size: 22rpx;"> {{objData.unit}}/ {{it.unit}}</view>
@@ -70,19 +70,10 @@
 								</image>
 							</view>
 
-
 						</view>
 
-
-
 					</u-list>
-
-
-
-
 				</view>
-
-
 			</view>
 
 
@@ -97,102 +88,97 @@
 			</view>
 
 
-			<!-- 外包装  列表-->
-			<view class="content_table2" v-if='packTwoList.length > 0'>
+			<view class="content_table2" v-if='temporaryList.length'>
 				<view class="head row rx-sc">
 					<view class="item ww10">序号</view>
 					<view class="item ww30">数量</view>
-
 					<view class="item ww50">条码</view>
 					<view class="item ww10"></view>
-
 				</view>
 
 				<view class="table">
 
-					<view class="tr row rx-sc " v-for="(it, idx) in packTwoList" :key='idx'>
+					<view class="tr row rx-sc" v-for="(it, idx) in temporaryList" :key='idx'>
 						<view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
 						<view class="item ww30 content_num rx-sc">
-							{{ it.quantity}} {{ objData.unit }} / {{it.unit}}
+							<input class="uni-input" v-model="it.quantity" disabled type="digit"></input>
+							<view style="width: 260rpx; font-size: 22rpx;"> {{objData.unit}}/ {{it.unit}}</view>
 						</view>
-
-
-
 						<view class="item ww50">
 							{{ it.code }}
 						</view>
 						<view class="item ww10 rx-cc">
-
+							<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
+								color="#fa3534"></uni-icons>
 						</view>
 
 
 					</view>
 
+					<view class="tr row rx-sc">
+						<view class="item ww10 rx-cc ">合并</view>
+						<view class="item ww90  rx-sc">
+							总共{{temporaryCount}} {{objData.unit}} / {{this.temporaryNum}} {{unit}}
+							--打包成 1
+							<zxz-uni-data-select :localdata="unitList" v-model="packUnit" dataValue='Key'
+								format='{Value}' dataKey="Key" filterable :clear='false'></zxz-uni-data-select>
 
-				</view>
+							<view class="penalize" @click="handlePack">打包</view>
 
-			</view>
+						</view>
 
 
+					</view>
 
 
 
+				</view>
+			</view>
 
 
 
-			<view class="content_table2" v-if='temporaryList.length'>
+
+			<!-- 外包装  列表-->
+			<view class="content_table2" v-if='packTwoList.length > 0'>
 				<view class="head row rx-sc">
 					<view class="item ww10">序号</view>
 					<view class="item ww30">数量</view>
+
 					<view class="item ww50">条码</view>
 					<view class="item ww10"></view>
 				</view>
 
 				<view class="table">
-					<u-list @scrolltolower="scrolltolower" class="z_list">
-						<view class="tr row rx-sc" v-for="(it, idx) in temporaryList" :key='idx'>
-							<view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
-							<view class="item ww30 content_num rx-sc">
-								<input class="uni-input" v-model="it.quantity" disabled type="digit"></input>
-								<view style="width: 260rpx; font-size: 22rpx;"> {{objData.unit}}/ {{it.unit}}</view>
-							</view>
-							<view class="item ww50">
-								{{ it.code }}
-							</view>
-							<view class="item ww10 rx-cc">
-								<uni-icons custom-prefix="iconfont" type="icon-shanchu" size="20"
-									color="#fa3534"></uni-icons>
-							</view>
+					<view class="tr row rx-sc " v-for="(it, idx) in packTwoList" :key='idx'>
+						<view class="item ww10 rx-cc ">{{ idx + 1 }}</view>
+						<view class="item ww30 content_num rx-sc">
+							{{ it.quantity}} {{ objData.unit }} / {{it.unit}}
+						</view>
 
 
+
+						<view class="item ww50">
+							{{ it.code }}
 						</view>
+						<view class="item ww10 rx-cc">
 
-						<view class="tr row rx-sc">
-							<view class="item ww10 rx-cc ">合并</view>
-							<view class="item ww90  rx-sc">
-								总共{{temporaryCount}} {{objData.unit}} / {{this.temporaryNum}} {{unit}}
-								--打包成 1
-								<zxz-uni-data-select :localdata="unitList" v-model="packUnit" dataValue='Key'
-									format='{Value}' dataKey="Key" filterable :clear='false'></zxz-uni-data-select>
+						</view>
 
-								<view class="penalize" @click="handlePack">打包</view>
 
-							</view>
+					</view>
 
 
-						</view>
+				</view>
 
-					</u-list>
+			</view>
 
 
 
 
 
 
-				</view>
 
 
-			</view>
 
 		</view>
 
@@ -311,6 +297,15 @@
 
 			handleSplit() {
 
+				if (this.splitList.length) {
+					uni.showToast({
+						title: '产品已分包',
+						icon: 'none'
+					})
+					return false
+				}
+
+
 
 				if (!this.formedNumLast) {
 					uni.showToast({
@@ -428,6 +423,21 @@
 			scrolltolower() {
 
 			},
+
+			getData() {
+				let _packingReportMarginList = []
+
+				_packingReportMarginList = this.splitList.filter(e => {
+					return !e.parentId
+				})
+
+				let packInfo = {
+					packingReportList: this.packTwoList,
+					packingReportMarginList: _packingReportMarginList,
+					formedNumLast: this.formedNumLast
+				}
+				return packInfo
+			},
 		},
 	}
 </script>

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

@@ -40,7 +40,8 @@
 					<aridRegion v-if='objData.aridRegionList.length != 0' :list='objData.aridRegionList'
 						:remainingTime='remainingTime' @handleScan='handleScan' :isType='true'></aridRegion>
 
-					<packingBom :taskId='taskId' :workOrderId='id' :objData='objData' v-if='objData'></packingBom>
+					<packingBom :taskId='taskId' :workOrderId='id' :objData='objData' ref="packRef"
+						v-if='taskType == 4 && objData'></packingBom>
 
 					<view class="operate_box rx-sc">
 						<u-button size="small" class="u-reset-button" type="success" @click="handAdd">手动添加</u-button>
@@ -140,6 +141,7 @@
 		data() {
 			return {
 				title: '',
+				taskType: 1,
 
 				objData: {
 					equipmentList: [],
@@ -176,6 +178,7 @@
 		},
 		onLoad(options) {
 			this.title = options.taskName ? options.taskName + '-报工' : '报工'
+			this.taskType = options.taskType
 			this.id = options.id
 			this.taskId = options.taskId
 			this.getList()
@@ -224,6 +227,8 @@
 			// 相机扫码
 			HandlScanCode() {
 
+
+
 				let _this = this
 				uni.scanCode({
 					success: function(res) {
@@ -293,6 +298,9 @@
 			handleScan(id, type) {
 
 
+
+
+
 				let _this = this
 				uni.scanCode({
 					success: function(res) {
@@ -351,6 +359,9 @@
 					}
 
 
+					this.taskType = res.currentTaskDiagram.type
+					
+
 
 
 
@@ -520,7 +531,7 @@
 
 				}
 
-
+				// 预制体
 				if (this.objData.instanceList.length > 0) {
 					let bol
 					let _i
@@ -541,6 +552,43 @@
 
 
 
+				// 包装
+				if (this.taskType == 4) {
+					let packInfo = this.$refs.packRef.getData()
+					this.objData.packInfo = packInfo
+					this.objData.taskType = this.taskType
+
+
+
+					if (packInfo.formedNumLast != Number(this.objData.workReportInfo['formedNum']) + Number(this.objData
+							.notFormedList[0].notFormedNum)) {
+						uni.showToast({
+							title: `合格品数量加不合格品数量不等于包装总数`,
+							icon: 'none'
+						})
+						return false
+					}
+
+
+				}
+
+
+
+				if (this.objData.currentTaskDiagram.isFirstTask == 0) { // isFirstTask 判断是否首工序
+					if (this.objData.formedNumLast != Number(this.objData.workReportInfo['formedNum']) + Number(this
+							.objData.notFormedList[0].notFormedNum)) {
+						uni.showToast({
+							title: `合格品数量加不合格品数量不等于上道工序数量`,
+							icon: 'none'
+						})
+						return false
+					}
+				}
+
+
+
+		
+
 				jobSave(this.objData).then(res => {
 					uni.hideLoading();
 					uni.navigateBack()

+ 2 - 1
pages/pda/workOrder/extrusionMolding/index.vue

@@ -283,6 +283,7 @@
 			},
 
 			operate(type, item) {
+				
 			
 				let url
 				let taskId = this.currentTaskId || this.taskId
@@ -312,7 +313,7 @@
 				} else if (type == 'jobBooking') {
 					if (!this.feedAllow) {
 						url = '/pages/pda/jobBooking/index/index'
-						url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
+						url += `?id=${this.info.id}&taskId=${taskId }&taskName=${taskName}&taskType=${this.currentType}`
 						uni.navigateTo({
 							url
 						})