ezhizao_zx před 8 měsíci
rodič
revize
4f426ad22b

+ 245 - 191
pages/deliveryInspection/form.vue

@@ -51,14 +51,14 @@
 		</view>
 		<view class="unfit-container">
 			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
-			<view class="resu uni-row">
-				<view class="label">检查标准</view>
-				<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
-				<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
-					@click="handleDelWaste(index)" />
-			</view>
-			
-			<!-- <view class="result uni-row">
+				<view class="resu uni-row">
+					<view class="label">检查标准</view>
+					<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
+					<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
+						@click="handleDelWaste(index)" />
+				</view>
+
+				<!-- <view class="result uni-row">
 				<view class="label">检查结果</view>
 				<input v-model="item.checkResult" placeholder="请输入检查结果" />
 				<view class="label" style="text-align: right; padding-right: 16rpx;">数量
@@ -66,29 +66,29 @@
 				<input class="number" type="number" @blur="rejectNumberChange" v-model="item.rejectNum"
 					placeholder="" />
 			</view> -->
-			<view class="resu uni-row">
-				<view class="label">检查结果</view>
-				<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
-			</view>
-			<view class="resu uni-row">
-				<view class="label">超差范围</view>
-				<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
-			</view>
-			<view class="resu uni-row">
-				<view :class="!editable() ? 'label' : ''">检查量</view>
-				<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-					v-model="item.examiningNum" placeholder="" />
-				<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
-				<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
-				<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-					v-model="item.disqualificationNum" placeholder="" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
-			</view>
+				<view class="resu uni-row">
+					<view class="label">检查结果</view>
+					<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view class="label">超差范围</view>
+					<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view :class="!editable() ? 'label' : ''">检查量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.examiningNum" placeholder="" />
+					<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
+					<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.disqualificationNum" placeholder="" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
+				</view>
 			</view>
 		</view>
-<!-- 拍照上传部分 -->
+		<!-- 拍照上传部分 -->
 		<view class="title unfit-title uni-row">
 			<text>拍照上传</text>
 		</view>
@@ -96,7 +96,8 @@
 		margin: 0 16rpx;
 		background-color: #ffffff;
 		border-radius: 12rpx;">
-		<uni-file-picker v-model="photoList" :readonly="!editable()"   return-type="array" :image-styles="imageStyles" @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto" ></uni-file-picker>
+			<uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles"
+				@select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto"></uni-file-picker>
 		</view>
 		<!-- 咨询部分 -->
 		<view class="title unfit-title uni-row">
@@ -107,7 +108,8 @@
 				<view class="question uni-column">
 					<view class="label uni-row">
 						<text>问题描述</text>
-						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}} {{ selectText(item) }}</text>
+						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}}
+							{{ selectText(item) }}</text>
 					</view>
 					<view class="content">{{ item.content }}</view>
 				</view>
@@ -128,14 +130,27 @@
 					:localdata="range"></uni-data-checkbox>
 			</view>
 			<view v-if="editable()">
-			<view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
-				<text class="label">是否移交仪器室</text><text>&nbsp;否</text>
-				<switch class="switch" @change="switchChange"  style="transform:scale(0.7);margin-top: -16rpx;" color="rgba(255,85,85,1)" />
-				<text>是</text>
-			</view>
-			<view v-else class="list-title uni-row" style="margin-top: 16rpx;">
-				<text class="label">已经移交给仪器室</text>
-			</view>
+				<view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">是否移交仪器室</text><text>&nbsp;否</text>
+					<!-- <switch class="switch" @change="switchChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="processInspecion.flag" @change="switchChange" active-color="rgba(255,85,85,1)"
+						:size="18" style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
+				<view v-else class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">已经移交给仪器室</text>
+				</view>
+				<view class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">全项已检</text><text>&nbsp;否</text>
+					<!-- <switch :checked="isAllChecked" class="switch" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="isAllChecked" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" active-color="rgba(255,85,85,1)" :size="18"
+						style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
 			</view>
 			<view class="remark uni-row">
 				<view class="label">备注</view>
@@ -180,13 +195,16 @@
 	import {
 		getInspectionStandardsList
 	} from '@/api/business/inspectionStandards.js'
-	import {getURL} from '@/api/sys/user.js'
+	import {
+		getURL
+	} from '@/api/sys/user.js'
 	const lot = ref({})
 	const isEventTriggered = ref(false); // 创建一个标志位
 	const unfitInfos = ref([]) //废品信息
 	const consultations = ref([]) //咨询信息
 	const flag = ref(false)
 	const showTransfer = ref(true)
+	const isAllChecked = ref(false)
 	const selectInspectionChamber = ref(null)
 	// 创建一个引用来存储最后一次请求的时间戳
 	const lastRequestTimestamp = ref(0);
@@ -202,9 +220,9 @@
 	const selected = ref([]);
 	const selectedPhotos = ref([])
 	const imageStyles = {
-				width:60,
-				height:60
-			}
+		width: 60,
+		height: 60
+	}
 	const initStatus = ref(0)
 	const editable = () => {
 		// if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:edit')) {
@@ -249,7 +267,7 @@
 
 	/***************************** 页面生命周期函数 *****************************/
 
-	function init(){
+	function init() {
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 
@@ -268,60 +286,65 @@
 		uni.$off('addWasteInfoEvent');
 		console.log(store.processInspection)
 		console.log(flag.value)
-		if(!flag.value){
+		if (!flag.value) {
 			console.log("888")
-		if (store.processInspection != null) {
-			uni.showLoading({
-				title: '加载中'
-			});
-			processInspecion.value = store.processInspection
-			selectInspecion(processInspecion.value).then(res => {
-				if (res.code == 200) {
-					processInspecion.value = res.data;
-					processInspecion.value.flag = false
-					unfitInfos.value = res.data.processInspectionDetails;
-					initStatus.value = res.data.status
-					consultations.value = res.data.dayworkItemConsults;
-					selectedPhotos.value = res.data.processInspectionPictureList
-					photoList.value = res.data.processInspectionPictureList.map(item => {  
-					  return { ...item, url: webHost.value + item.url };
-					});
-					console.log("res", res);
-					console.log(processInspecion.value)
-					//是否已经移交仪器室
-					getInstrumentRoomInspectionList()
-					uni.hideLoading();
-					// getInspecion();
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: res.msg,
-						duration: 2000
-					})
-				}
-			});
-		}else{
-			console.log("99999")
-			init()
-		}
+			if (store.processInspection != null) {
+				uni.showLoading({
+					title: '加载中'
+				});
+				processInspecion.value = store.processInspection
+				isAllChecked.value = (processInspecion.value.isAllChecked == 1)
+				selectInspecion(processInspecion.value).then(res => {
+					if (res.code == 200) {
+						processInspecion.value = res.data;
+						processInspecion.value.flag = false
+						unfitInfos.value = res.data.processInspectionDetails;
+						initStatus.value = res.data.status
+						consultations.value = res.data.dayworkItemConsults;
+						selectedPhotos.value = res.data.processInspectionPictureList
+						photoList.value = res.data.processInspectionPictureList.map(item => {
+							return {
+								...item,
+								url: webHost.value + item.url
+							};
+						});
+						console.log("res", res);
+						console.log(processInspecion.value)
+						//是否已经移交仪器室
+						getInstrumentRoomInspectionList()
+						uni.hideLoading();
+						// getInspecion();
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 2000
+						})
+					}
+				});
+			} else {
+				console.log("99999")
+				init()
+			}
 		}
 	})
+
 	function getOringicalList() {
 		console.log(processInspecion.value)
-			//查询该产品,当前工序,当前检查绑定的检查
-				getInspectionStandardsList({
-					productId:processInspecion.value.lot.productId,
-					processId:processInspecion.value.lot.processId,
-					inspectionCode:"deliveryInspection"
-					}).then(res =>{
-						unfitInfos.value = res.rows.map(item => {
-						    // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
-						    return {
-						      inspectionStandardsId: item.id, // 从 item 中获取 id
-						      checkStandard: item.standard // 从 item 中获取 standard
-						    };
-						  });
-			})
+		//查询该产品,当前工序,当前检查绑定的检查
+		getInspectionStandardsList({
+			productId: processInspecion.value.lot.productId,
+			processId: processInspecion.value.lot.processId,
+			inspectionCode: "deliveryInspection"
+		}).then(res => {
+			unfitInfos.value = res.rows.map(item => {
+				// 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
+				return {
+					inspectionStandardsId: item.id, // 从 item 中获取 id
+					checkStandard: item.standard // 从 item 中获取 standard
+				};
+			});
+		})
 	}
 
 	/***************************** 定义了一些方法 *****************************/
@@ -332,93 +355,120 @@
 				return consul[i].text
 			}
 		}
-	} 
+	}
+
 	function upLoadImageHandler(arg) {
 		console.log(arg)
-		getURL(arg).then(res =>{
+		getURL(arg).then(res => {
 			let data = JSON.parse(res)
-						   selectedPhotos.value.push({
-							   url:data.fileName,
-							   pictureName:data.originalFilename
-						   })
-						   console.log(selectedPhotos.value)
-						   })
+			selectedPhotos.value.push({
+				url: data.fileName,
+				pictureName: data.originalFilename
+			})
+			console.log(selectedPhotos.value)
+		})
 	}
-	function select (e) {
+
+	function select(e) {
 		console.log(e)
 		const {
 			tempFilePaths,
 			tempFiles
-		} = e	
-		tempFiles.forEach((item,index)=>{
-			upLoadImageHandler({ filePath: tempFilePaths[index],name:item.name})
+		} = e
+		tempFiles.forEach((item, index) => {
+			upLoadImageHandler({
+				filePath: tempFilePaths[index],
+				name: item.name
+			})
 		})
 	}
+
 	function handleDeletedPhoto(e) {
 		let fileName = selectedPhotos.value.map(info => info.pictureName)
 		const firstSlashIndex = e.tempFile.url.lastIndexOf('/');
 		const lastSlashIndex = e.tempFile.url.lastIndexOf('_');
-		const type = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex)
-		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex) +e.tempFile.url.substring(e.tempFile.url.lastIndexOf('.') -1 + 1);;
-			let index = -1; // 初始化 index 为 -1,表示未找到
-	
-			// 首先检查 e.tempFile.name 是否存在
-			if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.name);
-			} 
-			// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
-			else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.pictureName);
-			} 
-			// 如果以上两个都不存在,检查 pictureName 是否存在
-			else if (fileName.findIndex(name => name === pictureName) !== -1) {
-				index = fileName.findIndex(name => name === pictureName);
-			}
-			selectedPhotos.value.splice(index,1)
+		const type = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex)
+		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex) + e.tempFile.url.substring(e
+			.tempFile.url.lastIndexOf('.') - 1 + 1);;
+		let index = -1; // 初始化 index 为 -1,表示未找到
+
+		// 首先检查 e.tempFile.name 是否存在
+		if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.name);
+		}
+		// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
+		else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.pictureName);
+		}
+		// 如果以上两个都不存在,检查 pictureName 是否存在
+		else if (fileName.findIndex(name => name === pictureName) !== -1) {
+			index = fileName.findIndex(name => name === pictureName);
+		}
+		selectedPhotos.value.splice(index, 1)
 	}
-	function handleDrawingMenu(){
-		  // 对 technologicalProcessDetailId 进行URL编码
-		  var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
-		  var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
-		  var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
-		  var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
-		  var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
-		  // 构建查询参数字符串
-		  var queryParam = `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
-		
-		  // 使用模板字符串构建完整的URL
-		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
-		
-		  // 导航到指定页面
-		  uni.navigateTo({
+
+	function handleDrawingMenu() {
+		// 对 technologicalProcessDetailId 进行URL编码
+		var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
+		var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
+		var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
+		var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
+		var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
+		// 构建查询参数字符串
+		var queryParam =
+			`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
+
+		// 使用模板字符串构建完整的URL
+		var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+		// 导航到指定页面
+		uni.navigateTo({
 			url: navigateUrl
-		  });
+		});
 	}
