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

+ 0 - 11
api/pda/workOrder.js

@@ -246,14 +246,3 @@ export async function listWorkReport(params) {
 }
 }
 
 
 
 
-// 根据工单工序获取普通质检工序投料的废品数量
-
-export async function junkCount(id,taskId) {
-	const data = await get(
-		Vue.prototype.apiUrl + `/pda/mes/feed/junkCount/${id}/${taskId}`,
-	);
-	if (data.code == 0) {
-		return data.data;
-	}
-	return Promise.reject(data.message);
-}

+ 13 - 6
pages.json

@@ -1472,15 +1472,21 @@
 			}
 			}
 		},
 		},
 		{
 		{
-			"path" : "pages/pda/sample/index/jobBooking",
-			"style" : 
-			{
-				"navigationStyle" : "custom",
-				"navigationBarTextStyle" : "white"
+			"path": "pages/pda/sample/index/jobBooking",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
 			}
 			}
 		},
 		},
 		{
 		{
-			"path" : "pages/pda/sample/inspection/index",
+			"path": "pages/pda/sample/inspection/index",
+			"style": {
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
+			}
+		},
+		{
+			"path" : "pages/pda/sample/inspection/job",
 			"style" : 
 			"style" : 
 			{
 			{
 				"navigationStyle" : "custom",
 				"navigationStyle" : "custom",
@@ -1492,6 +1498,7 @@
 
 
 
 
 
 
+
 	],
 	],
 	"tabBar": {
 	"tabBar": {
 		"color": "#908f8f",
 		"color": "#908f8f",

+ 1 - 1
pages/pda/components/bottomOperate.vue

@@ -122,7 +122,7 @@
 						..._arr,
 						..._arr,
 						{
 						{
 							name: '报工',
 							name: '报工',
-							type: ''
+							type: 'inspectionJob'
 						}
 						}
 					]
 					]
 
 

+ 5 - 20
pages/pda/sample/components/diagramLast.vue

@@ -8,6 +8,7 @@
 				<view class="item">
 				<view class="item">
 					<view class="lable rx-cc">工序名称</view>
 					<view class="lable rx-cc">工序名称</view>
 					<view class="content">
 					<view class="content">
+
 						{{item.diagramLast.taskTypeName}}
 						{{item.diagramLast.taskTypeName}}
 					</view>
 					</view>
 				</view>
 				</view>
@@ -31,12 +32,7 @@
 
 
 				</view>
 				</view>
 
 
-				<view class="item">
-					<view class="lable rx-cc">已质检数量</view>
-					<view class="content">
-						{{ feedCount }}
-					</view>
-				</view>
+
 
 
 
 
 
 
@@ -65,10 +61,7 @@
 				default: () => {}
 				default: () => {}
 			},
 			},
 
 
-			count: {
-				type: Number,
-				default: 0
-			}
+
 
 
 
 
 
 
@@ -77,19 +70,11 @@
 		},
 		},
 
 
 		watch: {
 		watch: {
-			count: {
-				immediate: true,
-				deep: true,
-				handler(val) {
-					console.log(val)
-					this.feedCount = val
 
 
-				}
-			}
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
-				feedCount: 0
+
 			}
 			}
 		},
 		},
 		created() {
 		created() {
@@ -107,7 +92,7 @@
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 	.material {
 	.material {
-		margin-top: 10rpx;
+		margin-top: 40rpx;
 
 
 
 
 
 

+ 1 - 1
pages/pda/sample/components/inspectionBom.vue

@@ -7,7 +7,7 @@
 
 
 
 
 
 
-		<view class="content_table2">
+		<view class="content_table2" v-if='inspectionList.length > 0'>
 			<view class="head row rx-sc">
 			<view class="head row rx-sc">
 				<view class="item ww30">类型</view>
 				<view class="item ww30">类型</view>
 				<view class="item ww20">废品数量</view>
 				<view class="item ww20">废品数量</view>

+ 250 - 0
pages/pda/sample/components/qualityStat.vue

@@ -0,0 +1,250 @@
+<template>
+	<view>
+		<view class="title_box rx-bc">
+			<view class="name">质检统计</view>
+		</view>
+
+
+		<view class="material ">
+
+			<view class="content_table" v-for="(item, index) in normalQuality" :key="index">
+				<view class="item">
+					<view class="lable rx-cc">质检类型</view>
+					<view class="content">
+						{{ item.inspectionName }}
+					</view>
+				</view>
+
+
+
+
+
+				<view class="item rx-sc">
+					<view class="rx ww55 ">
+						<view class="lable  rx-cc">废品数量</view>
+						<view class="content rx-sc">
+			<view>{{item.quantity}}</view>
+			<view class="unit">{{item.unit}}</view>
+						</view>
+					</view>
+
+					<view class="rx ww45">
+						<view class="lable rx-cc ww80"></view>
+						<view class="content">
+						</view>
+					</view>
+
+				</view>
+
+
+
+
+
+
+
+
+
+
+
+
+
+			</view>
+
+
+
+
+		</view>
+
+
+
+
+
+
+
+
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+
+			normalQuality: {
+				type: Array,
+				default: () => []
+			}
+
+
+		},
+		data() {
+			return {
+
+			}
+		},
+		created() {
+
+		},
+		methods: {
+
+
+
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.title_box {
+		margin-top: 28rpx;
+
+		.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;
+			}
+
+
+		}
+
+		.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;
+
+			}
+
+		}
+
+	}
+
+
+	.material {
+		margin-top: 10rpx;
+
+
+
+		.content_table {
+			width: 100%;
+			border: 2rpx solid $border-color;
+
+			.item {
+				display: flex;
+				border-bottom: 2rpx solid $border-color;
+
+
+				.lable {
+					width: 156rpx;
+					text-align: center;
+					background-color: #F7F9FA;
+					font-size: 26rpx;
+					border-right: 2rpx solid $border-color;
+					flex-shrink: 0;
+				}
+
+				.lable150 {
+					width: 156rpx !important;
+					font-size: 24rpx;
+				}
+
+				.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;
+
+
+					.unit {
+						padding: 0 4rpx;
+						font-size: 24rpx;
+						color: #404446;
+					}
+
+					.penalize {
+						width: 200rpx;
+						line-height: 60rpx;
+						background: $theme-color;
+						font-size: 24rpx;
+						text-align: center;
+						color: #fff;
+					}
+
+				}
+
+
+				.pd4 {
+					padding: 4rpx 8rpx;
+				}
+
+
+
+				&:last-child {
+					border-bottom: none;
+				}
+			}
+
+			.ww55 {
+				width: 55%;
+			}
+
+			.ww45 {
+				width: 45%;
+			}
+		}
+
+
+	}
+
+
+	.content_num {
+		display: flex;
+		align-items: center;
+		padding: 0 4rpx;
+		box-sizing: border-box;
+
+		/deep/ .uni-input-input {
+			border: 2rpx solid #F0F8F2;
+			min-width: 100rpx;
+			background: #F0F8F2;
+			color: $theme-color;
+			box-sizing: border-box;
+		}
+
+
+	}
+</style>

