ezhizao_zx 5 mesiacov pred
rodič
commit
a0ed7170f9

+ 47 - 39
components/dialog-lotReporting/dialog-lotReporting.vue

@@ -49,11 +49,15 @@
 			<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;" @change="handleDeptChange"></uni-data-select>
+					style="outline: 2rpx solid #999999;border-radius: 10rpx;"
+					@change="handleDeptChange"></uni-data-select>
 			</view>
 			<view v-if="!isWx" class="item-info uni-row" style="margin-top: 12rpx;">
-				<text class="label" style="width: 250rpx;"  >下序是否包装</text><text style="margin-left: 24rpx;" class="label right">否</text>
-				<switch class="switch" @change="switchChange" :checked="normalStatus" style="transform: scale(0.8);align-items: center;font-size:32rpx ;" color="rgba(103, 195, 55, 1.0)" />
+				<text class="label" style="width: 250rpx;">是否包装签票</text><text style="margin-left: 24rpx;"
+					class="label right">否</text>
+				<switch class="switch" @change="switchChange" :checked="normalStatus"
+					style="transform: scale(0.8);align-items: center;font-size:32rpx ;"
+					color="rgba(103, 195, 55, 1.0)" />
 				<text class=" label right">是</text>
 			</view>
 		</view>
@@ -87,7 +91,8 @@
 						<text>{{ index + 1 }}.{{item.processAlias}}</text>
 					</view>
 				</scroll-view>
-				<view><button v-if="!editStatus" class="start-batch-btn" style="margin-bottom: 10rpx;" type="primary" @click="handleOpenDrawing">查看本工序图纸</button></view>
+				<view><button v-if="!editStatus" class="start-batch-btn" style="margin-bottom: 10rpx;" type="primary"
+						@click="handleOpenDrawing">查看本工序图纸</button></view>
 			</uni-drawer>
 		</view>
 		<view class="add-btn-container uni-row">
@@ -177,14 +182,14 @@
 	}
 
 	function handleClickProcessList(item) {
-		console.log(item,7979)
-		if(item.isWasteRecycling ==1 || item.isAmend ==1){
+		console.log(item, 7979)
+		if (item.isWasteRecycling == 1 || item.isAmend == 1) {
 			editStatus.value = true
-		}else{
+		} else {
 			editStatus.value = false
 		}
 		var filteredProcess = item.processSequence.filter(i => i.processStepNumber == item.process.processStepNumber);
-		
+
 		processCode.value = filteredProcess[0].processCode
 		processAlias.value = filteredProcess[0].processAlias
 		productId.value = item.daywork.productId
@@ -200,8 +205,8 @@
 		deptList.value = workshopList.value.find(v => v.value === arg).deptList.map(v => ({
 			value: v.deptId,
 			text: v.deptName,
-			isSortPackaging:v.isSortPackaging,
-			code:v.deptCode
+			isSortPackaging: v.isSortPackaging,
+			code: v.deptCode
 		}))
 		normalStatus.value = false
 		isWx.value = false
@@ -209,7 +214,7 @@
 	//结束扫码
 	function handleFinishScan() {
 		const currentTime = Date.now();
-		
+
 		// 检查是否已经过去了 2 秒
 		if (currentTime - lastRequestTimestamp.value < 2000) {
 			// 如果在 2 秒 内已经点击,那么不执行
@@ -230,43 +235,46 @@
 		})
 	}
 	//打开电子图纸
-	function handleOpenDrawing(){
-		
-		    // 对 technologicalProcessDetailId 进行URL编码
-		    var encodedId = encodeURIComponent(productId.value);
-		    var enTechnologicalProcessId = encodeURIComponent(technologicalProcessId.value);
-		    var enprocessCode = encodeURIComponent(processCode.value);
-		    
-		    var encodeCode = encodeURIComponent(currentLotCode.value);
-		    var enProcessAlias = encodeURIComponent(processAlias.value);
-		    // 构建查询参数字符串
-		    var queryParam = `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
-
-		
-		  // 使用模板字符串构建完整的URL
-		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
-		
-		  // 导航到指定页面
-		  uni.navigateTo({
-		    url: navigateUrl
-		  });
-	
+	function handleOpenDrawing() {
+
+		// 对 technologicalProcessDetailId 进行URL编码
+		var encodedId = encodeURIComponent(productId.value);
+		var enTechnologicalProcessId = encodeURIComponent(technologicalProcessId.value);
+		var enprocessCode = encodeURIComponent(processCode.value);
+
+		var encodeCode = encodeURIComponent(currentLotCode.value);
+		var enProcessAlias = encodeURIComponent(processAlias.value);
+		// 构建查询参数字符串
+		var queryParam =
+			`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
+
+
+		// 使用模板字符串构建完整的URL
+		var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+		// 导航到指定页面
+		uni.navigateTo({
+			url: navigateUrl
+		});
+
 	}
+
 	function handleDeptChange() {
 		console.log(deptList.value)
-		let deptInfo = deptList.value.find(item =>item.value == curDaywork.value.deptId)
+		let deptInfo = deptList.value.find(item => item.value == curDaywork.value.deptId)
 		console.log(deptInfo)
-		if(deptInfo.code =='170000') {
+		if (deptInfo.code == '170000') {
 			isWx.value = true
-		}else{
+		} else {
 			isWx.value = false
 		}
-		if(deptInfo.isSortPackaging == 1){
+		if (deptInfo.isSortPackaging == 1) {
 			normalStatus.value = true
-		}else{
+		} else {
 			normalStatus.value = false
 		}
 	}
+
 	function switchChange(event) {
 		console.log(event.detail.value)
 		//是
@@ -300,11 +308,11 @@
 				deptId: curDaywork.value.deptId,
 				workshopId: curDaywork.value.workshopId,
 				deptName: deptList.value.find(v => v.value === curDaywork.value.deptId).text,
-				isSortPackaging :normalStatus.value?"1":"0"
+				isSortPackaging: normalStatus.value ? "1" : "0"
 			}
 
 		}))