+
 	function switchChange(event) {
-		if (event.detail.value) {
+		console.log(event)
+		// if (event.detail.value) {
+		if (event) {
 			processInspecion.value.flag = true
+			processInspecion.value.isAllChecked = 0
+			isAllChecked.value = false
 		} else {
 			processInspecion.value.flag = false
 		}
 	}
 
+	function switchAllCheckChange(event) {
+		console.log(event)
+		// if (event.detail.value) {
+		if (event) {
+			processInspecion.value.isAllChecked = 1
+		} else {
+			processInspecion.value.isAllChecked = 0
+		}
+	}
+
 	const rejectNumberChange = () => {
-	let sumDisqualificationNum = 0
-	let sumExaminingNum = 0
-	unfitInfos.value.forEach(v => {
-		sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
-		sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
-	})
-	processInspecion.value.disqualificationNum = sumDisqualificationNum
-	processInspecion.value.examiningNum = sumExaminingNum
-	console.log(processInspecion.value)
+		let sumDisqualificationNum = 0
+		let sumExaminingNum = 0
+		unfitInfos.value.forEach(v => {
+			sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
+			sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
+		})
+		processInspecion.value.disqualificationNum = sumDisqualificationNum
+		processInspecion.value.examiningNum = sumExaminingNum
+		console.log(processInspecion.value)
 	}
+
 	function getInstrumentRoomInspectionList() {
-		getInstrumentRoomInspection(processInspecion.value).then(res =>{
-			if(res.data.length >0) {
+		getInstrumentRoomInspection(processInspecion.value).then(res => {
+			if (res.data.length > 0) {
 				showTransfer.value = false
-			}else {
+				processInspecion.value.flag = true
+			} else {
 				showTransfer.value = true
+				processInspecion.value.flag = false
 			}
 		})
 	}
@@ -461,8 +511,8 @@
 				})
 				return
 			}
-			}
-	
+		}
+
 
 		if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
 			uni.showToast({
@@ -500,34 +550,34 @@
 		processInspecion.value.inspectionCarrierCode = processInspecion.value.lot.inspectionCarrierCode
 		processInspecion.value.processInspectionPictureList = selectedPhotos.value
 		console.log(processInspecion.value)
-		if(processInspecion.value.flag) {
+		if (processInspecion.value.flag) {
 			//打开选择仪器室的弹窗
 			selectInspectionChamber.value.open()
 			console.log(processInspecion.value)
-		}else{
-		saveDeliveryInspecion(processInspecion.value).then(res => {
-			if (res.code == 200) {
-				let index = 0;
+		} else {
+			saveDeliveryInspecion(processInspecion.value).then(res => {
+				if (res.code == 200) {
+					let index = 0;
 
-				for (let i = 0; i < pages.length; i++) {
+					for (let i = 0; i < pages.length; i++) {
 
-					if (pages[i].$page.fullPath == "/pages/deliveryInspection/index") {
+						if (pages[i].$page.fullPath == "/pages/deliveryInspection/index") {
 
-						index = pages.length - i - 1;
+							index = pages.length - i - 1;
+						}
 					}
+					console.log("index", index);
+					uni.navigateBack({
+						delta: index
+					});
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					})
 				}
-				console.log("index", index);
-				uni.navigateBack({
-					delta: index
-				});
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration: 2000
-				})
-			}
-		});
+			});
 		}
 	}
 	//仪器室带回
@@ -539,9 +589,9 @@
 				let index = 0;
 				let pages = getCurrentPages();
 				for (let i = 0; i < pages.length; i++) {
-		
+
 					if (pages[i].$page.fullPath == "/pages/deliveryInspection/index") {
-		
+
 						index = pages.length - i - 1;
 					}
 				}
@@ -570,7 +620,7 @@
 	}
 
 	const addWasteInfo = (data) => {
-		console.log(data,"55555555")
+		console.log(data, "55555555")
 		flag.value = true
 		var info = {
 			inspectionStandardsId: data.id,
@@ -580,11 +630,11 @@
 		console.log(data)
 	}
 	const addConsultation = (data) => {
-	let info = data
-	info.forEach(item =>{
-		item.status = 0
-	})
-      consultations.value = consultations.value.concat(info)
+		let info = data
+		info.forEach(item => {
+			item.status = 0
+		})
+		consultations.value = consultations.value.concat(info)
 		isEventTriggered.value = true; // 更新标志位状态
 	}
 
@@ -600,10 +650,10 @@
 		var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
 		// 构建查询参数字符串
 		var queryParam = `param1=${encodedId}&param2=${enprocessId}`;
-				
+
 		// 使用模板字符串构建完整的URL
 		var navigateUrl = `/pages/deliveryInspection/options?${queryParam}`;
-				
+
 		// 导航到指定页面
 		uni.navigateTo({
 			url: navigateUrl
@@ -681,6 +731,7 @@
 			.label {
 				width: 160rpx;
 			}
+
 			.drawing-btn {
 				padding: 12rpx 32rpx;
 				background-color: #0055ff;
@@ -850,6 +901,7 @@
 				text-align: center;
 			}
 		}
+
 		.switch {
 			margin-top: -8rpx;
 			align-items: center;
@@ -899,18 +951,20 @@
 			}
 		}
 	}
-input:disabled {
-    background-color: #aaaaff !important;
-    color: #ccc !important; /* 假设您想要设置文本颜色 */
-}
+
+	input:disabled {
+		background-color: #aaaaff !important;
+		color: #ccc !important;
+		/* 假设您想要设置文本颜色 */
+	}
+
 	.my-files {
 		display: flex;
 		justify-content: center;
-		
+
 		:deep(.uni-file-picker__container) {
-		flex-direction: row;
-			
+			flex-direction: row;
+
 		}
 	}
-
 </style>

+ 136 - 133
pages/deliveryInspection/scan.vue

@@ -2,45 +2,44 @@
 	<view class="page-container uni-column">
 		<view class="consultation-container uni-column">
 			<view class="info-row uni-row">