+ 9 - 10
pages/pda/sample/inspection/index.vue

@@ -19,7 +19,7 @@
 							@click="scanIt(item.workOrderId)">扫一扫</u-button>
 							@click="scanIt(item.workOrderId)">扫一扫</u-button>
 					</view>
 					</view>
 
 
-					<diagramLast :item='item.normalQuality' v-if='item' :count='feedCount'></diagramLast>
+					<diagramLast :item='item.normalQuality' v-if='item'></diagramLast>
 
 
 
 
 					<inspectionBom :inspectionList='inspectionList' :normalQuality='item.normalQuality'></inspectionBom>
 					<inspectionBom :inspectionList='inspectionList' :normalQuality='item.normalQuality'></inspectionBom>
@@ -47,7 +47,7 @@
 		workorderList,
 		workorderList,
 		getLastTreeByPid,
 		getLastTreeByPid,
 		scanLedger,
 		scanLedger,
-		junkCount
+		
 	} from '@/api/pda/workOrder.js'
 	} from '@/api/pda/workOrder.js'
 	import {
 	import {
 		batchSave
 		batchSave
@@ -76,17 +76,19 @@
 				List: [],
 				List: [],
 				inspectionList: [],
 				inspectionList: [],
 
 
-				feedCount: 0,
+		
 			}
 			}
 		},
 		},
 
 
 		onLoad(options) {
 		onLoad(options) {
 			this.title = options.taskName ? options.taskName + '-' + options.inspectionName : '质检'
 			this.title = options.taskName ? options.taskName + '-' + options.inspectionName : '质检'
+			this.inspectionId = options.inspectionId
+			this.inspectionName = options.inspectionName
 			this.id = options.workOrderId
 			this.id = options.workOrderId
 			this.taskId = options.taskId
 			this.taskId = options.taskId
 			this.getList()
 			this.getList()
 
 
-			this.getCount()
+		
 			this.getLastTree()
 			this.getLastTree()
 		},
 		},
 
 
@@ -129,6 +131,8 @@
 						m.aridRegionList = [] // 干燥区
 						m.aridRegionList = [] // 干燥区
 
 
 						m.normalQuality.quantity = 0
 						m.normalQuality.quantity = 0
+						m.normalQuality.inspectionId = this.inspectionId
+						m.normalQuality.inspectionName = this.inspectionName
 						m.feedType = 3
 						m.feedType = 3
 
 
 						delete m.id
 						delete m.id
@@ -143,12 +147,7 @@
 				})
 				})
 			},
 			},
 
 