-		 console.log(params)
+		console.log(params)
 		reportDaywork(params).then(res => {
 			callback()
 		})

+ 86 - 77
components/dialog-turnoverApplication/dialog-turnoverApplication.vue

@@ -22,13 +22,16 @@
 						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
 				</uni-section>
 			</view>
-	<view v-if="curDayworkItem.turnoverType != '3'" class="list-title uni-row">
-		<text class="label" style="margin: 0 0 0 -24rpx;" >下序是否包装</text><text style="margin-left: 56rpx;" class="label">否</text>
-		<switch class="switch" @change="switchChange" :checked="normalStatus" style="transform: scale(0.8);align-items: center;font-size:32rpx ;" color="rgba(103, 195, 55, 1.0)" />
-		<text class="label">是</text>
-	</view>
-	<view class="list-title">
-				<text class="label" style="margin: 0 0 0 -308rpx;" >请选择您摆放位置</text>
+			<view v-if="curDayworkItem.turnoverType != '3'" class="list-title uni-row">
+				<text class="label" style="margin: 0 0 0 -24rpx;">是否包装签票</text><text style="margin-left: 56rpx;"
+					class="label">否</text>
+				<switch class="switch" @change="switchChange" :checked="normalStatus"
+					style="transform: scale(0.8);align-items: center;font-size:32rpx ;"
+					color="rgba(103, 195, 55, 1.0)" />
+				<text class="label">是</text>
+			</view>
+			<view class="list-title">
+				<text class="label" style="margin: 0 0 0 -308rpx;">请选择您摆放位置</text>
 			</view>
 			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '1'">
 				<view v-for="(item,index) in turnAreaList" class="btn">
@@ -145,6 +148,7 @@
 		outsideDepts.value = []
 		turnAreaList.value = []
 	}