-					<view class="label">批次号</view>
-					<view class="value">{{ lot.lotCode }}</view>
-				</view>
-				<view class="info-row uni-row">
-					<view class="label">图号</view>
-					<view class="value">{{ lot.drawingNumber }}</view>
-				</view>
-				<view class="info-row uni-row">
-					<view class="label">工艺版本</view>
-					<view class="value">{{ lot.technologyVersion }}</view>
-				</view>
-				<view class="info-row uni-row">
-					<view class="label">产品描述</view>
-					<view class="value">{{ lot.productDescription }}</view>
-				</view>
-				<view class="info-row uni-row">
-					<view class="label">当前工序</view>
-					<view class="value">{{ lot.processAlias }}</view>
-				</view>
-				<view class="info-row uni-row">
-					<view class="label">当前工段</view>
-					<view class="value">{{ lot.deptName }}</view>
-				</view>
-				<view class="info-row uni-row" style="margin-top: 40rpx;">
-						<view class="label">操作者</view>
-						<view class="value">	
-						<uni-data-select v-model="userId" :localdata="userList"
-						:clear="false" @change="handleGetEquipmentList"
+				<view class="label">批次号</view>
+				<view class="value">{{ lot.lotCode }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">图号</view>
+				<view class="value">{{ lot.drawingNumber }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">工艺版本</view>
+				<view class="value">{{ lot.technologyVersion }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ lot.productDescription }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">当前工序</view>
+				<view class="value">{{ lot.processAlias }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">当前工段</view>
+				<view class="value">{{ lot.deptName }}</view>
+			</view>
+			<view class="info-row uni-row" style="margin-top: 40rpx;">
+				<view class="label">操作者</view>
+				<view class="value">
+					<uni-data-select v-model="userId" :localdata="userList" :clear="false"
+						@change="handleGetEquipmentList"
 						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
 				</view>
-					</view>
-				<view class="info-row uni-row" style="margin-top: 40rpx;">
-					<view class="label">加工设备</view>
-					<view class="value">	
-					<uni-data-select v-model="equipment" :localdata="equipmentList"
-					:clear="false"
-					style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
 			</view>
+			<view class="info-row uni-row" style="margin-top: 40rpx;">
+				<view class="label">加工设备</view>
+				<view class="value">
+					<uni-data-select v-model="equipment" :localdata="equipmentList" :clear="false"
+						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
 				</view>
+			</view>
 			<view class="info-row uni-row">
 				<view class="label">所有箱号</view>
 				<view class="value">{{ lot.allCarrierName }}</view>
@@ -95,7 +94,7 @@
 	// 页面生命周期函数
 	onLoad(() => {})
 	const handleScanCode = () => {
-	// 引入原生插件
+		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
 		if (mpaasScanModule) {
 			// 调用插件的 mpaasScan 方法
@@ -129,7 +128,7 @@
 						if (response.code == 200) {
 							// 判断是哪种返回值 假设是想信息则给lot附检查箱信息
 							// 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
-						if (response.data.dayworkCarriers != null) {
+							if (response.data.dayworkCarriers != null) {
 								if (response.data.dayworkCarriers.length > 1) {
 									query.value = result;
 									selectProcessInspection.value.open(response.data.dayworkCarriers)
@@ -143,26 +142,26 @@
 									getDeliveryLotInfo(result).then(res => {
 										if (res.code == 200) {
 											console.log(res)
-											
-											if(res.data.dayworkItemList.length == 0) {
+
+											if (res.data.dayworkItemList.length == 0) {
 												uni.showToast({
 													icon: 'none',
 													title: "该批次当天没有报工",
 													duration: 2000
 												})
-											}else{
+											} else {
 												getUser(res.data.dayworkItemList)
-												getEquipment(res.data.dayworkItemList)	
-																lot.value = {
-																	...lot.value,
-																	...res.data
-																};	
-											lot.value.carrierCode = result.carrierCode
-											carrierCode.value = result.carrierCode;
-											// console.log("res", res);
-											uni.hideLoading();
-											// 判断是否批次号和检查箱码都扫完
-											checkSave()
+												getEquipment(res.data.dayworkItemList)
+												lot.value = {
+													...lot.value,
+													...res.data
+												};
+												lot.value.carrierCode = result.carrierCode
+												carrierCode.value = result.carrierCode;
+												// console.log("res", res);
+												uni.hideLoading();
+												// 判断是否批次号和检查箱码都扫完
+												checkSave()
 											}
 										} else {
 											uni.showToast({
@@ -178,7 +177,7 @@
 											duration: 2000
 										})
 									})
-						
+
 								}
 							} else if (response.data.inspectionCarrier != null) {
 								console.log(response)
@@ -205,7 +204,7 @@
 			)
 		} else {
 			const result = {
-				carrierCode: '000948'
+				carrierCode: '000052'
 			}
 			getCarrierInfo(result).then(response => {
 				if (response.code == 200) {
@@ -225,28 +224,28 @@
 							getDeliveryLotInfo(result).then(res => {
 								if (res.code == 200) {
 									console.log(res)
-									
-									if(res.data.dayworkItemList.length == 0) {
+
+									if (res.data.dayworkItemList.length == 0) {
 										uni.showToast({
 											icon: 'none',
 											title: "该批次当天没有报工",
 											duration: 2000
 										})
-									}else{
+									} else {
 										getUser(res.data.dayworkItemList)
-										getEquipment(res.data.dayworkItemList)	
-														lot.value = {
-															...lot.value,
-															...res.data
-														};	
-									lot.value.carrierCode = result.carrierCode
-									carrierCode.value = result.carrierCode;
-									lot.value.inspectionCarrierId = '1803605009558978562'
-									lot.value.inspectionCarrierCode = "300057"
-									// console.log("res", res);
-									uni.hideLoading();
-									// 判断是否批次号和检查箱码都扫完
-									checkSave()
+										getEquipment(res.data.dayworkItemList)
+										lot.value = {
+											...lot.value,
+											...res.data
+										};
+										lot.value.carrierCode = result.carrierCode
+										carrierCode.value = result.carrierCode;
+										lot.value.inspectionCarrierId = '1803605009558978562'
+										lot.value.inspectionCarrierCode = "300057"
+										// console.log("res", res);
+										uni.hideLoading();
+										// 判断是否批次号和检查箱码都扫完
+										checkSave()
 									}
 								} else {
 									uni.showToast({
@@ -286,8 +285,9 @@
 				})
 			})
 		}
-		
+
 	}
+
 	function checkSave() {
 		if (lot.value.lotCode == '' || lot.value.lotCode == null) {
 			debounce(handleScanCode, 700)
@@ -296,6 +296,7 @@
 			debounce(handleScanCode, 700)
 		}
 	}
+
 	function handleGetEquipmentList() {
 		getEquipment(lot.value.dayworkItemList)
 	}
@@ -306,14 +307,14 @@
 		let filterList = data.filter(info => info.userId == userId.value)
 		console.log(filterList)
 		filterList.forEach(item => {
-		  // 检查 Map 中是否已经有这个 equimentDetailId
-		  if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
-		    // 如果没有,添加到 Map 中
-		    uniqueEquipmentMap.set(item.equipmentDetailId, {
-		      value: item.equipmentDetailId,
-		      text: item.equipmentDetailCode
-		    });
-		  }
+			// 检查 Map 中是否已经有这个 equimentDetailId
+			if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
+				// 如果没有,添加到 Map 中
+				uniqueEquipmentMap.set(item.equipmentDetailId, {
+					value: item.equipmentDetailId,
+					text: item.equipmentDetailCode
+				});
+			}
 		});
 		// 将 Map 的值转换为数组
 		equipmentList.value = Array.from(uniqueEquipmentMap.values());
@@ -321,18 +322,19 @@
 		console.log(equipmentList.value)
 		console.log(equipmentList.value)
 	}
+
 	function getUser(data) {
 		const uniqueUserMap = new Map();
 		console.log(data)
 		data.forEach(item => {
-		  // 检查 Map 中是否已经有这个 equimentDetailId
-		  if (!uniqueUserMap.has(item.userId)) {
-		    // 如果没有,添加到 Map 中
-		    uniqueUserMap.set(item.userId, {
-		      value: item.userId,
-		      text: item.nickName
-		    });
-		  }
+			// 检查 Map 中是否已经有这个 equimentDetailId
+			if (!uniqueUserMap.has(item.userId)) {
+				// 如果没有,添加到 Map 中
+				uniqueUserMap.set(item.userId, {
+					value: item.userId,
+					text: item.nickName
+				});
+			}
 		});
 		console.log(uniqueUserMap)
 		// 将 Map 的值转换为数组
@@ -347,80 +349,81 @@
 		uni.showLoading({
 			title: '加载中'
 		});
-	getLotInfo(query.value).then(res => {
-		if (res.code == 200) {
-			console.log(res)
-			
-			if(res.data.dayworkItemList.length == 0) {
+		getLotInfo(query.value).then(res => {
+			if (res.code == 200) {
+				console.log(res)
+
+				if (res.data.dayworkItemList.length == 0) {
+					uni.showToast({
+						icon: 'none',
+						title: "该批次当天没有报工",
+						duration: 2000
+					})
+				} else {
+					console.log("888")
+					getUser(res.data.dayworkItemList)
+					getEquipment(res.data.dayworkItemList)
+					lot.value = {
+						...lot.value,
+						...res.data
+					};
+					lot.value.carrierCode = query.value.carrierCode
+					carrierCode.value = query.value.carrierCode;
+					// console.log("res", res);
+					uni.hideLoading();
+					// 判断是否批次号和检查箱码都扫完
+					checkSave()
+				}
+			} else {
 				uni.showToast({
 					icon: 'none',
-					title: "该批次当天没有报工",
+					title: res.msg,
 					duration: 2000
 				})
-			}else{
-				console.log("888")
-				getUser(res.data.dayworkItemList)
-				getEquipment(res.data.dayworkItemList)	
-								lot.value = {
-									...lot.value,
-									...res.data
-								};	
-			lot.value.carrierCode = query.value.carrierCode
-			carrierCode.value = query.value.carrierCode;
-			// console.log("res", res);
-			uni.hideLoading();
-			// 判断是否批次号和检查箱码都扫完
-			checkSave()
 			}
-		} else {
+		}).catch(err => {
 			uni.showToast({
 				icon: 'none',
-				title: res.msg,
+				title: err.message,
 				duration: 2000
 			})
-		}
-	}).catch(err => {
-		uni.showToast({
-			icon: 'none',
-			title: err.message,
-			duration: 2000
 		})
-	})
 	}
 
 	//确定后,将批次id,批次号,传递过去
 	const handleConfirm = () => {
 		console.log(lot.value)
-		if(lot.value.allCarrierName !=undefined && lot.value.inspectionCarrierId !=undefined){
+		if (lot.value.allCarrierName != undefined && lot.value.inspectionCarrierId != undefined) {
 			lot.value.equipmentDetailId = equipment.value
-			lot.value.equipmentDetailCode = equipmentList.value[equipmentList.value.findIndex(item =>item.value == equipment.value)].text
+			lot.value.equipmentDetailCode = equipmentList.value[equipmentList.value.findIndex(item => item.value ==
+				equipment.value)].text
 			lot.value.userId = userId.value
-			lot.value.nickName = userList.value[userList.value.findIndex(item =>item.value == userId.value)].text
+			lot.value.nickName = userList.value[userList.value.findIndex(item => item.value == userId.value)].text
 			store.processInspection = null
 			uni.navigateTo({
-						url: "/pages/deliveryInspection/form",
-						success: (res) => {
-							// 通过eventChannel向被打开页面传送数据
-							res.eventChannel.emit("deliveryInspectionFrom", {
-								data: lot.value
-							})
-						}
+				url: "/pages/deliveryInspection/form",
+				success: (res) => {
+					// 通过eventChannel向被打开页面传送数据
+					res.eventChannel.emit("deliveryInspectionFrom", {
+						data: lot.value
 					})
-		} else {
-			if(lot.value.allCarrierName == undefined){
-			uni.showToast({
-				icon: 'none',
-				title: "请扫描箱码",
-				duration: 2000
+				}
 			})
-			}else if(lot.value.allCarrierName != undefined && lot.value.inspectionCarrierId == undefined) {
+		} else {
+			if (lot.value.allCarrierName == undefined) {
+				uni.showToast({
+					icon: 'none',
+					title: "请扫描箱码",
+					duration: 2000
+				})
+			} else if (lot.value.allCarrierName != undefined && lot.value.inspectionCarrierId == undefined) {
 				uni.showToast({
 					icon: 'none',
 					title: "请扫描检测载具",
 					duration: 2000
 				})
 			}
-		
+
 			return;
 		}
 

+ 196 - 154
pages/factoryInspection/form.vue

@@ -43,14 +43,14 @@
 		</view>
 		<view class="unfit-container">
 			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
-			<view class="resu uni-row">
-				<view class="label">检查标准</view>
-				<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
-				<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
-					@click="handleDelWaste(index)" />
-			</view>
-			
-			<!-- <view class="result uni-row">
+				<view class="resu uni-row">
+					<view class="label">检查标准</view>
+					<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
+					<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
+						@click="handleDelWaste(index)" />
+				</view>
+
+				<!-- <view class="result uni-row">
 				<view class="label">检查结果</view>
 				<input v-model="item.checkResult" placeholder="请输入检查结果" />
 				<view class="label" style="text-align: right; padding-right: 16rpx;">数量
@@ -58,29 +58,29 @@
 				<input class="number" type="number" @blur="rejectNumberChange" v-model="item.rejectNum"
 					placeholder="" />
 			</view> -->
-			<view class="resu uni-row">
-				<view class="label">检查结果</view>
-				<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
-			</view>
-			<view class="resu uni-row">
-				<view class="label">超差范围</view>
-				<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
-			</view>
-			<view class="resu uni-row">
-				<view :class="!editable() ? 'label' : ''">检查量</view>
-				<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-					v-model="item.examiningNum" placeholder="" />
-				<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
-				<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
-				<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-					v-model="item.disqualificationNum" placeholder="" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
-			</view>
+				<view class="resu uni-row">
+					<view class="label">检查结果</view>
+					<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view class="label">超差范围</view>
+					<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view :class="!editable() ? 'label' : ''">检查量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.examiningNum" placeholder="" />
+					<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
+					<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.disqualificationNum" placeholder="" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
+				</view>
 			</view>
 		</view>
-<!-- 拍照上传部分 -->
+		<!-- 拍照上传部分 -->
 		<view class="title unfit-title uni-row">
 			<text>拍照上传</text>
 		</view>
@@ -88,7 +88,8 @@
 		margin: 0 16rpx;
 		background-color: #ffffff;
 		border-radius: 12rpx;">
-		<uni-file-picker v-model="photoList" :readonly="!editable()"   return-type="array" :image-styles="imageStyles" @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto" ></uni-file-picker>
+			<uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles"
+				@select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto"></uni-file-picker>
 		</view>
 		<!-- 咨询部分 -->
 		<view class="title unfit-title uni-row">
@@ -99,7 +100,8 @@
 				<view class="question uni-column">
 					<view class="label uni-row">
 						<text>问题描述</text>
-						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}} {{ selectText(item) }}</text>
+						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}}
+							{{ selectText(item) }}</text>
 					</view>
 					<view class="content">{{ item.content }}</view>
 				</view>
@@ -113,6 +115,17 @@
 				<uni-data-checkbox :disabled="!editable()" style="margin-top: 20rpx;" v-model="processInspecion.status"
 					:localdata="range"></uni-data-checkbox>
 			</view>
+			<view v-if="editable()">
+				<view class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">全项已检</text><text>&nbsp;否</text>
+					<!-- <switch :checked="isAllChecked" class="switch" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="isAllChecked" @change="switchAllCheckChange" active-color="rgba(255,85,85,1)"
+						:size="18" style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
+			</view>
 			<view class="remark uni-row">
 				<view class="label">备注</view>
 				<textarea v-if="editable()" v-model="processInspecion.remark" />
@@ -153,9 +166,12 @@
 	import {
 		getInspectionStandardsList
 	} from '@/api/business/inspectionStandards.js'
-	import {getURL} from '@/api/sys/user.js'
+	import {
+		getURL
+	} from '@/api/sys/user.js'
 	const lot = ref({})
 	const isEventTriggered = ref(false); // 创建一个标志位
+	const isAllChecked = ref(false)
 	const unfitInfos = ref([]) //废品信息
 	const consultations = ref([]) //咨询信息
 	const flag = ref(false)
@@ -173,16 +189,26 @@
 	const selected = ref([]);
 	const selectedPhotos = ref([])
 	const imageStyles = {
-				width:60,
-				height:60
-			}
+		width: 60,
+		height: 60
+	}
 	const initStatus = ref(0)
 	const editable = () => {
-	if(store.userInfo.roles.some(item =>item.roleKey == 'factoryInspection')) {
-		return true
-	}else{
-		return false
+		if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
+			return true
+		} else {
+			return false
+		}
 	}
+
+	function switchAllCheckChange(event) {
+		console.log(event)
+		// if (event.detail.value) {
+		if (event) {
+			processInspecion.value.isAllChecked = 1
+		} else {
+			processInspecion.value.isAllChecked = 0
+		}
 	}
 
 	const consul = [{
@@ -214,7 +240,7 @@
 	}]
 
 	/***************************** 页面生命周期函数 *****************************/
-	function init(){
+	function init() {
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 
@@ -232,39 +258,42 @@
 		uni.$off('addWasteInfoEvent');
 		console.log(store.processInspection)
 		console.log(flag.value)
-		if(!flag.value){
+		if (!flag.value) {
 			console.log("888")
-		if (store.processInspection != null) {
-			uni.showLoading({
-				title: '加载中'
-			});
-			processInspecion.value = store.processInspection
-			selectInspecion(processInspecion.value).then(res => {
-				if (res.code == 200) {
-					processInspecion.value = res.data;
-					processInspecion.value.flag = false
-					unfitInfos.value = res.data.processInspectionDetails;
-					initStatus.value = res.data.status
-					consultations.value = res.data.dayworkItemConsults;
-					selectedPhotos.value = res.data.processInspectionPictureList
-					photoList.value = res.data.processInspectionPictureList.map(item => {  
-					  return { ...item, url: webHost.value + item.url };
-					});
-					console.log("res", res);
-					console.log(processInspecion.value)
-					uni.hideLoading();
-					// getInspecion();
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: res.msg,
-						duration: 2000
-					})
-				}
-			});
-		}else{
-			init()
-		}
+			if (store.processInspection != null) {
+				uni.showLoading({
+					title: '加载中'
+				});
+				processInspecion.value = store.processInspection
+				selectInspecion(processInspecion.value).then(res => {
+					if (res.code == 200) {
+						processInspecion.value = res.data;
+						processInspecion.value.flag = false
+						unfitInfos.value = res.data.processInspectionDetails;
+						initStatus.value = res.data.status
+						consultations.value = res.data.dayworkItemConsults;
+						selectedPhotos.value = res.data.processInspectionPictureList
+						photoList.value = res.data.processInspectionPictureList.map(item => {
+							return {
+								...item,
+								url: webHost.value + item.url
+							};
+						});
+						console.log("res", res);
+						console.log(processInspecion.value)
+						uni.hideLoading();
+						// getInspecion();
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 2000
+						})
+					}
+				});
+			} else {
+				init()
+			}
 		}
 	})
 
@@ -276,95 +305,105 @@
 				return consul[i].text
 			}
 		}
-	} 
+	}
+
 	function upLoadImageHandler(arg) {
-		getURL(arg).then(res =>{
+		getURL(arg).then(res => {
 			let data = JSON.parse(res)
-						   selectedPhotos.value.push({
-							   url:data.fileName,
-							   pictureName:data.originalFilename
-						   })
-						   console.log(selectedPhotos.value)
-						   })
+			selectedPhotos.value.push({
+				url: data.fileName,
+				pictureName: data.originalFilename
+			})
+			console.log(selectedPhotos.value)
+		})
 	}
-	function select (e) {
+
+	function select(e) {
 		console.log(e)
 		const {
 			tempFilePaths,
 			tempFiles
-		} = e	
-		tempFiles.forEach((item,index)=>{
-			upLoadImageHandler({ filePath: tempFilePaths[index],name:item.name})
+		} = e
+		tempFiles.forEach((item, index) => {
+			upLoadImageHandler({
+				filePath: tempFilePaths[index],
+				name: item.name
+			})
 		})
 	}
-function handleDeletedPhoto(e) {
+
+	function handleDeletedPhoto(e) {
 		let fileName = selectedPhotos.value.map(info => info.pictureName)
 		const firstSlashIndex = e.tempFile.url.lastIndexOf('/');
 		const lastSlashIndex = e.tempFile.url.lastIndexOf('_');
-		const type = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex)
-		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex) +e.tempFile.url.substring(e.tempFile.url.lastIndexOf('.') -1 + 1);;
-			let index = -1; // 初始化 index 为 -1,表示未找到
-
-			// 首先检查 e.tempFile.name 是否存在
-			if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.name);
-			} 
-			// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
-			else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.pictureName);
-			} 
-			// 如果以上两个都不存在,检查 pictureName 是否存在
-			else if (fileName.findIndex(name => name === pictureName) !== -1) {
-				index = fileName.findIndex(name => name === pictureName);
-			}
-			selectedPhotos.value.splice(index,1)
+		const type = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex)
+		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex) + e.tempFile.url.substring(e
+			.tempFile.url.lastIndexOf('.') - 1 + 1);;
+		let index = -1; // 初始化 index 为 -1,表示未找到
+
+		// 首先检查 e.tempFile.name 是否存在
+		if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.name);
+		}
+		// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
+		else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.pictureName);
+		}
+		// 如果以上两个都不存在,检查 pictureName 是否存在
+		else if (fileName.findIndex(name => name === pictureName) !== -1) {
+			index = fileName.findIndex(name => name === pictureName);
+		}
+		selectedPhotos.value.splice(index, 1)
 	}
-	function handleDrawingMenu(){
-		  // 对 technologicalProcessDetailId 进行URL编码
-		  var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
-		  var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
-		  var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
-		  var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
-		  var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
-		  // 构建查询参数字符串
-		  var queryParam = `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
-		
-		  // 使用模板字符串构建完整的URL
-		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
-		
-		  // 导航到指定页面
-		  uni.navigateTo({
+
+	function handleDrawingMenu() {
+		// 对 technologicalProcessDetailId 进行URL编码
+		var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
+		var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
+		var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
+		var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
+		var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
+		// 构建查询参数字符串
+		var queryParam =
+			`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
+
+		// 使用模板字符串构建完整的URL
+		var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+		// 导航到指定页面
+		uni.navigateTo({
 			url: navigateUrl
-		  });
+		});
 	}