-			getCount() {
-				junkCount(this.id, this.taskId).then(res => {
-					this.feedCount = res
 
 
-				})
-			},
 
 
 			getLastTree() {
 			getLastTree() {
 				getLastTreeByPid(this.$route.query.inspectionId).then(res => {
 				getLastTreeByPid(this.$route.query.inspectionId).then(res => {
@@ -217,7 +216,7 @@
 					return false
 					return false
 				}
 				}
 
 
-				if (this.List[0].normalQuality.formedNum - this.List[0].normalQuality.quantity - this.feedCount < 0) {
+				if (this.List[0].normalQuality.formedNum - this.List[0].normalQuality.quantity  < 0) {
 					uni.showToast({
 					uni.showToast({
 						icon: 'none',
 						icon: 'none',
 						title: '已质检数量不能大于合格数量'
 						title: '已质检数量不能大于合格数量'

+ 217 - 0
pages/pda/sample/inspection/job.vue

@@ -0,0 +1,217 @@
+<template>
+	<view class="content-box">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title='title' background-color="#F7F9FA"
+			color="#000" @clickLeft="back">
+		</uni-nav-bar>
+
+
+		<view class="list_box">
+			<u-list @scrolltolower="scrolltolower">
+				<view class="card_box">
+					<workOrderBom :item='objData' v-if='objData' @handleScan='handleWordScan'></workOrderBom>
+
+					<diagramLast v-if='lastObj' :item='lastObj'>
+					</diagramLast>
+
+					<qualityStat :normalQuality='objData.normalQuality' v-if='objData'></qualityStat>
+
+					<u-form labelPosition="left" labelWidth="180" labelAlign="left" style="margin-top: 40rpx;">
+                         
+						<u-form-item label="合格数量:" class="required-form" borderBottom prop="formingNum">
+							<input class="uni-input" v-model="formingNum" type='digit'></input>
+						</u-form-item>
+
+					</u-form>
+
+
+
+
+
+				</view>
+			</u-list>
+		</view>
+
+		<view class="bottom-wrapper">
+			<view class="btn_box" @click="save">一键报工</view>
+		</view>
+
+	</view>
+
+
+</template>
+
+<script>
+	import {
+		getByIdReport,
+		jobSave
+	} from '@/api/pda/jobBooking.js'
+
+	import {
+
+		junkCount
+	} from '@/api/pda/workOrder.js'
+
+	import workOrderBom from '../../feeding/components/workOrderBom.vue'
+	import qualityStat from '../components/qualityStat.vue'
+	import diagramLast from '../components/diagramLast.vue'
+	export default {
+		components: {
+			workOrderBom,
+			qualityStat,
+			diagramLast
+		},
+		data() {
+			return {
+				title: null,
+
+				objData: null,
+				lastObj: null,
+				feedCount: null,
+
+				formingNum: 0,
+				formedNumLast: 0
+			}
+		},
+
+
+		onLoad(options) {
+			this.title = options.taskName ? options.taskName + '-报工' : '报工'
+			this.id = options.workOrderId
+			this.taskId = options.taskId
+			this.getList()
+
+
+		},
+
+		created() {
+
+		},
+
+
+		methods: {
+
+			handleWordScan() {
+				uni.showToast({
+					icon: 'none',
+					title: '不支持换工单'
+				})
+			},
+
+
+			getList() {
+				getByIdReport(this.id, this.taskId).then(res => {
+
+					res.workReportInfo = {
+						formingNum: null,
+						taskId: this.taskId,
+						reportType: 3
+					}
+
+					this.formedNumLast = res.formedNumLast
+					this.formingNum = 0
+					res.normalQuality.forEach(f => {
+						this.formingNum = this.formedNumLast - Number(f.quantity)
+					})
+
+
+					this.lastObj = {
+						formedNum: res.formedNumLast,
+						diagramLast: {
+							taskTypeName: res.taskNameLast
+						}
+					}
+
+					this.objData = res
+
+
+				})
+			},
+			
+			save() {
+			      
+				  this.objData.workReportInfo.formingNum = this.formingNum
+				  console.log(this.objData.workReportInfo)
+			
+				if (Number(this.objData.workReportInfo.formingNum) < 0 || this.objData.workReportInfo.formingNum == null) {
+
+					uni.showToast({
+						icon: 'none',
+						title: '合格数量不能小于0'
+					})
+			
+					return false
+				}
+			
+			
+		
+			
+				jobSave(this.objData).then(res => {
+					if (res) {
+						uni.navigateBack()
+					}
+				})
+			
+			
+			
+			}
+
+
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.content-box {
+		height: 100vh;
+		overflow: hidden;
+		display: flex;
+		flex-direction: column;
+
+	}
+
+	.list_box {
+		flex: 1;
+		overflow: hidden;
+		padding: 4rpx 0;
+
+		.u-list {
+			height: 100% !important;
+		}
+
+		.card_box {
+			padding: 16rpx 24rpx;
+		}
+
+
+
+	}
+
+	.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;
+
+		/deep/ .u-button {
+			width: 160rpx;
+		}
+	}
+
+	/deep/ .uni-input-input {
+		border: 2rpx solid #F0F8F2;
+		background: #F0F8F2;
+		color: $theme-color;
+	}
+</style>

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

@@ -346,7 +346,14 @@
 					uni.navigateTo({
 					uni.navigateTo({
 						url
 						url
 					})
 					})
-				}
+				}  else if (type == 'inspectionJob') {
+					url = '/pages/pda/sample/inspection/job'
+					url += `?workOrderId=${this.info.id}&taskId=${taskId }&taskName=${taskName}`
+					uni.navigateTo({
+						url
+					})
+				} 
+