+
 	function switchChange(event) {
 		console.log(event.detail.value)
 		//是
@@ -171,8 +175,8 @@
 			})
 		})
 		getOutsourceTurnoverByWorkshop({
-			deptCode:'170000'
-		}).then(response =>{
+			deptCode: '170000'
+		}).then(response => {
 			outTurnArea.value = response.data
 		})
 		getDayWorkItemList({
@@ -180,7 +184,7 @@
 			userId: store.userInfo.userId,
 			lotId: dayworkInfo.value.lotId,
 			isWasteRecycling: dayworkInfo.value.isWasteRecycling,
-			isAmend:dayworkInfo.value.isAmend,
+			isAmend: dayworkInfo.value.isAmend,
 			processStepNumber: dayworkInfo.value.currentProcess.processStepNumber
 		}).then(res => {
 			curDayworkItem.value = {
@@ -227,7 +231,7 @@
 	}
 
 	function selectTurnoverDoor(item) {
-		console.log(item,"chejiannei")
+		console.log(item, "chejiannei")
 		// turnoverDoorChecked.value = item;
 		// curDayworkItem.value.turnoverArea = item.dictValue;
 		let index = selection.value.findIndex(selectedItem => selectedItem === item);
@@ -239,13 +243,14 @@
 	}
 
 	function selectTurnoverDoorOutside(item) {
-		console.log(item,"wai")
+		console.log(item, "wai")
 		selection.value[0] = item;
 	}
-	 function selectTurnoverOutsource(item) {
-		 console.log(item,"waixie")
-		 selection.value[0] = item
-	 }
+
+	function selectTurnoverOutsource(item) {
+		console.log(item, "waixie")
+		selection.value[0] = item
+	}
 
 	function handleTurnoverDoor(item) {
 		return selection.value.includes(item);
@@ -277,7 +282,7 @@
 			});
 		} else {
 			const currentTime = Date.now();
-			
+
 			// 检查是否已经过去了 2 秒
 			if (currentTime - lastRequestTimestamp.value < 2000) {
 				// 如果在 2 秒 内已经有请求发出,那么不执行
@@ -288,45 +293,49 @@
 				})
 				return;
 			}
-		lastRequestTimestamp.value = currentTime;
-		curDayworkItem.value.id = null;
-		curDayworkItem.value.processStepNumber = dayworkInfo.value.currentProcess.processStepNumber
-		curDayworkItem.value.startTime = timestampToTime(new Date());
-		curDayworkItem.value.endTime = timestampToTime(new Date());
-		curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
-		curDayworkItem.value.dayworkId = dayworkInfo.value.id;
-		curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
-		curDayworkItem.value.status = '4';
-		if (!store.tenantId) {
-			curDayworkItem.value.tenantId = store.userInfo.tenantId;
-		} else {
-			curDayworkItem.value.tenantId = store.tenantId;
-		}
-		//curDayworkItem.value.turnoverArea = "外协周转";
-		curDayworkItem.value.turnoverArea = selection.value.map((item) => {return item.code;}).join('、')
-		// 0627 将turnoverId存入dayworkItem,多选将Id进行拼接
-		curDayworkItem.value.turnoverId = selection.value.map((item) => {return item.id;}).join('、')
-		/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
-		curDayworkItem.value.deptCode = 170000;
-		close();
-		turnoverOutsource(curDayworkItem.value).then(res => {
-			if (res.code === 200) {
-				uni.showToast({
-					icon: 'success',
-					title: '操作成功'
-				});
-				emit('reflushDaywork');
+			lastRequestTimestamp.value = currentTime;
+			curDayworkItem.value.id = null;
+			curDayworkItem.value.processStepNumber = dayworkInfo.value.currentProcess.processStepNumber
+			curDayworkItem.value.startTime = timestampToTime(new Date());
+			curDayworkItem.value.endTime = timestampToTime(new Date());
+			curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
+			curDayworkItem.value.dayworkId = dayworkInfo.value.id;
+			curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
+			curDayworkItem.value.status = '4';
+			if (!store.tenantId) {
+				curDayworkItem.value.tenantId = store.userInfo.tenantId;
 			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration:2000
-				});
-				setTimeout(() => {
-				 emit('reflushDaywork')
-				}, 1000);
+				curDayworkItem.value.tenantId = store.tenantId;
 			}
-		})
+			//curDayworkItem.value.turnoverArea = "外协周转";
+			curDayworkItem.value.turnoverArea = selection.value.map((item) => {
+				return item.code;
+			}).join('、')
+			// 0627 将turnoverId存入dayworkItem,多选将Id进行拼接
+			curDayworkItem.value.turnoverId = selection.value.map((item) => {
+				return item.id;
+			}).join('、')
+			/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
+			curDayworkItem.value.deptCode = 170000;
+			close();
+			turnoverOutsource(curDayworkItem.value).then(res => {
+				if (res.code === 200) {
+					uni.showToast({
+						icon: 'success',
+						title: '操作成功'
+					});
+					emit('reflushDaywork');
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					});
+					setTimeout(() => {
+						emit('reflushDaywork')
+					}, 1000);
+				}
+			})
 		}
 	}
 