+
 	function getOringicalList() {
 		console.log(processInspecion.value)
-			//查询该产品,当前工序,当前检查绑定的检查
-				getInspectionStandardsList({
-					productId:processInspecion.value.lot.productId,
-					processId:processInspecion.value.lot.processId,
-					inspectionCode:"factoryInspection"
-					}).then(res =>{
-						unfitInfos.value = res.rows.map(item => {
-						    // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
-						    return {
-						      inspectionStandardsId: item.id, // 从 item 中获取 id
-						      checkStandard: item.standard // 从 item 中获取 standard
-						    };
-						  });
-			})
+		//查询该产品,当前工序,当前检查绑定的检查
+		getInspectionStandardsList({
+			productId: processInspecion.value.lot.productId,
+			processId: processInspecion.value.lot.processId,
+			inspectionCode: "factoryInspection"
+		}).then(res => {
+			unfitInfos.value = res.rows.map(item => {
+				// 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
+				return {
+					inspectionStandardsId: item.id, // 从 item 中获取 id
+					checkStandard: item.standard // 从 item 中获取 standard
+				};
+			});
+		})
 	}
 
 	const rejectNumberChange = () => {
-	let sumDisqualificationNum = 0
-	let sumExaminingNum = 0
-	unfitInfos.value.forEach(v => {
-		sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
-		sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
-	})
-	processInspecion.value.disqualificationNum = sumDisqualificationNum
-	processInspecion.value.examiningNum = sumExaminingNum
-	console.log(processInspecion.value)
+		let sumDisqualificationNum = 0
+		let sumExaminingNum = 0
+		unfitInfos.value.forEach(v => {
+			sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
+			sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
+		})
+		processInspecion.value.disqualificationNum = sumDisqualificationNum
+		processInspecion.value.examiningNum = sumExaminingNum
+		console.log(processInspecion.value)
 	}
 
 	//查询咨询列表
@@ -404,8 +443,8 @@ function handleDeletedPhoto(e) {
 				})
 				return
 			}
-			}
-	
+		}
+
 
 		if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
 			uni.showToast({
@@ -482,7 +521,7 @@ function handleDeletedPhoto(e) {
 	}
 
 	const addWasteInfo = (data) => {
-		console.log(data,"55555555")
+		console.log(data, "55555555")
 		flag.value = true
 		var info = {
 			inspectionStandardsId: data.id,
@@ -492,11 +531,11 @@ function handleDeletedPhoto(e) {
 		console.log(data)
 	}
 	const addConsultation = (data) => {
-	let info = data
-	info.forEach(item =>{
-		item.status = 0
-	})
-	consultations.value = consultations.value.concat(info)
+		let info = data
+		info.forEach(item => {
+			item.status = 0
+		})
+		consultations.value = consultations.value.concat(info)
 		isEventTriggered.value = true; // 更新标志位状态
 	}
 
@@ -512,10 +551,10 @@ function handleDeletedPhoto(e) {
 		var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
 		// 构建查询参数字符串
 		var queryParam = `param1=${encodedId}&param2=${enprocessId}`;
-				
+
 		// 使用模板字符串构建完整的URL
 		var navigateUrl = `/pages/factoryInspection/options?${queryParam}`;
-				
+
 		// 导航到指定页面
 		uni.navigateTo({
 			url: navigateUrl
@@ -593,6 +632,7 @@ function handleDeletedPhoto(e) {
 			.label {
 				width: 160rpx;
 			}
+
 			.drawing-btn {
 				padding: 12rpx 32rpx;
 				background-color: #0055ff;
@@ -762,6 +802,7 @@ function handleDeletedPhoto(e) {
 				text-align: center;
 			}
 		}
+
 		.switch {
 			margin-top: -8rpx;
 			align-items: center;
@@ -811,13 +852,14 @@ function handleDeletedPhoto(e) {
 			}
 		}
 	}
+
 	.my-files {
 		display: flex;
 		justify-content: center;
-		
+
 		:deep(.uni-file-picker__container) {
-		flex-direction: row;
-			
+			flex-direction: row;
+
 		}
 	}
 </style>

+ 21 - 21
pages/factoryInspection/scan.vue

@@ -205,8 +205,8 @@
 									};
 									lot.value.carrierCode = result.carrierCode
 									carrierCode.value = result.carrierCode;
-									lot.value.inspectionCarrierId = '1803605009550589955'
-									lot.value.inspectionCarrierCode = "300045"
+									lot.value.inspectionCarrierId = '1803605009546395649'
+									lot.value.inspectionCarrierCode = "300038"
 									// console.log("res", res);
 									uni.hideLoading();
 									// 判断是否批次号和检查箱码都扫完
@@ -305,34 +305,34 @@
 			store.processInspection = null
 			let processInspection = {}
 			processInspection.lot = lot.value
-			if(store.userInfo.roles.some(item =>item.roleKey == 'factoryInspection')) {
+			if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
 				processInspection.reviewerId = store.userInfo.userId
-			}else{
+			} else {
 				processInspection.reviewerId = 0
 			}
 			//保存
 			console.log(processInspection)
 			lot.value = {}
-			if(store.userInfo.roles.some(item =>item.roleKey == 'factoryInspection')) {
-			uni.navigateTo({
-						url: "/pages/factoryInspection/form",
-						success: (res) => {
-							// 通过eventChannel向被打开页面传送数据
-							res.eventChannel.emit("factoryInspectionFrom", {
-								data: processInspection.lot
-							})
-						}
+			if (store.userInfo.roles.some(item => item.roleKey == 'factoryInspection')) {
+				uni.navigateTo({
+					url: "/pages/factoryInspection/form",
+					success: (res) => {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit("factoryInspectionFrom", {
+							data: processInspection.lot
+						})
+					}
+				})
+			} else {
+				saveFactoryInspecion(processInspection).then(res => {
+
+					uni.navigateTo({
+						url: '/pages/factoryInspection/index'
 					})
-			}else{
-				saveFactoryInspecion(processInspection).then(res =>{
-		
-						uni.navigateTo({
-					url: '/pages/factoryInspection/index'
-				})		 
 				})
-			
+
 			}
-		
+
 		} else {
 			if (lot.value.allCarrierName == undefined) {
 				uni.showToast({

+ 279 - 219
pages/firstInspection/form.vue

@@ -51,14 +51,14 @@
 		</view>
 		<view class="unfit-container">
 			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
-			<view class="resu uni-row">
-				<view class="label">检查标准</view>
-				<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
-				<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
-					@click="handleDelWaste(index)" />
-			</view>
-			
-			<!-- <view class="result uni-row">
+				<view class="resu uni-row">
+					<view class="label">检查标准</view>
+					<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
+					<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
+						@click="handleDelWaste(index)" />
+				</view>
+
+				<!-- <view class="result uni-row">
 				<view class="label">检查结果</view>
 				<input v-model="item.checkResult" placeholder="请输入检查结果" />
 				<view class="label" style="text-align: right; padding-right: 16rpx;">数量
@@ -66,29 +66,29 @@
 				<input class="number" type="number" @blur="rejectNumberChange" v-model="item.rejectNum"
 					placeholder="" />
 			</view> -->
-	<view class="resu uni-row">
-		<view class="label">检查结果</view>
-		<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
-		<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
-	</view>
-	<view class="resu uni-row">
-		<view class="label">超差范围</view>
-		<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
-		<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
-	</view>
-	<view class="resu uni-row">
-		<view :class="!editable() ? 'label' : ''">检查量</view>
-		<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-			v-model="item.examiningNum" placeholder="" />
-		<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
-		<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
-		<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-			v-model="item.disqualificationNum" placeholder="" />
-		<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
-	</view>
+				<view class="resu uni-row">
+					<view class="label">检查结果</view>
+					<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view class="label">超差范围</view>
+					<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view :class="!editable() ? 'label' : ''">检查量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.examiningNum" placeholder="" />
+					<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
+					<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.disqualificationNum" placeholder="" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
+				</view>
 			</view>
 		</view>
-<!-- 拍照上传部分 -->
+		<!-- 拍照上传部分 -->
 		<view class="title unfit-title uni-row">
 			<text>拍照上传</text>
 		</view>
@@ -96,7 +96,8 @@
 		margin: 0 16rpx;
 		background-color: #ffffff;
 		border-radius: 12rpx;">
-		<uni-file-picker v-model="photoList" :readonly="!editable()"   return-type="array" :image-styles="imageStyles" @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto" ></uni-file-picker>
+			<uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles"
+				@select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto"></uni-file-picker>
 		</view>
 		<!-- 咨询部分 -->
 		<view v-if="editable()" class="title unfit-title uni-row">
@@ -107,7 +108,8 @@
 				<view class="question uni-column">
 					<view class="label uni-row">
 						<text>问题描述</text>
-						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}} {{ selectText(item) }}</text>
+						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}}
+							{{ selectText(item) }}</text>
 					</view>
 					<view class="content">{{ item.content }}</view>
 				</view>
@@ -122,22 +124,35 @@
 					:localdata="range"></uni-data-checkbox>
 			</view>
 			<view v-if="editable()">
-			<view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
-				<text class="label">是否移交仪器室</text><text>&nbsp;否</text>
-				<switch class="switch" @change="switchChange"  style="transform:scale(0.7);margin-top: -16rpx;" color="rgba(255,85,85,1)" />
-				<text>是</text>
-			</view>
-			<view v-else class="list-title uni-row" style="margin-top: 16rpx;">
-				<text class="label">已经移交给仪器室</text>
-			</view>
+				<view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">是否移交仪器室</text><text>&nbsp;否</text>
+					<!-- <switch class="switch" @change="switchChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="processInspecion.flag" @change="switchChange" active-color="rgba(255,85,85,1)"
+						:size="18" style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
+				<view v-else class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">已经移交给仪器室</text>
+				</view>
+				<view class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">全项已检</text><text>&nbsp;否</text>
+					<!-- <switch :checked="isAllChecked" class="switch" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="isAllChecked" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" active-color="rgba(255,85,85,1)" :size="18"
+						style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
 			</view>
-			<view v-if="editable()"  class="remark uni-row">
+			<view v-if="editable()" class="remark uni-row">
 				<view class="label">备注</view>
 				<textarea v-if="editable()" v-model="processInspecion.remark" />
 				<view v-else class="value">{{ processInspecion.remark }}</view>
 			</view>
 
-			<view  class="btns-container uni-row">
+			<view class="btns-container uni-row">
 				<view class="finished-btn" @click="endWork">提交</view>
 				<view v-if="editable()" class="question-btn uni-column" @click.stop="handleAddConsultation">
 					<uni-icons type="headphones" size="24" />
@@ -175,13 +190,16 @@
 	import {
 		getInspectionStandardsList
 	} from '@/api/business/inspectionStandards.js'
-	import {getURL} from '@/api/sys/user.js'
+	import {
+		getURL
+	} from '@/api/sys/user.js'
 	const lot = ref({})
 	const isEventTriggered = ref(false); // 创建一个标志位
 	const unfitInfos = ref([]) //废品信息
 	const consultations = ref([]) //咨询信息
 	const flag = ref(false)
 	const showTransfer = ref(true)
+	const isAllChecked = ref(false)
 	const selectInspectionChamber = ref(null)
 	// 创建一个引用来存储最后一次请求的时间戳
 	const lastRequestTimestamp = ref(0);
@@ -197,15 +215,16 @@
 	const selected = ref([]);
 	const selectedPhotos = ref([])
 	const imageStyles = {
-				width:60,
-				height:60
-			}
+		width: 60,
+		height: 60
+	}
 	const initStatus = ref(0)
 	const editable = () => {
 		if (initStatus.value == 0 && store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
 			return true
 		}
-      if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection') && processInspecion.value.firstUpdaterId == store.userInfo.userId) {
+		if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection') && processInspecion.value
+			.firstUpdaterId == store.userInfo.userId) {
 			return true
 		} else {
 			return false
@@ -242,7 +261,7 @@
 
 	/***************************** 页面生命周期函数 *****************************/
 
-	function init(){
+	function init() {
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 
@@ -257,74 +276,96 @@
 
 	onLoad(() => {
 		uni.$off('addWasteInfoEvent');
-		if(!flag.value){
-		if (store.processInspection != null) {
-			uni.showLoading({
-				title: '加载中'
-			});
-			processInspecion.value = store.processInspection
-			selectInspecion(processInspecion.value).then(res => {
-				if (res.code == 200) {
-					processInspecion.value = res.data;
-					processInspecion.value.flag = false
-					unfitInfos.value = res.data.processInspectionDetails;
-					initStatus.value = res.data.status
-					selectedPhotos.value = res.data.processInspectionPictureList
-					photoList.value = res.data.processInspectionPictureList.map(item => {  
-					  return { ...item, url: webHost.value + item.url };
-					});
-					consultations.value = res.data.dayworkItemConsults;
-					console.log("res", res);
-					console.log(processInspecion.value)
-					//判断是否移交到了仪器室
-					getInstrumentRoomInspectionList()
-					uni.hideLoading();
-					// getInspecion();
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: res.msg,
-						duration: 2000
-					})
-				}
-			});
-		}else{
-			init()
-		}
+		if (!flag.value) {
+			if (store.processInspection != null) {
+				uni.showLoading({
+					title: '加载中'
+				});
+				processInspecion.value = store.processInspection
+				selectInspecion(processInspecion.value).then(res => {
+					if (res.code == 200) {
+						processInspecion.value = res.data;
+						processInspecion.value.flag = false
+						unfitInfos.value = res.data.processInspectionDetails;
+						initStatus.value = res.data.status
+						selectedPhotos.value = res.data.processInspectionPictureList
+						photoList.value = res.data.processInspectionPictureList.map(item => {
+							return {
+								...item,
+								url: webHost.value + item.url
+							};
+						});
+						consultations.value = res.data.dayworkItemConsults;
+						console.log("res", res);
+						console.log(processInspecion.value)
+						//判断是否移交到了仪器室
+						getInstrumentRoomInspectionList()
+						uni.hideLoading();
+						// getInspecion();
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 2000
+						})
+					}
+				});
+			} else {
+				init()
+			}
 		}
 	})
+
 	function getInstrumentRoomInspectionList() {
-		getInstrumentRoomInspection(processInspecion.value).then(res =>{
-			if(res.data.length >0) {
+		getInstrumentRoomInspection(processInspecion.value).then(res => {
+			if (res.data.length > 0) {
 				showTransfer.value = false
-			}else {
+				processInspecion.value.flag = true
+			} else {
 				showTransfer.value = true
+				processInspecion.value.flag = false
 			}
 		})
 	}
+
 	function switchChange(event) {
-		if (event.detail.value) {
+		console.log(event)
+		// if (event.detail.value) {
+		if (event) {
 			processInspecion.value.flag = true
+			processInspecion.value.isAllChecked = 0
+			isAllChecked.value = false
 		} else {
 			processInspecion.value.flag = false
 		}
 	}
+
+	function switchAllCheckChange(event) {
+		console.log(event)
+		// if (event.detail.value) {
+		if (event) {
+			processInspecion.value.isAllChecked = 1
+		} else {
+			processInspecion.value.isAllChecked = 0
+		}
+	}
+
 	function getOringicalList() {
 		console.log(processInspecion.value)
-			//查询该产品,当前工序,当前检查绑定的检查
-				getInspectionStandardsList({
-					productId:processInspecion.value.lot.productId,
-					processId:processInspecion.value.lot.processId,
-					inspectionCode:"firstArticleInspection"
-					}).then(res =>{
-						unfitInfos.value = res.rows.map(item => {
-						    // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
-						    return {
-						      inspectionStandardsId: item.id, // 从 item 中获取 id
-						      checkStandard: item.standard // 从 item 中获取 standard
-						    };
-						  });
-			})
+		//查询该产品,当前工序,当前检查绑定的检查
+		getInspectionStandardsList({
+			productId: processInspecion.value.lot.productId,
+			processId: processInspecion.value.lot.processId,
+			inspectionCode: "firstArticleInspection"
+		}).then(res => {
+			unfitInfos.value = res.rows.map(item => {
+				// 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
+				return {
+					inspectionStandardsId: item.id, // 从 item 中获取 id
+					checkStandard: item.standard // 从 item 中获取 standard
+				};
+			});
+		})
 	}
 
 	/***************************** 定义了一些方法 *****************************/
@@ -335,78 +376,87 @@
 				return consul[i].text
 			}
 		}
-	} 
+	}
+
 	function upLoadImageHandler(arg) {
-		getURL(arg).then(res =>{
+		getURL(arg).then(res => {
 			let data = JSON.parse(res)
-						   selectedPhotos.value.push({
-							   url:data.fileName,
-							   pictureName:data.originalFilename
-						   })
-						   console.log(selectedPhotos.value)
-						   })
+			selectedPhotos.value.push({
+				url: data.fileName,
+				pictureName: data.originalFilename
+			})
+			console.log(selectedPhotos.value)
+		})
 	}
-	function select (e) {
+
+	function select(e) {
 		console.log(e)
 		const {
 			tempFilePaths,
 			tempFiles
-		} = e	
-		tempFiles.forEach((item,index)=>{
-			upLoadImageHandler({ filePath: tempFilePaths[index],name:item.name})
+		} = e
+		tempFiles.forEach((item, index) => {
+			upLoadImageHandler({
+				filePath: tempFilePaths[index],
+				name: item.name
+			})
 		})
 	}
-function handleDeletedPhoto(e) {
+
+	function handleDeletedPhoto(e) {
 		let fileName = selectedPhotos.value.map(info => info.pictureName)
 		const firstSlashIndex = e.tempFile.url.lastIndexOf('/');
 		const lastSlashIndex = e.tempFile.url.lastIndexOf('_');
-		const type = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex)
-		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex) +e.tempFile.url.substring(e.tempFile.url.lastIndexOf('.') -1 + 1);;
-			let index = -1; // 初始化 index 为 -1,表示未找到
-
-			// 首先检查 e.tempFile.name 是否存在
-			if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.name);
-			} 
-			// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
-			else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.pictureName);
-			} 
-			// 如果以上两个都不存在,检查 pictureName 是否存在
-			else if (fileName.findIndex(name => name === pictureName) !== -1) {
-				index = fileName.findIndex(name => name === pictureName);
-			}
-			selectedPhotos.value.splice(index,1)
+		const type = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex)
+		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex) + e.tempFile.url.substring(e
+			.tempFile.url.lastIndexOf('.') - 1 + 1);;
+		let index = -1; // 初始化 index 为 -1,表示未找到
+
+		// 首先检查 e.tempFile.name 是否存在
+		if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.name);
+		}
+		// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
+		else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.pictureName);
+		}
+		// 如果以上两个都不存在,检查 pictureName 是否存在
+		else if (fileName.findIndex(name => name === pictureName) !== -1) {
+			index = fileName.findIndex(name => name === pictureName);
+		}
+		selectedPhotos.value.splice(index, 1)
 	}
