wangxin 1 年之前
父節點
當前提交
1e896439c9

+ 15 - 14
components/dialog-end-work/dialog-end-work.vue

@@ -107,6 +107,7 @@
 		workInfo.value = {
 			...data,
 		};
+		console.log("数据data", workInfo);
 		//查看是否为首序
 		getIsFirst(store.dayworkInfo.id);
 		workInfo.value.qualifiedNum = 0;
@@ -261,21 +262,22 @@
 
 	function handlePreFinishReporting() {
 
-		//数投产
-		let number = store.dayworkInfo.processQualifiedNum == 0 ? store.dayworkInfo.oneLotQuantity : store.dayworkInfo
-			.processQualifiedNum;
+		//投产数
+		let number = workInfo.value.prodNum;
 		console.log("总数", number);
 		console.log("合格量", (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value))
 		let percent = (((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value) / number) * 100).toFixed(2);
 		let num = 103;
 		// 填入数大于剩余量情况
-		if (store.isPreProcess && (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number > 0)) {
+		if (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number > 0) {
 			// 判断当前是否为首序
 			if (isFirstOrder.value) {
+				percent = ((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number) / number) * 100;
+				percent = Math.ceil(percent * 100) / 100;
 				uni.showModal({
 					title: '提示',
-					// content: `合格数总量超出投入量${parseInt(workInfo.value.qualifiedNum)  + lotPreSumQualifiedNum.value - store.dayworkInfo.oneLotQuantity},是否继续保存?`,
-					content: `合格数总量超出投入量${(((parseInt(workInfo.value.qualifiedNum)  + lotPreSumQualifiedNum.value - store.dayworkInfo.oneLotQuantity) / store.dayworkInfo.oneLotQuantity) * 100).toFixed(2)}%,是否继续保存?`,
+
+					content: `合格数总量超出投入量${percent}%,是否继续保存?`,
 					success: function(res) {
 						if (res.confirm) {
 							handleSave();
@@ -299,19 +301,18 @@
 	}
 
 	function handleFinishReporting() {
-		//数投产
-		let number = store.dayworkInfo.processQualifiedNum == 0 ? store.dayworkInfo.oneLotQuantity : store.dayworkInfo
-			.processQualifiedNum;
-		console.log("总数", number);
+		//投产数
+		let number = workInfo.value.prodNum;
 		let percent = (((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value) / number) * 100).toFixed(2);
 		let num = 103;
-		if (store.isPreProcess && (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - store.dayworkInfo
-				.oneLotQuantity > 0)) {
+		if (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number > 0) {
 			if (isFirstOrder.value) {
+				percent = ((parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number) / number) * 100;
+				percent = Math.ceil(percent * 100) / 100;
 				uni.showModal({
 					title: '提示',
-					// content: `合格数总量超出投入量${parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - store.dayworkInfo.oneLotQuantity},是否继续保存?`,
-					content: `合格数总量超出投入量${(((parseInt(workInfo.value.qualifiedNum)  + lotPreSumQualifiedNum.value - store.dayworkInfo.oneLotQuantity) / store.dayworkInfo.oneLotQuantity) * 100).toFixed(2)}%,是否继续保存?`,
+
+					content: `合格数总量超出投入量${percent}%,是否继续保存?`,
 					success: function(res) {
 						if (res.confirm) {
 							if (showCarrierList.value) {

+ 82 - 54
components/dialog-lotReporting/dialog-lotReporting.vue

@@ -1,7 +1,7 @@
 <template>
 	<dialog-base class="dialog-body" ref="baseDialog" title="添加批次报工">
 		<view style="overflow: auto;height: 800rpx;">
-			<view v-for="(item, index) in lotData" :key="index" class="list-item" >
+			<view v-for="(item, index) in lotData" :key="index" class="list-item">
 				<view class="item-info uni-row">
 					<text class="label">批次号</text>
 					<text class="label right">{{ item['lotCode'] }}</text>
@@ -19,52 +19,51 @@
 					<text class="label right">{{ item['carrierName'] }}</text>
 				</view>
 				<view class="item-info uni-row">
-						<text class="label">下道工序</text>
-						<view class="label right uni-row">{{ item['nextProcess'] ? item['nextProcess'].processAlias : '-' }}
-							(<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
-							</view>)
-						</view>
-					</view>
-					<view class='middle'>
-						<view class='segment'></view>
-						<uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
-						<view class='segment'></view>
+					<text class="label">下道工序</text>
+					<view class="label right uni-row">{{ item['nextProcess'] ? item['nextProcess'].processAlias : '-' }}
+						(<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
+						</view>)
 					</view>
-			</view>
-			</view>
-			<view class="list-item">
-				<view class="item-info uni-row">
-					<text class="label">下序车间</text>
-							<uni-data-select v-model="curDaywork.workshopId" :localdata="workshopList" @change="handleChangeWorkshop"
-								:clear="false"
-								style="outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
-				</view>
-				<view class="item-info uni-row">
-					<text class="label">下序工段</text>
-							<uni-data-select v-model="curDaywork.deptId" :localdata="deptList"
-								:clear="false"
-								style="outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
 				</view>
+				<view class='middle'>
+					<view class='segment'></view>
+					<uni-icons type="paperclip" size="30" style="margin: 10rpx;"></uni-icons>
+					<view class='segment'></view>
 				</view>
+			</view>
+		</view>
+		<view class="list-item">
+			<view class="item-info uni-row">
+				<text class="label">下序车间</text>
+				<uni-data-select v-model="curDaywork.workshopId" :localdata="workshopList"
+					@change="handleChangeWorkshop" :clear="false"
+					style="outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+			</view>
+			<view class="item-info uni-row">
+				<text class="label">下序工段</text>
+				<uni-data-select v-model="curDaywork.deptId" :localdata="deptList" :clear="false"
+					style="outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+			</view>
+		</view>
 
-			<!-- 抽屉 -->
-				<view>
+		<!-- 抽屉 -->
+		<view>
 		</view>
 		<view style="z-index: 99999;">
-		<uni-drawer ref="showRight" mode="right" :mask-click="true">
-			<view class="scroll-view">
-				<scroll-view class="scroll-view-box"  style="height:100%;">
-					<view style="width: 100%;text-align: center;;font-size: 48rpx;margin: 48rpx 0 24rpx 0;">工艺列表
-					</view>
-					<view style="font-size: 24rpx;width: 100%;text-align: center;color: red;margin-bottom: 48rpx;">
-						仅显示当前工序后面工艺</view>
-					<view class="info-content" v-for="(item,index) in curProcessAfte" :key="index"
-						style="width: 100%;margin: 8rpx 0 8rpx 14%;">
-						<text>{{ index + 1 }}.{{item.processAlias}}</text>
-					</view>
-				</scroll-view>
-			</view>
-		</uni-drawer>
+			<uni-drawer ref="showRight" mode="right" :mask-click="true">
+				<view class="scroll-view">
+					<scroll-view class="scroll-view-box" style="height:100%;">
+						<view style="width: 100%;text-align: center;;font-size: 48rpx;margin: 48rpx 0 24rpx 0;">工艺列表
+						</view>
+						<view style="font-size: 24rpx;width: 100%;text-align: center;color: red;margin-bottom: 48rpx;">
+							仅显示当前工序后面工艺</view>
+						<view class="info-content" v-for="(item,index) in curProcessAfte" :key="index"
+							style="width: 100%;margin: 8rpx 0 8rpx 14%;">
+							<text>{{ index + 1 }}.{{item.processAlias}}</text>
+						</view>
+					</scroll-view>
+				</view>
+			</uni-drawer>
 		</view>
 		<view class="add-btn-container uni-row">
 			<button type="default" class="leftBtn" @click="handleFinishScan">结束扫码</button>
@@ -92,13 +91,41 @@
 	function open(data) {
 		lotData.value = data
 		baseDialog.value.open()
+		workshopList.value = [{
+				value: '1762872520725155842',
+				text: '一号车间'
+			},
+			{
+				value: '1762874510792380417',
+				text: '二三车间'
+			}
+		];
+
+		deptList.value = [{
+			value: 11,
+			text: '热处理'
+		}];
 		init()
 	}
+
 	function init() {
 		//查询车间
-    }
+	}
+
 	function handleClickProcessList(item) {
-		 let curProcessAfterList = [{processAlias:'下料'},{processAlias:'大切断'},{processAlias:'分选'},{processAlias:'下料'},{processAlias:'大切断'},{processAlias:'分选'}];
+		let curProcessAfterList = [{
+			processAlias: '下料'
+		}, {
+			processAlias: '大切断'
+		}, {
+			processAlias: '分选'
+		}, {
+			processAlias: '下料'
+		}, {
+			processAlias: '大切断'
+		}, {
+			processAlias: '分选'
+		}];
 		// let nextIndex = 0;
 		// for (let i = 0; i < item.processSequence.length; i++) {
 		// 	if (item.nextProcess.id == item.processSequence[i].id) {
@@ -111,20 +138,18 @@
 		// 	}
 		// }
 		// console.log(curProcessAfterList)
-		 curProcessAfte.value = curProcessAfterList;
+		curProcessAfte.value = curProcessAfterList;
 		showRight.value.open();
 	}
 	//切换车间
-	function handleChangeWorkshop() {
-		
-	}
+	function handleChangeWorkshop() {}
 	//结束扫码
 	function handleFinishScan() {
-		
+
 	}
 	//继续扫码
 	function handleContinueScan() {
-		
+
 	}
 
 	function close() {
@@ -157,18 +182,20 @@
 			}
 		}
 	}
+
 	.middle {
 		display: flex;
 		flex-direction: row;
 		align-items: center;
 		justify-content: center
 	}
-	
+
 	.segment {
 		width: 280rpx;
 		background-color: rgba(213, 213, 213, 1);
 		border: 1rpx solid rgba(213, 213, 213, 1);
 	}
+
 	.middle {
 		display: flex;
 		flex-direction: row;
@@ -181,22 +208,23 @@
 		background-color: rgba(213, 213, 213, 1);
 		border: 1rpx solid rgba(213, 213, 213, 1);
 	}
+
 	.add-btn-container {
 		margin-top: 32rpx;
-	
+
 		.leftBtn {
 			flex: 1;
 			background-color: rgb(164, 173, 179);
 			color: #FFFFFF;
-	
+
 		}
+
 		.rightBtn {
 			flex: 1;
 			margin-left: 24rpx;
 			background-color: rgb(91, 214, 165);
 			color: #FFFFFF;
-			
+
 		}
 	}
-
 </style>

+ 2 - 1
pages/dashboard/index.vue

@@ -318,7 +318,7 @@
 	.business-btn {
 		margin: 0 20rpx 20rpx 20rpx;
 		background-color: #fff;
-		height: 100rpx;
+		min-height: 100rpx;
 		width: 94%;
 		align-items: center;
 		justify-content: center;
@@ -345,6 +345,7 @@
 			align-items: center;
 			height: 80rpx;
 
+
 			.label {
 				font-size: 32rpx;
 				color: #ffffff;

+ 35 - 9
pages/fastProductionPlaan/index.vue

@@ -3,10 +3,10 @@
 		<view style="color: #999;margin: 50% auto;">
 			<text>扫码开始快速报工</text>
 		</view>
-	<view class='bottom-btn-container'>
-		<button class="start-batch-btn uni-row" type=primary @click='handleAdd'>扫码开始报工</button>
-	</view>
-	<dialog-lotReporting ref="lotReporting"></dialog-lotReporting>
+		<view class='bottom-btn-container'>
+			<button class="start-batch-btn uni-row" type=primary @click='handleAdd'>扫码开始报工</button>
+		</view>
+		<dialog-lotReporting ref="lotReporting"></dialog-lotReporting>
 	</view>
 </template>
 
@@ -15,13 +15,38 @@
 		ref
 	} from 'vue'
 	import path from '@/api/base/path.js'
-	
+
 	const lotReporting = ref(null)
+
 	function handleAdd() {
-		let data = [
-			{productionPlanNo:'456123',lotCode:'D597412820',productDescription:'8669sdfrfw',carrierName:'X12522、X55222、X15522',nextProcess:{processAlias:'热处理'}},
-			{productionPlanNo:'456123',lotCode:'D597412820',productDescription:'8669sdfrfw',carrierName:'X12522、X55222、X15522',nextProcess:{processAlias:'热处理'}},
-			{productionPlanNo:'456123',lotCode:'D597412820',productDescription:'8669sdfrfw',carrierName:'X12522、X55222、X15522',nextProcess:{processAlias:'热处理'}}]
+		let data = [{
+				productionPlanNo: '456123',
+				lotCode: 'D597412820',
+				productDescription: '8669sdfrfw',
+				carrierName: 'X12522、X55222、X15522',
+				nextProcess: {
+					processAlias: '热处理'
+				}
+			},
+			{
+				productionPlanNo: '456123',
+				lotCode: 'D597412820',
+				productDescription: '8669sdfrfw',
+				carrierName: 'X12522、X55222、X15522',
+				nextProcess: {
+					processAlias: '热处理'
+				}
+			},
+			{
+				productionPlanNo: '456123',
+				lotCode: 'D597412820',
+				productDescription: '8669sdfrfw',
+				carrierName: 'X12522、X55222、X15522',
+				nextProcess: {
+					processAlias: '热处理'
+				}
+			}
+		]
 		// 调用子组件中的方法
 		lotReporting.value.open(data);
 	}
@@ -30,6 +55,7 @@
 <style lang="scss">
 	.bottom-btn-container {
 		position: fixed;
+		top: 80%;
 		right: 20rpx;
 		left: 20rpx;
 

+ 0 - 2
pages/reportingForWork/index.vue

@@ -191,8 +191,6 @@
 	}
 
 	function handleShowEndWorkDialog(data) {
-		
-		console.log("dayWorkInfo展示",dayWorkInfo.value);
 		checkBizDayworkCarriers({
 			id: store.dayworkInfo.id
 		}).then(res => {