@@ -335,17 +344,17 @@
 			handleConfirmOutsource();
 		} else {
 			const currentTime = Date.now();
-				
-				// 检查是否已经过去了 2 秒
-				if (currentTime - lastRequestTimestamp.value < 2000) {
-					// 如果在 2 秒 内已经有请求发出,那么不执行
-					uni.showToast({
-						icon: 'none',
-						title: `请勿重复点击`,
-						duration: 2000
-					})
-					return;
-				}
+
+			// 检查是否已经过去了 2 秒
+			if (currentTime - lastRequestTimestamp.value < 2000) {
+				// 如果在 2 秒 内已经有请求发出,那么不执行
+				uni.showToast({
+					icon: 'none',
+					title: `请勿重复点击`,
+					duration: 2000
+				})
+				return;
+			}
 			lastRequestTimestamp.value = currentTime;
 			console.log(dayworkInfo.value)
 			curDayworkItem.value.id = null;
@@ -391,7 +400,7 @@
 				//0628将位置id也拼接的方式存下来
 				curDayworkItem.value.turnoverId = newIdArray.join('、');
 			}
-			
+
 			// curDayworkItem.value.dayworkId = store.dayworkInfo.id;
 			// 设置周转下一个车间名
 			for (let i = 0; i < deptList.value.length; i++) {
@@ -408,10 +417,10 @@
 				});
 			} else {
 				curDayworkItem.value.isNextPacking = false
-				if(normalStatus.value) {
+				if (normalStatus.value) {
 					curDayworkItem.value.isNextPacking = true
 				}
-				
+
 				close();
 				turnover(curDayworkItem.value).then(res => {
 					if (res.code === 200) {
@@ -426,12 +435,12 @@
 						uni.showToast({
 							icon: 'none',
 							title: res.msg,
-							duration:2000
+							duration: 2000
 						});
 						setTimeout(() => {
-						 emit('reflushDaywork')
+							emit('reflushDaywork')
 						}, 1000);
-						
+
 					}
 				})
 			}
@@ -442,11 +451,11 @@
 	}
 
 	function handleChangeInside() {
-		let deptInfo = deptList.value.find(item=>  item.deptId == curDayworkItem.value.deptId )
+		let deptInfo = deptList.value.find(item => item.deptId == curDayworkItem.value.deptId)
 		console.log(deptInfo)
-		if(deptInfo.isSortPackaging == 1){
+		if (deptInfo.isSortPackaging == 1) {
 			normalStatus.value = true
-		}else{
+		} else {
 			normalStatus.value = false
 		}
 		turnAreaList.value = [];
@@ -463,11 +472,11 @@
 	}
 
 	function handleChangeOutside() {
-		let deptInfo = deptList.value.find(item=>  item.deptId == curDayworkItem.value.deptId )
+		let deptInfo = deptList.value.find(item => item.deptId == curDayworkItem.value.deptId)
 		console.log(deptInfo)
-		if(deptInfo.isSortPackaging == 1){
+		if (deptInfo.isSortPackaging == 1) {
 			normalStatus.value = true
-		}else{
+		} else {
 			normalStatus.value = false
 		}
 	}