-	function handleDrawingMenu(){
-		  // 对 technologicalProcessDetailId 进行URL编码
-		  var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
-		  var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
-		  var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
-		  var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
-		  var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
-		  // 构建查询参数字符串
-		  var queryParam = `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
-		
-		  // 使用模板字符串构建完整的URL
-		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
-		
-		  // 导航到指定页面
-		  uni.navigateTo({
+
+	function handleDrawingMenu() {
+		// 对 technologicalProcessDetailId 进行URL编码
+		var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
+		var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
+		var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
+		var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
+		var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
+		// 构建查询参数字符串
+		var queryParam =
+			`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
+
+		// 使用模板字符串构建完整的URL
+		var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+		// 导航到指定页面
+		uni.navigateTo({
 			url: navigateUrl
-		  });
+		});
 	}
 
 	const rejectNumberChange = () => {
-	let sumDisqualificationNum = 0
-	let sumExaminingNum = 0
-	unfitInfos.value.forEach(v => {
-		sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
-		sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
-	})
-	processInspecion.value.disqualificationNum = sumDisqualificationNum
-	processInspecion.value.examiningNum = sumExaminingNum
-	console.log(processInspecion.value)
+		let sumDisqualificationNum = 0
+		let sumExaminingNum = 0
+		unfitInfos.value.forEach(v => {
+			sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
+			sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
+		})
+		processInspecion.value.disqualificationNum = sumDisqualificationNum
+		processInspecion.value.examiningNum = sumExaminingNum
+		console.log(processInspecion.value)
 	}
 
 	//查询咨询列表
