guoyujia před 5 měsíci
rodič
revize
19b3b95181

+ 7 - 0
pages.json

@@ -28,6 +28,13 @@
 				// "enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/productionPlan/details",
+			"style": {
+				"navigationBarTitleText": "查箱号",
+				"onReachBottomDistance": 100
+			}
+		},
 		{
 			"path": "pages/outsourceProductionPlan/index",
 			"style": {

+ 11 - 3
pages/batchReporting/index.vue

@@ -235,10 +235,18 @@
 
 
 
-	onLoad(() => {
+	onLoad((options) => {
 		curPlan.value = store.planDetails;
 		normalStatus.value = true;
 		console.log(curPlan.value)
+		if (options != null) {
+			console.log(options)
+			console.log("999")
+			keywords.value = options.param1
+			if (store.planDetails.isAmend == 1 || store.planDetails.isWasteRecycling == 1) {
+				normalStatus.value = false;
+			}
+		}
 		//废品回用的领料部门如果是当前工段,也要可以开始新批次
 		//查找当前计划单下的批次废品回用是当前工段
 		getAbnormalityLot({
@@ -524,8 +532,8 @@
 		} else {
 			// 测试时用
 			showDaywork({
-				carrierId: '1780467398971187210',
-				carrierCode: '',
+				carrierId: '0',
+				carrierCode: '100164',
 				status: 7
 			}).then(response => {
 				if (response.code == 200) {

+ 247 - 0
pages/productionPlan/details.vue

@@ -0,0 +1,247 @@
+<template>
+	<view class="page-container uni-column" style="padding: 24rpx;box-sizing: border-box;">
+		<view class="box-bg uni-row" style="height: 10%;position: fixed;top:0px;left: 12px;right: 12px;z-index: 10;">
+			<view class="input-view uni-row">
+				<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
+			</view>
+			<view class="search" @click="handleSearch">搜索</view>
+		</view>
+		<view v-if="listData.length == 0" style="color: #999;margin:90% auto;height: 90%;">
+			<text>暂无周转到该工段批次</text>
+		</view>
+		<view class="uni-column" v-else style="overflow: scroll;margin-top: 65px;" >
+			<view v-for="(item, index) in listData" :key="index"
+				class="list-item">
+				<view class="title-container uni-row">
+					<view class="title uni-row">
+						<text class="label">批次号</text>
+						<text class="label code">{{ item['lotCode'] }}</text>
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ item['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">箱号</text>
+					<text class="label right">{{ item['carrierCode'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">所在区域</text>
+					<text class="label right">{{ item['place'] }}</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		getCarrierTotalList
+	} from '@/api/business/dayWork.js'
+	import {
+		ref
+	} from 'vue'
+	import {
+		onReady,
+		onLoad,
+		onUnload,
+		onReachBottom,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+
+
+	const listData = ref([])
+	const keywords = ref('')
+	const pageSize = ref(10)
+	const pageNum = ref(1)
+	const status = ref(true)
+
+	onShow(() => {
+		reflush();
+	})
+
+	function reflush() {
+		init();
+	}
+	onReachBottom(()=>{
+		console.log(status.value)
+		if(status.value) {
+		pageNum.value += 1
+uni.showLoading({
+			title: '加载中'
+		});
+		getCarrierTotalList({
+			deptId: Number(store.curDeptDetails.deptId),
+			keywords: keywords.value,
+			userId:store.userInfo.userId,
+			pageNum:pageNum.value,
+			pageSize:pageSize.value
+		}).then(res =>{
+		 const existingIds = new Set(listData.value.map(item => item.lotCode));
+		
+		  // 过滤出那些不在 existingIds 中的项,即新数据
+		  const newRows = res.data.filter(row => !existingIds.has(row.lotCode));
+		console.log(newRows)
+		  // 如果有新数据,将其添加到 listData
+		  if (newRows.length > 0) {
+		    listData.value = listData.value.concat(newRows);
+			uni.hideLoading();
+		  } else {
+			  uni.hideLoading();
+		    // 如果没有新数据,更新状态表示没有更多数据
+		    status.value = false;
+		  }
+		})
+		}
+		console.log(status.value)
+	})
+
+	function init(data) {
+		uni.showLoading({
+			title: '加载中'
+		});
+		pageNum.value = 1
+		getCarrierTotalList({
+			deptId: Number(store.curDeptDetails.deptId),
+			keywords: keywords.value,
+			userId:store.userInfo.userId,
+			pageNum:pageNum.value,
+			pageSize:pageSize.value
+		}).then(res => {
+			if (res.code == 200) {
+				listData.value = res.data;
+				uni.hideLoading();
+			}
+			uni.hideLoading();
+		})
+	}
+
+	function handleSearch() {
+		let reqParam = {
+			keywords: keywords.value
+		}
+		reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
+		pageNum.value = 1
+		status.value = true
+		init(reqParam)
+	}
+</script>
+
+<style lang="scss">
+	$nav-height: 60rpx;
+
+	.box-bg {
+		width: 100%;
+		background-color: #F5F5F5;
+		padding: 5rpx 0;
+		justify-content: space-around;
+		align-items: center;
+
+		.input-view {
+			width: 100%;
+			flex: 4;
+			background-color: #f8f8f8;
+			height: $nav-height;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			margin: 0 10rpx 20rpx;
+			line-height: $nav-height;
+
+			.input-uni-icon {
+				line-height: $nav-height;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: $nav-height;
+				line-height: $nav-height;
+				padding: 0 5rpx;
+				background-color: #f8f8f8;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			color: #808080;
+			margin-top: -20rpx;
+		}
+	}
+
+	.page-container {
+		background-color: rgba(245, 245, 245, 1);
+		 // height: 100%;
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		border-radius: 24rpx;
+		margin-bottom: 24rpx;
+
+		.title-container {
+			justify-content: space-between;
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1ce5b0;
+				background-color: #f6fffd;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1ce5b0;
+					font-size: 24rpx;
+				}
+
+				&.not-start {
+					border: 1px solid #bbbbbb;
+					background-color: #f5f5f5;
+
+					.label {
+						color: #bbbbbb;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+	}
+</style>

+ 136 - 5
pages/productionPlan/index.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="uni-column" style="padding: 24rpx">
-		<view class="box-bg uni-row">
+	<view class="uni-column" style="padding: 24rpx;height: 100%; left:0;right: 0;position: fixed;">
+		<view class="box-bg uni-row" style="height: 6%;">
 			<view class="input-view uni-row">
 				<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
 				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
@@ -10,7 +10,7 @@
 		<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
 			<text>暂无生产计划</text>
 		</view>
-		<view v-else style="height: calc(100% - 100rpx); overflow: auto;">
+		<view v-else style="height: 81%; overflow: auto;">
 			<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
 				class="list-item">
 				<view class="title-container uni-row">
@@ -45,12 +45,20 @@
 				</view>
 			</view>
 		</view>
+		<view class="bottom uni-row" style="z-index: 10;">
+			<button class="start-batch-btn" style="margin-right: 10rpx;background-color: #67c337;"
+				@click="handleScanCode">扫码报工</button>
+			<button class="start-batch-btn" type="primary" @click="handleSearchCode">查箱号</button>
+		</view>
+		<dialog-selectDaywork ref='selectDaywork' @handleSelectDaywork='handleSelectDaywork'></dialog-selectDaywork>
 	</view>
 </template>
 
 <script setup>
 	import {
-		getPlanDetailsList
+		getPlanDetailsList,
+		selectByCarrierCode,
+		selectInfoByLotCode
 	} from '@/api/business/planDetails.js'
 	import {
 		ref
@@ -75,6 +83,8 @@
 
 	const listData = ref([])
 	const keywords = ref('')
+	const selectDaywork = ref(null)
+	const carrierCode = ref(null)
 
 	onLoad(() => {
 		// dayworkItem数据更改后刷新数据
@@ -132,6 +142,104 @@
 		reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
 		init(reqParam)
 	}
+
+	function handleScanCode() {
+		// 引入原生插件
+		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		// const mpaasScanModule = null
+		if (mpaasScanModule) {
+			// 调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					console.log(ret);
+					let vehicleObj = {
+						carrierCode: ret.resp_result
+					};
+					if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+						uni.showToast({
+							icon: "none",
+							title: "请扫载具码",
+							duration: 1000
+						})
+						return;
+					}
+					selectByCarrierCode({
+						carrierCode: vehicleObj.carrierCode,
+						deptId: Number(store.curDeptDetails.deptId)
+					}).then(response => {
+						carrierCode.value = vehicleObj.carrierCode
+						if (response.code == 200) {
+							if (response.data.length > 1) {
+								selectDaywork.value.open(response.data)
+
+							} else {
+								handleSelectDaywork(response.data[0].lotCode)
+							}
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: response.msg,
+								duration: 2000
+							})
+						}
+					})
+				}
+			);
+		} else {
+			// 测试时用
+			selectByCarrierCode({
+				carrierCode: '000625',
+				deptId: Number(store.curDeptDetails.deptId)
+			}).then(response => {
+				if (response.code == 200) {
+					carrierCode.value = '000625'
+					if (response.data.length > 1) {
+						selectDaywork.value.open(response.data)
+					} else {
+						handleSelectDaywork(response.data[0].lotCode)
+					}
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: response.msg,
+						duration: 2000
+					})
+				}
+			})
+		}
+	}
+	//带回
+	function handleSelectDaywork(data) {
+		console.log(data)
+		//查询计划单信息跳转
+		selectInfoByLotCode({
+			lotCode: data
+		}).then(res => {
+			store.planDetails = res.data
+			var code = encodeURIComponent(carrierCode.value);
+			// 构建查询参数字符串
+			var queryParam =
+				`param1=${code}`;
+
+			// 使用模板字符串构建完整的URL
+			var navigateUrl = `/pages/batchReporting/index?${queryParam}`;
+			uni.navigateTo({
+				url: navigateUrl
+			});
+		})
+	}
+	//查箱号
+	function handleSearchCode() {
+		uni.navigateTo({
+			url: '/pages/productionPlan/details'
+		})
+	}
 </script>
 
 <style lang="scss">
@@ -179,7 +287,7 @@
 
 	.uni-column {
 		background-color: rgba(245, 245, 245, 1);
-		height: calc(100% - 40rpx);
+		// height: calc(100% - 40rpx);
 	}
 
 	.list-item {
@@ -246,4 +354,27 @@
 			}
 		}
 	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+	}
 </style>

+ 22 - 27
pages/sortProductionPlan/index.vue

@@ -50,14 +50,15 @@
 				@click="handleScanCode">扫码报工</button>
 			<button class="start-batch-btn" type="primary" @click="handleSearchCode">查箱号</button>
 		</view>
-		<dialog-selectDaywork ref='selectDaywork'
-			@handleSelectDaywork='handleSelectDaywork'></dialog-selectDaywork>
+		<dialog-selectDaywork ref='selectDaywork' @handleSelectDaywork='handleSelectDaywork'></dialog-selectDaywork>
 	</view>
 </template>
 
 <script setup>
 	import {
-		getPlanDetailsList,selectByCarrierCode,selectInfoByLotCode
+		getPlanDetailsList,
+		selectByCarrierCode,
+		selectInfoByLotCode
 	} from '@/api/business/planDetails.js'
 	import {
 		ref
@@ -155,19 +156,21 @@
 	function handleSelectDaywork(data) {
 		console.log(data)
 		//查询计划单信息跳转
-		selectInfoByLotCode({lotCode:data}).then(res=>{
+		selectInfoByLotCode({
+			lotCode: data
+		}).then(res => {
 			store.planDetails = res.data
 			var code = encodeURIComponent(carrierCode.value);
 			// 构建查询参数字符串
 			var queryParam =
 				`param1=${code}`;
-			
+
 			// 使用模板字符串构建完整的URL
-		var navigateUrl = `/pages/sortBatchReporting/index?${queryParam}`;
-		uni.navigateTo({
-			url: navigateUrl
-		});
-	})
+			var navigateUrl = `/pages/sortBatchReporting/index?${queryParam}`;
+			uni.navigateTo({
+				url: navigateUrl
+			});
+		})
 	}
 
 	function handleSearch() {
@@ -177,6 +180,7 @@
 		reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
 		init(reqParam)
 	}
+
 	function handleScanCode() {
 		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
@@ -205,13 +209,13 @@
 					}
 					selectByCarrierCode({
 						carrierCode: vehicleObj.carrierCode,
-						deptId:Number(store.curDeptDetails.deptId)
+						deptId: Number(store.curDeptDetails.deptId)
 					}).then(response => {
-							carrierCode.value = vehicleObj.carrierCode
+						carrierCode.value = vehicleObj.carrierCode
 						if (response.code == 200) {
 							if (response.data.length > 1) {
-								selectDaywork.value.open(response.data)	
-																		
+								selectDaywork.value.open(response.data)
+
 							} else {
 								handleSelectDaywork(response.data[0].lotCode)
 							}
@@ -229,12 +233,12 @@
 			// 测试时用
 			selectByCarrierCode({
 				carrierCode: '000745',
-				deptId:Number(store.curDeptDetails.deptId)
+				deptId: Number(store.curDeptDetails.deptId)
 			}).then(response => {
 				if (response.code == 200) {
 					carrierCode.value = '000745'
 					if (response.data.length > 1) {
-						selectDaywork.value.open(response.data)								
+						selectDaywork.value.open(response.data)
 					} else {
 						handleSelectDaywork(response.data[0].lotCode)
 					}
@@ -362,6 +366,7 @@
 			}
 		}
 	}
+
 	.bottom {
 		height: 10%;
 		position: fixed;
@@ -374,7 +379,7 @@
 		align-items: center;
 		background-color: #fff;
 		justify-content: space-evenly;
-	
+
 		.start-batch-btn {
 			flex: 1;
 			height: 80rpx;
@@ -383,15 +388,5 @@
 			color: #FFFFFF;
 			font-size: 28rpx;
 		}
-	
-		.view-end-btn {
-			flex: 1;
-			height: 80rpx;
-			line-height: 80rpx;
-			border-radius: 8rpx;
-			color: #FFFFFF;
-			font-size: 28rpx;
-	
-		}
 	}
 </style>