@@ -430,35 +480,35 @@ function handleDeletedPhoto(e) {
 	//结束报工按钮
 	function endWork() {
 		let unf = unfitInfos.value;
-		if(store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
-		for (var i = 0; i < unfitInfos.value.length; i++) {
+		if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
+			for (var i = 0; i < unfitInfos.value.length; i++) {
 
-			if (unf[i].examiningNum < 0 || unf[i].disqualificationNum < 0) {
-				uni.showToast({
-					icon: 'none',
-					title: '检查量,不良品量不能小于0',
-					duration: 2000
-				})
-				return
+				if (unf[i].examiningNum < 0 || unf[i].disqualificationNum < 0) {
+					uni.showToast({
+						icon: 'none',
+						title: '检查量,不良品量不能小于0',
+						duration: 2000
+					})
+					return
+				}
+				if (unf[i].examiningNum > processInspecion.value.lot.pudName) {
+					uni.showToast({
+						icon: 'none',
+						title: '检查量不能大于投产量'
+					})
+					return
+				}
 			}
-			if (unf[i].examiningNum > processInspecion.value.lot.pudName) {
+
+
+			if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
 				uni.showToast({
 					icon: 'none',
-					title: '检查量不能大于投产量'
+					title: '不良品量不能大于投产量'
 				})
 				return
 			}
-			}
-	
-
-		if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
-			uni.showToast({
-				icon: 'none',
-				title: '不良品量不能大于投产量'
-			})
-			return
 		}
-}
 		save();
 
 
@@ -488,40 +538,41 @@ function handleDeletedPhoto(e) {
 		processInspecion.value.processInspectionPictureList = selectedPhotos.value
 		processInspecion.value.isReviewer = store.isReviewer
 		console.log(processInspecion.value)
-		if(processInspecion.value.flag) {
+		if (processInspecion.value.flag) {
 			//打开选择仪器室的弹窗
 			selectInspectionChamber.value.open()
 			console.log(processInspecion.value)
-		}else{
-		saveFirstInspection(processInspecion.value).then(res => {
-			if (res.code == 200) {
-				let index = 0;
-				console.log(store.isReviewer)
-				for (let i = 0; i < pages.length; i++) {
+		} else {
+			saveFirstInspection(processInspecion.value).then(res => {
+				if (res.code == 200) {
+					let index = 0;
+					console.log(store.isReviewer)
+					for (let i = 0; i < pages.length; i++) {
 
-					if (!store.isReviewer && pages[i].$page.fullPath == "/pages/reportingForWork/index") {
+						if (!store.isReviewer && pages[i].$page.fullPath == "/pages/reportingForWork/index") {
 
-						index = pages.length - i - 1;
-					}
-					if (store.isReviewer && pages[i].$page.fullPath == "/pages/firstInspection/index") {
-		
-						index = pages.length - i - 1;
+							index = pages.length - i - 1;
+						}
+						if (store.isReviewer && pages[i].$page.fullPath == "/pages/firstInspection/index") {
+
+							index = pages.length - i - 1;
+						}
 					}
+					console.log("index", index);
+					uni.navigateBack({
+						delta: index
+					});
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					})
 				}
-				console.log("index", index);
-				uni.navigateBack({
-					delta: index
-				});
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration: 2000
-				})
-			}
-		});
+			});
 		}
 	}
+
 	function handleSelectInspectionChamber(data) {
 		processInspecion.value.inspectionChamberId = data
 		console.log(processInspecion.value)
@@ -531,9 +582,9 @@ function handleDeletedPhoto(e) {
 				let pages = getCurrentPages();
 				console.log(store.isReviewer)
 				for (let i = 0; i < pages.length; i++) {
-		
-					if ( pages[i].$page.fullPath == "/pages/reportingForWork/index") {
-		
+
+					if (pages[i].$page.fullPath == "/pages/reportingForWork/index") {
+
 						index = pages.length - i - 1;
 					}
 				}
@@ -564,7 +615,7 @@ function handleDeletedPhoto(e) {
 	}
 
 	const addWasteInfo = (data) => {
-		console.log(data,"55555555")
+		console.log(data, "55555555")
 		flag.value = true
 		var info = {
 			inspectionStandardsId: data.id,
@@ -574,11 +625,11 @@ function handleDeletedPhoto(e) {
 		console.log(data)
 	}
 	const addConsultation = (data) => {
-	let info = data
-	info.forEach(item =>{
-		item.status = 0
-	})
-	consultations.value = consultations.value.concat(info)
+		let info = data
+		info.forEach(item => {
+			item.status = 0
+		})
+		consultations.value = consultations.value.concat(info)
 		isEventTriggered.value = true; // 更新标志位状态
 	}
 
@@ -594,10 +645,10 @@ function handleDeletedPhoto(e) {
 		var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
 		// 构建查询参数字符串
 		var queryParam = `param1=${encodedId}&param2=${enprocessId}`;
-				
+
 		// 使用模板字符串构建完整的URL
 		var navigateUrl = `/pages/firstInspection/options?${queryParam}`;
-				
+
 		// 导航到指定页面
 		uni.navigateTo({
 			url: navigateUrl
@@ -675,6 +726,7 @@ function handleDeletedPhoto(e) {
 			.label {
 				width: 160rpx;
 			}
+
 			.drawing-btn {
 				padding: 12rpx 32rpx;
 				background-color: #0055ff;
@@ -755,9 +807,10 @@ function handleDeletedPhoto(e) {
 					font-size: 28rpx;
 				}
 			}
-		.uni-input-input:disabled {
-		    background-color: #f5f7fa;
-		}
+
+			.uni-input-input:disabled {
+				background-color: #f5f7fa;
+			}
 
 			.result {
 				align-items: center;
@@ -831,10 +884,12 @@ function handleDeletedPhoto(e) {
 		padding: 24rpx;
 		background-color: #ffffff;
 		border: 1px solid #bcbcbc;
-	.switch {
+
+		.switch {
 			margin-top: -4px;
 			//align-items: center;
 		}
+
 		.result {
 			align-items: center;
 
@@ -894,20 +949,25 @@ function handleDeletedPhoto(e) {
 				}
 			}
 		}
+
 		.switch {
 			margin-top: -8rpx;
 			align-items: center;
 			transform: scale(0.7);
 		}
 	}
-	input:disabled {background-color: #00ff00;}
+
+	input:disabled {
+		background-color: #00ff00;
+	}
+
 	.my-files {
 		display: flex;
 		justify-content: center;
-		
+
 		:deep(.uni-file-picker__container) {
-		flex-direction: row;
-			
+			flex-direction: row;
+
 		}
 	}
 </style>

+ 67 - 66
pages/firstInspection/reviewScan.vue

@@ -25,14 +25,14 @@
 				<view class="label">当前工段</view>
 				<view class="value">{{ lot.deptName }}</view>
 			</view>
-	<view class="info-row uni-row" style="margin-top: 40rpx;">
-			<view class="label">操作者</view>
-			<view class="value">	
-			<uni-data-select v-model="userId" :localdata="userList"
-			:clear="false" @change="handleGetEquipmentList"
-			style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
-	</view>
-		</view>
+			<view class="info-row uni-row" style="margin-top: 40rpx;">
+				<view class="label">操作者</view>
+				<view class="value">
+					<uni-data-select v-model="userId" :localdata="userList" :clear="false"
+						@change="handleGetEquipmentList"
+						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+				</view>
+			</view>
 			<view class="info-row uni-row" style="margin-top: 40rpx;">
 				<view class="label">加工设备</view>
 				<view class="value">
@@ -93,7 +93,7 @@
 	const query = ref({})
 	// 页面生命周期函数
 	const handleScanCode = () => {
-	// 引入原生插件
+		// 引入原生插件
 		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
 		if (mpaasScanModule) {
 			// 调用插件的 mpaasScan 方法
@@ -109,7 +109,7 @@
 					const result = {
 						carrierCode: ret.resp_result,
 						processCode: '',
-		               deptId : store.curDeptDetails.deptId
+						deptId: store.curDeptDetails.deptId
 					}
 					if (!result.carrierCode || result.carrierCode == "") {
 						uni.showToast({
@@ -128,7 +128,7 @@
 						if (response.code == 200) {
 							// 判断是哪种返回值 假设是想信息则给lot附检查箱信息
 							// 假设是dayworkCarriers 则 判断是几个批次,假设为多批,则弹出选择框。
-						if (response.data.dayworkCarriers != null) {
+							if (response.data.dayworkCarriers != null) {
 								if (response.data.dayworkCarriers.length > 1) {
 									query.value = result;
 									selectProcessInspection.value.open(response.data.dayworkCarriers)
@@ -143,12 +143,12 @@
 									getFirstInspectionLotInfo(result).then(res => {
 										if (res.code == 200) {
 											console.log(res)
-												getUser(res.data.dayworkItemList)
-												getEquipment(res.data.dayworkItemList)	
-																lot.value = {
-																	...lot.value,
-																	...res.data
-																};	
+											getUser(res.data.dayworkItemList)
+											getEquipment(res.data.dayworkItemList)
+											lot.value = {
+												...lot.value,
+												...res.data
+											};
 											lot.value.carrierCode = result.carrierCode
 											carrierCode.value = result.carrierCode;
 											// console.log("res", res);
@@ -169,7 +169,7 @@
 											duration: 2000
 										})
 									})
-						
+
 								}
 							} else if (response.data.inspectionCarrier != null) {
 								console.log(response)
@@ -196,8 +196,8 @@
 			)
 		} else {
 			const result = {
-				carrierCode: '000613',
-				deptId : store.curDeptDetails.deptId
+				carrierCode: '300027',
+				deptId: store.curDeptDetails.deptId
 			}
 			getCarrierInfo(result).then(response => {
 				if (response.code == 200) {
@@ -207,31 +207,31 @@
 						if (response.data.dayworkCarriers.length > 1) {
 							query.value = result;
 							query.value.deptId = store.curDeptDetails.deptId
-							selectProcessInspection.value.open(response.data.dayworkCarriers)	
-										
+							selectProcessInspection.value.open(response.data.dayworkCarriers)
+
 						} else {
-		
+
 							// console.log(response)
 							uni.showLoading({
 								title: '加载中'
 							});
 							// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
 							// 需要定义一个请求方法, 从后端获取
-							
+
 							getFirstInspectionLotInfo(result).then(res => {
 								if (res.code == 200) {
 									console.log(res)
-										console.log("888")
-										getUser(res.data.dayworkItemList)
-										getEquipment(res.data.dayworkItemList)	
-														lot.value = {
-															...lot.value,
-															...res.data
-														};	
+									console.log("888")
+									getUser(res.data.dayworkItemList)
+									getEquipment(res.data.dayworkItemList)
+									lot.value = {
+										...lot.value,
+										...res.data
+									};
 									lot.value.carrierCode = result.carrierCode
 									carrierCode.value = result.carrierCode;
-									lot.value.inspectionCarrierId = '1803605009533812739'
-									lot.value.inspectionCarrierCode = "300022"
+									lot.value.inspectionCarrierId = '1803605009533812742'
+									lot.value.inspectionCarrierCode = "300025"
 									// console.log("res", res);
 									uni.hideLoading();
 									// 判断是否批次号和检查箱码都扫完
@@ -274,21 +274,22 @@
 				})
 			})
 		}
-		
+
 	}
+
 	function getUser(data) {
-		
+
 		const uniqueUserMap = new Map();
 		console.log(data)
 		data.forEach(item => {
-		  // 检查 Map 中是否已经有这个 equimentDetailId
-		  if (!uniqueUserMap.has(item.userId)) {
-		    // 如果没有,添加到 Map 中
-		    uniqueUserMap.set(item.userId, {
-		      value: item.userId,
-		      text: item.nickName
-		    });
-		  }
+			// 检查 Map 中是否已经有这个 equimentDetailId
+			if (!uniqueUserMap.has(item.userId)) {
+				// 如果没有,添加到 Map 中
+				uniqueUserMap.set(item.userId, {
+					value: item.userId,
+					text: item.nickName
+				});
+			}
 		});
 		console.log(uniqueUserMap)
 		// 将 Map 的值转换为数组
@@ -296,6 +297,7 @@
 		console.log(userList.value)
 		userId.value = userList.value[0].value
 	}
+
 	function checkSave() {
 		if (lot.value.lotCode == '' || lot.value.lotCode == null) {
 			debounce(handleScanCode, 700)
@@ -304,7 +306,7 @@
 			debounce(handleScanCode, 700)
 		}
 	}
-	
+
 	function handleGetEquipmentList() {
 		getEquipment(lot.value.dayworkItemList)
 	}
@@ -315,14 +317,14 @@
 		let filterList = data.filter(info => info.userId == userId.value)
 		console.log(filterList)
 		filterList.forEach(item => {
-		  // 检查 Map 中是否已经有这个 equimentDetailId
-		  if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
-		    // 如果没有,添加到 Map 中
-		    uniqueEquipmentMap.set(item.equipmentDetailId, {
-		      value: item.equipmentDetailId,
-		      text: item.equipmentDetailCode
-		    });
-		  }
+			// 检查 Map 中是否已经有这个 equimentDetailId
+			if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
+				// 如果没有,添加到 Map 中
+				uniqueEquipmentMap.set(item.equipmentDetailId, {
+					value: item.equipmentDetailId,
+					text: item.equipmentDetailCode
+				});
+			}
 		});
 		// 将 Map 的值转换为数组
 		equipmentList.value = Array.from(uniqueEquipmentMap.values());
@@ -339,25 +341,24 @@
 					title: "请选择加工设备",
 					duration: 2000
 				})
-			}
-			 else {
+			} else {
 				lot.value.equipmentDetailId = equipment.value
 				lot.value.equipmentDetailCode = equipmentList.value[equipmentList.value.findIndex(item => item.value ==
 					equipment.value)].text
-					lot.value.userId = userId.value
-					lot.value.nickName = userList.value[userList.value.findIndex(item =>item.value == userId.value)].text
+				lot.value.userId = userId.value
+				lot.value.nickName = userList.value[userList.value.findIndex(item => item.value == userId.value)].text
 				store.processInspection = null
 				//判断选择了那种检测类型
-					//选择首检
-					uni.navigateTo({
-						url: "/pages/firstInspection/form",
-						success: (res) => {
-							// 通过eventChannel向被打开页面传送数据
-							res.eventChannel.emit("firstInspectionFrom", {
-								data: lot.value
-							})
-						}
-					})
+				//选择首检
+				uni.navigateTo({
+					url: "/pages/firstInspection/form",
+					success: (res) => {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit("firstInspectionFrom", {
+							data: lot.value
+						})
+					}
+				})
 			}
 		} else {
 			if (lot.value.inspectionCarrierId == undefined) {

+ 27 - 30
pages/firstInspection/scan.vue

@@ -94,15 +94,13 @@
 	} from '../../api/business/dayWorkItem';
 	const carrierCode = ref('')
 	const equipmentList = ref([])
-	const inspectionTypeList = ref([
-		{
-			value: 0,
-			text: "首件",
-		}, {
-			value: 1,
-			text: "仪器室",
-		}
-	])
+	const inspectionTypeList = ref([{
+		value: 0,
+		text: "首件",
+	}, {
+		value: 1,
+		text: "仪器室",
+	}])
 	const inspectionType = ref(null)
 	const inspectionChamber = ref(null)
 	const userList = ref([])
@@ -124,12 +122,12 @@
 		getLotInfoByFirstInspection(result).then(res => {
 			if (res.code == 200) {
 				inspectionType.value = 0
-				if(res.data.inspectionChamberList.length > 0){
-				res.data.inspectionChamberList = res.data.inspectionChamberList.map(item => ({
-				  value: item.id,
-				  text: item.chamberName
-				}));
-				inspectionChamber.value = res.data.inspectionChamberList[0].value
+				if (res.data.inspectionChamberList.length > 0) {
+					res.data.inspectionChamberList = res.data.inspectionChamberList.map(item => ({
+						value: item.id,
+						text: item.chamberName
+					}));
+					inspectionChamber.value = res.data.inspectionChamberList[0].value
 				}
 				if (res.data.dayworkItemList.length == 0) {
 					uni.showToast({
@@ -229,7 +227,7 @@
 			const result = {
 				dayworkId: store.dayworkInfo.id,
 				deptId: store.curDeptDetails.deptId,
-				carrierCode: '000493'
+				carrierCode: '300037'
 			}
 			getFirstCarrierInfo(result).then(response => {
 				if (response.code == 200) {
@@ -269,14 +267,14 @@
 		let filterList = data.filter(info => info.userId == store.userInfo.userId)
 		console.log(filterList)
 		filterList.forEach(item => {
-		  // 检查 Map 中是否已经有这个 equimentDetailId
-		  if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
-		    // 如果没有,添加到 Map 中
-		    uniqueEquipmentMap.set(item.equipmentDetailId, {
-		      value: item.equipmentDetailId,
-		      text: item.equipmentDetailCode
-		    });
-		  }
+			// 检查 Map 中是否已经有这个 equimentDetailId
+			if (!uniqueEquipmentMap.has(item.equipmentDetailId)) {
+				// 如果没有,添加到 Map 中
+				uniqueEquipmentMap.set(item.equipmentDetailId, {
+					value: item.equipmentDetailId,
+					text: item.equipmentDetailCode
+				});
+			}
 		});
 		// 将 Map 的值转换为数组
 		equipmentList.value = Array.from(uniqueEquipmentMap.values());
@@ -296,20 +294,19 @@
 					title: "请选择加工设备",
 					duration: 2000
 				})
-			}else if(inspectionType.value == 1 && inspectionChamber == null) {
+			} else if (inspectionType.value == 1 && inspectionChamber == null) {
 				uni.showToast({
 					icon: 'none',
 					title: "请选择仪器室",
 					duration: 2000
 				})
-			}
-			 else {
+			} else {
 				lot.value.equipmentDetailId = equipment.value
 				lot.value.equipmentDetailCode = equipmentList.value[equipmentList.value.findIndex(item => item.value ==
 					equipment.value)].text
 				store.processInspection = null
 				//判断选择了那种检测类型
-				if(inspectionType.value == 0) {
+				if (inspectionType.value == 0) {
 					//选择首检
 					uni.navigateTo({
 						url: "/pages/firstInspection/form",
@@ -320,7 +317,7 @@
 							})
 						}
 					})
-				}else{
+				} else {
 					lot.value.inspectionChamberId = inspectionChamber.value
 					console.log(lot.value)
 					//选择仪器室
@@ -334,7 +331,7 @@
 						}
 					})
 				}
-			
+
 			}
 		} else {
 			if (lot.value.inspectionCarrierId == undefined) {

+ 252 - 193
pages/onSiteInspection/form.vue

@@ -51,32 +51,32 @@
 		</view>
 		<view class="unfit-container">
 			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
-			<view class="resu uni-row">
-				<view class="label">检查标准</view>
-				<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
-				<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
-					@click="handleDelWaste(index)" />
-			</view>
-			<view class="resu uni-row">
-				<view class="label">检查结果</view>
-				<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
-			</view>
-			<view class="resu uni-row">
-				<view class="label">超差范围</view>
-				<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
-			</view>
-			<view class="resu uni-row">
-				<view :class="!editable() ? 'label' : ''">检查量</view>
-				<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-					v-model="item.examiningNum" placeholder="" />
-				<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
-				<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
-				<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
-					v-model="item.disqualificationNum" placeholder="" />
-				<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
-			</view>
+				<view class="resu uni-row">
+					<view class="label">检查标准</view>
+					<view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
+					<uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
+						@click="handleDelWaste(index)" />
+				</view>
+				<view class="resu uni-row">
+					<view class="label">检查结果</view>
+					<input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view class="label">超差范围</view>
+					<input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
+				</view>
+				<view class="resu uni-row">
+					<view :class="!editable() ? 'label' : ''">检查量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.examiningNum" placeholder="" />
+					<view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
+					<view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
+					<input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
+						v-model="item.disqualificationNum" placeholder="" />
+					<view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
+				</view>
 			</view>
 		</view>
 		<!-- 拍照上传部分 -->
@@ -87,7 +87,8 @@
 		margin: 0 16rpx;
 		background-color: #ffffff;
 		border-radius: 12rpx;">
-		<uni-file-picker v-model="photoList" :readonly="!editable()"   return-type="array" :image-styles="imageStyles" @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto" ></uni-file-picker>
+			<uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles"
+				@select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto"></uni-file-picker>
 		</view>
 		<!-- 咨询部分 -->
 		<view class="title unfit-title uni-row">
@@ -98,7 +99,8 @@
 				<view class="question uni-column">
 					<view class="label uni-row">
 						<text>问题描述</text>
-						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}} {{ selectText(item) }}</text>
+						<text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}}
+							{{ selectText(item) }}</text>
 					</view>
 					<view class="content">{{ item.content }}</view>
 				</view>
@@ -119,14 +121,27 @@
 					:localdata="range"></uni-data-checkbox>
 			</view>
 			<view v-if="editable()">
-			<view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
-				<text class="label">是否移交仪器室</text><text>&nbsp;否</text>
-				<switch class="switch" @change="switchChange"  style="transform:scale(0.7);margin-top: -16rpx;" color="rgba(255,85,85,1)" />
-				<text>是</text>
-			</view>
-			<view v-else class="list-title uni-row" style="margin-top: 16rpx;">
-				<text class="label">已经移交给仪器室</text>
-			</view>
+				<view v-if="showTransfer" class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">是否移交仪器室</text><text>&nbsp;否</text>
+					<!-- <switch class="switch" @change="switchChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="processInspecion.flag" @change="switchChange" active-color="rgba(255,85,85,1)"
+						:size="18" style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
+				<view v-else class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">已经移交给仪器室</text>
+				</view>
+				<view class="list-title uni-row" style="margin-top: 16rpx;">
+					<text class="label">全项已检</text><text>&nbsp;否</text>
+					<!-- <switch :checked="isAllChecked" class="switch" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" style="transform:scale(0.7);margin-top: -16rpx;"
+						color="rgba(255,85,85,1)" /> -->
+					<zero-switch v-model="isAllChecked" :disabled="!showTransfer || processInspecion.flag"
+						@change="switchAllCheckChange" active-color="rgba(255,85,85,1)" :size="18"
+						style="transform:scale(0.9);margin-top: -9rpx;"></zero-switch>
+					<text>是</text>
+				</view>
 			</view>
 			<view class="remark uni-row">
 				<view class="label">备注</view>
@@ -135,8 +150,8 @@
 			</view>
 
 			<view v-if="editable()" class="btns-container uni-row">
-				<view  class="finished-btn" @click="endWork">提交</view>
-				<view  class="question-btn uni-column" @click.stop="handleAddConsultation">
+				<view class="finished-btn" @click="endWork">提交</view>
+				<view class="question-btn uni-column" @click.stop="handleAddConsultation">
 					<uni-icons type="headphones" size="24" />
 					<text>咨询</text>
 				</view>
@@ -164,7 +179,9 @@
 	import {
 		store
 	} from '@/store/index.js'
-	import {getURL} from '@/api/sys/user.js'
+	import {
+		getURL
+	} from '@/api/sys/user.js'
 	import {
 		saveOnSiteInspecion,
 		selectInspecion,
@@ -181,6 +198,7 @@
 	const consultations = ref([]) //咨询信息
 	const flag = ref(false)
 	const showTransfer = ref(true)
+	const isAllChecked = ref(false)
 	const selectInspectionChamber = ref(null)
 	// 创建一个引用来存储最后一次请求的时间戳
 	const lastRequestTimestamp = ref(0);
@@ -195,9 +213,9 @@
 	const selected = ref([]);
 	const selectedPhotos = ref([])
 	const imageStyles = {
-				width:60,
-				height:60
-			}
+		width: 60,
+		height: 60
+	}
 	const editable = () => {
 		// if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:edit')) {
 		// 	return true
@@ -241,7 +259,7 @@
 
 	/***************************** 页面生命周期函数 *****************************/
 
-	function init(){
+	function init() {
 		const instance = getCurrentInstance().proxy
 		const eventChannel = instance.getOpenerEventChannel();
 
@@ -255,127 +273,159 @@
 		})
 
 	}
+
 	function upLoadImageHandler(arg) {
-		getURL(arg).then(res =>{
+		getURL(arg).then(res => {
 			let data = JSON.parse(res)
-						   selectedPhotos.value.push({
-							   url:data.fileName,
-							   pictureName:data.originalFilename
-						   })
-						   photoList.value.push({
-							   url:data.fileName,
-							   pictureName:data.originalFilename
-						   })
-						   console.log(photoList.value)
-						   })
+			selectedPhotos.value.push({
+				url: data.fileName,
+				pictureName: data.originalFilename
+			})
+			photoList.value.push({
+				url: data.fileName,
+				pictureName: data.originalFilename
+			})
+			console.log(photoList.value)
+		})
 	}
-	function select (e) {
+
+	function select(e) {
 		console.log(e)
 		const {
 			tempFilePaths,
 			tempFiles
-		} = e	
-		tempFiles.forEach((item,index)=>{
-			upLoadImageHandler({ filePath: tempFilePaths[index],name:item.name})
+		} = e
+		tempFiles.forEach((item, index) => {
+			upLoadImageHandler({
+				filePath: tempFilePaths[index],
+				name: item.name
+			})
 		})
 	}
+
 	function handleDeletedPhoto(e) {
 		let fileName = selectedPhotos.value.map(info => info.pictureName)
 		const firstSlashIndex = e.tempFile.url.lastIndexOf('/');
 		const lastSlashIndex = e.tempFile.url.lastIndexOf('_');
-		const type = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex)
-		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1,lastSlashIndex) +e.tempFile.url.substring(e.tempFile.url.lastIndexOf('.') -1 + 1);;
-			let index = -1; // 初始化 index 为 -1,表示未找到
-
-			// 首先检查 e.tempFile.name 是否存在
-			if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.name);
-			} 
-			// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
-			else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
-				index = fileName.findIndex(name => name === e.tempFile.pictureName);
-			} 
-			// 如果以上两个都不存在,检查 pictureName 是否存在
-			else if (fileName.findIndex(name => name === pictureName) !== -1) {
-				index = fileName.findIndex(name => name === pictureName);
-			}
-			selectedPhotos.value.splice(index,1)
+		const type = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex)
+		const pictureName = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex) + e.tempFile.url.substring(e
+			.tempFile.url.lastIndexOf('.') - 1 + 1);;
+		let index = -1; // 初始化 index 为 -1,表示未找到
+
+		// 首先检查 e.tempFile.name 是否存在
+		if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.name);
+		}
+		// 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
+		else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
+			index = fileName.findIndex(name => name === e.tempFile.pictureName);
+		}
+		// 如果以上两个都不存在,检查 pictureName 是否存在
+		else if (fileName.findIndex(name => name === pictureName) !== -1) {
+			index = fileName.findIndex(name => name === pictureName);
+		}
+		selectedPhotos.value.splice(index, 1)
 	}
 
 	onLoad(() => {
-		 uni.$off('addWasteInfoEvent');
+		uni.$off('addWasteInfoEvent');
 		console.log(store.processInspection)
 		console.log(flag.value)
-		if(!flag.value){
-		if (store.processInspection != null) {
-			uni.showLoading({
-				title: '加载中'
-			});
-			processInspecion.value = store.processInspection
-			selectInspecion(processInspecion.value).then(res => {
-				if (res.code == 200) {
-					processInspecion.value = res.data;
-					processInspecion.value.flag = false
-					unfitInfos.value = res.data.processInspectionDetails;
-					initStatus.value = res.data.status
-					selectedPhotos.value = res.data.processInspectionPictureList
-					photoList.value = res.data.processInspectionPictureList.map(item => {  
-					  return { ...item, url: webHost.value + item.url };
-					});
-					console.log(selectedPhotos.value)
-					console.log(photoList.value)
-					// photoList.value = res.data.processInspectionPictureList
-					consultations.value = res.data.dayworkItemConsults;
-					console.log(processInspecion.value)
-					//判断是否移交到了仪器室
-					getInstrumentRoomInspectionList()
-					uni.hideLoading();
-					// getInspecion();
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: res.msg,
-						duration: 2000
-					})
-				}
-			});
-		}else{
-			init()
-		}
+		if (!flag.value) {
+			if (store.processInspection != null) {
+				uni.showLoading({
+					title: '加载中'
+				});
+				processInspecion.value = store.processInspection
+				selectInspecion(processInspecion.value).then(res => {
+					if (res.code == 200) {
+						processInspecion.value = res.data;
+						processInspecion.value.flag = false
+						unfitInfos.value = res.data.processInspectionDetails;
+						initStatus.value = res.data.status
+						selectedPhotos.value = res.data.processInspectionPictureList
+						photoList.value = res.data.processInspectionPictureList.map(item => {
+							return {
+								...item,
+								url: webHost.value + item.url
+							};
+						});
+						console.log(selectedPhotos.value)
+						console.log(photoList.value)
+						// photoList.value = res.data.processInspectionPictureList
+						consultations.value = res.data.dayworkItemConsults;
+						console.log(processInspecion.value)
+						//判断是否移交到了仪器室
+						getInstrumentRoomInspectionList()
+						uni.hideLoading();
+						// getInspecion();
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 2000
+						})
+					}
+				});
+			} else {
+				init()
+			}
 		}
 	})
+
 	function getInstrumentRoomInspectionList() {
-		getInstrumentRoomInspection(processInspecion.value).then(res =>{
-			if(res.data.length >0) {
+		getInstrumentRoomInspection(processInspecion.value).then(res => {
+			if (res.data.length > 0) {
 				showTransfer.value = false
-			}else {
+				processInspecion.value.flag = true
+			} else {
 				showTransfer.value = true
+				processInspecion.value.flag = false
 			}
 		})
 	}
+
 	function switchChange(event) {
-		if (event.detail.value) {
+		// if (event.detail.value) {
+		// 	processInspecion.value.flag = true
+		// } else {
+		// 	processInspecion.value.flag = false
+		// }
+		if (event) {
 			processInspecion.value.flag = true
+			processInspecion.value.isAllChecked = 0
+			isAllChecked.value = false
 		} else {
 			processInspecion.value.flag = false
 		}
 	}
+
+	function switchAllCheckChange(event) {
+		console.log(event)
+		// if (event.detail.value) {
+		if (event) {
+			processInspecion.value.isAllChecked = 1
+		} else {
+			processInspecion.value.isAllChecked = 0
+		}
+	}
+
 	function getOringicalList() {
 		console.log(processInspecion.value)
-			//查询该产品,当前工序,当前检查绑定的检查
-				getInspectionStandardsList({
-					productId:processInspecion.value.lot.productId,
-					processId:processInspecion.value.lot.processId,
-					inspectionCode:"patrolInspection"
-					}).then(res =>{
-						unfitInfos.value = res.rows.map(item => {
-						    // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
-						    return {
-						      inspectionStandardsId: item.id, // 从 item 中获取 id
-						      checkStandard: item.standard // 从 item 中获取 standard
-						    };
-						  });
-			})
+		//查询该产品,当前工序,当前检查绑定的检查
+		getInspectionStandardsList({
+			productId: processInspecion.value.lot.productId,
+			processId: processInspecion.value.lot.processId,
+			inspectionCode: "patrolInspection"
+		}).then(res => {
+			unfitInfos.value = res.rows.map(item => {
+				// 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
+				return {
+					inspectionStandardsId: item.id, // 从 item 中获取 id
+					checkStandard: item.standard // 从 item 中获取 standard
+				};
+			});
+		})
 	}
 
 	/***************************** 定义了一些方法 *****************************/
@@ -386,36 +436,38 @@
 				return consul[i].text
 			}
 		}
-	} 
-	function handleDrawingMenu(){
-		  // 对 technologicalProcessDetailId 进行URL编码
-		  var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
-		  var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
-		  var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
-		  var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
-		  var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
-		  // 构建查询参数字符串
-		  var queryParam = `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
-		
-		  // 使用模板字符串构建完整的URL
-		  var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
-		
-		  // 导航到指定页面
-		  uni.navigateTo({
+	}
+
+	function handleDrawingMenu() {
+		// 对 technologicalProcessDetailId 进行URL编码
+		var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
+		var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
+		var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
+		var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
+		var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
+		// 构建查询参数字符串
+		var queryParam =
+			`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}`;
+
+		// 使用模板字符串构建完整的URL
+		var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+		// 导航到指定页面
+		uni.navigateTo({
 			url: navigateUrl
-		  });
+		});
 	}
 
 	const rejectNumberChange = () => {
-	let sumDisqualificationNum = 0
-	let sumExaminingNum = 0
-	unfitInfos.value.forEach(v => {
-		sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
-		sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
-	})
-	processInspecion.value.disqualificationNum = sumDisqualificationNum
-	processInspecion.value.examiningNum = sumExaminingNum
-	console.log(processInspecion.value)
+		let sumDisqualificationNum = 0
+		let sumExaminingNum = 0
+		unfitInfos.value.forEach(v => {
+			sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
+			sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
+		})
+		processInspecion.value.disqualificationNum = sumDisqualificationNum
+		processInspecion.value.examiningNum = sumExaminingNum
+		console.log(processInspecion.value)
 	}
 
 	//查询咨询列表
@@ -456,8 +508,8 @@
 				})
 				return
 			}
-			}
-	
+		}
+
 
 		if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
 			uni.showToast({
@@ -496,36 +548,37 @@
 		processInspecion.value.processInspectionPictureList = selectedPhotos.value
 		console.log(photoList.value)
 		console.log(processInspecion.value)
-		if(processInspecion.value.flag) {
+		if (processInspecion.value.flag) {
 			//打开选择仪器室的弹窗
 			selectInspectionChamber.value.open()
 			console.log(processInspecion.value)
-		}else{
-		saveOnSiteInspecion(processInspecion.value).then(res => {
-			if (res.code == 200) {
-				let index = 0;
+		} else {
+			saveOnSiteInspecion(processInspecion.value).then(res => {
+				if (res.code == 200) {
+					let index = 0;
 
-				for (let i = 0; i < pages.length; i++) {
+					for (let i = 0; i < pages.length; i++) {
 
-					if (pages[i].$page.fullPath == "/pages/onSiteInspection/index") {
+						if (pages[i].$page.fullPath == "/pages/onSiteInspection/index") {
 
-						index = pages.length - i - 1;
+							index = pages.length - i - 1;
+						}
 					}
+					console.log("index", index);
+					uni.navigateBack({
+						delta: index
+					});
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					})
 				}
-				console.log("index", index);
-				uni.navigateBack({
-					delta: index
-				});
-			} else {
-				uni.showToast({
-					icon: 'none',
-					title: res.msg,
-					duration: 2000
-				})
-			}
-		});
+			});
 		}
 	}
+
 	function handleSelectInspectionChamber(data) {
 		processInspecion.value.inspectionChamberId = data
 		console.log(processInspecion.value)
@@ -534,9 +587,9 @@
 				let index = 0;
 				let pages = getCurrentPages();
 				for (let i = 0; i < pages.length; i++) {
-		
+
 					if (pages[i].$page.fullPath == "/pages/onSiteInspection/index") {
-		
+
 						index = pages.length - i - 1;
 					}
 				}
@@ -567,7 +620,7 @@
 	}
 
 	const addWasteInfo = (data) => {
-		console.log(data,"55555555")
+		console.log(data, "55555555")
 		flag.value = true
 		var info = {
 			inspectionStandardsId: data.id,
@@ -577,11 +630,11 @@
 		console.log(data)
 	}
 	const addConsultation = (data) => {
-	let info = data
-	info.forEach(item =>{
-		item.status = 0
-	})
-	consultations.value = consultations.value.concat(info)
+		let info = data
+		info.forEach(item => {
+			item.status = 0
+		})
+		consultations.value = consultations.value.concat(info)
 		isEventTriggered.value = true; // 更新标志位状态
 	}
 
@@ -597,10 +650,10 @@
 		var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
 		// 构建查询参数字符串
 		var queryParam = `param1=${encodedId}&param2=${enprocessId}`;
-				
+
 		// 使用模板字符串构建完整的URL
 		var navigateUrl = `/pages/onSiteInspection/options?${queryParam}`;
-				
+
 		// 导航到指定页面
 		uni.navigateTo({
 			url: navigateUrl
@@ -678,6 +731,7 @@
 			.label {
 				width: 160rpx;
 			}
+
 			.drawing-btn {
 				padding: 12rpx 32rpx;
 				background-color: #0055ff;
@@ -831,10 +885,12 @@
 		padding: 24rpx;
 		background-color: #ffffff;
 		border: 1px solid #bcbcbc;
-	.switch {
+
+		.switch {
 			margin-top: -4px;
 			//align-items: center;
 		}
+
 		.result {
 			align-items: center;
 
@@ -894,22 +950,25 @@
 				}
 			}
 		}
+
 		.switch {
 			margin-top: -8rpx;
 			align-items: center;
 			transform: scale(0.7);
 		}
 	}
+
 	.uni-input-input:disabled {
-	    background-color: #f5f7fa;
+		background-color: #f5f7fa;
 	}
+
 	.my-files {
 		display: flex;
 		justify-content: center;
-		
+
 		:deep(.uni-file-picker__container) {
-		flex-direction: row;
-			
+			flex-direction: row;
+
 		}
 	}
 </style>

+ 6 - 0
uni_modules/zero-switch/changelog.md

@@ -0,0 +1,6 @@
+## 2.0.1(2023-09-18)
+兼容vue2,vue3,新增月亮模式使用案例,或者懒人一键月亮模式
+## 2.0.0(2022-05-12)
+重构,已使用的请及时更新,传参字段也需更改
+## 1.0.0(2022-05-09)
+首次发布

+ 188 - 0
uni_modules/zero-switch/components/zero-switch/zero-switch.vue

@@ -0,0 +1,188 @@
+<template>
+	<view class="zero_switch" :class="[disabled?'zero_switch_disabled':'']"
+		:style="{background:checked?backgroundColorOn:backgroundColorOff,borderColor:checked?borderColorOn:borderColorOff,width:2*size+2+'px',height:size+4+'px',borderRadius:size+'px'}"
+		@click="onChange">
+		<view class="dot" :class="[checked?'dot_act':'',{'moon':moon},{'moon_act':checked&&moon}]"
+			:style="{background:checked?activeColor:inactiveColor,width:size-2+'px',height:size-2+'px'}">
+		</view>
+		<view class="text" v-if="showText && !moon"
+			:style="{color:checked?activeColor:inactiveColor,lineHeight:size+2+'px',fontSize:size-11+'px'}">
+			<!-- :style="{width:size+'px'}" -->
+			<view v-if="checked" class="text_on" :style="{width:size-10+'px'}">
+				{{textOn}}
+			</view>
+			<view v-else class="text_off" :style="{width:size-10+'px'}">
+				{{textOff}}
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "zero-switch",
+		emits: ['input', 'update:modelValue', 'change'],
+		model: {
+			prop: 'modelValue',
+			event: 'update:modelValue'
+		},
+		props: {
+			value: {
+				type: Boolean,
+				default: false,
+			},
+			modelValue: {
+				type: Boolean,
+				default: false,
+			},
+			activeColor: {
+				type: String,
+				default: "#007aff",
+			},
+			inactiveColor: {
+				type: String,
+				default: "#cccccc",
+			},
+			backgroundColorOn: {
+				type: String,
+				default: "#ffffff",
+			},
+			backgroundColorOff: {
+				type: String,
+				default: "#ffffff",
+			},
+			borderColorOn: {
+				type: String,
+				default: '#eeeeee'
+			},
+			borderColorOff: {
+				type: String,
+				default: '#eeeeee'
+			},
+			showText: {
+				type: Boolean,
+				default: false,
+			},
+			textOn: {
+				type: String,
+				default: "开",
+			},
+			textOff: {
+				type: String,
+				default: "关",
+			},
+			size: {
+				type: Number,
+				default: 26,
+			},
+			disabled: {
+				type: Boolean,
+				default: false,
+			},
+			stopChange: {
+				type: Boolean,
+				default: false,
+			},
+			moon: {
+				type: Boolean,
+				default: false,
+			}
+		},
+		data() {
+			return {
+				checked: false
+			};
+		},
+		beforeMount() {
+			this.checked = this.value || this.modelValue
+		},
+		watch: {
+			value(newValue) {
+				this.checked = newValue
+			},
+			modelValue(newValue) {
+				this.checked = newValue
+			}
+		},
+		methods: {
+			onChange() {
+				if (!this.disabled) {
+					if (!this.stopChange) {
+						this.checked = !this.checked
+						this.$emit("input", this.checked);
+						this.$emit('update:modelValue', this.checked);
+						this.$emit('change', this.checked)
+					} else {
+
+						this.$emit('change', this.checked)
+					}
+				}
+			},
+		},
+	};
+</script>
+<style lang="scss" scoped>
+	view {
+		box-sizing: border-box;
+	}
+
+	.zero_switch_disabled {
+		opacity: 0.7;
+	}
+
+	.zero_switch {
+		width: 54px;
+		height: 30px;
+		border-radius: 26px;
+		overflow: hidden;
+		border: 1px solid #000000;
+		position: relative;
+		transition: all 0.3s;
+
+		.text {
+			line-height: 28px;
+			padding: 0 7px;
+
+			.text_on {
+				text-align: left;
+				overflow: hidden;
+				white-space: nowrap;
+
+			}
+
+			.text_off {
+				text-align: right;
+				overflow: hidden;
+				white-space: nowrap;
+				margin-left: auto;
+			}
+		}
+
+		.dot {
+			position: absolute;
+			border-radius: 100%;
+			transition: all 0.3s;
+			width: 24px;
+			height: 24px;
+			background: #fff;
+			left: 2px;
+			top: 2px;
+			// box-shadow: 0rpx 0rpx 1px 1px rgba(0, 0, 0, 0.2);
+
+		}
+
+		.dot_act {
+			transform: translate(100%);
+		}
+
+		.moon {
+			background: transparent !important;
+			box-shadow: inset 8px -4px 0px 0px #fff000;
+		}
+
+		.moon_act {
+			background: #fff000 !important;
+			box-shadow: none;
+		}
+	}
+</style>

+ 78 - 0
uni_modules/zero-switch/package.json

@@ -0,0 +1,78 @@
+{
+  "id": "zero-switch",
+  "displayName": "zero-switch (开关组件)",
+  "version": "2.0.1",
+  "description": "一个好看的switch开关组件,支持v-model,支持vue2,vue3. 新增月亮模式,异步控制,显示文字,渐变效果.",
+  "keywords": [
+    "zero-switch",
+    "开关",
+    "switch"
+],
+  "repository": "",
+"engines": {
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无 ",
+      "data": "插件不采集任何数据",
+      "permissions": "无"
+    },
+    "npmurl": "",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "Vue": {
+          "vue2": "y",
+          "vue3": "y"
+        },
+        "App": {
+          "app-vue": "u",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "u",
+          "Android Browser": "u",
+          "微信浏览器(Android)": "u",
+          "QQ浏览器(Android)": "u"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "u",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 94 - 0
uni_modules/zero-switch/readme.md

@@ -0,0 +1,94 @@
+# zero-switch
+
+## 一. 插件说明
+
+个人仅测试与vue2,vue3,微信小程序,其他平台请自行测试
+
+### `增加 **moon** 月亮模式` ,直接实现暗黑模式切换的开关,也可以自行配色,下面有介绍
+
+### [zero-switch-看似简单的一个uniapp开关小组件,你真的用明白了吗?](https://juejin.cn/post/7279402761413558326)
+
+## 二. 使用方法
+
+```html
+<template>
+	<view class="container">
+	<!-- 默认用法 -->
+	<zero-switch  v-model="switchBtn"></zero-switch>
+
+	<!-- 渐变玩法 -->
+	<zero-switch class='inline_item' v-model="switchBtn" inactive-color="radial-gradient(circle,#fff 10%, #ccc 100%)" active-color="radial-gradient(circle,#fff 10%, #007aff 100%)"></zero-switch>
+	<zero-switch class='inline_item' v-model="switchBtn" inactive-color="radial-gradient(circle,#000 10%, #f00000 40%,  #000 70%)" active-color="radial-gradient(circle,#000 10%, #00f260 40%,  #000 70%)" backgroundColorOff='#000000' backgroundColorOn='#000000'></zero-switch>
+	
+	<!-- 进阶渐变玩法 -->
+	<zero-switch class='inline_item' v-model="switchBtn" inactive-color="radial-gradient(circle at 70% 35%, #000000 30%, #009fff 60%)" backgroundColorOff='#000000' active-color="linear-gradient(40deg,#ff0080,#ff8c00 70%)"></zero-switch>
+	
+	<!-- 提供一个没有渐变的月亮模式  :moon="true"-->
+    <zero-switch class='inline_item' v-model="switchBtn" :moon="true" backgroundColorOff='#000000' backgroundColorOn="#000000"></zero-switch>
+
+	<!-- 异步控制 -->
+	<zero-switch  v-model="switchBtn" @change="handleAsync"></zero-switch>
+     
+    <!-- 禁用 -->
+   <zero-switch  v-model="switchBtn" :disabled="true"></zero-switch>
+
+      
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				switchBtn: false,
+			}
+		},
+		methods:{
+			handleAsync(e) {
+				uni.showModal({
+					title: '提示',
+					content: '确定要改变开关状态吗?',
+					success: (res) => {
+						if (res.confirm) {
+							console.log('用户点击确定');
+							this.btnAsync = !this.btnAsync
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+					}
+				});
+			}
+
+		},
+	}
+</script>
+```
+
+## 三. 参数说明
+
+|参数				|类型	|默认值	|描述																								|
+|--					|--		|--		|--																									|
+|value				|Boolean|false	|开关状态																							|
+|activeColor		|String	|#1EABFA|开关开启时颜色																						|
+|inactiveColor		|String	|#cccccc|开关关闭时颜色																						|
+|backgroundColorOn	|String	|#ffffff|开关开启背景颜色																					|
+|backgroundColorOff	|String	|#ffffff|开关关闭背景颜色																					|
+|borderColorOn		|String	|#eeeeee|开关开启边框颜色																					|
+|borderColorOff		|String	|#eeeeee|开关关闭边框颜色																					|
+|showText			|Boolean|false	|是否显示文字(只能显示一个字)																		|
+|textOn				|String	|开		|开关开启时的文字																					|
+|textOff			|String	|关		|开关关闭时的文字																					|
+|size				|Number	|26		|开关大小																							|
+|disabled			|Boolean|false	|是否禁用																							|
+|stopChange			|Boolean|false	|是否需要异步控制																					|
+|moon				|Boolean|false	|月亮模式,此时禁用文字,建议把背景色改成黑色backgroundColorOff='#000000' backgroundColorOn="#000000"	|
+
+## 四. event
+
+|参数	|返回值	|
+|---	|---	|
+|change	| value	|
+
+插件预览:
+![code](https://img.jszero.cn/mweb/we_code.jpg)
+
+> 预览的小程序不一定能及时更新当前插件