guoyujia 5 months ago
parent
commit
b8557ddc46

+ 23 - 1
api/business/dayWork.js

@@ -12,7 +12,22 @@ export function getDayWorkList(data) {
 		data: data
 	})
 }
-
+export function getDayWorkInnerList(data) {
+	return req.request({
+		url: '/business/daywork/innerList',
+		// header: reqHeader,
+		method: 'GET',
+		data: data
+	})
+}
+export function getDayWorkInnerSortList(data) {
+	return req.request({
+		url: '/business/daywork/innerSortList',
+		// header: reqHeader,
+		method: 'GET',
+		data: data
+	})
+}
 
 export function saveDayWork(data) {
 	console.log("请求", data)
@@ -54,6 +69,13 @@ export function showDayworkSave(data) {
 		data: data
 	})
 }
+export function showDayworkInnerSave(data) {
+	return req.request({
+		url: '/business/daywork/showDayworkInnerSave',
+		method: 'POST',
+		data: data
+	})
+}
 
 export function turnoverDelete(data) {
 	return req.request({

+ 21 - 0
api/business/dayWorkItem.js

@@ -20,6 +20,13 @@ export function updateDayWorkItem(data) {
 		data: data
 	})
 }
+export function addEquipmentInfo(data) {
+	return req.request({
+		url: '/business/dayworkItem/addEquipmentInfo',
+		method: 'POST',
+		data: data
+	})
+}
 
 export function updateBatchBack(data) {
 	return req.request({
@@ -44,6 +51,13 @@ export function saveDayWorkItem(data) {
 		data: data
 	})
 }
+export function saveInnerDayworkItem(data) {
+	return req.request({
+		url: '/business/dayworkItem/saveInnerDayworkItem',
+		method: 'POST',
+		data: data
+	})
+}
 
 export function saveDayWorkItemBatch(data) {
 	return req.request({
@@ -158,6 +172,13 @@ export function turnover(data) {
 		data: data
 	})
 }
+export function turnoverInner(data) {
+	return req.request({
+		url: '/business/dayworkItem/turnoverInner',
+		method: 'POST',
+		data: data
+	})
+}
 
 export function updateTurnoverInfo(data) {
 	return req.request({

+ 7 - 0
api/business/lot.js

@@ -33,4 +33,11 @@ export function getProcessListByLot(data) {
 		method: 'GET',
 		data: data
 	})
+}
+export function getInnerNextProcess(data) {
+	return req.request({
+		url: '/business/lot/getInnerNextProcess',
+		method: 'GET',
+		data: data
+	})
 }

+ 10 - 3
api/business/planDetails.js

@@ -2,21 +2,28 @@ import req from '@/utils/request.js'
 
 export function getPlanDetailsList(data) {
 	return req.request({
-		url:'/business/productionPlanDetail/list',
+		url: '/business/productionPlanDetail/list',
+		method: 'POST',
+		data: data
+	})
+}
+export function getInnerPlanDetailsList(data) {
+	return req.request({
+		url: '/business/productionPlanDetail/innerList',
 		method: 'POST',
 		data: data
 	})
 }
 export function selectByCarrierCode(data) {
 	return req.request({
-		url:'/business/productionPlanDetail/selectByCarrierCode',
+		url: '/business/productionPlanDetail/selectByCarrierCode',
 		method: 'Get',
 		data: data
 	})
 }
 export function selectInfoByLotCode(data) {
 	return req.request({
-		url:'/business/productionPlanDetail/selectInfoByLotCode',
+		url: '/business/productionPlanDetail/selectInfoByLotCode',
 		method: 'Get',
 		data: data
 	})

+ 15 - 0
api/business/sortDaywork.js

@@ -57,6 +57,14 @@ export function finish(data) {
 
 	})
 }
+export function finishInner(data) {
+	return req.request({
+		url: '/business/sortDaywork/finishInner',
+		method: 'POST',
+		data: data
+
+	})
+}
 
 export function update(data) {
 	return req.request({
@@ -74,4 +82,11 @@ export function showDayworkSave(data) {
 		method: 'POST',
 		data: data
 	})
+}
+export function showDayworkSaveInner(data) {
+	return req.request({
+		url: '/business/sortDaywork/showDayworkSaveInner',
+		method: 'POST',
+		data: data
+	})
 }

+ 653 - 0
components/dialog-end-inner-work/dialog-end-inner-work.vue

@@ -0,0 +1,653 @@
+<template>
+	<view class="mask" v-if="isLoading"></view>
+	<dialog-base ref="baseDialog" title="结束报工">
+		<view class="list-container">
+			<view class="list-title uni-row">
+				<text class="label">合格量</text>
+				<input class="input" @input="handleInputQualifiedNum" style="width: 70%;"
+					v-model="workInfo.qualifiedNum" placeholder="请输入合格量" />
+			</view>
+			<view class="list-title uni-row">
+				<text class="label">废品信息</text>
+				<view class="uni-row" style="justify-content: flex-end;"><text class="label" style="color: blue;"
+						@click="handleAddWasteInfo">+添加</text></view>
+			</view>
+			<view class="list-title uni-row" v-for="(item, index) in wasteInfo">
+				<input class="input" @input="handleInputRejectNum(item)" style="width: 20%;" v-model="item.rejectNum"
+					placeholder="废品量" />
+				<uni-data-select style="margin-left: 40rpx;width: 70%;" v-model="item.reason" :localdata="reasonList"
+					@change="handleReasonChange(item)"></uni-data-select>
+
+				<uni-icons class="icon-gear" type="close" size="40" color="red"
+					@click="handleDeleteWasteInfo(index)"></uni-icons>
+			</view>
+
+			<view class="list-title uni-row">
+				<text class="label">当前序是否完成</text><text>否</text>
+				<switch class="switch" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
+				<text>是</text>
+			</view>
+			<view v-if="showCarrierList && !store.isPreProcess" class="confirmCarrier">
+				<text class="label">确认载具</text>
+				<view class="vehicleList uni-row">
+					<view v-for="(item,index) in bindList" :key="index"
+						:class="{ 'vehicleNo': true, 'uni-row': true, 'blueBorder': item.flag }">
+						<text>{{item.carrierCode}}</text>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view v-if="store.isPreProcess" class="add-btn-container uni-row">
+			<button type="default" class="btn" @click="handlePreFinishReporting">结束报工</button>
+		</view>
+		<view v-if="!store.isPreProcess" class="add-btn-container uni-row">
+			<button v-if="showCarrierList" type="primary" class="btnScan" @click="handleScanCode">扫码确认载具</button>
+			<button type="default" class="btn" @click="handleFinishReporting">结束报工</button>
+		</view>
+	</dialog-base>
+</template>
+
+
+<script setup>
+	import {
+		ref,
+		getCurrentInstance
+	} from 'vue'
+	import {
+		onLoad
+	} from '@dcloudio/uni-app'
+	import {
+		updateDayWorkItem,
+		saveInnerDayworkItem
+	} from "@/api/business/dayWorkItem.js"
+	import {
+		getDayworkCarrierList
+	} from '@/api/business/dayworkCarrier.js'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		timestampToTime,
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		getDictInfoByType
+	} from '@/api/dict/dict.js'
+	import {
+		getSpecialDeptProcessList
+	} from '@/api/business/deptProcess.js'
+	import {
+		debounce
+	} from '@/utils/common.js'
+	import {
+		getDayWorkItemList,
+		listItem,
+		getIsFirstOrder,
+	} from '@/api/business/dayWorkItem.js'
+
+	const baseDialog = ref(null)
+	const workInfo = ref({})
+	const wasteInfo = ref([])
+	const reasonList = ref([])
+	const emit = defineEmits(['resflushItem'])
+	const showCarrierList = ref(false) // 工序是否完成显示载具列表
+	const bindList = ref([])
+	const confirmCarrierList = ref([])
+	const isFirstOrder = ref(true); //是否为首序
+	const isLoading = ref(false);
+	const endFlag = ref(0)
+	const specialDeptProcessList = ref([])
+	const temp = ref(0) // 保存workInfo.value.qualifiedNum的值(还原用)
+	const lotPreSumReject = ref(0)
+	const lotPreSumQualifiedNum = ref(0)
+	const remainingQualifiedNum = ref(0) // 当前的合格量还能最大添加多少(剩余数量)
+
+	onLoad(() => {})
+
+	function open(data, itemListData) {
+		console.log(store.isPreProcess)
+		console.log("777")
+		resetPage();
+		workInfo.value = {
+			...data,
+		};
+		console.log("数据data", workInfo);
+		//查看是否为首序
+		getIsFirst(store.dayworkInfo.id);
+		workInfo.value.qualifiedNum = 0;
+		Promise.all([getSpecialDeptProcessList(), listItem({
+				dayworkId: store.dayworkInfo.id,
+				status: 2
+			}), ], )
+			.then(([res, response]) => {
+				if (res.code == 200 && response.code == 200) {
+					for (let i = 0; i < res.data.length; i++) {
+						specialDeptProcessList.value[i] = res.data[i].processId;
+					}
+					for (let i = 0; i < response.rows.length; i++) {
+						if (response.rows[i].processId == workInfo.value.processId) {
+							lotPreSumReject.value += response.rows[i].rejectSum;
+							lotPreSumQualifiedNum.value += response.rows[i].qualifiedNum;
+						}
+					}
+
+				}
+				if (specialDeptProcessList.value.includes(workInfo.value.processId)) {
+					workInfo.value.qualifiedNum = store.dayworkInfo.prevProcess != null ?
+						Math.max(0, store.dayworkInfo.processQualifiedNum - lotPreSumQualifiedNum.value -
+							lotPreSumReject.value) :
+						Math.max(0, store.dayworkInfo.productionQuantity - lotPreSumQualifiedNum.value -
+							lotPreSumReject
+							.value);
+					// temp.value = workInfo.value.qualifiedNum;
+				} else {
+					workInfo.value.qualifiedNum = 0;
+				}
+
+
+			}).catch(err => {
+				console.log('146 err')
+			});
+		init();
+		baseDialog.value.open()
+	}
+
+	function close() {
+		baseDialog.value.close()
+	}
+
+	function getIsFirst(dayworkId) {
+		getIsFirstOrder(dayworkId).then(res => {
+			if (res.code == 200) {
+				isFirstOrder.value = res.data.isFirstOrder;
+			}
+		}).catch(err => {
+			console.log(err)
+		})
+	}
+
+	function resetPage() {
+		workInfo.value.qualifiedNum = null;
+		workInfo.value = {};
+		wasteInfo.value = [];
+		reasonList.value = [];
+		showCarrierList.value = false;
+		bindList.value = [];
+		confirmCarrierList.value = [];
+		endFlag.value = 0;
+		lotPreSumReject.value = 0;
+		lotPreSumQualifiedNum.value = 0;
+		remainingQualifiedNum.value = 0;
+	}
+
+	function init() {
+		getDictInfoByType("waste_causes").then(res => {
+			for (let i = 0; i < res.data.length; i++) {
+				reasonList.value[i] = {
+					value: res.data[i].dictValue,
+					text: res.data[i].dictLabel
+				}
+			}
+		}).catch(err => {
+			console.log('189 err')
+		})
+		getDayworkCarrierList({
+			dayworkId: store.dayworkInfo.id,
+			isChanged: 0,
+			processInspectionId: 0
+		}).then(res => {
+			console.log(res)
+			if (res.code == 200) {
+				bindList.value = res.rows;
+				for (let i = 0; i < bindList.value.length; i++) {
+					bindList.value[i].flag = false;
+				}
+			}
+		}).catch(err => {
+			console.log('203 err')
+		})
+	}
+
+	function switchChange(event) {
+		if (event.detail.value) {
+			workInfo.value.status = "3"
+		} else {
+			workInfo.value.status = "2"
+		}
+		console.log(event.detail.value, !store.isPreProcess)
+		showCarrierList.value = event.detail.value;
+	}
+
+	function handleInputQualifiedNum() {
+		workInfo.value.qualifiedNum = workInfo.value.qualifiedNum.replace(/^-+|[^\d]/g, '');
+	}
+
+	function handleInputRejectNum(item) {
+		item.rejectNum = item.rejectNum.replace(/^0+|^-|[^\d]/g, '');
+		// 合格数随着投产数
+		//let sumRejectNum = 0;
+		// for (let i = 0; i < wasteInfo.value.length; i++) {
+		// 	wasteInfo.value[i].rejectNum = wasteInfo.value[i].rejectNum.replace(/^0+|^-|[^\d]/g, '');
+		// 	// sumRejectNum += Number(wasteInfo.value[i].rejectNum);
+		// }
+		// if (temp.value > 0) {
+		// 	debounce(function() {
+		// 		workInfo.value.qualifiedNum = temp.value;
+		// 		workInfo.value.qualifiedNum -= sumRejectNum;
+		// 	}, 500)
+		// }
+	}
+
+	/*
+		function handleScanCode() {
+			// 引入原生插件
+			const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+			if (mpaasScanModule) {
+			//调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					let vehicleObj = JSON.parse(ret.resp_result);
+					let hasInFlag = false
+					for (let i = 0; i < bindList.value.length; i++) {
+						if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
+							hasInFlag = true
+							if (!bindList.value[i].flag) {
+								endFlag.value += 1;
+							}
+							bindList.value[i].flag = true;
+						}
+					}
+					if(!hasInFlag) {
+						uni.showToast({
+							icon: 'none',
+							title: '该批次没有绑定此箱',
+							duration: 2000
+						})
+					}
+					if (endFlag.value < bindList.value.length && hasInFlag) {
+							 setTimeout(() => {
+							    handleScanCode();
+							  }, 700);
+					}
+				}
+			);
+			}
+		}
+	*/
+
+	function handleScanCode() {
+		// 引入原生插件
+		const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		if (mpaasScanModule) {
+			//调用插件的 mpaasScan 方法
+			mpaasScanModule.mpaasScan({
+					// 扫码识别类型,参数可多选,qrCode、barCode,
+					// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+					scanType: ["qrCode", "barCode"],
+					// 是否隐藏相册,默认false不隐藏
+					hideAlbum: false,
+				},
+				(ret) => {
+					let vehicleObj = {
+						carrierCode: ret.resp_result
+					};
+					let hasInFlag = false
+					for (let i = 0; i < bindList.value.length; i++) {
+						if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
+							hasInFlag = true
+							if (!bindList.value[i].flag) {
+								endFlag.value += 1;
+							}
+							bindList.value[i].flag = true;
+						}
+					}
+					if (!hasInFlag) {
+						uni.showToast({
+							icon: 'none',
+							title: '该批次没有绑定此箱',
+							duration: 2000
+						})
+					}
+					if (endFlag.value < bindList.value.length && hasInFlag) {
+						setTimeout(() => {
+							handleScanCode();
+						}, 700);
+					}
+				}
+			);
+		} else {
+			let vehicleObj = {
+				carrierCode: bindList.value[0].carrierCode
+			};
+			let hasInFlag = false
+			for (let i = 0; i < bindList.value.length; i++) {
+				if (vehicleObj.carrierCode == bindList.value[i].carrierCode) {
+					hasInFlag = true
+					if (!bindList.value[i].flag) {
+						endFlag.value += 1;
+					}
+					bindList.value[i].flag = true;
+				}
+			}
+			if (!hasInFlag) {
+				uni.showToast({
+					icon: 'none',
+					title: '该批次没有绑定此箱',
+					duration: 2000
+				})
+			}
+			if (endFlag.value < bindList.value.length && hasInFlag) {
+				setTimeout(() => {
+					handleScanCode();
+				}, 700);
+			}
+		}
+	}
+
+	function handlePreFinishReporting() {
+		console.log("999")
+		//投产数
+		let number = store.dayworkInfo.prevProcess == null ? store.dayworkInfo.productionQuantity : store.dayworkInfo
+			.processQualifiedNum;
+		workInfo.value.prodNum = number
+		console.log(parseInt(workInfo.value.qualifiedNum))
+		console.log(lotPreSumQualifiedNum.value)
+		console.log(number)
+		// 填入数大于剩余量情况
+		if (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value - number > 0) {
+			console.log("555")
+			uni.showToast({
+				icon: 'none',
+				title: '当前序合格总数不能超过投产数'
+			})
+		} else {
+			//判断当前序合格总数为0 ,不允许保存
+			if (workInfo.value.status == "3" && parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value == 0) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前序合格总数不能为0',
+					duration: 2000
+				})
+			} else {
+				handleSave();
+			}
+		}
+	}
+
+	function handleFinishReporting() {
+		console.log(store.isPreProcess)
+		//投产数
+		let number = workInfo.value.prodNum;
+		//判断当前序合格总数为0 ,不允许保存
+		if (workInfo.value.status == "3" && parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value == 0) {
+			uni.showToast({
+				icon: 'none',
+				title: '当前序合格总数不能为0'
+			})
+			return;
+		}
+		console.log(parseInt(workInfo.value.qualifiedNum))
+		console.log(lotPreSumQualifiedNum.value)
+		console.log(number)
+		if (parseInt(workInfo.value.qualifiedNum) + lotPreSumQualifiedNum.value > number) {
+			uni.showToast({
+				icon: 'none',
+				title: '当前序合格总数不能超过投产数'
+			})
+			return;
+		}
+		if (showCarrierList.value) {
+			if (endFlag.value >= bindList.value.length) {
+				handleSave();
+			} else {
+				uni.showToast({
+					icon: "none",
+					title: "请先扫码确认载具",
+					duration: 2000
+				})
+				return;
+			}
+		} else {
+			handleSave();
+		}
+	}
+
+	function handleSave() {
+		console.log(workInfo.value.qualifiedNum)
+		if (workInfo.value.qualifiedNum === null || workInfo.value.qualifiedNum === '') {
+			uni.showToast({
+				icon: "none",
+				title: "请输入合格数",
+				duration: 2000
+			})
+			return;
+		}
+		let rejectSum = 0
+		console.log(rejectSum);
+		for (let i = 0; i < wasteInfo.value.length; i++) {
+			if ((!wasteInfo.value[i].rejectNum && wasteInfo.value[i].reason) ||
+				(wasteInfo.value[i].rejectNum && !wasteInfo.value[i].reason) ||
+				(!wasteInfo.value[i].rejectNum && !wasteInfo.value[i].reason)) {
+				uni.showToast({
+					icon: 'none',
+					title: "请输入废弃数或废弃原因",
+					duration: 2000
+				})
+				return;
+			}
+			rejectSum += Number(wasteInfo.value[i].rejectNum);
+		}
+		if (rejectSum > workInfo.value.prodNum) {
+			uni.showToast({
+				icon: 'none',
+				title: '废品数不能大于投产数',
+				duration: 2000
+			})
+			return;
+		}
+		if (workInfo.value.status != '3') {
+			workInfo.value.status = '2';
+		}
+		isLoading.value = true; // 显示遮罩层
+		workInfo.value.endTime = timestampToTime(new Date());
+		uni.showLoading({
+			title: '加载中'
+		});
+		workInfo.value.rejectList = wasteInfo.value;
+		workInfo.value.isPreProcess = store.isPreProcess;
+		workInfo.value.processStepNumber = store.dayworkInfo.currentProcess.processStepNumber
+		console.log(workInfo.value)
+		saveInnerDayworkItem(workInfo.value).then(res => {
+			isLoading.value = false; // 隐藏遮罩层
+			uni.hideLoading();
+			if (res.code === 200) {
+				uni.showToast({
+					icon: 'success',
+					title: '操作成功',
+				});
+				emit('resflushItem');
+				close();
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg
+				});
+			}
+		})
+	}
+
+	function handleAddWasteInfo() {
+		if (wasteInfo.value.length > 0) {
+			if (wasteInfo.value.some(item => item.rejectNum == '' || item.reason == '')) {
+				uni.showToast({
+					icon: 'none',
+					title: '请填写废品量或废品原因再点击添加'
+				})
+			} else {
+				wasteInfo.value.push({
+					rejectNum: '',
+					reason: ''
+				})
+			}
+		} else {
+			wasteInfo.value.push({
+				rejectNum: store.dayworkInfo.processQualifiedNum > 0 ? store.dayworkInfo
+					.processQualifiedNum - lotPreSumQualifiedNum.value - lotPreSumReject.value - workInfo.value
+					.qualifiedNum > 0 ? store.dayworkInfo
+					.processQualifiedNum - lotPreSumQualifiedNum.value - lotPreSumReject.value - workInfo.value
+					.qualifiedNum : 1 : store.dayworkInfo.isLast == 1 ?
+					store.dayworkInfo.lastLotQuantity - lotPreSumQualifiedNum.value - lotPreSumReject.value -
+					workInfo.value.qualifiedNum > 0 ?
+					store.dayworkInfo.lastLotQuantity - lotPreSumQualifiedNum.value - lotPreSumReject.value -
+					workInfo.value.qualifiedNum : 1 : store.dayworkInfo.oneLotQuantity - lotPreSumQualifiedNum
+					.value - lotPreSumReject.value -
+					workInfo.value.qualifiedNum > 0 ?
+					store.dayworkInfo.oneLotQuantity - lotPreSumQualifiedNum.value - lotPreSumReject.value -
+					workInfo.value.qualifiedNum : 1,
+				reason: ''
+			})
+		}
+
+	}
+
+	function handleDeleteWasteInfo(index) {
+		wasteInfo.value.splice(index, 1);
+	}
+
+	function handleReasonChange(item) {
+		if (wasteInfo.value.filter(waste => waste.reason == item.reason).length > 1) {
+			wasteInfo.value.splice(wasteInfo.value.indexOf(item), 1);
+			uni.showToast({
+				icon: 'none',
+				title: '请勿重复选择废品原因',
+				duration: 2000
+			})
+		}
+	}
+
+	defineExpose({
+		open
+	})
+</script>
+
+<style lang="scss">
+	.dialog-body {
+		.list-container {
+			width: 100%;
+			display: flex;
+			align-items: flex-start;
+			padding: 0 4rpx;
+
+			.list-title {
+				width: 100%;
+				margin-top: 16rpx;
+				height: 64rpx;
+				line-height: 64rpx;
+				align-items: center;
+
+				.label {
+					flex: 1;
+					font-size: 32rpx;
+				}
+
+				.input {
+					width: 40%;
+					height: 66rpx;
+					padding-left: 10rpx;
+					font-size: 22rpx;
+					border: 1rpx solid #e1e1e1;
+					border-radius: 8rpx;
+				}
+
+				.icon-gear {
+					font-size: 56rpx;
+				}
+			}
+
+			.switch {
+				margin-top: -8rpx;
+				align-items: center;
+				transform: scale(0.7);
+			}
+
+			.confirmCarrier {
+				.label {
+					padding-top: 20rpx;
+					font-size: 32rpx;
+				}
+
+				.vehicleList {
+					justify-content: baseline;
+					align-content: flex-start;
+					flex-wrap: wrap;
+					width: 100%;
+					height: 120rpx;
+					overflow: auto;
+
+					.vehicleNo {
+						padding: 0 10rpx;
+						margin: 10rpx 20rpx 0 0;
+						justify-content: space-between;
+						align-items: center;
+						width: auto;
+						height: 60rpx;
+						border: 2rpx solid rgba(213, 213, 213, 1);
+						border-radius: 6rpx;
+					}
+
+					.blueBorder {
+						background-color: #1684fc;
+						color: #FFFFFF;
+					}
+
+				}
+			}
+
+
+		}
+
+		.add-btn-container {
+			margin-top: 32rpx;
+
+
+			.btn {
+				flex: 1;
+				background-color: rgba(255, 85, 85, 1);
+				color: #FFFFFF;
+				margin-left: 5rpx;
+				padding: 0;
+			}
+
+			.btnScan {
+				flex: 1;
+				color: #FFFFFF;
+				margin-right: 5rpx;
+				padding: 0;
+			}
+		}
+	}
+
+	.mask {
+		position: fixed;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background-color: rgba(0, 0, 0, 0.5);
+		z-index: 2000;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.mask .loading-text {
+		color: #fff;
+		font-size: 36rpx;
+	}
+</style>

+ 19 - 11
components/dialog-lotInfo/dialog-lotInfo.vue

@@ -13,7 +13,8 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">产品描述</text>
-				<text class="label right">{{ store.planDetails['productDescription'] ? store.planDetails['productDescription'] : '-' }}</text>
+				<text class="label right"
+					style="word-break: break-all;">{{ store.planDetails['productDescription'] ? store.planDetails['productDescription'] : '-' }}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">箱号</text>
@@ -21,7 +22,8 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">投入数</text>
-				<text class="label right">{{lotData['processQualifiedNum'] == 0 ? lotData['productionQuantity'] : lotData['processQualifiedNum']}}</text>
+				<text
+					class="label right">{{lotData['processQualifiedNum'] == 0 ? lotData['productionQuantity'] : lotData['processQualifiedNum']}}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">上道工序</text>
@@ -29,7 +31,8 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">当前工序</text>
-				<text class="label right">{{ lotData.currentProcess ? lotData['currentProcess'].processAlias : '-'}}</text>
+				<text
+					class="label right">{{ lotData.currentProcess ? lotData['currentProcess'].processAlias : '-'}}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">下道工序</text>
@@ -47,11 +50,13 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">炉号</text>
-				<text id="manufacturer" class="label right">{{ furnaceNoInfo.furnaceNumber ? furnaceNoInfo.furnaceNumber : '-'}}</text>
+				<text id="manufacturer"
+					class="label right">{{ furnaceNoInfo.furnaceNumber ? furnaceNoInfo.furnaceNumber : '-'}}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">计划单号</text>
-				<text id="manufacturer" class="label right">{{ furnaceNoInfo.productionPlanNo ? furnaceNoInfo.productionPlanNo : '-'}}</text>
+				<text id="manufacturer"
+					class="label right">{{ furnaceNoInfo.productionPlanNo ? furnaceNoInfo.productionPlanNo : '-'}}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">序号</text>
@@ -79,7 +84,8 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">原料编码</text>
-				<text class="label right">{{ furnaceNoInfo.rawMaterialCode ? furnaceNoInfo.rawMaterialCode : '-' }}</text>
+				<text
+					class="label right">{{ furnaceNoInfo.rawMaterialCode ? furnaceNoInfo.rawMaterialCode : '-' }}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">来料日期</text>
@@ -87,11 +93,13 @@
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">技术要求1</text>
-				<text class="label right">{{ furnaceNoInfo.firstTechnicalRequirement ? furnaceNoInfo.firstTechnicalRequirement : '-' }}</text>
+				<text
+					class="label right">{{ furnaceNoInfo.firstTechnicalRequirement ? furnaceNoInfo.firstTechnicalRequirement : '-' }}</text>
 			</view>
 			<view class="item-info uni-row">
 				<text class="label">技术要求2</text>
-				<text class="label right">{{ furnaceNoInfo.secondTechnicalRequirement ? furnaceNoInfo.secondTechnicalRequirement : '-' }}</text>
+				<text
+					class="label right">{{ furnaceNoInfo.secondTechnicalRequirement ? furnaceNoInfo.secondTechnicalRequirement : '-' }}</text>
 			</view>
 		</view>
 
@@ -189,20 +197,20 @@
 
 		}
 	}
-	
+
 	.middle {
 		display: flex;
 		flex-direction: row;
 		align-items: center;
 		justify-content: center
 	}
-	
+
 	.segment {
 		width: 80rpx;
 		background-color: rgba(213, 213, 213, 1);
 		border: 1rpx solid rgba(213, 213, 213, 1);
 	}
-	
+
 	.lotTitle {
 		margin: 16rpx 16rpx 16rpx 0;
 	}

+ 270 - 0
components/dialog-outsourceLot/dialog-outsourceLot.vue

@@ -0,0 +1,270 @@
+<template>
+	<dialog-base class="dialog-body" ref="baseDialog" title="添加新批次">
+		<view class="prompt">
+			<text>请选择批次后再确认</text>
+		</view>
+		<uni-section title="当前工序" type="square">
+			<uni-data-select v-model="selectedProcess" disabled="true" :localdata="processList"
+				:clear="false"></uni-data-select>
+		</uni-section>
+		<view style="overflow: auto;">
+			<view :class="{'list-container':true, 'selected':isSelected(item)}" @click="handleSelection(item,index)"
+				v-for="(item, index) in form" :key="item.id">
+				<view class="list-title"><text class="label">批次号:{{item.lotCode}}</text></view>
+				<view class="list-container-item uni-row"
+					style="border-top: 1px solid #e1e1e1;border-radius: 8rpx 8rpx 0 0;">
+					<text class="label">产品描述</text>
+					<text class="label value" style="word-wrap: break-word;">{{item['productDescription']}}</text>
+				</view>
+				<view class="list-container-item uni-row">
+					<text class="label">关联箱号</text>
+					<text class="label value">{{item['carrierName']}}</text>
+				</view>
+				<view class="list-container-item uni-row">
+					<text class="label">投产数量</text>
+					<text class="label value">{{item['daywork'].temporaryProcessQualifiedNum}}</text>
+				</view>
+				<view class="list-container-item uni-row" style="border-radius: 0 0 8rpx 8rpx;">
+					<text class="label">上道工序</text>
+					<text class="label value">{{item['process'].processAlias}}</text>
+				</view>
+			</view>
+		</view>
+		<view class="add-btn-container uni-row">
+			<button type="primary" class="btn" @click="handleConfirm">确认</button>
+		</view>
+	</dialog-base>
+</template>
+
+<script setup>
+	import {
+		ref,
+		getCurrentInstance
+	} from 'vue'
+	import {
+		getInnerNextProcess,
+		getProcessListByLot
+	} from "@/api/business/lot.js"
+	import {
+		getProcessList,
+	} from '@/api/business/deptProcess.js'
+	import {
+		getExamine
+	} from '@/api/business/dayworkItemExamine.js'
+	import {
+		store
+	} from '@/store/index.js'
+
+	const baseDialog = ref(null)
+	const selectedButton = ref(null)
+	const form = ref([])
+	const emit = defineEmits(['submit'])
+	const selection = ref([])
+	const selectedProcess = ref({})
+	const allProcessList = ref([])
+	const processList = ref([])
+
+
+	const open = (data) => {
+		console.log(data)
+		form.value = data;
+		baseDialog.value.open();
+		selection.value = [];
+		selectedProcess.value = {};
+		processList.value = [];
+		getProcesses()
+
+	}
+
+	const close = () => {
+		baseDialog.value.close()
+	}
+
+	defineExpose({
+		open
+	})
+
+	function getProcesses() {
+		console.log(form.value[0])
+		Promise.all([getInnerNextProcess({
+			deptId: store.curDeptDetails.deptId,
+			id: form.value[0].dayworkId
+		}), getProcessListByLot({
+			id: form.value[0].daywork.lotId,
+			isWasteRecycling: form.value[0].daywork.isWasteRecycling,
+			isAmend: form.value[0].daywork.isAmend,
+			technologicalProcessId: form.value[0].technologicalProcessId
+		})]).then(([res, response]) => {
+			//过滤工序列表将上道序及之前的工序去掉, 然后过滤出工序交集
+			// let curProcessSequence = [...store.planDetails.processSequence];
+			let curProcessSequence = response.data
+			allProcessList.value = curProcessSequence
+			processList.value[0] = {
+				text: res.data.processAlias,
+				value: res.data.technologicalProcessDetailId,
+				processId: res.data.processId,
+				processStepNumber: res.data.processStepNumber
+			}
+			selectedProcess.value = processList.value[0].value
+			console.log(selectedProcess.value)
+		})
+
+	}
+
+	function handleProcessChange() {
+		console.log(selectedProcess.value)
+	}
+
+	function handleConfirm() {
+		// 添加选择的工序
+		for (let i = 0; i < selection.value.length; i++) {
+			selection.value[i].daywork.technologicalProcessDetailId = selectedProcess.value;
+			selection.value[i].daywork.processStepNumber = processList.value.find(v => v.value === selectedProcess.value)
+				?.processStepNumber;
+			selection.value[i].daywork.processId = processList.value.findIndex(v => v.value === selectedProcess.value) >=
+				0 ? processList.value.find(v => v.value === selectedProcess.value).processId : null
+			console.log(processList.value.findIndex(v => v.value === selectedProcess.value) >= 0 ? processList.value.find(
+				v => v.value === selectedProcess.value).processId : null)
+		}
+		console.log(selection.value)
+		//执行确认
+		var msg = ""
+		if (selectedProcess.value && selection.value.length > 0) {
+			//判断选择的批次里是否有废品回用的
+			for (let i = 0; i < selection.value.length; i++) {
+				if (selection.value[i].daywork.isWaste == 0) {
+					msg += selection.value[i].lotCode + ","
+				}
+			}
+			if (msg === "") {
+				uni.showToast({
+					icon: 'none',
+					title: msg + "已被废弃"
+				})
+			} else {
+				//判断选择最后一道序的时候是否审核通过
+				let dayworkIds = []
+				for (let i = 0; i < selection.value.length; i++) {
+					// console.log(selection.value[i].daywork.processStepNumber)
+					// console.log(selection.value[i].processSequence[selection.value[i].processSequence.length - 1]
+					// 	.processStepNumber)
+					if (selection.value[i].daywork.processStepNumber == allProcessList.value[allProcessList.value.length -
+							1].processStepNumber) {
+						dayworkIds.push(selection.value[i].dayworkId)
+					}
+				}
+				if (dayworkIds.length > 0) {
+					getExamine({
+							dayworkIds: dayworkIds
+						})
+						.then(res => {
+							console.log(res.code);
+							if (res.code === 200) {
+								//处理成功情况
+								close();
+								emit('submit', selection.value);
+							} else {
+								uni.showModal({
+									title: '提示',
+									content: res.msg,
+								});
+
+							}
+						})
+				} else {
+					close();
+					emit('submit', selection.value);
+				}
+
+				// 	console.log(selection.value)
+
+			}
+		} else {
+			uni.showToast({
+				icon: 'none',
+				title: '请选择工序、批次后再确认'
+			})
+		}
+	}
+
+	function isSelected(item) {
+		return selection.value.includes(item);
+	}
+
+	function handleSelection(item, index) {
+		const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
+		if (buttonIndex > -1) {
+			selection.value.splice(buttonIndex, 1); // 取消选中
+		} else {
+			selection.value.push(item); // 选中
+		}
+		console.log(selection.value, "selection");
+	}
+</script>
+
+<style lang="scss">
+	.selected {
+		border: 3rpx solid #1684fc;
+		border-radius: 8rpx;
+	}
+
+	.dialog-body {
+		overflow: auto;
+
+		.list-title {
+			margin: 10rpx 0 20rpx 0;
+
+			.label {
+				font-size: 32rpx;
+				font-weight: bold;
+			}
+		}
+
+		.prompt {
+			color: red;
+			margin: 8rpx auto 0;
+		}
+
+		.list-container {
+			width: 94%;
+			display: flex;
+			align-items: flex-start;
+			margin: 10rpx auto;
+			padding: 8px 2% 16px 2%;
+			border-radius: 8rpx;
+
+			.list-container-item {
+				width: 100%;
+				border-bottom: 1px solid #e1e1e1;
+				border-left: 1px solid #e1e1e1;
+				border-right: 1px solid #e1e1e1;
+				padding: 12rpx 8rpx;
+				box-sizing: border-box;
+
+				.label {
+					font-size: 28rpx;
+					color: gray;
+					width: 140rpx;
+
+					&.value {
+						flex: 1;
+					}
+				}
+			}
+
+		}
+
+		.add-btn-container {
+			margin-top: 32rpx;
+
+			.btn {
+				flex: 1;
+			}
+		}
+	}
+
+	.selectedProcess {
+		width: 88%;
+		margin: 20rpx auto 40rpx;
+	}
+</style>

+ 372 - 0
components/dialog-turnoverInnerApplication/dialog-turnoverInnerApplication.vue

@@ -0,0 +1,372 @@
+<template>
+	<dialog-base ref="baseDialog" title="周转申请">
+		<view class="list-container">
+			<view><text style="margin: 0 0 0 5rpx;">请选择周转类型</text></view>
+			<view class="btn uni-row">
+				<view v-for="(item,index) in turnoverType"
+					:class="{ 'middle-btn': true, 'active': item.dictValue == curDayworkItem.turnoverType }"
+					@click="selectTurnoverType(item)"><text class="label"
+						style="font-size: 30rpx;">{{item.dictLabel}}</text></view>
+			</view>
+			<view class="" style="margin: 0 20rpx 20rpx 0;width: 88%;">
+				<uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;"
+					v-if="curDayworkItem.turnoverType == '1'">
+					<uni-data-select disabled="true" v-model="curDayworkItem.deptId" :localdata="insideDepts"
+						:clear="false"
+						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+				</uni-section>
+				<uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;"
+					v-if="curDayworkItem.turnoverType == '2'">
+					<uni-data-select v-model="curDayworkItem.deptId" :localdata="outsideDepts" :clear="false"
+						style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
+				</uni-section>
+			</view>
+			<view class="list-title">
+				<text class="label">请选择您摆放位置</text>
+			</view>
+			<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '1'">
+				<view v-for="(item,index) in turnAreaList" class="btn">
+					<view :class="{ 'middle-btn': true, 'active': handleTurnoverDoor(item) }"
+						@click="selectTurnoverDoor(item)"><text class="label"
+							style="font-size: 30rpx;">{{item.code}}</text></view>
+				</view>
+			</view>
+		</view>
+		<view class="add-btn-container uni-row">
+			<button type="default" class="btn" @click="handleConfirm">确认</button>
+		</view>
+	</dialog-base>
+</template>
+
+<script setup>
+	import {
+		ref,
+		getCurrentInstance
+	} from 'vue'
+	import {
+		onLoad
+	} from '@dcloudio/uni-app'
+	import {
+		getDictInfoByType
+	} from '@/api/dict/dict.js'
+	import {
+		getTurnoverByWorkshop,
+		getOutsourceTurnoverByWorkshop
+	} from '@/api/business/workshop.js'
+	import {
+		getDayWorkItemList,
+		turnoverInner,
+	} from '@/api/business/dayWorkItem.js'
+	import {
+		getDeptListInfo
+	} from '@/api/dept/dept.js'
+	import {
+		getTurnoverListByDeptId,
+	} from '@/api/business/turnover.js'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		timestampToTime
+	} from '@/utils/common.js'
+
+	const baseDialog = ref(null)
+	const turnoverDoorChecked = ref([])
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
+	const turnoverType = ref([])
+	const outTurnArea = ref([])
+	const turnoverArea = ref([])
+	const normalStatus = ref(false)
+	const selection = ref([])
+	const curDayworkItem = ref({
+		turnoverType: 1
+	})
+	const dayworkInfo = ref(null)
+	const deptList = ref([]) // 工段列表
+	const insideDepts = ref([]) // 车间内工段
+	const outsideDepts = ref([]) // 车间外工段
+	const turnAreaList = ref([]) // 周转区列表
+	const emit = defineEmits(['reflushDaywork']) // 自定义调用父组件方法
+
+	onLoad(() => {
+
+	})
+
+	function open(data) {
+		resetPage();
+		dayworkInfo.value = data;
+		normalStatus.value = false
+		init();
+		baseDialog.value.open();
+	}
+
+	defineExpose({
+		open
+	})
+
+	function close() {
+		baseDialog.value.close()
+		turnAreaList.value = [];
+	}
+
+	function resetPage() {
+		turnoverDoorChecked.value = []
+		turnoverType.value = []
+		turnoverArea.value = []
+		selection.value = []
+		curDayworkItem.value = {
+			turnoverType: 1,
+			deptId: store.curDeptDetails.deptId,
+			deptName: store.curDeptDetails.deptName
+		}
+		deptList.value = []
+		insideDepts.value = []
+		outsideDepts.value = []
+		turnAreaList.value = []
+	}
+
+	function init() {
+		console.log(dayworkInfo.value)
+		turnoverType.value = [{
+			dictValue: "1",
+			dictLabel: "车间内"
+		}];
+		getDayWorkItemList({
+			dayworkId: dayworkInfo.value.id,
+			userId: store.userInfo.userId,
+			lotId: dayworkInfo.value.lotId,
+			isWasteRecycling: dayworkInfo.value.isWasteRecycling,
+			isAmend: dayworkInfo.value.isAmend,
+			processStepNumber: dayworkInfo.value.currentProcess.processStepNumber
+		}).then(res => {
+			curDayworkItem.value = {
+				...res.rows[0],
+				turnoverType: 1,
+				deptId: store.curDeptDetails.deptId,
+				deptName: store.curDeptDetails.deptName
+			};
+		})
+		deptList.value = store.curDeptDetails;
+		console.log(deptList.value)
+		insideDepts.value.push({
+			text: deptList.value.deptName,
+			value: deptList.value.deptId,
+		})
+		if (store.curDeptDetails.isSortPackaging == 1) {
+			normalStatus.value = true
+		} else {
+			normalStatus.value = false
+		}
+		getTurnoverListByDeptId({
+			deptId: curDayworkItem.value.deptId,
+		}).then(res => {
+			console.log("999")
+			for (var i = 0; i < res.data.length; i++) {
+				if (res.data[i].status != 1) {
+					turnAreaList.value[i] = res.data[i];
+				}
+			}
+		})
+		curDayworkItem.value = {
+			turnoverType: 1,
+			deptId: store.curDeptDetails.deptId,
+			deptName: store.curDeptDetails.deptName
+		}
+
+	}
+
+	function selectTurnoverType(item) {
+		curDayworkItem.value.deptId = null
+		curDayworkItem.value.turnoverType = item.dictValue;
+		selection.value = []
+		normalStatus.value = false
+		curDayworkItem.value.isNextPacking = false
+	}
+
+	function selectTurnoverDoor(item) {
+		console.log(item, "chejiannei")
+		// turnoverDoorChecked.value = item;
+		// curDayworkItem.value.turnoverArea = item.dictValue;
+		let index = selection.value.findIndex(selectedItem => selectedItem === item);
+		if (index > -1) {
+			selection.value.splice(index, 1);
+		} else {
+			selection.value.push(item);
+		}
+	}
+
+	function handleTurnoverDoor(item) {
+		return selection.value.includes(item);
+	}
+	//校验车间内车间外
+	function handleValidate(data) {
+		console.log(data)
+		if (data.turnoverArea == "" || data.deptId == null || (turnAreaList.value.length != 0 && selection.value.length ==
+				0)) {
+			console.log("999")
+			return false;
+		} else {
+			console.log("888")
+			return true;
+		}
+	}
+
+	function handleConfirm() {
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经有请求发出,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
+		lastRequestTimestamp.value = currentTime;
+		console.log(dayworkInfo.value)
+		curDayworkItem.value.id = null;
+		curDayworkItem.value.status = '4';
+		curDayworkItem.value.processStepNumber = dayworkInfo.value.currentProcess.processStepNumber
+		curDayworkItem.value.startTime = timestampToTime(new Date());
+		curDayworkItem.value.endTime = timestampToTime(new Date());
+		curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
+		curDayworkItem.value.dayworkId = dayworkInfo.value.id;
+		curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
+		if (!store.tenantId) {
+			curDayworkItem.value.tenantId = store.userInfo.tenantId;
+		} else {
+			curDayworkItem.value.tenantId = store.tenantId;
+		}
+
+		// 过滤出周转位置的数组,并转换成字符串
+		if (selection.value.length > 0) {
+			const newArray = selection.value.map((item) => {
+				if (item.code) {
+					return item.code;
+				} else if (item.dictLabel) {
+					return item.dictLabel;
+				} else {
+					return null;
+				}
+			})
+			const newIdArray = selection.value.map((item) => {
+				if (item.id) {
+					return item.id;
+				} else {
+					return null;
+				}
+			})
+			curDayworkItem.value.place = newArray.join('、');
+			//0628将位置id也拼接的方式存下来
+			curDayworkItem.value.placeId = newIdArray.join('、');
+		}
+
+		curDayworkItem.value.turnoverArea = "车间内周转看place字段";
+		// console.log(dayworkInfo.value)
+		if (!handleValidate(curDayworkItem.value)) {
+			uni.showToast({
+				icon: "none",
+				title: '请选择完整信息'
+			});
+		} else {
+			curDayworkItem.value.isNextPacking = false
+			if (normalStatus.value) {
+				curDayworkItem.value.isNextPacking = true
+			}
+
+			close();
+			turnoverInner(curDayworkItem.value).then(res => {
+				if (res.code === 200) {
+					uni.showToast({
+						icon: 'success',
+						title: '操作成功'
+					});
+					emit('reflushDaywork');
+				} else {
+					console.log("999")
+					console.log(res.msg)
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					});
+					setTimeout(() => {
+						emit('reflushDaywork')
+					}, 1000);
+
+				}
+			})
+		}
+
+
+	}
+</script>
+
+<style lang="scss">
+	.dialog-body {
+		.list-container {
+			width: 100%;
+
+			.list-title {
+				margin-top: 24rpx;
+
+				.label {
+					font-size: 32rpx;
+				}
+			}
+
+			.turnArea {
+				flex-wrap: wrap;
+				height: auto;
+				max-height: 200rpx;
+				overflow: auto;
+			}
+
+			.btn {
+				margin-top: 24rpx;
+
+				.middle-btn {
+					margin-right: 32rpx;
+					align-items: center;
+					justify-content: center;
+					padding-left: 0;
+					height: 80rpx;
+					width: 220rpx;
+					border-radius: 8rpx;
+					background-color: #FFFFFF;
+					border: 1px solid #999999;
+					background-color: #FFFFFF;
+
+				}
+
+				.label {
+					font-size: 24rpx;
+					color: #000000;
+				}
+
+				.active {
+					border-color: #1684fc;
+					background-color: rgb(236, 245, 255);
+
+					.label {
+						color: #1684fc;
+					}
+				}
+			}
+		}
+
+		.add-btn-container {
+			margin-top: 32rpx;
+
+			.btn {
+				flex: 1;
+				background-color: rgb(255, 121, 1);
+				color: #FFFFFF;
+
+			}
+		}
+	}
+</style>

+ 71 - 0
pages.json

@@ -28,6 +28,13 @@
 				// "enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/outsourceProductionPlan/index",
+			"style": {
+				"navigationBarTitleText": "生产计划单"
+				// "enablePullDownRefresh": true
+			}
+		},
 		{
 			"path": "pages/sortProductionPlan/details",
 			"style": {
@@ -42,6 +49,13 @@
 				// "enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/batchReportingOutsource/index",
+			"style": {
+				"navigationBarTitleText": "批次报工"
+				// "enablePullDownRefresh": true
+			}
+		},
 		{
 			"path": "pages/addNewBatch/index",
 			"style": {
@@ -55,6 +69,13 @@
 
 			}
 		},
+		{
+			"path": "pages/reportingForInnerWork/index",
+			"style": {
+				"navigationBarTitleText": "报工记录"
+
+			}
+		},
 		{
 			"path": "pages/reportHistory/index",
 			"style": {
@@ -98,6 +119,13 @@
 				// "enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/sortInnerProductionPlan/index",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+				// "enablePullDownRefresh": true
+			}
+		},
 		{
 			"path": "pages/sortBatchReporting/index",
 			"style": {
@@ -105,6 +133,13 @@
 				// "enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/sortBatchInnerReporting/index",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+				// "enablePullDownRefresh": true
+			}
+		},
 		{
 			"path": "pages/sorting/form",
 			"style": {
@@ -141,6 +176,42 @@
 				"navigationBarTitleText": "分选报工"
 			}
 		},
+		{
+			"path": "pages/sortingOutsource/form",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+			}
+		},
+		{
+			"path": "pages/sortingOutsource/options",
+			"style": {
+				"navigationBarTitleText": "检查项选择"
+			}
+		},
+		{
+			"path": "pages/sortingOutsource/technicianOptions",
+			"style": {
+				"navigationBarTitleText": "技术负责人"
+			}
+		},
+		{
+			"path": "pages/sortingOutsource/specialOptions",
+			"style": {
+				"navigationBarTitleText": "检查项选择"
+			}
+		},
+		{
+			"path": "pages/sortingOutsource/storageRetrieval",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+			}
+		},
+		{
+			"path": "pages/sortingOutsource/consultation",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+			}
+		},
 		{
 			"path": "pages/processInspection/consultation",
 			"style": {

+ 3 - 1
pages/addNewBatch/index.vue

@@ -518,10 +518,11 @@
 			}
 		});
 	}
+
 	function qrReaderClose() {
 		showQrCodeReader.value = false;
 	}
-	
+
 	function onDecodeHandler(ret) {
 		showQrCodeReader.value = false;
 		checkLotCode(ret);
@@ -633,6 +634,7 @@
 		dayWork.value.isAmend = batchNoList.value[0].isAmend
 		dayWork.value.fromId = batchNoList.value[0].fromId
 		dayWork.value.isSuperaddition = batchNoList.value[0].isSuperaddition
+		dayWork.value.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId
 		store.furnaceNumberInfo = basicInfo.value;
 		if (checkLotCode(dayWork.value.lotCode)) {
 			isTakeStock().then(response => {

+ 952 - 0
pages/batchReportingOutsource/index.vue

@@ -0,0 +1,952 @@
+<template>
+	<view v-if="isMaskShow" class="mask">
+	</view>
+	<view class="uni-column" style="height: 100%; background-color: #f5f5f5;">
+		<view class="box-bg uni-row">
+			<view class="input-view uni-row">
+				<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="请输入批次号/箱号" />
+			</view>
+			<view class="search" @click="handleSearch">
+				搜索
+			</view>
+		</view>
+		<view class="list-title uni-row">
+			<!-- <div class="list-title uni-row"> -->
+			<text class="label">是否正常批次</text>
+			<text>{{ normalStatus ? '是' : '否' }}</text>
+			<switch class="switch" :checked="normalStatus" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
+			<!-- <text>{{ }}</text> -->
+			<!-- </div> -->
+			<!-- 	<text class="label">是否正常批次</text><text>是</text>
+			<switch class="switch" @change="switchChange" color="rgba(255,85,85,1)" />
+			<text>否</text> -->
+		</view>
+
+		<view class="scroll-container" style="padding-bottom:  150rpx">
+			<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
+				<text>暂无批次</text>
+			</view>
+			<!-- 批次列表 -->
+			<view v-else v-for="(item, index) in listData" :key="index" class="list-item"
+				@click="handleToreportingForWork(item)">
+				<view class="title-container uni-row" style="justify-content: flex-start;">
+					<view class="title uni-row">
+						<text class="label">批次号:</text>
+						<text class="label code">{{ item['lotCode'] }}</text>
+					</view>
+					<view class=" uni-row" style="margin-left: 16rpx;">
+						<view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
+						<view v-else-if="item['status'] == 3" class="tag turnover "><text class="label">待领取</text>
+						</view>
+						<view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">待周转</text>
+						</view>
+						<view v-else-if="item['status'] == 0" class="tag finished "><text class="label">未开始</text>
+						</view>
+						<view v-else-if="item['status'] == 4" type="default finished" class="tag finished"><text
+								class="label">已完成</text></view>
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ curPlan['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">材质</text>
+					<text
+						class="label right">{{ item['furnaceNoInfo'] && item['furnaceNoInfo'].firstTechnicalRequirement != '' ? item['furnaceNoInfo'].firstTechnicalRequirement + ";" + item['furnaceNoInfo'].secondTechnicalRequirement : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">箱号</text>
+					<text class="label right">{{ item['carrierName'] ? item['carrierName'] : '-' }}</text>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">总工时</text>
+					<text class="label right">{{ item['totalWorkingHours']}}</text>
+				</view> -->
+				<view class="item-info uni-row">
+					<text class="label">投入数</text>
+					<text
+						class="label right">{{ item.prevProcess == null ? item['productionQuantity']  : item['processQualifiedNum']}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">上道工序</text>
+					<text class="label right">{{ item.prevProcess ? item['prevProcess'].processAlias : '-'}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">当前工序</text>
+					<!-- <text
+						class="label right">{{ item.currentProcess ? item.prevProcess && item['currentProcess'].processAlias == item['prevProcess'].processAlias ? '-' : item['currentProcess'].processAlias : '-'}}</text> -->
+					<text
+						class="label right">{{ item.currentProcess ? item['currentProcess'].processAlias : '-'}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">下道工序</text>
+					<view class="label right uni-row">
+						{{ item.nextProcess ? item['nextProcess'].processAlias : '-' }}
+						(<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
+						</view>)
+					</view>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">设备</text>
+					<text class="label right">{{ curPlan['equipmentName'] }}</text>
+				</view> -->
+				<view v-if="notPreProcess" class="item-info uni-row">
+					<text class="label">所在区域</text>
+					<text class="label right">{{ item['place'] ? item['place'] : '-' }}</text>
+				</view>
+				<view
+					v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
+					class="item-info uni-row">
+					<text class="label">目标工段</text>
+					<text
+						class="label right">{{ item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3 ? item['dayworkItemList'][0].deptName : '-' }}</text>
+				</view>
+				<view
+					v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
+					class="item-info uni-row">
+					<text class="label">目标车间</text>
+					<text class="label right">{{ item['workshopName']}}</text>
+				</view>
+
+				<view v-if="item.protemResourceGroupDetailList && item.protemResourceGroupDetailList.length>0"
+					class="item-info uni-row">
+					<text class="label">邀请者</text>
+					<text
+						class="label right">{{ item['protemResourceGroupDetailList'] && item['protemResourceGroupDetailList'].length>0 ? item['protemResourceGroupDetailList'][0].protemCreatorName : '-' }}</text>
+				</view>
+				<view v-if="item.protemResourceGroupDetailList&& item.protemResourceGroupDetailList.length>0"
+					class="item-info uni-row">
+					<text class="label">已完成数量</text>
+					<text class="label right">{{ item['totalQuantity'] ? item['totalQuantity'] : 0 }}</text>
+				</view>
+				<view class="status-btn uni-row">
+					<view v-if="item['status'] == 2 && !item['hasFinishOutsource']" class=" uni-row">
+						<button class="turnover-tag" size="mini"
+							@click.stop="handleShowTurnoverApplication(item)">周转申请</button>
+						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
+					</view>
+					<view v-else-if="item['status'] == 3" class=" uni-row">
+						<button class="turnover-tag" size="mini" @click.stop="handleCancelTurnover(item)"
+							style="background-color: rgba(255, 85, 85, 1);">取消周转</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 抽屉 -->
+		<uni-drawer ref="showRight" mode="right" :mask-click="true" style="height: 100%;">
+			<view style="text-align: center; font-size: 48rpx; padding: 80rpx 0 24rpx 0;">工艺列表</view>
+			<view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
+				仅显示当前工序后面工艺
+			</view>
+			<view><button v-if="!editStatus" class="view-end-btn" style="margin-bottom: 16rpx;" type="primary"
+					@click="handleOpenDrawing">查看本工序图纸</button></view>
+			<scroll-view scroll-y="true" style="height: 70%;" @touchmove.stop>
+				<view v-for="(item,index) in curProcessAfte" :key="index"
+					style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
+					<text>{{ index + 1 }}.{{item.processAlias}}</text>
+				</view>
+			</scroll-view>
+			<!-- 		<view><button v-if="!editStatus" class="view-end-btn" style="margin-top: 20rpx;" type="primary"
+					@click="handleOpenDrawing">查看本工序图纸</button></view> -->
+
+		</uni-drawer>
+		<!-- <view v-if="bottomStatus" class="bottom uni-row">
+			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
+		</view>
+		<view v-if="!bottomStatus" class="bottom uni-row">
+			<button class="start-batch-btn" type="primary" @click="handleScanCode">扫一扫开始新批次</button>
+		</view> -->
+		<view class="bottom uni-row">
+			<!-- <button v-if="bottomStatus" class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
+				@click="handleStartNewBatch">开始新批次</button> -->
+			<button class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
+				@click="handleScanCode">扫码开始批次</button>
+		</view>
+		<dialog-outsourceLot ref="outsourceLotDialog" @submit="handleDoIt" />
+		<dialog-turnoverInnerApplication ref="turnoverApplicationDialog" @reflushDaywork="handleDoTurnoverAfter" />
+		<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
+	</view>
+
+</template>
+
+<script setup>
+	import {
+		normalizeProps,
+		reactive,
+		onMounted,
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import QrScanner from '../vueQrCode/index.vue'
+	import {
+		getDayWorkInnerList,
+		showDaywork,
+		showDayworkInnerSave,
+		turnoverDelete
+	} from '@/api/business/dayWork.js'
+	import {
+		isTakeStock
+	} from '@/api/business/taksStackLot.js'
+	import {
+		getAbnormalityLot
+	} from '@/api/business/lot.js'
+	import {
+		carrierFinishedCheck
+	} from '@/api/business/carrier.js'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		onPullDownRefresh
+	} from "@dcloudio/uni-app"
+
+	const turnoverApplicationDialog = ref(null)
+	const outsourceLotDialog = ref(null)
+	const showQrCodeReader = ref(false);
+	const listData = ref([])
+	const curPlan = ref(null)
+	const bizDayworkObj = ref({})
+	const bottomStatus = ref(false) // 底部按钮显示
+	const paging = ref();
+	const reqParam = ref(null);
+	const normalStatus = ref(true)
+	const isLoding = ref(false);
+	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
+	const keywords = ref(null)
+	const tempList = ref([])
+	const wasteRecyclingList = ref([]) //废品回用批次
+	// 在数据中定义一个变量来控制遮罩层的显示
+	const isMaskShow = ref(false);
+	//打开图纸
+	//选中的daywork
+	const currentDaywork = ref({})
+	const editStatus = ref(false)
+	const notPreProcess = ref(true)
+	const curProcessAfte = ref([])
+	const showRight = ref(null) // 抽屉
+
+
+
+	onLoad(() => {
+		curPlan.value = store.planDetails;
+		normalStatus.value = true;
+		console.log(curPlan.value)
+		//废品回用的领料部门如果是当前工段,也要可以开始新批次
+		//查找当前计划单下的批次废品回用是当前工段
+		getAbnormalityLot({
+			productionPlanDetailId: store.planDetails.id,
+			requisitionDepartmentId: store.curDeptDetails.deptId
+		}).then(res => {
+			wasteRecyclingList.value = res.rows
+			if (store.planDetails.requisitionDepartmentId == store.curDeptDetails.deptId ||
+				wasteRecyclingList.value.length > 0) {
+				bottomStatus.value = true;
+				store.isPreProcess = true;
+			} else {
+				bottomStatus.value = false;
+				store.isPreProcess = false;
+			}
+		})
+		console.log(wasteRecyclingList.value.length)
+
+	})
+
+	// 页面下拉刷新操作
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		reflush();
+	})
+
+
+	onShow(() => {
+		reflush();
+
+
+	})
+
+	;
+
+	function reflush() {
+		init(store.planDetails.id);
+	}
+
+	function handleShowTurnoverApplication(data) {
+		console.log(data)
+		//如果这批废了,则不能周转申请
+		if (data.isWaste == 1) {
+			uni.showToast({
+				icon: 'none',
+				title: '此批已废,不能申请周转',
+				duration: 2000
+			})
+		} else {
+			isTakeStock().then(response => {
+				if (response.data) {
+					uni.showToast({
+						icon: 'none',
+						title: '正在盘点,不能申请周转',
+						duration: 2000
+					})
+				} else {
+					let _data = data ?? {}
+					carrierFinishedCheck(data).then(res => {
+						if (res.code === 200) {
+							// 调用子组件中的方法
+							turnoverApplicationDialog.value.open(_data)
+						} else {
+							uni.showToast({
+								icon: 'none',
+								title: res.msg
+							})
+						}
+					})
+				}
+			})
+
+		}
+
+	}
+
+	function handleStartNewBatch() {
+		store.normalStatus = normalStatus.value;
+		// console.log(normalStatus.value)
+		uni.navigateTo({
+			url: "/pages/addNewBatch/index"
+		})
+	}
+
+	function init(id) {
+
+		uni.showLoading({
+			title: '加载中'
+		});
+		let reqData = {
+			productionPlanDetailId: id,
+			deptId: store.curDeptDetails.deptId,
+			keywords: keywords.value
+		};
+		// console.log(normalStatus.value)
+
+		getDayWorkInnerList(reqData).then(res => {
+			console.log(res.data)
+			if (res.code == 200) {
+				res.data.forEach(item => {
+					let quantitySum = 0;
+					item.dayworkItemList.forEach(info => {
+						if (info.status < 4 && item.currentProcess.processStepNumber == info
+							.processStepNumber) {
+							quantitySum += info.qualifiedNum;
+						}
+					});
+					item.totalQuantity = quantitySum;
+				});
+				tempList.value = res.data
+				// console.log(res)
+				if (normalStatus.value) {
+					listData.value = res.data.filter(item => {
+						return item.isWasteRecycling == 0 && item.isAmend == 0;
+					});
+				} else {
+					listData.value = res.data.filter(item => {
+						return item.isWasteRecycling == 1 || item.isAmend == 1;
+					})
+				}
+				// 20240614 分批投产数量不按照上到序的完成数量来。
+				// for (let i = 0; i < listData.value.length; i++) {
+				// 	if (listData.value[i].prevProcess) {
+				// 		let sum = 0;
+				// 		for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
+				// 			if (listData.value[i].dayworkItemList[j].processId == listData.value[i]
+				// 				.prevProcess
+				// 				.id && (listData.value[i].dayworkItemList[j].status == 2 || listData
+				// 					.value[i]
+				// 					.dayworkItemList[j].status == 3)) {
+				// 				sum += listData.value[i].dayworkItemList[j].qualifiedNum;
+				// 			}
+				// 		}
+				// 		listData.value[i].processQualifiedNum = sum;
+				// 	}
+				// }
+			}
+
+			uni.hideLoading();
+		})
+	}
+
+	function handleSearch() {
+		init(store.planDetails.id);
+
+	}
+
+	function handleToreportingForWork(item) {
+		store.dayworkInfo = item
+		uni.navigateTo({
+			url: "/pages/reportingForInnerWork/index"
+		})
+	}
+
+	function handleClickProcessList(item) {
+		let curProcessAfterList = [];
+		console.log("工序列表", item)
+		currentDaywork.value = item
+		editStatus.value = false
+		// if (item.isWasteRecycling == 1 || item.isAmend == 1) {
+		// 	editStatus.value = true
+		// } else {
+		// 	editStatus.value = false
+		// }
+		let nextIndex = 0;
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (item.nextProcess) {
+				if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
+					nextIndex = i;
+				}
+			} else {
+				nextIndex = item.processSequence.length
+			}
+		}
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (i >= nextIndex) {
+				curProcessAfterList.push(item.processSequence[i]);
+			}
+		}
+		if (item.status == 3) {
+			curProcessAfterList.splice(0, 1)
+		}
+		console.log(curProcessAfterList)
+		curProcessAfte.value = curProcessAfterList;
+		showRight.value.open();
+	}
+
+	function switchChange(event) {
+		console.log(event)
+		//异常批
+		if (normalStatus.value) {
+			listData.value = tempList.value.filter(item => {
+				return item.isWasteRecycling == 1 || item.isAmend == 1;
+			});
+			normalStatus.value = false
+		} else {
+			listData.value = tempList.value.filter(item => {
+				return item.isWasteRecycling == 0 && item.isAmend == 0;
+			});
+			normalStatus.value = true
+		}
+	}
+
+	//H5扫码器回调
+	function onDecodeHandler(data) {
+		showQrCodeReader.value = false;
+		console.log(data);
+		let vehicleObj = {
+			carrierCode: data
+		};
+		if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return;
+		}
+		showDaywork({
+			carrierId: '0', // 不传递箱子id
+			carrierCode: vehicleObj.carrierCode,
+			status: 7
+		}).then(response => {
+			if (response.code == 200) {
+				console.log(response)
+				console.log(response.data[0].productionPlanDetailId)
+				console.log(store.planDetails.id)
+				console.log(response.data[0].deptId !== store.curDeptDetails.deptId)
+				if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+					uni.showToast({
+						icon: 'none',
+						title: '该批次不在当前工段',
+						duration: 2000
+					})
+					return
+				}
+				if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+					console.log(response.data)
+					outsourceLotDialog.value.open(response.data);
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '该批次不在此计划单内',
+						duration: 2000
+					})
+				}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: response.msg,
+					duration: 2000
+				})
+			}
+		})
+	}
+
+
+	//H5扫码器关闭
+	function qrReaderClose() {
+		showQrCodeReader.value = false;
+	}
+
+	function handleScanCode() {
+		showQrCodeReader.value = true;
+		// 	// 引入原生插件
+		// 	const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		// 	if (mpaasScanModule) {
+		// 		// 调用插件的 mpaasScan 方法
+		// 		mpaasScanModule.mpaasScan({
+		// 				// 扫码识别类型,参数可多选,qrCode、barCode,
+		// 				// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+		// 				scanType: ["qrCode", "barCode"],
+		// 				// 是否隐藏相册,默认false不隐藏
+		// 				hideAlbum: false,
+		// 			},
+		// 			(ret) => {
+		// 				console.log(ret);
+		// 				/* 原有代码,之前二维码中存的信息比较多,用一个JSON格式存储。
+		// 				let vehicleObj = JSON.parse(ret.resp_result);
+		// 				if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
+		// 					uni.showToast({
+		// 						icon: "none",
+		// 						title: "请扫载具码",
+		// 						duration: 1000
+		// 					})
+		// 					return;
+		// 				}
+		// 				*/
+		// 				let vehicleObj = {
+		// 					carrierCode: ret.resp_result
+		// 				};
+		// 				if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+		// 					uni.showToast({
+		// 						icon: "none",
+		// 						title: "请扫载具码",
+		// 						duration: 1000
+		// 					})
+		// 					return;
+		// 				}
+		// 				showDaywork({
+		// 					carrierId: '0', // 不传递箱子id
+		// 					carrierCode: vehicleObj.carrierCode,
+		// 					status: 7
+		// 				}).then(response => {
+		// 					if (response.code == 200) {
+		// 						console.log(response)
+		// 						console.log(response.data[0].productionPlanDetailId)
+		// 						console.log(store.planDetails.id)
+		// 						console.log(response.data[0].deptId !== store.curDeptDetails.deptId)
+		// 						if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+		// 							uni.showToast({
+		// 								icon: 'none',
+		// 								title: '该批次不在当前工段',
+		// 								duration: 2000
+		// 							})
+		// 							return
+		// 						}
+		// 						if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+		// 							console.log(response.data)
+		// 							lotDialog.value.open(response.data);
+		// 						} else {
+		// 							uni.showToast({
+		// 								icon: 'none',
+		// 								title: '该批次不在此计划单内',
+		// 								duration: 2000
+		// 							})
+		// 						}
+		// 					} else {
+		// 						uni.showToast({
+		// 							icon: 'none',
+		// 							title: response.msg,
+		// 							duration: 2000
+		// 						})
+		// 					}
+		// 				})
+		// 			}
+		// 		);
+		// 	} else {
+		// 		// 测试时用
+		// 		showDaywork({
+		// 			carrierId: '1780467398971187210',
+		// 			carrierCode: '',
+		// 			status: 7
+		// 		}).then(response => {
+		// 			if (response.code == 200) {
+		// 				console.log(response)
+		// 				console.log(response.data[0].productionPlanDetailId)
+		// 				console.log(store.planDetails.id)
+		// 				console.log(response.data[0].deptId !== store.curDeptDetails.deptId)
+		// 				if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+		// 					uni.showToast({
+		// 						icon: 'none',
+		// 						title: '该批次已转至其他工段',
+		// 						duration: 2000
+		// 					})
+		// 					return
+		// 				}
+		// 				if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+		// 					console.log(response.data)
+		// 					lotDialog.value.open(response.data);
+		// 				} else {
+		// 					uni.showToast({
+		// 						icon: 'none',
+		// 						title: '该批次不在此计划单内',
+		// 						duration: 2000
+		// 					})
+		// 				}
+		// 			} else {
+		// 				uni.showToast({
+		// 					icon: 'none',
+		// 					title: response.msg,
+		// 					duration: 2000
+		// 				})
+		// 			}
+		// 		})
+		// 	}
+	}
+
+	function handleAddDaywork(data) {
+		console.log(data)
+		let reqParam = [];
+		for (var i = 0; i < data.length; i++) {
+			reqParam.push(data[i].daywork)
+		}
+		console.log(data)
+		data.forEach(item => {
+			item.isSort = 0
+		})
+		showDayworkInnerSave(data).then(res => {
+			console.log(res)
+			init(store.planDetails.id);
+		})
+	}
+
+	function handleDoIt(data) {
+		handleAddDaywork(data);
+	}
+
+	function handleOpenDrawing() {
+		console.log(currentDaywork.value, "444")
+
+		var filteredProcess = currentDaywork.value.processSequence.filter(item => item.processStepNumber == currentDaywork
+			.value.currentProcess.processStepNumber);
+
+		// 检查 filteredProcess 是否有元素,并选择第一个元素
+		if (filteredProcess.length > 0) {
+			var firstMatch = filteredProcess[0]; // 获取第一个匹配的对象
+			console.log("currentDaywork", currentDaywork.value)
+			// 对 technologicalProcessDetailId 进行URL编码
+			var encodedId = encodeURIComponent(currentDaywork.value.productId);
+			var enTechnologicalProcessId = encodeURIComponent(currentDaywork.value.technologicalProcessId);
+			var enprocessCode = encodeURIComponent(firstMatch.processCode);
+			var encodeCode = encodeURIComponent(currentDaywork.value.lotCode);
+			var enProcessAlias = encodeURIComponent(firstMatch.processAlias);
+			var enIsWasteRecycling = encodeURIComponent(currentDaywork.value.isWasteRecycling);
+			var enIsAmend = encodeURIComponent(currentDaywork.value.isAmend);
+			// 构建查询参数字符串
+			var queryParam =
+				`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}&param6=${enIsWasteRecycling}&param7=${enIsAmend}`;
+
+			// 使用模板字符串构建完整的URL
+			var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+			// 导航到指定页面
+			uni.navigateTo({
+				url: navigateUrl
+			});
+		} else {
+			console.log('No process matched the current process step number.');
+		}
+	}
+
+	function handleDoTurnoverAfter() {
+		reflush();
+	}
+
+
+
+
+	function handleCancelTurnover(data) {
+		isTakeStock().then(response => {
+			if (response.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '正在盘点,不能取消周转',
+					duration: 2000
+				})
+			} else {
+				isMaskShow.value = true; // 显示遮罩层
+				uni.showLoading({
+					title: '加载中'
+				});
+				turnoverDelete(data).then(res => {
+					isMaskShow.value = false
+					if (res.code == 200) {
+						uni.showToast({
+							icon: "success",
+							title: "取消成功",
+							duration: 2000
+						})
+						isLoding.value = false;
+						setTimeout(() => {
+							init(store.planDetails.id);
+						}, 1000);
+					} else {
+						uni.showToast({
+							icon: "none",
+							title: "取消失败",
+							duration: 2000
+						})
+						isLoding.value = false;
+						setTimeout(() => {
+							init(store.planDetails.id);
+						}, 1000);
+					}
+				})
+			}
+		})
+	}
+</script>
+
+<style lang="scss">
+	$nav-height: 60rpx;
+
+	/* 遮罩层样式 */
+	.mask {
+		position: fixed;
+		/* 固定定位,覆盖整个屏幕 */
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background-color: rgba(0, 0, 0, 0.3);
+		/* 黑色背景,透明度30% */
+		display: flex;
+		justify-content: center;
+		/* 水平居中 */
+		align-items: center;
+		/* 垂直居中 */
+		z-index: 1000;
+		/* 确保遮罩层在其他元素之上 */
+	}
+
+	.box-bg {
+		width: 94%;
+		background-color: #F5F5F5;
+		padding: 5rpx 16rpx;
+		justify-content: space-around;
+		align-items: center;
+		margin: 24rpx auto 0;
+
+		.input-view {
+			width: 100%;
+			flex: 4;
+			background-color: #f8f8f8;
+			height: $nav-height;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			margin: 0 10rpx 0;
+			line-height: $nav-height;
+
+			.input-uni-icon {
+				line-height: $nav-height;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: $nav-height;
+				line-height: $nav-height;
+				padding: 0 5rpx;
+				background-color: #f8f8f8;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			color: #808080;
+		}
+	}
+
+	.list-title {
+		width: 100%;
+		margin-top: 16rpx;
+		height: 64rpx;
+		line-height: 64rpx;
+		align-items: center;
+		margin-left: 32rpx;
+
+		.label {
+
+			font-size: 32rpx;
+			margin-right: 24rpx;
+		}
+
+		.icon-gear {
+			font-size: 56rpx;
+		}
+	}
+
+	.switch {
+		margin-top: -8rpx;
+		transform: scale(0.7);
+	}
+
+	.scroll-container {
+		width: 92%;
+		margin: 24rpx auto 0 auto;
+		height: calc(90% - 100rpx);
+		overflow: auto;
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		margin-bottom: 24rpx;
+		border-radius: 24rpx;
+
+		.title-container {
+
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1CE5B0;
+				background-color: #F6FFFD;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1CE5B0;
+					font-size: 24rpx;
+				}
+
+				&.finished {
+					border: 1px solid #BBBBBB;
+					background-color: #F5F5F5;
+
+					.label {
+						color: #BBBBBB;
+					}
+				}
+
+				&.turnover {
+					border: 1px solid #FF7901;
+					background-color: #F6FFFD;
+
+					.label {
+						color: #FF7901;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+
+		.status-btn {
+			justify-content: flex-end;
+			align-items: center;
+
+			.turnover-tag {
+				padding-right: 12rpx;
+				padding-left: 12rpx;
+				border-radius: 8rpx;
+				border: 1rpx solid #FF7901;
+				background-color: #FF7901;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+			}
+
+			.reporting-tag {
+				padding-right: 12rpx;
+				padding-left: 12rpx;
+				border-radius: 8rpx;
+				margin-left: 16rpx;
+				border: 1rpx solid #1684fc;
+				background-color: #1684fc;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+			}
+		}
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+
+		.view-end-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+
+		}
+	}
+</style>

+ 186 - 118
pages/dashboard/index.vue

@@ -24,71 +24,86 @@
 			</uni-section>
 		</view>
 		<view class="scroll-container" style="padding-bottom:120rpx;">
-		<!-- <view class="business-btn uni-row" v-if="showOther" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view> -->
-		<view class="business-btn uni-row" v-if="showOther" @click="handeleToReportHistory">
-			<text class="label">我的报工</text>
-		</view>
-		<view v-if="showQuick" class="business-btn uni-row" @click="handleFastToProductionPlan">
-			<text class="label">快速报工</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showTakeStock" @click="handleToTakeStock">
-			<text class="label">盘点</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showOther && !showSizing" @click="handleToProductionPlan">
-			<text class="label">报工</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showInnerTurnover" @click="handleInnerTurnover">
-			<text class="label">内部周转</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showSizing" @click="handleToSorting">
-			<text class="label">分选报工</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showAuxiliary" @click="handleToAuxiliary">
-			<text class="label">辅助工序报工</text>
-		</view>
-		<view class="business-btn uni-row" @click="handleToGetLotInfo">
-			<text class="label">扫码查询批次信息</text>
-		</view>
-		<!-- 		<view class="business-btn uni-row" v-if="showInspector" @click="handleToProcessInspection">
-			<text class="label">序检</text>
-		</view> -->
-		<view class="business-btn uni-row"  @click="handleToInspectionReceive">
-			<text class="label">检测领取</text>
-		</view>
-		<view class="business-btn uni-row"  @click="handleToInspectionDetails">
-			<text class="label">检查列表</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showOutsourcedInspector" @click="handleToOutsourcedInspection">
-			<text class="label">外协检查</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showDeliveryInspection" @click="handleToDeliveryInspection">
-			<text class="label">交检</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showFirstArticleInspection" @click="handleToFirstInspection">
-			<text class="label">首件检</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showOnSiteInspector" @click="handleToOnSiteInspection">
-			<text class="label">巡检</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showInstrumentRoomInspection" @click="handleToInstrumentInspection">
-			<text class="label">仪器室</text>
-		</view>
-		<view class="business-btn uni-row"  @click="handleToFactoryInspection">
-			<text class="label">出厂检</text>
-		</view> 
-		<view class="business-btn uni-row" v-if="showAdjust" @click="handleToAdjust">
-			<text class="label">交检审核</text>
-		</view>
-		<!-- v-hasRoles="['porter']" 可通过v-Roles自定义指令进行显隐 -->
-		<view class="business-btn uni-row" v-if="showTurn" @click="handleToHandlingList">
-			<text class="label">周转</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showOutSourceList" @click="handleOutsourceList">
-			<text class="label">外协验箱</text>
-		</view>
-		<view class="business-btn uni-row" v-if="showChangeTurnover" @click="handleChangeTurnover">
-			<text class="label">更换工段加工</text>
-		</view>
+			<!-- <view class="business-btn uni-row" v-if="showOther" @click="handleRecerptSfprod"><text class="label">半成品接收</text></view> -->
+			<view class="business-btn uni-row" v-if="showOther" @click="handeleToReportHistory">
+				<text class="label">我的报工</text>
+			</view>
+			<view v-if="showQuick && !showOutsource " class="business-btn uni-row" @click="handleFastToProductionPlan">
+				<text class="label">快速报工</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showTakeStock && !showOutsource " @click="handleToTakeStock">
+				<text class="label">盘点</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showOther && !showSizing && !showOutsource"
+				@click="handleToProductionPlan">
+				<text class="label">报工</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showInnerTurnover && !showOutsource" @click="handleInnerTurnover">
+				<text class="label">内部周转</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showSizing && !showOutsource" @click="handleToSorting">
+				<text class="label">分选报工</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showOutsource && !showSortOutsource"
+				@click="handleToNormalOutsource">
+				<text class="label">委外报工</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showOutsource && showSortOutsource "
+				@click="handleToUnNormalOutsource">
+				<text class="label">委外分选</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showAuxiliary && !showOutsource" @click="handleToAuxiliary">
+				<text class="label">辅助工序报工</text>
+			</view>
+			<view class="business-btn uni-row" @click="handleToGetLotInfo">
+				<text class="label">扫码查询批次信息</text>
+			</view>
+			<!-- 		<view class="business-btn uni-row" v-if="showInspector" @click="handleToProcessInspection">
+		<text class="label">序检</text>
+	</view> -->
+			<view class="business-btn uni-row" v-if="!showOutsource" @click="handleToInspectionReceive">
+				<text class="label">检测领取</text>
+			</view>
+			<view class="business-btn uni-row" v-if="!showOutsource" @click="handleToInspectionDetails">
+				<text class="label">检查列表</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showOutsourcedInspector && !showOutsource"
+				@click="handleToOutsourcedInspection">
+				<text class="label">外协检查</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showDeliveryInspection && !showOutsource"
+				@click="handleToDeliveryInspection">
+				<text class="label">交检</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showFirstArticleInspection && !showOutsource"
+				@click="handleToFirstInspection">
+				<text class="label">首件检</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showOnSiteInspector && !showOutsource"
+				@click="handleToOnSiteInspection">
+				<text class="label">巡检</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showInstrumentRoomInspection && !showOutsource"
+				@click="handleToInstrumentInspection">
+				<text class="label">仪器室</text>
+			</view>
+			<view class="business-btn uni-row" v-if="!showOutsource " @click="handleToFactoryInspection">
+				<text class="label">出厂检</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showAdjust && !showOutsource" @click="handleToAdjust">
+				<text class="label">交检审核</text>
+			</view>
+			<!-- v-hasRoles="['porter']" 可通过v-Roles自定义指令进行显隐 -->
+			<view class="business-btn uni-row" v-if="showTurn && !showOutsource" @click="handleToHandlingList">
+				<text class="label">周转</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showOutSourceList && !showOutsource" @click="handleOutsourceList">
+				<text class="label">外协验箱</text>
+			</view>
+			<view class="business-btn uni-row" v-if="showChangeTurnover && !showOutsource"
+				@click="handleChangeTurnover">
+				<text class="label">更换工段加工</text>
+			</view>
 		</view>
 		<view class="bottom-btn-container">
 			<!-- <view class="start-batch-btn uni-row" @click="handleToEquiPmentList"><text class="label">绑定设备</text></view> -->
@@ -98,7 +113,8 @@
 		</view>
 	</view>
 	<dialog-confirm ref="confirm" @submit="logout"></dialog-confirm>
-	<dialog-inspectionChamber ref="inspectionChanberRef" @handleSelectInspectionChamber='handleSelectInspectionChamber'></dialog-inspectionChamber>
+	<dialog-inspectionChamber ref="inspectionChanberRef"
+		@handleSelectInspectionChamber='handleSelectInspectionChamber'></dialog-inspectionChamber>
 	<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
 </template>
 
@@ -140,6 +156,8 @@
 	const userDeptsByTenantId = ref([])
 	const confirm = ref(null) // 确认组件
 	const inspectionChanberRef = ref(null)
+	const showOutsource = ref(false)
+	const showSortOutsource = ref(false)
 	const showTurn = ref(false)
 	const showOther = ref(false)
 	const showInspector = ref(false);
@@ -202,15 +220,15 @@
 			showDeliveryInspection.value = false
 		}
 		//仪器室
-		if(store.userInfo.roles.some(item =>item.roleKey == 'instrumentRoomInspection')) {
+		if (store.userInfo.roles.some(item => item.roleKey == 'instrumentRoomInspection')) {
 			showInstrumentRoomInspection.value = true
-		}else{
+		} else {
 			showInstrumentRoomInspection.value = false
 		}
 		//首件检
-		if(store.userInfo.roles.some(item =>item.roleKey == 'firstArticleInspection')) {
+		if (store.userInfo.roles.some(item => item.roleKey == 'firstArticleInspection')) {
 			showFirstArticleInspection.value = true
-		}else{
+		} else {
 			showFirstArticleInspection.value = false
 		}
 		//交检审核
@@ -275,17 +293,28 @@
 					}
 				}
 				console.log(userDeptsByTenantId.value)
-				if(userDeptsByTenantId.value && userDeptsByTenantId.value.length >0){
+				if (userDeptsByTenantId.value && userDeptsByTenantId.value.length > 0) {
 					curSelectedDeptId.value = userDeptsByTenantId.value[0].value
 					console.log(curSelectedDeptId.value)
 					let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
 					store.curDeptDetails = curDept
-					console.log(curDept,"77777")
-					if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey == 'sortingInspector')) {
+					console.log(curDept, "77777")
+					if (curDept.deptCode === '105060' || store.userInfo.roles.some(item => item.roleKey ==
+							'sortingInspector')) {
 						showSizing.value = true
 					} else {
 						showSizing.value = false
 					}
+					if (curDept.isSortPackaging == 1) {
+						showSortOutsource.value = true
+					} else {
+						showSortOutsource.value = false
+					}
+					if (curDept.isOutsourcing == 1) {
+						showOutsource.value = true
+					} else {
+						showOutsource.value = false
+					}
 					console.log(store)
 					handleSelectInnerTurnover()
 				}
@@ -307,7 +336,7 @@
 				value: newArr[i].deptId
 			})
 		}
-		if(newArr && newArr.length >0){
+		if (newArr && newArr.length > 0) {
 			curSelectedDeptId.value = userDeptsByTenantId.value[0].value
 			let curDept = userDeptList.value.find(item => item.deptId === curSelectedDeptId.value)
 			store.curDeptDetails = curDept
@@ -341,12 +370,14 @@
 			url: '/pages/reportHistory/index'
 		})
 	}
+
 	function handleToGetLotInfo() {
 		uni.navigateTo({
 			url: '/pages/queryLotInfo/index'
 		})
 	}
-	function handleInnerTurnover(){
+
+	function handleInnerTurnover() {
 		uni.navigateTo({
 			url: '/pages/innerTurnover/index'
 		})
@@ -434,40 +465,40 @@
 	function onDecodeHandler(data) {
 		showQrCodeReader.value = false;
 		let vehicleObj = {
-				carrierCode: data
-			};
-			if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+			carrierCode: data
+		};
+		if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return;
+		}
+		checkCarrier({
+			carrierCode: vehicleObj.carrierCode,
+		}).then(response => {
+			if (response.code == 200) {
+				uni.navigateTo({
+					url: "/pages/processInspectionReceive/form",
+					success: (res) => {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit("inspecionCarrierCode", {
+							carrierCode: vehicleObj.carrierCode
+						})
+					}
+				})
+			} else {
 				uni.showToast({
-					icon: "none",
-					title: "请扫载具码",
-					duration: 1000
+					icon: 'none',
+					title: response.msg,
+					duration: 2000
 				})
-				return;
 			}
-			checkCarrier({
-				carrierCode: vehicleObj.carrierCode,
-			}).then(response => {
-				if (response.code == 200) {
-					uni.navigateTo({
-								url: "/pages/processInspectionReceive/form",
-								success: (res) => {
-									// 通过eventChannel向被打开页面传送数据
-									res.eventChannel.emit("inspecionCarrierCode", {
-										carrierCode: vehicleObj.carrierCode
-									})
-								}
-							})
-				} else {
-					uni.showToast({
-						icon: 'none',
-						title: response.msg,
-						duration: 2000
-					})
-				}
-			})
-}
-	
-	
+		})
+	}
+
+
 	//H5扫码器关闭
 	function qrReaderClose() {
 		showQrCodeReader.value = false;
@@ -476,7 +507,7 @@
 	//检查列表
 	function handleToInspectionReceive() {
 		showQrCodeReader.value = true;
-	 //  const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		//  const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
 		// if (mpaasScanModule) {
 		// 	// 调用插件的 mpaasScan 方法
 		// 	mpaasScanModule.mpaasScan({
@@ -523,7 +554,7 @@
 		// 		}
 		// 	);
 		// } else {
-			
+
 		// 	// 测试时用
 		// checkCarrier({
 		// 	carrierCode: "300086",
@@ -633,20 +664,21 @@
 	}
 	//仪器室
 	function handleToInstrumentInspection() {
-			//选择仪器室
-			inspectionChanberRef.value.open()
-		
+		//选择仪器室
+		inspectionChanberRef.value.open()
+
 	}
+
 	function handleSelectInspectionChamber(data) {
 		uni.navigateTo({
-					url: "/pages/instrumentRoomInspection/index",
-					success: (res) => {
-						// 通过eventChannel向被打开页面传送数据
-						res.eventChannel.emit("inspectionChamberInfo", {
-							data: data
-						})
-					}
+			url: "/pages/instrumentRoomInspection/index",
+			success: (res) => {
+				// 通过eventChannel向被打开页面传送数据
+				res.eventChannel.emit("inspectionChamberInfo", {
+					data: data
 				})
+			}
+		})
 	}
 	//出厂检
 	function handleToFactoryInspection() {
@@ -665,6 +697,32 @@
 		let msg = "确认退出登录吗?"
 		confirm.value.open(msg);
 	}
+
+	function handleToNormalOutsource() {
+		if (curSelectedDeptId.value) {
+			uni.navigateTo({
+				url: '/pages/outsourceProductionPlan/index'
+			})
+		} else {
+			uni.showToast({
+				icon: "none",
+				title: "请选择工段"
+			})
+		}
+	}
+	// 分选
+	function handleToUnNormalOutsource() {
+		if (curSelectedDeptId.value) {
+			uni.navigateTo({
+				url: '/pages/sortInnerProductionPlan/index'
+			})
+		} else {
+			uni.showToast({
+				icon: "none",
+				title: "请选择工段"
+			})
+		}
+	}
 	/*
 	// 绑定设备
 	function handleToEquiPmentList() {
@@ -690,6 +748,16 @@
 		} else {
 			showSizing.value = false
 		}
+		if (curDept.isSortPackaging == 1) {
+			showSortOutsource.value = true
+		} else {
+			showSortOutsource.value = false
+		}
+		if (curDept.isOutsourcing == 1) {
+			showOutsource.value = true
+		} else {
+			showOutsource.value = false
+		}
 		console.log(store)
 		handleSelectInnerTurnover()
 	}

+ 36 - 33
pages/fastProductionPlan/index.vue

@@ -274,48 +274,48 @@
 	//H5扫码器回调
 	function onDecodeHandler(data) {
 		showQrCodeReader.value = false;
-	let vehicleObj = {
-		carrierCode: data
-	};
-	if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
-		uni.showToast({
-			icon: "none",
-			title: "请扫载具码",
-			duration: 1000
-		})
-		return;
-	}
-	getDayworkByCarrierCode({
-		carrierCode: vehicleObj.carrierCode,
-		deptId: store.curDeptDetails.deptId,
-		status: 7
-	}).then(response => {
-		if (response.code == 200) {
-			if (response.data.items.length > 0) {
-				lotReporting.value.open(response.data);
+		let vehicleObj = {
+			carrierCode: data
+		};
+		if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return;
+		}
+		getDayworkByCarrierCode({
+			carrierCode: vehicleObj.carrierCode,
+			deptId: store.curDeptDetails.deptId,
+			status: 7
+		}).then(response => {
+			if (response.code == 200) {
+				if (response.data.items.length > 0) {
+					lotReporting.value.open(response.data);
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '该批次不在此计划单内, 或不在当前工段',
+						duration: 2000
+					})
+				}
 			} else {
 				uni.showToast({
 					icon: 'none',
-					title: '该批次不在此计划单内, 或不在当前工段',
+					title: response.msg,
 					duration: 2000
 				})
 			}
-		} else {
-			uni.showToast({
-				icon: 'none',
-				title: response.msg,
-				duration: 2000
-			})
-		}
-	})
+		})
 	}
-	
-	
+
+
 	//H5扫码器关闭
 	function qrReaderClose() {
 		showQrCodeReader.value = false;
 	}
-	
+
 	function handleAdd() {
 		showQrCodeReader.value = true;
 		// const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
@@ -505,6 +505,9 @@
 					title: '加载中'
 				});
 				lastRequestTimestamp.value = currentTime;
+				selection.value.forEach(item => {
+					item.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId
+				})
 				finishQuick(selection.value).then(res => {
 					// console.log(res)
 					if (res.code === 200) {
@@ -515,10 +518,10 @@
 						uni.showToast({
 							icon: 'none',
 							title: res.msg,
-							duration:2000
+							duration: 2000
 						});
 						setTimeout(() => {
-						 init()
+							init()
 						}, 1500);
 					}
 				})

+ 249 - 0
pages/outsourceProductionPlan/index.vue

@@ -0,0 +1,249 @@
+<template>
+	<view class="uni-column" style="padding: 24rpx;position: fixed;left: 0;right: 0;height: 100%;">
+		<view class="box-bg uni-row">
+			<view class="input-view uni-row">
+				<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
+			</view>
+			<view class="search" @click="handleSearch">搜索</view>
+		</view>
+		<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
+			<text>暂无生产计划</text>
+		</view>
+		<view v-else style="height: calc(100% - 100rpx); overflow: auto;margin-bottom: 30px;">
+			<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
+				class="list-item">
+				<view class="title-container uni-row">
+					<view class="title uni-row">
+						<text class="label">生产计划单号</text>
+						<text class="label code">{{ item['productionPlanNo'] }}</text>
+						<text class="label" style="margin-left: 20px;">序号</text>
+						<text class="label code">{{ item['lineNumber'] }}</text>
+					</view>
+					<view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
+					<view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ item['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">总批数</text>
+					<text class="label right">{{ item['totalLotNumber'] }}</text>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">完成批数</text>
+					<text class="label right">{{ item['equiment'] }}</text>
+				</view> -->
+				<view class="item-info uni-row">
+					<text class="label">投产数</text>
+					<text class="label right">{{ item['productionQuantity'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">单批量</text>
+					<text class="label right">{{ item['oneLotQuantity'] }}</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		getInnerPlanDetailsList
+	} from '@/api/business/planDetails.js'
+	import {
+		ref
+	} from 'vue'
+	import {
+		onReady,
+		onLoad,
+		onUnload,
+		onPullDownRefresh,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getToken
+	} from '@/utils/auth'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		getUserProcess
+	} from '@/api/process/process.js'
+
+
+	const listData = ref([])
+	const keywords = ref('')
+
+	onLoad(() => {
+		// dayworkItem数据更改后刷新数据
+		// uni.$on('dayworkItemUpdate', reflush);
+	})
+
+	onShow(() => {
+		reflush();
+	})
+
+	onUnload(() => {
+		console.log(store.curDeptDetails)
+		// uni.$off('dayworkItemUpdate', reflush)
+	})
+
+	/**	
+	 * 监听下拉刷新
+	 */
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		init();
+	})
+
+	function reflush() {
+		init();
+	}
+
+	function init(data) {
+		uni.showLoading({
+			title: '加载中'
+		});
+		getInnerPlanDetailsList({
+			deptId: Number(store.curDeptDetails.deptId),
+			keywords: keywords.value
+		}).then(res => {
+			if (res.code == 200) {
+				listData.value = res.data;
+				uni.hideLoading();
+			}
+			uni.hideLoading();
+		})
+	}
+
+	function handleToBatchReporting(item) {
+		store.planDetails = item
+		uni.navigateTo({
+			url: '/pages/batchReportingOutsource/index'
+		})
+	}
+
+	function handleSearch() {
+		let reqParam = {
+			keywords: keywords.value
+		}
+		reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
+		init(reqParam)
+	}
+</script>
+
+<style lang="scss">
+	$nav-height: 60rpx;
+
+	.box-bg {
+		width: 100%;
+		background-color: #F5F5F5;
+		padding: 5rpx 0;
+		justify-content: space-around;
+		align-items: center;
+
+		.input-view {
+			width: 100%;
+			flex: 4;
+			background-color: #f8f8f8;
+			height: $nav-height;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			margin: 0 10rpx 20rpx;
+			line-height: $nav-height;
+
+			.input-uni-icon {
+				line-height: $nav-height;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: $nav-height;
+				line-height: $nav-height;
+				padding: 0 5rpx;
+				background-color: #f8f8f8;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			color: #808080;
+			margin-top: -20rpx;
+		}
+	}
+
+	.uni-column {
+		background-color: rgba(245, 245, 245, 1);
+		height: calc(100% - 40rpx);
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		border-radius: 24rpx;
+		margin-bottom: 24rpx;
+
+		.title-container {
+			justify-content: space-between;
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1ce5b0;
+				background-color: #f6fffd;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1ce5b0;
+					font-size: 24rpx;
+				}
+
+				&.not-start {
+					border: 1px solid #bbbbbb;
+					background-color: #f5f5f5;
+
+					.label {
+						color: #bbbbbb;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+	}
+</style>

+ 3 - 1
pages/pdfviewer/index.vue

@@ -46,7 +46,9 @@
 
 	function init() {
 		console.log(fileUrl.value)
-		url.value = pdfjs.value + '?file=' + encodeURIComponent(fileUrl.value);
+		const encodeFileUrl = encodeURIComponent(fileUrl.value);
+		console.log(encodeFileUrl, "777")
+		url.value = pdfjs.value + '?file=' + encodeFileUrl
 
 		console.log(11, url.value)
 	}

+ 3 - 0
pages/queryLotInfo/index.vue

@@ -264,6 +264,9 @@
 					<view class="item-info uni-row"> <text class="label">分选人员:</text>
 						<text class="label right ">{{ item['nickName'] }}</text>
 					</view>
+					<view class="item-info uni-row"> <text class="label">分选设备:</text>
+						<text class="label right ">{{ item['equipmentDetailCode'] }}</text>
+					</view>
 					<view v-for="(info, index) in item.rejectList" :key="index">
 						<view class="item-info uni-row">
 							<text class="label">检测项目:</text>

+ 9 - 18
pages/reportHistory/index.vue

@@ -291,7 +291,7 @@
 					return accumulator;
 				}, {});
 
-
+				var hasEndTime = false
 				// 0718
 				for (var i = 0; i < listData.value.length; i++) {
 					var current = listData.value[i];
@@ -314,12 +314,17 @@
 					}
 
 					if (current.status == 3) {
+						console.log("999")
+						hasEndTime = true
 						endTimeStatus = current.endTime;
-
-					} else {
+						console.log(endTimeStatus)
+					}
+					if (!hasEndTime && current.status != 3) {
+						console.log("777")
 						endTimeStatus = null;
 					}
-					if (!found) {
+					if (!found && current.status == 3) {
+						console.log()
 						listDaywork.value.push({
 							processAlias: current.process.processAlias,
 							equipmentDetailCode: current.equipmentDetailCode,
@@ -339,20 +344,6 @@
 
 				console.log(listData.value);
 				console.log(listDaywork.value);
-
-				// 时间下拉
-				// for (let i = 0; i < Object.keys(groupedData).length; i++) {
-				// 	dateList.value[i] = {
-				// 		text: Object.keys(groupedData)[i],
-				// 		value: Object.keys(groupedData)[i]
-				// 	}
-				// }
-				// listData.value = groupedData;
-				// if(dateList.value.length > 0){
-				// 	listDataItem.value = listData.value[dateList.value[0].value]
-				// 	selectDate.value = dateList.value[0].value;
-				// }	
-				// console.log(groupedData)
 				uni.hideLoading();
 			} else {
 				uni.showToast({

+ 559 - 0
pages/reportingForInnerWork/index.vue

@@ -0,0 +1,559 @@
+<template>
+	<view class="uni-column container">
+		<view class="scroll-container">
+			<view v-for="(item, index) in listData" :key="index" class="list-item">
+				<view class="title-container">
+					<view class="title uni-row">
+						<view class="uni-row">
+							<text class="label">批次号:</text>
+							<text class="label code"> {{ item['lotCode'] }}</text>
+						</view>
+						<view style="color: #1684fc; margin-right: 0;" @click="handleOpenLonInfo">
+							<text>批次详情</text>
+						</view>
+					</view>
+					<view class="uni-row">
+						<view class="right-info uni-row"> <text class="label">工时</text>
+							<text class="label time">{{ item['taskTime'] }}</text>
+							<!-- <text class="label time">{{ item['taskTime'] }}h</text> -->
+						</view>
+						<view class="right-info uni-row" style="margin-left: 50rpx;"> <text class="label">合格数</text>
+							<text class="label number ">{{ item['qualifiedNum'] }}</text>
+						</view>
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ curPlan['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">操作者</text>
+					<text class="label right">{{ item['nickName'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">开始时间</text>
+					<text class="label right">{{ item['startTime'] ? item['startTime'] : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">结束时间</text>
+					<text class="label right">{{ item['endTime'] ? item['endTime'] : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">废品数</text>
+					<text class="label right">{{ item['rejectSum'] ? item['rejectSum'] : 0 }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">投入数</text>
+					<text
+						class="label right">{{store.dayworkInfo.prevProcess == null ?  store.dayworkInfo['productionQuantity'] : store.dayworkInfo['processQualifiedNum']}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">设备</text>
+					<text class="label right">{{ item['equipmentDetailCode']}}</text>
+				</view>
+				<view v-if="item['userId'] == userInfo['userId'] ? item['status'] == 1 : false"
+					class="status-btn uni-row ">
+					<button class="finished-turnover-tag" size="mini"
+						@click.stop="handleShowEndWorkDialog(item)">结束报工</button>
+				</view>
+				<view v-if="item['userId'] == userInfo['userId'] ? item['status'] == 0 : false"
+					class="status-btn uni-row ">
+					<button class="start-turnover-tag" size="mini" type="primary"
+						@click.stop="handleStartProcessing(item)">开始报工</button>
+				</view>
+			</view>
+		</view>
+		<view class="bottom uni-row">
+			<button class="bottom-btn left-btn" @click="handleChangevehicle"><text class="label">更换载具</text></button>
+			<button v-if="flag" class="bottom-btn right-btn" type="primary" @click="handleStartProcessing(null)"><text
+					class="label">开始加工</text></button>
+		</view>
+		<dialog-end-inner-work ref="endInnerWorkDialog" @resflushItem='resflushItem' />
+		<dialog-selectEquipment ref='selectEquipment'
+			@handleAddDayWorkItem='handleAddDayWorkItem'></dialog-selectEquipment>
+		<dialog-selectInviteUser ref="inviteUser"
+			@handleAddDayWorkItem='handleAddDayWorkItem'></dialog-selectInviteUser>
+		<dialog-lotInfo ref="lotInfo"></dialog-lotInfo>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getDayWorkItemList,
+		saveDayWorkItemBatch,
+		updateDayWorkItem
+	} from "@/api/business/dayWorkItem.js"
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		timestampToTime,
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		checkBizDayworkCarriers
+	} from '@/api/business/dayWork.js'
+	import {
+		isCurProcessFinish
+	} from '@/api/business/dayWorkItem.js'
+	import {
+		getEquipmentByUidAndDid
+	} from '@/api/resourceGroup/resourceGroupDetail.js'
+
+	const listData = ref([]) // 回显 
+	const curPlan = ref({}) // 接收生产计划单信息 
+	const dayWorkInfo = ref({}) // 接收daywork信息
+	const equipmentList = ref([]) // 设备列表
+	const endInnerWorkDialog = ref(null) // 组件
+	const selectEquipment = ref(null) // 组件   
+	const inviteUser = ref(null) // 组件  
+	const dayWorkItem = ref({}) // 添加传输对象
+	const reqParam = ref([]) // 请求参数
+	const userInfo = ref(null) // 登录员工信息
+	const flag = ref(true) // 控制底部开始加工按钮功能
+	const lotInfo = ref(null) // 详情弹窗
+	const hasEquipment = ref(true) // 判断资源组是否有设备
+
+
+	onLoad(() => {
+		curPlan.value = store.planDetails;
+		dayWorkInfo.value = store.dayworkInfo;
+		init();
+	})
+	// onUnload(() => {
+	// 	uni.$off('dayworkItemUpdate', reflush)
+	// })
+
+	onShow(() => {
+		uni.$on('dayworkItemUpdate', reflush)
+	})
+
+	function init() {
+		console.log(store.dayworkInfo)
+		userInfo.value = store.userInfo;
+		uni.showLoading({
+			title: '加载中'
+		});
+		getDayWorkItemList({
+			dayworkId: dayWorkInfo.value.id,
+			lotId: dayWorkInfo.value.lotId,
+			isWasteRecycling: dayWorkInfo.value.isWasteRecycling,
+			isAmend: dayWorkInfo.value.isAmend,
+			processStepNumber: dayWorkInfo.value.currentProcess.processStepNumber,
+			// processId: store.dayworkInfo.currentProcess.id,
+			type: '非周转中item'
+		}).then(res => {
+			if (res.code == 200) {
+				listData.value = res.rows || [];
+				console.log(listData.value)
+				// 时间戳转工时
+				for (var i = 0; i < listData.value.length; i++) {
+					let timeStamp = listData.value[i].workingHours;
+					listData.value[i].taskTime = toHHmmss(timeStamp);
+				}
+				flag.value = !listData.value.some(item => item.status == 0);
+				uni.hideLoading();
+			} else {
+				uni.showToast({
+					icon: "error",
+					title: res.message,
+					duration: 1000
+				})
+				uni.hideLoading();
+			}
+		})
+
+		getEquipmentByUidAndDid(store.planDetails.id, store.curDeptDetails.deptId, store.dayworkInfo.lotId).then(
+			equipmentRes => {
+				if (equipmentRes.code == 200) {
+					hasEquipment.value = equipmentRes.rows.length > 0 ? true : false;
+				}
+			})
+	}
+
+	function reflush() {
+		init();
+	}
+
+	function resflushItem() {
+		reflush();
+	}
+
+	function handleOpenLonInfo() {
+		lotInfo.value.open();
+	}
+
+	function handleShowEndWorkDialog(data) {
+		checkBizDayworkCarriers({
+			id: store.dayworkInfo.id
+		}).then(res => {
+			if (res.code == 200) {
+				// 调用子组件中的方法
+				endInnerWorkDialog.value.open(data, listData)
+			} else {
+				uni.showToast({
+					icon: "none",
+					title: res.msg + ",请绑定",
+					duration: 2000
+				})
+				uni.navigateTo({
+					url: "/pages/changeBox/index"
+				})
+			}
+		})
+	}
+
+	function HandleSeleteInviteUser(data) {
+		isCurProcessFinish({
+			dayworkId: store.dayworkInfo.id,
+			processId: listData.value[0].processId
+		}).then(res => {
+			if (store.dayworkInfo.status == 4) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前批次已完成'
+				})
+			} else if (res.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '该工序已完成,不能邀请报工'
+				})
+			} else if (!hasEquipment.value) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前无可用设备',
+				})
+			} else {
+				inviteUser.value.open(data);
+			}
+		})
+	}
+
+	function handleChangevehicle() {
+		if (store.dayworkInfo.status == 4) {
+			uni.showToast({
+				icon: 'none',
+				title: '该工序已完成'
+			})
+		} else {
+			uni.navigateTo({
+				url: "/pages/changeBox/index"
+			})
+		}
+	}
+	//送检跳转
+	function HandleSendInspection() {
+		uni.navigateTo({
+			url: "/pages/firstInspection/scan"
+		})
+	}
+
+	function getEquipment(data) {
+		console.log(data);
+		equipmentList.value = data;
+	}
+
+	function handleStartProcessing(item) {
+		// 先判断默认的一条是否开始加工
+		// if (!item && listData.value.some(item => item.status == 0)) {
+		// 	uni.showToast({
+		// 		icon: 'none',
+		// 		title: '请先开始默认的报工记录再进行报工',
+		// 		duration: 2000
+		// 	})
+		// }else{
+		// 查询当前工序是否完成再判断是否进行报工
+		isCurProcessFinish({
+			dayworkId: store.dayworkInfo.id,
+			processId: listData.value[0].processId
+		}).then(res => {
+			if (store.dayworkInfo.status == 4) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前批次已完成'
+				})
+			} else if (res.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '该工序已完成,不能继续报工'
+				})
+			} else if (!hasEquipment.value) {
+				uni.showToast({
+					icon: 'none',
+					title: '当前无可用设备',
+				})
+			} else {
+				selectEquipment.value.open(item);
+			}
+		})
+		// }
+	}
+
+	/**
+	 * 新批次默认item去报工(执行方法)
+	 * @param {Object} item
+	 */
+	function handleStartFirstItem(item) {
+		let reqParam = item;
+		reqParam.status = 1;
+		reqParam.startTime = timestampToTime(new Date());
+		updateDayWorkItem(reqParam).then(res => {
+			if (res.code === 200) {
+				uni.showToast({
+					icon: "success",
+					title: "报工成功",
+					duration: 2000
+				})
+				init();
+			} else {
+				uni.showToast({
+					icon: "none",
+					title: "报工失败,请联系管理员",
+					duration: 2000
+				})
+			}
+		})
+	}
+
+	function handleAddDayWorkItem(data) {
+		console.log(data)
+		console.log(dayWorkInfo.value)
+		if (data.dayworkId) { // data里面任意一对象除了设备相关的字段存在,直接给reqParam赋值
+			reqParam.value = {
+				...data,
+				productionPlanId: curPlan.value.productionPlanId,
+				productionPlanDetailId: curPlan.value.id,
+				technologicalProcessId: dayWorkInfo.value.technologicalProcessId,
+				prodNum: store.dayworkInfo.prevProcess == null ?
+					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
+						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
+				deptId: store.curDeptDetails.deptId,
+				deptName: store.curDeptDetails.deptName,
+				outsourceDetailId: dayWorkInfo.value.dayworkItemList[0].outsourceDetailId,
+				tenantId: !store.tenantId ? store.userInfo.tenantId : store.tenantId,
+				isWx: 1
+			}
+		} else {
+			// equipmentList.value = data;
+			dayWorkItem.value = {
+				dayworkId: dayWorkInfo.value.id,
+				lotId: dayWorkInfo.value.lotId,
+				productionPlanId: curPlan.value.productionPlanId,
+				productionPlanDetailId: curPlan.value.id,
+				technologicalProcessId: dayWorkInfo.value.technologicalProcessId,
+				prodNum: store.dayworkInfo.prevProcess == null ?
+					store.dayworkInfo['isLast'] == 1 ? store.dayworkInfo['lastLotQuantity'] : store.dayworkInfo[
+						'oneLotQuantity'] : store.dayworkInfo['processQualifiedNum'],
+				status: 1,
+				startTime: timestampToTime(new Date()),
+				deptId: store.curDeptDetails.deptId,
+				deptName: store.curDeptDetails.deptName,
+				outsourceDetailId: dayWorkInfo.value.dayworkItemList[0].outsourceDetailId,
+				tenantId: !store.tenantId ? store.userInfo.tenantId : store.tenantId,
+				isWx: 1,
+				...data
+			}
+			reqParam.value = dayWorkItem.value;
+		}
+		console.log(reqParam.value)
+		saveDayWorkItemBatch(reqParam.value).then(res => {
+			if (res.code === 200) {
+				uni.showToast({
+					icon: 'success',
+					title: '操作成功',
+					duration: 2000
+				});
+				reqParam.value = [];
+				reflush();
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '操作失败',
+					duration: 2000
+				});
+			}
+		})
+	}
+</script>
+
+<style lang="scss">
+	.container {
+		// height: calc(100% - 232rpx);
+		background-color: #f5f5f5;
+		overflow: auto;
+		position: absolute;
+		height: 100%;
+		left: 0;
+		right: 0;
+	}
+
+
+	.scroll-container {
+		position: relative;
+		top: 16rpx;
+		margin-bottom: 250rpx;
+		// right: 0;
+		// bottom: 144rpx;
+		// left: 0;
+	}
+
+	.selected {
+		border: 1px solid #1684fc;
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		margin: 0 24rpx;
+		margin-bottom: 24rpx;
+		border-radius: 8rpx;
+
+		.title-container {
+			margin: 8rpx 0;
+			width: 100%;
+
+			.title {
+				height: 48rpx;
+				justify-content: space-between;
+				align-items: center;
+				flex: 7;
+
+				.label {
+					// font-size: 32rpx;
+					font-weight: bold;
+				}
+
+				.code {
+					margin-left: 8rpx;
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 152rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+
+		.right-info {
+
+			// justify-content: flex-end;
+			// width:45%;
+			// margin-top: 5rpx;
+			.label {
+				font-size: 28rpx;
+			}
+
+			.time {
+				margin-left: 8rpx;
+				color: #1684fc;
+			}
+
+			.number {
+				margin-left: 8rpx;
+				color: #1684fc;
+			}
+
+		}
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.left-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+			background-color: rgba(0, 226, 166, 1);
+		}
+
+		.right-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+			margin-left: 24rpx;
+		}
+	}
+
+	// .bottom {
+	// 	position: fixed;
+	// 	right: 0;
+	// 	bottom: 0;
+	// 	left: 0;
+	// 	height: 100rpx;
+	// 	padding: 16rpx 24rpx;
+	// 	align-items: center;
+	// 	background-color: #FFFFFF;
+	// 	justify-content: space-between;
+
+	// 	.bottom-btn {
+	// 		flex: 1;
+	// 		font-size: 28rpx;
+	// 		color: #FFFFFF;
+
+	// 		&.left-btn {
+	// 			background-color: rgba(0, 226, 166, 1);
+	// 		}
+
+	// 		&.right-btn {
+	// 			margin-left: 24rpx;
+	// 		}
+	// 	}
+	// }
+
+	.status-btn {
+		width: 100%;
+		justify-content: flex-end;
+
+		.finished-turnover-tag {
+			margin: unset;
+			border-radius: 8rpx;
+			background-color: rgb(255, 85, 85);
+			font-size: 28rpx;
+			color: #FFFFFF;
+		}
+
+		.start-turnover-tag {
+			margin: unset;
+			border-radius: 8rpx;
+			font-size: 28rpx;
+			color: #FFFFFF;
+		}
+	}
+</style>

+ 951 - 0
pages/sortBatchInnerReporting/index.vue

@@ -0,0 +1,951 @@
+<template>
+	<view class="uni-column" style="height: 100%; background-color: #f5f5f5;position: fixed;left: 0;right: 0;">
+		<view class="box-bg uni-row">
+			<view class="input-view uni-row">
+				<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="请输入批次号/箱号" />
+			</view>
+			<view class="search" @click="handleSearch">
+				搜索
+			</view>
+		</view>
+		<view class="list-title uni-row">
+			<text class="label">是否正常批次</text>
+			<text>{{ normalStatus ? '是' : '否' }}</text>
+			<switch class="switch" :checked="normalStatus" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
+		</view>
+		<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
+			<text>暂无批次</text>
+		</view>
+		<view v-else class="scroll-container" style="margin-bottom:130px">
+			<!-- 批次列表 -->
+			<view v-for="(item, index) in listData" :key="index" class="list-item" @click="checkStatus(item)">
+				<!-- @click="handleToreportingForWork(item)" -->
+				<view class="title-container uni-row" style="justify-content: flex-start;">
+					<view class="title uni-row">
+						<text class="label">批次号:</text>
+						<text class="label code">{{ item['lotCode'] }}</text>
+					</view>
+					<view class=" uni-row" style="margin-left: 16rpx;">
+						<view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
+						<view v-else-if="item['status'] == 3" class="tag turnover "><text class="label">待领取</text>
+						</view>
+						<view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">待周转</text>
+						</view>
+						<view v-else-if="item['status'] == 0" class="tag finished "><text class="label">未开始</text>
+						</view>
+						<view v-else-if="item['status'] == 4" type="default finished" class="tag finished"><text
+								class="label">已完成</text></view>
+					</view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ curPlan['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">材质</text>
+					<text
+						class="label right">{{ item['furnaceNoInfo'] ? item['furnaceNoInfo'].firstTechnicalRequirement + ";" + item['furnaceNoInfo'].secondTechnicalRequirement : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">原材料厂家</text>
+					<text class="label right">{{ item['furnaceNoInfo'] ? item['furnaceNoInfo'].factory : '-' }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">箱号</text>
+					<text class="label right">{{ item['carrierName'] ? item['carrierName'] : '-' }}</text>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">总工时</text>
+					<text class="label right">{{ item['totalWorkingHours']}}</text>
+				</view> -->
+				<view class="item-info uni-row">
+					<text class="label">投入数</text>
+					<text
+						class="label right">{{item.prevProcess == null ?  item['productionQuantity']  : item['processQualifiedNum']}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">上道工序</text>
+					<text class="label right">{{ item.prevProcess ? item['prevProcess'].processAlias : '-'}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">当前工序</text>
+					<!-- <text
+						class="label right">{{ item.currentProcess ? item.prevProcess && item['currentProcess'].processAlias == item['prevProcess'].processAlias ? '-' : item['currentProcess'].processAlias : '-'}}</text> -->
+					<text class="label right">{{ item.currentProcess ?item['currentProcess'].processAlias : '-'}}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">下道工序</text>
+					<view class="label right uni-row">{{ item.nextProcess ? item['nextProcess'].processAlias : '-' }}
+						(<view style="color:  #1684fc;" @click.stop="handleClickProcessList(item)">&nbsp;工艺列表&nbsp;
+						</view>)
+					</view>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">设备</text>
+					<text class="label right">{{ curPlan['equipmentName'] }}</text>
+				</view> -->
+				<view v-if="notPreProcess" class="item-info uni-row">
+					<text class="label">所在区域</text>
+					<text class="label right">{{ item['place'] ? item['place'] : '-' }}</text>
+				</view>
+				<view class="status-btn uni-row">
+					<view v-if="item.dayworkItemList[0].status < 3" class=" uni-row">
+						<button class="reporting-tag" size="mini"
+							@click.stop="handleToreportingForWork(item)">开始报工</button>
+						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
+					</view>
+					<view v-if="item['status'] == 2 && !item['hasFinishOutsource']" class=" uni-row">
+						<button class="turnover-tag" size="mini"
+							@click.stop="handleShowTurnoverApplication(item)">周转申请</button>
+						<!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
+					</view>
+					<view v-else-if="item['status'] == 3" class=" uni-row">
+						<button class="turnover-tag" size="mini" @click.stop="handleCancelTurnover(item)"
+							style="background-color: rgba(255, 85, 85, 1);">取消周转</button>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 抽屉 -->
+		<uni-drawer ref="showRight" mode="right" :mask-click="true" style="height: 100%;">
+			<view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;margin-top: 20px;">工艺列表</view>
+			<view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
+				仅显示当前工序后面工艺
+			</view>
+			<view><button v-if="!editStatus" class="start-batch-btn" style="margin-bottom: 16rpx;" type="primary"
+					@click="handleOpenDrawing">查看本工序图纸</button></view>
+			<scroll-view scroll-y="true" style="height: 70%;" @touchmove.stop>
+				<view v-for="(item,index) in curProcessAfte" :key="index"
+					style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
+					<text>{{ index + 1 }}.{{item.processAlias}}</text>
+				</view>
+			</scroll-view>
+			<!-- 		<view><button v-if="!editStatus" class="view-end-btn" style="margin-top: 20rpx;" type="primary"
+				@click="handleOpenDrawing">查看本工序图纸</button></view> -->
+
+		</uni-drawer>
+		<!-- <view v-if="bottomStatus" class="bottom uni-row">
+			<button class="start-batch-btn" type="primary" @click="handleStartNewBatch">开始新批次</button>
+		</view>
+		<view v-if="!bottomStatus" class="bottom uni-row">
+			<button class="start-batch-btn" type="primary" @click="handleScanCode">扫一扫开始新批次</button>
+		</view> -->
+		<view class="bottom uni-row">
+			<button class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
+				@click="handleScanCode">扫码开始批次</button>
+		</view>
+		<dialog-outsourceLot ref="lotDialog" @submit="handleDoIt" />
+		<dialog-turnoverInnerApplication ref="turnoverApplicationDialog" @reflushDaywork="handleDoTurnoverAfter" />
+		<dialog-selectProduction ref="selectProduction"></dialog-selectProduction>
+		<dialog-selectEquipment ref='selectEquipment'
+			@handleAddDayWorkItem='handleAddEquipment'></dialog-selectEquipment>
+		<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
+	</view>
+
+</template>
+
+<script setup>
+	import {
+		normalizeProps,
+		reactive,
+		onMounted,
+		getCurrentInstance,
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow,
+		onPullDownRefresh
+	} from '@dcloudio/uni-app'
+	import QrScanner from '../vueQrCode/index.vue'
+	import {
+		getDayWorkInnerSortList,
+		showDaywork,
+		turnoverDelete
+	} from '@/api/business/dayWork.js'
+	import {
+		addEquipmentInfo
+	} from '@/api/business/dayWorkItem.js'
+	import {
+		getAbnormalityLot
+	} from '@/api/business/lot.js'
+	import {
+		carrierFinishedCheck
+	} from '@/api/business/carrier.js'
+	import {
+		isTakeStock
+	} from '@/api/business/taksStackLot.js'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		getSortingDayworkItem,
+		showDayworkSaveInner
+	} from '@/api/business/sortDaywork.js'
+
+	const turnoverApplicationDialog = ref(null)
+	const selectProduction = ref(null)
+	const lotDialog = ref(null)
+	const listData = ref([])
+	const curPlan = ref(null)
+	const bizDayworkObj = ref({})
+	const showQrCodeReader = ref(false);
+	const bottomStatus = ref(false) // 底部按钮显示
+	const paging = ref();
+	const reqParam = ref(null);
+	const normalStatus = ref(true)
+	const isLoading = ref(false);
+	const selectEquipment = ref(null) // 组件  
+	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
+	const keywords = ref(null)
+	const tempList = ref([])
+	const wasteRecyclingList = ref([]) //废品回用批次
+	// 在数据中定义一个变量来控制遮罩层的显示
+	const isMaskShow = ref(false);
+	const currentDaywork = ref({})
+	const notPreProcess = ref(true)
+	const curProcessAfte = ref([])
+	const showRight = ref(null) // 抽屉
+	const editStatus = ref(false)
+
+	onLoad((options) => {
+		curPlan.value = store.planDetails;
+		normalStatus.value = true;
+		console.log(store.planDetails)
+		if (options != null) {
+			console.log(options)
+			console.log("999")
+			keywords.value = options.param1
+			if (store.planDetails.isAmend == 1 || store.planDetails.isWasteRecycling == 1) {
+				normalStatus.value = false;
+			}
+		}
+
+		console.log(curPlan.value)
+		//废品回用的领料部门如果是当前工段,也要可以开始新批次
+		//查找当前计划单下的批次废品回用是当前工段
+		getAbnormalityLot({
+			productionPlanDetailId: store.planDetails.id,
+			requisitionDepartmentId: store.curDeptDetails.deptId
+		}).then(res => {
+			wasteRecyclingList.value = res.rows
+			console.log(wasteRecyclingList.value.length)
+			if (store.planDetails.requisitionDepartmentId == store.curDeptDetails.deptId ||
+				wasteRecyclingList.value.length > 0) {
+				bottomStatus.value = true;
+				store.isPreProcess = true;
+			} else {
+				bottomStatus.value = false;
+				store.isPreProcess = false;
+			}
+		})
+		console.log(wasteRecyclingList.value.length)
+	})
+
+
+	/**	
+	 * 监听下拉刷新
+	 */
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		reflush();
+		// normalStatus.value = true;
+		// let reqData = {
+		// 	productionPlanDetailId: store.planDetails.id,
+		// 	deptId: store.curDeptDetails.deptId,
+		// 	keywords: keywords.value
+		// };
+		// getDayWorkList(reqData).then(res => {
+		// 	if (res.code == 200) {
+		// 		tempList.value = res.data
+		// 		if (normalStatus.value) {
+		// 			listData.value = res.data.filter(item => {
+		// 				return item.isWasteRecycling == 0 && item.isAmend == 0;
+		// 			});
+		// 		} else {
+		// 			listData.value = res.data.filter(item => {
+		// 				return item.isWasteRecycling == 1 || item.isAmend == 1;
+		// 			})
+		// 		}
+		// 		for (let i = 0; i < listData.value.length; i++) {
+		// 			if (listData.value[i].prevProcess) {
+		// 				let sum = 0;
+		// 				for (let j = 0; j < listData.value[i].dayworkItemList.length; j++) {
+		// 					if (listData.value[i].dayworkItemList[j].processId == listData.value[i]
+		// 						.prevProcess
+		// 						.id && (listData.value[i].dayworkItemList[j].status == 2 || listData.value[
+		// 								i]
+		// 							.dayworkItemList[j].status == 3)) {
+		// 						sum += listData.value[i].dayworkItemList[j].qualifiedNum;
+		// 					}
+		// 				}
+		// 				listData.value[i].processQualifiedNum = sum;
+		// 			}
+		// 		}
+		// 	}
+		// 	uni.stopPullDownRefresh();
+		// })
+
+	})
+
+	onShow(() => {
+		reflush();
+	})
+
+	function handleOpenDrawing() {
+		console.log(currentDaywork.value, "444")
+
+		var filteredProcess = currentDaywork.value.processSequence.filter(item => item.processStepNumber == currentDaywork
+			.value.currentProcess.processStepNumber);
+
+		// 检查 filteredProcess 是否有元素,并选择第一个元素
+		if (filteredProcess.length > 0) {
+			var firstMatch = filteredProcess[0]; // 获取第一个匹配的对象
+			console.log("currentDaywork", currentDaywork.value)
+			// 对 technologicalProcessDetailId 进行URL编码
+			var encodedId = encodeURIComponent(currentDaywork.value.productId);
+			var enTechnologicalProcessId = encodeURIComponent(currentDaywork.value.technologicalProcessId);
+			var enprocessCode = encodeURIComponent(firstMatch.processCode);
+			var encodeCode = encodeURIComponent(currentDaywork.value.lotCode);
+			var enProcessAlias = encodeURIComponent(firstMatch.processAlias);
+			var enIsWasteRecycling = encodeURIComponent(currentDaywork.value.isWasteRecycling);
+			var enIsAmend = encodeURIComponent(currentDaywork.value.isAmend);
+			// 构建查询参数字符串
+			var queryParam =
+				`param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}&param6=${enIsWasteRecycling}&param7=${enIsAmend}`;
+
+			// 使用模板字符串构建完整的URL
+			var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
+
+			// 导航到指定页面
+			uni.navigateTo({
+				url: navigateUrl
+			});
+		} else {
+			console.log('No process matched the current process step number.');
+		}
+	}
+
+	function reflush() {
+		// normalStatus.value = true;
+		init(store.planDetails.id);
+	}
+
+	function handleShowTurnoverApplication(data) {
+		isTakeStock().then(response => {
+			if (response.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '正在盘点,不能申请周转',
+					duration: 2000
+				})
+			} else {
+				let _data = data ?? {}
+				carrierFinishedCheck(data).then(res => {
+					if (res.code === 200) {
+						// 调用子组件中的方法
+						turnoverApplicationDialog.value.open(_data)
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg
+						})
+					}
+				})
+			}
+		})
+		// .catch(err => {
+		// 	uri.showToast({
+		// 		icon: "fail",
+		// 		title: "网络请求失败。"
+		// 	})
+		// })
+	}
+
+
+	function init(id) {
+		uni.showLoading({
+			title: '加载中'
+		});
+		let reqData = {
+			productionPlanDetailId: id,
+			deptId: store.curDeptDetails.deptId,
+			keywords: keywords.value
+		};
+		// normalStatus.value = true;
+		getDayWorkInnerSortList(reqData).then(res => {
+			if (res.code == 200) {
+				console.log(res)
+				tempList.value = res.data
+				if (normalStatus.value) {
+					listData.value = res.data.filter(item => {
+						return item.isWasteRecycling == 0 && item.isAmend == 0;
+					});
+				} else {
+					listData.value = res.data.filter(item => {
+						return item.isWasteRecycling == 1 || item.isAmend == 1;
+					})
+				}
+			}
+			uni.hideLoading();
+		})
+	}
+
+	function handleSearch() {
+		init(store.planDetails.id);
+	}
+
+	function checkStatus(item) {
+		if (item.dayworkItemList[0].status < 3) {
+			return
+		} else {
+			handleToreportingForWork(item)
+		}
+	}
+
+	function handleToreportingForWork(item) {
+		store.dayworkInfo = item
+		console.log(store.dayworkInfo)
+		// if (item.dayworkItemList[0].status == 0) {
+		// 	return
+		// }
+		uni.$once("formBack", () => handleSearch())
+		if (item.dayworkItemList[0].equipmentDetailId == 0) {
+			selectEquipment.value.open(null);
+		} else {
+			uni.navigateTo({
+				url: "/pages/sortingOutsource/form",
+				success: function(res) {
+					// 通过eventChannel向被打开页面传送数据
+					res.eventChannel.emit('acceptDataFromOpenerPage', {
+						data: item
+					})
+				}
+			})
+		}
+
+	}
+
+	function handleClickProcessList(item) {
+		let curProcessAfterList = [];
+		console.log(item)
+		currentDaywork.value = item
+		editStatus.value = false
+		//20241220单批单改也要查看图纸
+		// if (item.isWasteRecycling == 1 || item.isAmend == 1) {
+		// 	editStatus.value = true
+		// } else {
+		// 	editStatus.value = false
+		// }
+		let nextIndex = 0;
+		for (let i = 0; i < item.processSequence.length; i++) {
+			console.log(item.nextProcess, "next")
+			if (item.nextProcess) {
+				if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
+					nextIndex = i;
+				}
+			} else {
+				nextIndex = item.processSequence.length
+			}
+
+		}
+		for (let i = 0; i < item.processSequence.length; i++) {
+			if (i >= nextIndex) {
+				curProcessAfterList.push(item.processSequence[i]);
+			}
+		}
+		if (item.status == 3) {
+			curProcessAfterList.splice(0, 1)
+		}
+		console.log(curProcessAfterList)
+		curProcessAfte.value = curProcessAfterList;
+		showRight.value.open();
+	}
+
+
+	function handleSearchCode() {
+		selectProduction.value.open(normalStatus.value);
+	}
+
+	//H5扫码器回调
+	function onDecodeHandler(data) {
+		showQrCodeReader.value = false;
+		let vehicleObj = {
+			carrierCode: data
+		};
+		if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return;
+		}
+		showDaywork({
+			carrierCode: vehicleObj.carrierCode,
+			status: 7
+		}).then(response => {
+			if (response.code == 200) {
+				// console.log(response)
+				// console.log(response.data[0].productionPlanDetailId)
+				// console.log(store.planDetails.id)
+				if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+					uni.showToast({
+						icon: 'none',
+						title: '该批次不在当前工段',
+						duration: 2000
+					})
+					return
+				}
+				if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+					// console.log(response.data)
+					lotDialog.value.open(response.data);
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: '该批次不在此计划单内',
+						duration: 2000
+					})
+				}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: response.msg,
+					duration: 2000
+				})
+			}
+		})
+	}
+
+
+	//H5扫码器关闭
+	function qrReaderClose() {
+		showQrCodeReader.value = false;
+	}
+
+	function handleScanCode() {
+		showQrCodeReader.value = true;
+		// 引入原生插件
+		// const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		// // const mpaasScanModule = null
+		// if (mpaasScanModule) {
+		// 	// 调用插件的 mpaasScan 方法
+		// 	mpaasScanModule.mpaasScan({
+		// 			// 扫码识别类型,参数可多选,qrCode、barCode,
+		// 			// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+		// 			scanType: ["qrCode", "barCode"],
+		// 			// 是否隐藏相册,默认false不隐藏
+		// 			hideAlbum: false,
+		// 		},
+		// 		(ret) => {
+		// 			console.log(ret);
+		// 			let vehicleObj = {
+		// 				carrierCode: ret.resp_result
+		// 			};
+		// 			if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+		// 				uni.showToast({
+		// 					icon: "none",
+		// 					title: "请扫载具码",
+		// 					duration: 1000
+		// 				})
+		// 				return;
+		// 			}
+		// 			showDaywork({
+		// 				carrierCode: vehicleObj.carrierCode,
+		// 				status: 7
+		// 			}).then(response => {
+		// 				if (response.code == 200) {
+		// 					// console.log(response)
+		// 					// console.log(response.data[0].productionPlanDetailId)
+		// 					// console.log(store.planDetails.id)
+		// 					if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+		// 						uni.showToast({
+		// 							icon: 'none',
+		// 							title: '该批次不在当前工段',
+		// 							duration: 2000
+		// 						})
+		// 						return
+		// 					}
+		// 					if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+		// 						// console.log(response.data)
+		// 						lotDialog.value.open(response.data);
+		// 					} else {
+		// 						uni.showToast({
+		// 							icon: 'none',
+		// 							title: '该批次不在此计划单内',
+		// 							duration: 2000
+		// 						})
+		// 					}
+		// 				} else {
+		// 					uni.showToast({
+		// 						icon: 'none',
+		// 						title: response.msg,
+		// 						duration: 2000
+		// 					})
+		// 				}
+		// 			})
+		// 		}
+		// 	);
+		// } else {
+		// 	// 测试时用
+		// 	showDaywork({
+		// 		carrierCode: '000075',
+		// 		status: 7
+		// 	}).then(response => {
+		// 		if (response.code == 200) {
+		// 			if (response.data[0].deptId !== store.curDeptDetails.deptId) {
+		// 				uni.showToast({
+		// 					icon: 'none',
+		// 					title: '该批次不在当前工段',
+		// 					duration: 2000
+		// 				})
+		// 				return
+		// 			}
+		// 			if (response.data[0].productionPlanDetailId == store.planDetails.id) {
+		// 				console.log(response.data)
+		// 				lotDialog.value.open(response.data);
+		// 			} else {
+		// 				uni.showToast({
+		// 					icon: 'none',
+		// 					title: '该批次不在此计划单内',
+		// 					duration: 2000
+		// 				})
+		// 			}
+		// 		} else {
+		// 			console.log(response)
+		// 			uni.showToast({
+		// 				icon: 'none',
+		// 				title: response.msg,
+		// 				duration: 2000
+		// 			})
+		// 		}
+		// 	})
+		// }
+	}
+
+	function handleAddDaywork(data) {
+		console.log(data)
+		let reqParam = [];
+		for (var i = 0; i < data.length; i++) {
+			reqParam.push(data[i].daywork)
+		}
+		console.log(data)
+		data.forEach(item => {
+			item.isSort = 1,
+				item.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId
+		})
+		showDayworkSaveInner(data).then(res => {
+			if (res.code == 200) {
+				console.log(res)
+				init(store.planDetails.id);
+			} else {
+				uni.showToast({
+					icon: "none",
+					title: res.msg,
+					duration: 2000
+				})
+			}
+
+		})
+	}
+
+	function handleDoIt(data) {
+		handleAddDaywork(data);
+	}
+
+	function handleDoTurnoverAfter() {
+		reflush();
+	}
+
+	function switchChange(event) {
+		console.log(event)
+		//异常批
+		if (normalStatus.value) {
+			listData.value = tempList.value.filter(item => {
+				return item.isWasteRecycling == 1 || item.isAmend == 1;
+			});
+			normalStatus.value = false
+		} else {
+			listData.value = tempList.value.filter(item => {
+				return item.isWasteRecycling == 0 && item.isAmend == 0;
+			});
+			normalStatus.value = true
+		}
+
+		console.log(listData.value)
+	}
+
+	function startReport(data) {
+		getSortingDayworkItem(data).then(res => {
+			uni.showToast({
+				icon: "success",
+				title: "开始成功",
+				duration: 2000
+			})
+			init(store.planDetails.id)
+		})
+	}
+	//选择设备
+	function handleAddEquipment(data) {
+		let dayworkItem = store.dayworkInfo.dayworkItemList[0]
+		store.dayworkInfo.dayworkItemList[0].equipmentDetailId = data.equipmentDetailId
+		store.dayworkInfo.dayworkItemList[0].equipmentDetailCode = data.equipmentDetailCode
+		dayworkItem.equipmentDetailId = data.equipmentDetailId
+		dayworkItem.equipmentDetailCode = data.equipmentDetailCode
+		//保存
+		addEquipmentInfo(dayworkItem).then(res => {
+			if (res.code == 200) {
+				uni.navigateTo({
+					url: "/pages/sortingOutsource/form",
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', {
+							data: store.dayworkInfo
+						})
+					}
+				})
+			}
+		})
+	}
+
+	function handleCancelTurnover(data) {
+		isTakeStock().then(response => {
+			if (response.data) {
+				uni.showToast({
+					icon: 'none',
+					title: '正在盘点,不能取消周转',
+					duration: 2000
+				})
+			} else {
+				turnoverDelete(data).then(res => {
+					if (res.code == 200) {
+						uni.showToast({
+							icon: "success",
+							title: "取消成功",
+							duration: 2000
+						})
+
+						setTimeout(() => {
+							init(store.planDetails.id);
+						}, 1500);
+					} else {
+						uni.showToast({
+							icon: "none",
+							title: "取消失败",
+							duration: 2000
+						})
+						setTimeout(() => {
+							init(store.planDetails.id);
+						}, 1000);
+					}
+				})
+			}
+		})
+	}
+</script>
+
+<style lang="scss">
+	$nav-height: 60rpx;
+
+	.box-bg {
+		width: 94%;
+		background-color: #F5F5F5;
+		padding: 5rpx 16rpx;
+		justify-content: space-around;
+		align-items: center;
+		margin: 24rpx auto 0;
+
+		.input-view {
+			width: 100%;
+			flex: 4;
+			background-color: #f8f8f8;
+			height: $nav-height;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			margin: 0 10rpx 0;
+			line-height: $nav-height;
+
+			.input-uni-icon {
+				line-height: $nav-height;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: $nav-height;
+				line-height: $nav-height;
+				padding: 0 5rpx;
+				background-color: #f8f8f8;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			color: #808080;
+		}
+	}
+
+	.list-title {
+		width: 100%;
+		margin-top: 16rpx;
+		height: 64rpx;
+		line-height: 64rpx;
+		align-items: center;
+		margin-left: 32rpx;
+
+		.label {
+
+			font-size: 32rpx;
+			margin-right: 24rpx;
+		}
+
+		.icon-gear {
+			font-size: 56rpx;
+		}
+	}
+
+	.switch {
+		margin-top: -8rpx;
+		transform: scale(0.7);
+	}
+
+	.scroll-container {
+		width: 92%;
+		margin: 24rpx auto 0 auto;
+		height: calc(90% - 100rpx);
+		overflow: auto;
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		margin-bottom: 24rpx;
+		border-radius: 24rpx;
+
+		.title-container {
+
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1CE5B0;
+				background-color: #F6FFFD;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1CE5B0;
+					font-size: 24rpx;
+				}
+
+				&.finished {
+					border: 1px solid #BBBBBB;
+					background-color: #F5F5F5;
+
+					.label {
+						color: #BBBBBB;
+					}
+				}
+
+				&.turnover {
+					border: 1px solid #FF7901;
+					background-color: #F6FFFD;
+
+					.label {
+						color: #FF7901;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+
+		.status-btn {
+			justify-content: flex-end;
+			align-items: center;
+
+			.turnover-tag {
+				padding-right: 12rpx;
+				padding-left: 12rpx;
+				border-radius: 8rpx;
+				border: 1rpx solid #FF7901;
+				background-color: #FF7901;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+			}
+
+			.reporting-tag {
+				padding-right: 12rpx;
+				padding-left: 12rpx;
+				border-radius: 8rpx;
+				margin-left: 16rpx;
+				border: 1rpx solid #1684fc;
+				background-color: #1684fc;
+				font-size: 28rpx;
+				color: #FFFFFF;
+
+			}
+		}
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+	}
+</style>

+ 43 - 7
pages/sortBatchReporting/index.vue

@@ -140,6 +140,8 @@
 		<dialog-lot ref="lotDialog" @submit="handleDoIt" />
 		<dialog-turnoverApplication ref="turnoverApplicationDialog" @reflushDaywork="handleDoTurnoverAfter" />
 		<dialog-selectProduction ref="selectProduction"></dialog-selectProduction>
+		<dialog-selectEquipment ref='selectEquipment'
+			@handleAddDayWorkItem='handleAddEquipment'></dialog-selectEquipment>
 		<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
 	</view>
 
@@ -173,6 +175,9 @@
 	import {
 		carrierFinishedCheck
 	} from '@/api/business/carrier.js'
+	import {
+		addEquipmentInfo
+	} from '@/api/business/dayWorkItem.js'
 	import {
 		isTakeStock
 	} from '@/api/business/taksStackLot.js'
@@ -200,6 +205,7 @@
 	const isLoading = ref(false);
 	const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态	
 	const keywords = ref(null)
+	const selectEquipment = ref(null) // 组件  
 	const tempList = ref([])
 	const wasteRecyclingList = ref([]) //废品回用批次
 	// 在数据中定义一个变量来控制遮罩层的显示
@@ -430,16 +436,45 @@
 	}
 
 	function handleToreportingForWork(item) {
+		store.dayworkInfo = item
+		console.log(store.dayworkInfo)
 		// if (item.dayworkItemList[0].status == 0) {
 		// 	return
 		// }
 		uni.$once("formBack", () => handleSearch())
-		uni.navigateTo({
-			url: "/pages/sorting/form",
-			success: function(res) {
-				// 通过eventChannel向被打开页面传送数据
-				res.eventChannel.emit('acceptDataFromOpenerPage', {
-					data: item
+		if (item.dayworkItemList[0].equipmentDetailId == 0) {
+			selectEquipment.value.open(null);
+		} else {
+			uni.navigateTo({
+				url: "/pages/sorting/form",
+				success: function(res) {
+					// 通过eventChannel向被打开页面传送数据
+					res.eventChannel.emit('acceptDataFromOpenerPage', {
+						data: item
+					})
+				}
+			})
+		}
+
+	}
+	//选择设备
+	function handleAddEquipment(data) {
+		let dayworkItem = store.dayworkInfo.dayworkItemList[0]
+		store.dayworkInfo.dayworkItemList[0].equipmentDetailId = data.equipmentDetailId
+		store.dayworkInfo.dayworkItemList[0].equipmentDetailCode = data.equipmentDetailCode
+		dayworkItem.equipmentDetailId = data.equipmentDetailId
+		dayworkItem.equipmentDetailCode = data.equipmentDetailCode
+		//保存
+		addEquipmentInfo(dayworkItem).then(res => {
+			if (res.code == 200) {
+				uni.navigateTo({
+					url: "/pages/sorting/form",
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', {
+							data: store.dayworkInfo
+						})
+					}
 				})
 			}
 		})
@@ -780,7 +815,8 @@
 		}
 		console.log(data)
 		data.forEach(item => {
-			item.isSort = 1
+			item.isSort = 1,
+				item.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId
 		})
 		showDayworkSave(data).then(res => {
 			if (res.code == 200) {

+ 438 - 0
pages/sortInnerProductionPlan/index.vue

@@ -0,0 +1,438 @@
+<template>
+	<view class="uni-column" style="padding: 24rpx;position: fixed;left: 0;right: 0;">
+		<view class="box-bg uni-row">
+			<view class="input-view uni-row">
+				<uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
+				<input class="nav-bar-input" type="text" v-model="keywords" placeholder="输入搜索关键词" />
+			</view>
+			<view class="search" @click="handleSearch">搜索</view>
+		</view>
+		<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
+			<text>暂无生产计划</text>
+		</view>
+		<view v-else style="height: calc(100% - 100rpx); overflow: auto;padding-bottom: 100rpx;">
+			<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
+				class="list-item">
+				<view class="title-container uni-row">
+					<view class="title uni-row">
+						<text class="label">生产计划单号</text>
+						<text class="label code">{{ item['productionPlanNo'] }}</text>
+						<text class="label" style="margin-left: 20px;">序号</text>
+						<text class="label code">{{ item['lineNumber'] }}</text>
+					</view>
+					<view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
+					<view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">产品描述</text>
+					<text class="label right">{{ item['productDescription'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">总批数</text>
+					<text class="label right">{{ item['totalLotNumber'] }}</text>
+				</view>
+				<!-- <view class="item-info uni-row">
+					<text class="label">完成批数</text>
+					<text class="label right">{{ item['equiment'] }}</text>
+				</view> -->
+				<view class="item-info uni-row">
+					<text class="label">投产数</text>
+					<text class="label right">{{ item['productionQuantity'] }}</text>
+				</view>
+				<view class="item-info uni-row">
+					<text class="label">单批量</text>
+					<text class="label right">{{ item['oneLotQuantity'] }}</text>
+				</view>
+			</view>
+		</view>
+		<view class="bottom uni-row">
+			<button class="start-batch-btn" style="margin-right: 10rpx;background-color: #67c337;"
+				@click="handleScanCode">扫码报工</button>
+		</view>
+		<dialog-selectDaywork ref='selectDaywork' @handleSelectDaywork='handleSelectDaywork'></dialog-selectDaywork>
+		<QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
+	</view>
+</template>
+
+<script setup>
+	import {
+		getInnerPlanDetailsList,
+		selectByCarrierCode,
+		selectInfoByLotCode
+	} from '@/api/business/planDetails.js'
+	import QrScanner from '../vueQrCode/index.vue'
+	import {
+		ref
+	} from 'vue'
+	import {
+		onReady,
+		onLoad,
+		onUnload,
+		onPullDownRefresh,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getToken
+	} from '@/utils/auth'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		getUserProcess
+	} from '@/api/process/process.js'
+
+
+	const listData = ref([])
+	const keywords = ref('')
+	const selectDaywork = ref(null)
+	const carrierCode = ref(null)
+	const showQrCodeReader = ref(false);
+
+	onLoad(() => {
+		// dayworkItem数据更改后刷新数据
+		// uni.$on('dayworkItemUpdate', reflush);
+	})
+
+	onShow(() => {
+		reflush();
+	})
+
+	onUnload(() => {
+		console.log(store.curDeptDetails)
+		// uni.$off('dayworkItemUpdate', reflush)
+	})
+
+	/**	
+	 * 监听下拉刷新
+	 */
+	onPullDownRefresh(() => {
+		uni.stopPullDownRefresh();
+		reflush();
+
+
+	})
+
+	function reflush() {
+		keywords.value = ''
+		init();
+	}
+
+	function init(data) {
+		uni.showLoading({
+			title: '加载中'
+		});
+		getInnerPlanDetailsList({
+			deptId: Number(store.curDeptDetails.deptId),
+			keywords: keywords.value
+		}).then(res => {
+			if (res.code == 200) {
+				listData.value = res.data;
+				uni.hideLoading();
+			}
+			uni.hideLoading();
+		})
+	}
+
+	function handleToBatchReporting(item) {
+		store.planDetails = item
+		uni.navigateTo({
+			url: '/pages/sortBatchInnerReporting/index'
+		})
+	}
+	//查箱号
+	function handleSearchCode() {
+		uni.navigateTo({
+			url: '/pages/sortProductionPlan/details'
+		})
+	}
+	//带回
+	function handleSelectDaywork(data) {
+		console.log(data)
+		//查询计划单信息跳转
+		selectInfoByLotCode({
+			lotCode: data
+		}).then(res => {
+			store.planDetails = res.data
+			var code = encodeURIComponent(carrierCode.value);
+			// 构建查询参数字符串
+			var queryParam =
+				`param1=${code}`;
+
+			// 使用模板字符串构建完整的URL
+			var navigateUrl = `/pages/sortBatchInnerReporting/index?${queryParam}`;
+			uni.navigateTo({
+				url: navigateUrl
+			});
+		})
+	}
+
+	function handleSearch() {
+		let reqParam = {
+			keywords: keywords.value
+		}
+		reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
+		init(reqParam)
+	}
+
+	//H5扫码器回调
+	function onDecodeHandler(data) {
+		showQrCodeReader.value = false;
+		let vehicleObj = {
+			carrierCode: data
+		};
+		if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+			uni.showToast({
+				icon: "none",
+				title: "请扫载具码",
+				duration: 1000
+			})
+			return;
+		}
+		selectByCarrierCode({
+			carrierCode: vehicleObj.carrierCode,
+			deptId: Number(store.curDeptDetails.deptId)
+		}).then(response => {
+			carrierCode.value = vehicleObj.carrierCode
+			if (response.code == 200) {
+				if (response.data.length > 1) {
+					selectDaywork.value.open(response.data)
+
+				} else {
+					handleSelectDaywork(response.data[0].lotCode)
+				}
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: response.msg,
+					duration: 2000
+				})
+			}
+		})
+	}
+
+
+	//H5扫码器关闭
+	function qrReaderClose() {
+		showQrCodeReader.value = false;
+	}
+
+	function handleScanCode() {
+		showQrCodeReader.value = true;
+		// 引入原生插件
+		// const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
+		// // const mpaasScanModule = null
+		// if (mpaasScanModule) {
+		// 	// 调用插件的 mpaasScan 方法
+		// 	mpaasScanModule.mpaasScan({
+		// 			// 扫码识别类型,参数可多选,qrCode、barCode,
+		// 			// 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
+		// 			scanType: ["qrCode", "barCode"],
+		// 			// 是否隐藏相册,默认false不隐藏
+		// 			hideAlbum: false,
+		// 		},
+		// 		(ret) => {
+		// 			console.log(ret);
+		// 			let vehicleObj = {
+		// 				carrierCode: ret.resp_result
+		// 			};
+		// 			if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
+		// 				uni.showToast({
+		// 					icon: "none",
+		// 					title: "请扫载具码",
+		// 					duration: 1000
+		// 				})
+		// 				return;
+		// 			}
+		// 			selectByCarrierCode({
+		// 				carrierCode: vehicleObj.carrierCode,
+		// 				deptId:Number(store.curDeptDetails.deptId)
+		// 			}).then(response => {
+		// 					carrierCode.value = vehicleObj.carrierCode
+		// 				if (response.code == 200) {
+		// 					if (response.data.length > 1) {
+		// 						selectDaywork.value.open(response.data)	
+
+		// 					} else {
+		// 						handleSelectDaywork(response.data[0].lotCode)
+		// 					}
+		// 				} else {
+		// 					uni.showToast({
+		// 						icon: 'none',
+		// 						title: response.msg,
+		// 						duration: 2000
+		// 					})
+		// 				}
+		// 			})
+		// 		}
+		// 	);
+		// } else {
+		// 	// 测试时用
+		// 	selectByCarrierCode({
+		// 		carrierCode: '000745',
+		// 		deptId:Number(store.curDeptDetails.deptId)
+		// 	}).then(response => {
+		// 		if (response.code == 200) {
+		// 			carrierCode.value = '000745'
+		// 			if (response.data.length > 1) {
+		// 				selectDaywork.value.open(response.data)								
+		// 			} else {
+		// 				handleSelectDaywork(response.data[0].lotCode)
+		// 			}
+		// 		} else {
+		// 			uni.showToast({
+		// 				icon: 'none',
+		// 				title: response.msg,
+		// 				duration: 2000
+		// 			})
+		// 		}
+		// 	})
+		// }
+	}
+</script>
+
+<style lang="scss">
+	$nav-height: 60rpx;
+
+	.box-bg {
+		width: 100%;
+		background-color: #F5F5F5;
+		padding: 5rpx 0;
+		justify-content: space-around;
+		align-items: center;
+
+		.input-view {
+			width: 100%;
+			flex: 4;
+			background-color: #f8f8f8;
+			height: $nav-height;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			margin: 0 10rpx 20rpx;
+			line-height: $nav-height;
+
+			.input-uni-icon {
+				line-height: $nav-height;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: $nav-height;
+				line-height: $nav-height;
+				padding: 0 5rpx;
+				background-color: #f8f8f8;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			color: #808080;
+			margin-top: -20rpx;
+		}
+	}
+
+	.uni-column {
+		background-color: rgba(245, 245, 245, 1);
+		height: calc(100% - 40rpx);
+	}
+
+	.list-item {
+		background-color: #fff;
+		position: relative;
+		padding: 16rpx;
+		padding-bottom: 24rpx;
+		border-radius: 24rpx;
+		margin-bottom: 24rpx;
+
+		.title-container {
+			justify-content: space-between;
+			margin-top: 8rpx;
+			margin-bottom: 16rpx;
+
+			.title {
+				height: 48rpx;
+				align-items: center;
+
+				.label {
+					font-size: 32rpx;
+					font-weight: bold;
+
+					&.code {
+						margin-left: 8rpx;
+					}
+				}
+			}
+
+			.tag {
+				border: 1px solid #1ce5b0;
+				background-color: #f6fffd;
+				padding: 8rpx;
+				border-radius: 8rpx;
+
+				.label {
+					color: #1ce5b0;
+					font-size: 24rpx;
+				}
+
+				&.not-start {
+					border: 1px solid #bbbbbb;
+					background-color: #f5f5f5;
+
+					.label {
+						color: #bbbbbb;
+					}
+				}
+			}
+		}
+
+		.item-info {
+			margin-bottom: 8rpx;
+
+			.label {
+				font-size: 28rpx;
+				width: 220rpx;
+				color: #808080;
+
+				&.right {
+					flex: 1;
+					color: #000000;
+				}
+			}
+		}
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+
+		.view-end-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+
+		}
+	}
+</style>

+ 7 - 0
pages/sorting/form.vue

@@ -14,6 +14,9 @@
 			<view class="product-info">
 				投产数量: {{ dayworkItem.prodNum }}
 			</view>
+			<view class="product-info">
+				设备: {{ dayworkItem.equipmentDetailCode }}
+			</view>
 		</view>
 
 		<!-- 不合格信息 -->
@@ -707,6 +710,8 @@
 			prodNum: dayworkItem.value.prodNum,
 			rejectNum: dayworkItem.value.rejectNum,
 			qualifiedNum: dayworkItem.value.qualifiedNum,
+			equipmentDetailId: dayworkItem.value.equipmentDetailId,
+			equipmentDetailCode: dayworkItem.value.equipmentDetailCode,
 			remark: dayworkItem.value.remark,
 			storageInfo: storageInfo.value,
 			retrievalInfo: retrievalInfo.value
@@ -777,6 +782,8 @@
 			id: dayworkItem.value.id,
 			prodNum: dayworkItem.value.prodNum,
 			rejectNum: dayworkItem.value.rejectNum,
+			equipmentDetailId: dayworkItem.value.equipmentDetailId,
+			equipmentDetailCode: dayworkItem.value.equipmentDetailCode,
 			qualifiedNum: dayworkItem.value.qualifiedNum,
 			remark: dayworkItem.value.remark,
 			storageInfo: storageInfo.value,

+ 3 - 4
pages/sorting/options.vue

@@ -20,10 +20,9 @@
 		</view>
 		<view class="uni-row" style="position: absolute;
     background-color: rgb(255, 255, 255);
-    height: 70%;
-    padding-bottom: 12px;
+    height: 68%;
     margin-top: 20px;
-    top: 90px;
+    top: 102px;
     left: 12px;
     right: 12px;">
 			<view style="width: 100%;height: 100%;overflow: auto;">
@@ -196,7 +195,7 @@
 
 
 		position: fixed;
-		top: 43px;
+		top: 50px;
 		/* height: 13%; */
 		background-color: #fff;
 		padding: .75rem;

+ 3 - 3
pages/sorting/specialOptions.vue

@@ -24,10 +24,10 @@
 			style="background-color:#ffffff;height: 76%;padding-bottom: 12px;margin-bottom:65px;margin-top: 8px;"> -->
 		<view v-else class="uni-row" style="position: absolute;
     background-color: rgb(255, 255, 255);
-    height: 70%;
+    height: 68%;
     padding-bottom: 12px;
     margin-top: 20px;
-    top: 90px;
+    top: 102px;
     left: 12px;
     right: 12px;">
 			<view style="width: 30%;height: 95%;overflow: auto;">
@@ -201,7 +201,7 @@
 
 
 		position: fixed;
-		top: 43px;
+		top: 50px;
 		/* height: 13%; */
 		background-color: #fff;
 		padding: .75rem;

+ 375 - 0
pages/sortingOutsource/consultation.vue

@@ -0,0 +1,375 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="consultation-container uni-column">
+			<view class="title uni-row">咨询</view>
+			<view class="info-row uni-row">
+				<view class="label">批次号</view>
+				<view class="value">{{ dayworkItem.lotCode }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ dayworkItem.productDescription }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">技术负责人</view>
+				<view class="box-bg uni-row">
+					<view class="input-view uni-row">
+						<input class="nav-bar-input" type="text" disabled="true" v-model="dayworkItem.technicianName" />
+					</view>
+					<view class="search" @click="handleSwitch">
+						<text style="padding-top: 5px;padding-right: 8px;color: aliceblue;">更换</text>
+
+					</view>
+				</view>
+				<!-- <view class="value">{{ dayworkItem.technicianName }}</view> -->
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">咨询部门</view>
+				<view class="value">
+					<checkbox-group @change="checkboxChange" style="margin-top: 16px;">
+						<view v-for="(item, index) in consulteList" :key="item.value">
+							<view class="uni-row checkbox-item">
+								<view style="flex-grow: 1;font-size: 16px;">{{item.label}}</view>
+								<view class="checkboxHidden">
+									<checkbox :value="item.value" :checked="selected.includes(item.value)"
+										color="#0000ff" class="checkbox" />
+								</view>
+							</view>
+							<view v-if="index!=consulteList.length -1" class='middle'>
+								<view class='segment'></view>
+								<view class='segment'></view>
+							</view>
+						</view>
+					</checkbox-group>
+				</view>
+			</view>
+			<view class="info-row uni-column">
+				<view class="label" style="margin-bottom: 16rpx;">问题描述</view>
+				<view class="value uni-row">
+					<textarea v-model="data.content" maxlength="200"></textarea>
+				</view>
+			</view>
+			<view class="info-row">
+				<view class="label" style="margin-bottom: 16rpx;">照片</view>
+				<view>
+					<uni-file-picker :value="photoList.url" @select="select" file-mediatype="image" class="my-files"
+						@delete="handleDeletedPhoto"></uni-file-picker>
+				</view>
+			</view>
+			<view class="btn uni-row" @click.stop="handleSubmit">提交</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref,
+		computed
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+
+	import {
+		onMounted,
+		getCurrentInstance
+	} from 'vue';
+	import {
+		getURL
+	} from '@/api/sys/user.js'
+	const dayworkItem = ref({})
+	const selected = ref([]);
+	const selectedPhotos = ref([])
+	const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
+	const webHost = ref(urlList.pdfAppURL)
+	const photoList = ref([])
+	const consulteList = ref([{
+			value: 0,
+			label: "技术"
+		},
+		{
+			value: 1,
+			label: "品管"
+		},
+	])
+	const data = ref({
+		content: '',
+		departments: null
+	})
+
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
+	onShow(() => {
+		uni.$off('addTechnicianEvent');
+	})
+
+	onMounted(() => {
+		const instance = getCurrentInstance().proxy
+		const eventChannel = instance.getOpenerEventChannel();
+
+		eventChannel.on('acceptDataFromOpenerPage', function(data) {
+			console.log('acceptDataFromOpenerPage', data)
+			// 传入当前报工信息 通过当前报工的产品和工序获取检查指导书和分选标准
+			if (data && data.data) {
+				dayworkItem.value = JSON.parse(JSON.stringify(data.data));
+				console.log(dayworkItem.value)
+			}
+		})
+	})
+
+
+	// 页面生命周期函数
+	onLoad(() => {
+
+	})
+
+	function upLoadImageHandler(arg) {
+		return getURL(arg).then(res => {
+			let data = JSON.parse(res)
+			selectedPhotos.value.push({
+				url: data.fileName,
+				pictureName: data.originalFilename
+			})
+			console.log(selectedPhotos.value)
+			// uni.showToast({
+			// 	icon: 'none',
+			// 	title: selectedPhotos.value.length,
+			// 	duration: 2000
+			// })
+		})
+	}
+
+	function select(e) {
+		console.log(e)
+		const {
+			tempFilePaths,
+			tempFiles
+		} = e
+		uni.showLoading({
+			title: '图片上传中',
+			mask: true
+		});
+		// 创建一个空的Promise数组
+		let uploadPromises = tempFiles.map((item, index) => {
+			return upLoadImageHandler({
+				filePath: tempFilePaths[index],
+				name: item.name
+			});
+		});
+
+		// 使用Promise.all等待所有图片上传完成
+		Promise.all(uploadPromises).then(() => {
+
+			// 上传完成后关闭加载提示
+			uni.hideLoading();
+		}).catch(() => {
+			// 如果有错误发生,也关闭加载提示
+			uni.hideLoading();
+		});
+	}
+
+	function handleDeletedPhoto(e) {
+		let fileName = selectedPhotos.value.map(info => info.name)
+		let index = fileName.findIndex(name => name === e.tempFile.name);
+		selectedPhotos.value.splice(index, 1)
+	}
+	//选中咨询部门数据
+	function checkboxChange(value) {
+		data.value.departments = value.detail.value; // 添加选中项
+	}
+
+	const handleSubmit = () => {
+		console.log(data.value.departments)
+		if (data.value.departments == null || (data.value.departments != null && data.value.departments.length == 0)) {
+			uni.showToast({
+				icon: 'none',
+				title: '请选择咨询部门'
+			})
+			return
+		}
+		console.log(dayworkItem.value.technicianId)
+		if (data.value.departments.includes(0) && (dayworkItem.value.technicianId == undefined || dayworkItem.value
+				.technicianId == 0)) {
+			uni.showToast({
+				icon: 'none',
+				title: '请选择技术负责人'
+			})
+			return
+		}
+		if (data.value.content == null || data.value.content == '') {
+			uni.showToast({
+				icon: 'none',
+				title: '请输入问题描述'
+			})
+			return
+		}
+		const currentTime = Date.now();
+		console.log("检查", lastRequestTimestamp);
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
+		lastRequestTimestamp.value = currentTime;
+		uni.$emit('addConsulttationEvent', {
+			content: data.value.content,
+			departments: data.value.departments,
+			pictures: selectedPhotos.value,
+			technicianId: dayworkItem.value.technicianId
+		})
+		uni.navigateBack()
+	}
+	const addTechnician = (data) => {
+		console.log(data)
+		dayworkItem.value.technicianId = data.technicianId
+		dayworkItem.value.technicianName = data.technicianName
+	}
+	//切换技术负责人
+	function handleSwitch() {
+		uni.$on('addTechnicianEvent', (data) => {
+			addTechnician(data)
+		})
+		console.log("777")
+		uni.navigateTo({
+			url: "/pages/sorting/technicianOptions"
+		})
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+
+	.consultation-container {
+		background-color: #ffffff;
+		padding: 24rpx;
+		border-radius: 12rpx;
+
+		.title {
+			justify-content: center;
+			font-size: 32rpx;
+			font-weight: 700;
+		}
+
+		.info-row {
+			margin-top: 24rpx;
+
+			.label {
+				width: 180rpx;
+			}
+
+			.value {
+				flex: 1;
+
+				textarea {
+					flex: 1;
+					border: 1px solid #888888;
+					box-sizing: border-box;
+					padding: 16rpx;
+				}
+			}
+		}
+
+		.btn {
+			background-color: #00D068;
+			color: #ffffff;
+			border-radius: 8rpx;
+			margin: 24rpx;
+			height: 64rpx;
+			justify-content: center;
+			align-items: center;
+		}
+	}
+
+	.middle {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center
+	}
+
+	.segment {
+		width: 60%;
+		background-color: rgba(213, 213, 213, 1);
+		border: 1rpx solid rgba(213, 213, 213, 1);
+		margin: 8px 0;
+	}
+
+	.checkbox-item {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		margin-bottom: 10px;
+	}
+
+	.checkbox {
+		margin-right: 10px;
+	}
+
+	// .uni-file-picker__container{
+	// }
+	.my-files {
+		display: flex;
+		justify-content: center;
+
+		:deep(.uni-file-picker__container) {
+			flex-direction: row;
+
+		}
+	}
+
+	.box-bg {
+		width: 94%;
+		padding: 5rpx 16rpx;
+		justify-content: space-around;
+		align-items: center;
+
+		.input-view {
+			flex: 1;
+			height: 60rpx;
+			border: 1rpx solid #999;
+			border-radius: 15rpx;
+			border-top-right-radius: 0;
+			border-bottom-right-radius: 0;
+			padding: 0 15rpx;
+			flex-wrap: nowrap;
+			line-height: 60rpx;
+
+			.input-uni-icon {
+				line-height: 60rpx;
+			}
+
+			.nav-bar-input {
+				width: 80%;
+				height: 60rpx;
+				line-height: 60rpx;
+				padding: 0 5rpx;
+			}
+		}
+
+		.search {
+			width: 20%;
+			text-align: center;
+			background-color: #3e9fff;
+			height: 60rpx;
+			border-radius: 15rpx;
+			border-top-left-radius: 0;
+			border-bottom-left-radius: 0;
+			border: 1rpx solid #999;
+			padding-left: 10px;
+		}
+	}
+</style>

+ 1110 - 0
pages/sortingOutsource/form.vue

@@ -0,0 +1,1110 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="lot-info uni-column">
+			<view class="lot-code uni-row">
+				<text>批次号</text>
+				<text style="margin-left: 24rpx;">{{ dayworkItem.lotCode }}</text>
+			</view>
+			<view class="product-info">
+				产品描述: {{ dayworkItem.productDescription }}
+			</view>
+			<view class="product-info">
+				原材料厂家: {{ dayworkInfo.furnaceNoInfo.factory }}
+			</view>
+			<view class="product-info">
+				投产数量: {{ dayworkItem.prodNum }}
+			</view>
+			<view class="product-info">
+				设备: {{ dayworkItem.equipmentDetailCode }}
+			</view>
+		</view>
+
+		<!-- 不合格信息 -->
+		<view class="title unfit-title uni-row">
+			<text>不合格信息</text>
+			<view v-if="Number(dayworkItem.status) < 3" class="add-btn" @click="handleAddUnfit">添加</view>
+		</view>
+		<view class="unfit-container">
+			<view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
+				<view class="title uni-row">
+					<text>检查标准-{{ item.checkStandard }}</text>
+					<uni-icons v-if="Number(dayworkItem.status) < 3" type="trash" size="24" color="#fc6565"
+						@click="handleDelUnfit(index)" />
+				</view>
+				<!-- <view class="standard">检查标准:{{ item.checkStandard }}</view> -->
+				<view class="result uni-row" style="display: flex;flex-direction: row;justify-content: space-between;">
+					<!-- align-items: flex-start; -->
+					<view class="label" style="padding-right: 16rpx;flex: 0 1 auto; min-width: 118rpx;">
+						检查结果</view>
+					<input v-if="Number(dayworkItem.status) < 3" v-model="item.reason" placeholder="请输入检查结果" />
+					<span v-else style="flex-grow: 1;">{{ item.reason }}</span>
+					<view class="label"
+						style="text-align: right; padding-right: 16rpx;flex: 0 1 auto; min-width: 68rpx;">数量</view>
+					<input v-if="Number(dayworkItem.status) < 3" class="number" type="number" v-model="item.rejectNum"
+						@blur="rejectNumberChange" />
+					<span v-else>{{ item.rejectNum }}</span>
+				</view>
+			</view>
+		</view>
+
+		<!-- 咨询部分 -->
+		<view class="title">咨询</view>
+		<view class="consultation-container uni-column">
+			<view class="consultation-item-container" v-for="(item, index) in consultations" :key="index">
+				<view class="question uni-column">
+					<view class="label uni-row">
+						<text>问题描述</text>
+						<text :style="{ color: showStatusColor(item.status) }">{{item.consultDepartment == 0?'技术':'品管'}}
+							{{ selectText(item) }}</text>
+					</view>
+					<view class="content">{{ item.content }}</view>
+				</view>
+				<!-- <view v-if="item.answer !== ''" class="answer"
+					style="margin-top: 24rpx; padding-top: 24rpx; border-top: 1px dotted #aaaaaa;">
+					<view class="label">回复</view>
+					<view class="content">{{ item.answer }}</view>
+				</view> -->
+			</view>
+		</view>
+		<!-- 零存库部分 -->
+		<view class="title">零存库</view>
+		<view class="consultation-container ">
+			<view class="title unfit-title uni-row">
+				<view class="title">零取</view>
+				<view class="add-btn" v-if="Number(dayworkItem.status) < 3" style="background-color: #409eff;"
+					@click="handleAddLot">添加</view>
+			</view>
+			<view>
+				<zb-table v-if="Number(dayworkItem.status) < 3" :columns="column1" :stripe="true" :fit="true"
+					@dele="dele" :data="retrievalInfo"></zb-table>
+				<zb-table v-else :columns="column2" :stripe="true" :fit="true" @dele="dele"
+					:data="retrievalInfo"></zb-table>
+				<!-- <uni-table   ref="table" :loading="loading" border stripe  emptyText="暂无更多数据" >
+							<uni-tr >
+								<uni-th style="font-size: 25rpx;" width="atuo"   align="center">批次号</uni-th>
+								<uni-th style="font-size: 25rpx;" width="120"  align="center">数量</uni-th>
+								<uni-th v-if="Number(dayworkItem.status) < 3" style="font-size: 25rpx;" width="80"  align="center">操作</uni-th>
+							</uni-tr>
+							<uni-tr v-for="(item, index) in retrievalInfo" :key="index">
+								<uni-th style="font-size: 24rpx;" width="auto" align="center">{{ item.lotCode }}</uni-th>
+								<uni-th style="font-size: 25rpx;" width="120" align="center">
+									{{ item.storageNum }}
+								</uni-th>
+								<uni-th v-if="Number(dayworkItem.status) < 3 && item.status == 0" align="center" width="80">
+									<uni-icons  type="closeempty" size="22" @click="handleDelete(item)"></uni-icons>
+
+								</uni-th>
+							</uni-tr>
+						</uni-table> -->
+			</view>
+			<view v-if="saveFlag" class='middle'>
+				<view class='segment'></view>
+				<view class='segment'></view>
+			</view>
+			<view v-if="saveFlag" class="title unfit-title uni-row">
+				<view class="title">零存</view>
+			</view>
+			<view v-if="saveFlag" class="save uni-row">
+				<text class="label">存入数量</text>
+				<input class="number" type="number"
+					v-if="!(storageInfo.status == 1 || Number(dayworkItem.status) >= 3 || storageInfo.id)"
+					placeholder="请输入" v-model="storageNum" />
+				<span style="margin-left: 56rpx;flex: 1;" v-else>{{ storageNum }}</span>
+			</view>
+		</view>
+
+		<!-- 报工部分 -->
+		<view class="daywork-container">
+			<view class="result uni-row">
+				<view class="label">合格量</view>
+				<input v-if="Number(dayworkItem.status) < 3" type="number" placeholder="请输入合格量"
+					v-model="dayworkItem.qualifiedNum" />
+				<span v-else>{{ dayworkItem.qualifiedNum }}</span>
+				<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
+				<input v-if="Number(dayworkItem.status) < 3" :disabled="true" type="number" placeholder="请输入废品量"
+					v-model="dayworkItem.rejectNum" />
+				<span v-else>{{ dayworkItem.rejectNum }}</span>
+			</view>
+			<view class="remark uni-row">
+				<view class="label">备注</view>
+				<textarea v-if="Number(dayworkItem.status) < 3" v-model="dayworkItem.remark" maxlength="999" />
+				<span v-else>{{ dayworkItem.remark }}</span>
+			</view>
+
+			<view class="btns-container uni-row">
+				<!-- 最后一步完成不能更换载具 -->
+				<view v-if="dayworkItem.daywork != null && dayworkItem.daywork.status != 2" class="bottom-btn left-btn "
+					@click="handleChangeCarrier">
+					更换载具</view>
+				<view v-if="checkFinishable()&&Number(dayworkItem.status) < 3" class="finished-btn"
+					@click.stop="handleFinishDaywork">结束报工</view>
+				<view v-if="Number(dayworkItem.status) < 3" class="pause-btn" @click.stop="handleUpdateDaywork">暂停
+				</view>
+				<view v-if="Number(dayworkItem.status) < 3" class="question-btn uni-column"
+					@click.stop="handleAddConsultation">
+					<uni-icons type="headphones" size="24" />
+					<text>咨询</text>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onMounted,
+		getCurrentInstance
+	} from 'vue';
+	import {
+		getSortingDayworkItem,
+		saveConsult,
+		finishInner,
+		update,
+		selectInstructionList
+	} from '@/api/business/sortDaywork.js'
+	import {
+		getTakeStockPeriod
+	} from '@/api/business/taksStackLot.js'
+	import {
+		getDictInfoByType
+	} from '@/api/dict/dict.js'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		timestampToTime,
+		toHHmmss
+	} from '@/utils/common.js'
+
+	const isEventTriggered = ref(false); // 创建一个标志位
+	const unfitInfos = ref([])
+	const consultations = ref([])
+	const dayworkInfo = ref({})
+	const retrievalInfo = ref([])
+	// 创建一个引用来存储最后一次请求的时间戳
+	const lastRequestTimestamp = ref(0);
+	const dayworkItem = ref({})
+	const saveFlag = ref(false)
+	const storageNum = ref(null)
+	const storageInfo = ref(null)
+	const qualifiedNumRatio = ref(0)
+	const selectEquipment = ref(null) // 组件   
+	const isFinish = ref(false)
+	const column1 = [{
+			name: 'lotCode',
+			label: '批次号',
+			align: 'center'
+		},
+		{
+			name: 'storageNum',
+			label: '数量',
+			align: 'center'
+		},
+		{
+			name: 'operation',
+			type: 'operation',
+			label: '操作',
+			align: 'center',
+			renders: [{
+				name: '删除',
+				type: 'warn',
+				func: "dele",
+				class: "buttonOp"
+			}, ]
+		},
+	]
+	const column2 = [{
+			name: 'lotCode',
+			label: '批次号',
+			align: 'center'
+		},
+		{
+			name: 'storageNum',
+			label: '数量',
+			align: 'center'
+		},
+	]
+
+	/***************************** 页面生命周期函数 *****************************/
+	onLoad(() => {})
+	onShow(() => {
+		uni.$off('addInfoEvent');
+		uni.$off('addUnfitInfoEvent')
+	})
+	onMounted(() => {
+		const instance = getCurrentInstance().proxy
+		const eventChannel = instance.getOpenerEventChannel();
+
+		eventChannel.on('acceptDataFromOpenerPage', function(data) {
+			if (data && data.data) {
+				dayworkInfo.value = data.data
+				console.log(dayworkInfo.value)
+				init({
+					id: data.data.id
+				})
+			} else {
+				let reqParam = {
+					id: dayworkInfo.value.id
+				}
+				init(reqParam);
+			}
+		})
+	})
+
+	/***************************** 定义了一些方法 *****************************/
+	const init = (data) => {
+		//获取当前跟选报工合格数最大值
+		// getDictInfoByType("sort_report_limit").then(res => {
+		// 	console.log(res.data && res.data.length >0)
+		// 	if(res.data && res.data.length >0) {
+		// 		qualifiedNumRatio.value =parseInt(res.data[0].dictValue) 
+		// 	}
+		// }).catch(err => {
+		// 	console.log(err)
+		// 	console.log('369 err')
+		// })
+		console.log(data)
+		console.log("dayworkInfo", dayworkInfo.value);
+		// 获取当前报工信息
+		getSortingDayworkItem(data).then(res => {
+			console.log(res)
+			if (res.code === 200) {
+				dayworkItem.value = res.data
+				//判断是否显示零存
+				if (dayworkItem.value.processStepNumber == dayworkInfo.value.processSequence[dayworkInfo.value
+						.processSequence.length - 1].processStepNumber) {
+					saveFlag.value = true
+				} else {
+					saveFlag.value = false
+				}
+				console.log(dayworkItem.value)
+				if (dayworkItem.value.status == 0 && dayworkItem.value.qualifiedNum === 0 && dayworkItem.value
+					.rejectNum === 0) {
+					dayworkItem.value.qualifiedNum = res.data.prodNum
+				}
+				retrievalInfo.value = res.data.retrievalInfo
+				storageInfo.value = res.data.storageInfo
+				console.log(Object.keys(storageInfo.value).length === 0)
+				if (Object.keys(storageInfo.value).length !== 0) {
+					storageNum.value = storageInfo.value.storageNum
+				}
+				consultations.value = res.data.consults
+				unfitInfos.value = res.data.rejectList
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.message
+				})
+			}
+		})
+	}
+
+	const addInfo = (data) => {
+		data.forEach(item => {
+			console.log(retrievalInfo.value)
+			retrievalInfo.value.push(item)
+		})
+		console.log(data)
+		uni.$off('addInfoEvent');
+	}
+	//添加零取批次
+	function handleAddLot() {
+		console.log('調用 handleAddLot')
+		uni.$on('addInfoEvent', (data) => {
+			addInfo(data.data)
+		})
+		console.log(dayworkItem.value)
+		const info = {
+			deptId: dayworkItem.value.deptId,
+			productId: dayworkItem.value.daywork.productId,
+			drawingNumber: dayworkItem.value.drawingNumber,
+			technologyVersion: dayworkItem.value.technologyVersion,
+			retrievalLotId: dayworkItem.value.lotId,
+			hasAddedList: retrievalInfo.value
+		}
+		// 将 info 对象转换为 JSON 字符串
+		const serializedData = JSON.stringify(info);
+
+		// 对 JSON 字符串进行 URL 编码
+		const encodedData = encodeURIComponent(serializedData);
+
+		// 构建 URL,确保使用正确编码的数据
+		uni.navigateTo({
+			url: `/pages/sortingOutsource/storageRetrieval?data=${encodedData}`
+		});
+	}
+	const addUnfitInfo = (data) => {
+		console.log(data)
+		if (data && data.length > 0) {
+			for (var i = 0; i < data.length; i++) {
+				const info = {
+					inspectionInstructionId: data[i].id,
+					title: data[i].title,
+					standard: data[i].standard,
+					checkStandard: data[i].standard,
+					type: data[i].type,
+					reason: ''
+				}
+				unfitInfos.value.push(info)
+			}
+
+		}
+	}
+
+	function dele(ite, index) {
+		if (ite.status == 1) {
+			uni.showToast({
+				icon: 'none',
+				title: '已被领取,不能删除'
+			})
+		} else {
+			retrievalInfo.value.splice(index, 1);
+		}
+	}
+	const addConsultation = (data) => {
+		const info = {
+			dayworkItemId: dayworkItem.value.id,
+			content: data.content,
+			userId: store.userInfo.userId,
+			nickName: store.userInfo.nickName,
+			dayworkId: dayworkItem.value.dayworkId,
+			productionPlandetailId: dayworkItem.value.productionPlandetailId,
+			productionPlanDetailSubDetailId: dayworkItem.value.productionPlanDetailSubDetailId,
+			lotId: dayworkItem.value.lotId,
+			lotCode: dayworkItem.value.lotCode,
+			productId: dayworkItem.value.productId,
+			productDescription: dayworkItem.value.productDescription,
+			technologicalProcessId: dayworkItem.value.technologicalProcessId,
+			technologicalProcessDetailId: dayworkItem.value.technologicalProcessDetailId,
+			processId: dayworkItem.value.processId,
+			processAlias: dayworkItem.value.process.processAlias,
+			// technicianId: dayworkItem.value.technicianId,
+			technicianId: data.technicianId,
+			departments: data.departments,
+			pictures: data.pictures
+		}
+		saveConsult(info).then(res => {
+			if (res.code === 200) {
+				consultations.value = res.data
+				console.log(consultations.value)
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.message
+				})
+			}
+		})
+		isEventTriggered.value = true; // 更新标志位状态
+		consultations.value.push(info)
+	}
+
+	/***************************** 定义了一些事件 *****************************/
+	// 添加不合格信息
+	async function handleAddUnfit() {
+		// 监听事件
+		uni.$once('addUnfitInfoEvent', (data) => {
+			addUnfitInfo(data)
+		})
+		const hasInstruction = await getHasInstruction();
+		console.log(hasInstruction); // 这将打印 true 或 false
+		if (!hasInstruction) {
+			uni.navigateTo({
+				url: "/pages/sortingOutsource/specialOptions",
+				success: (res) => {
+					// 通过eventChannel向被打开页面传送数据
+					res.eventChannel.emit('acceptDataFromOpenerPage', {
+						data: dayworkItem.value,
+						query: {
+							productId: dayworkItem.value.daywork.productId,
+							processId: dayworkItem.value.process.id,
+							// technologyVersion: dayworkItem.value.technologicalProcessDetail.technologyVersion
+							technologyVersion: dayworkItem.value.technologyVersion
+						},
+						index: unfitInfos.value.length
+					})
+				}
+			})
+		} else {
+			console.log(dayworkItem.value)
+			uni.navigateTo({
+				url: "/pages/sorting/options",
+				success: (res) => {
+					// 通过eventChannel向被打开页面传送数据
+					res.eventChannel.emit('acceptDataFromOpenerPage', {
+						data: dayworkItem.value,
+						query: {
+							productId: dayworkItem.value.daywork.productId,
+							processCode: dayworkItem.value.process.processCode,
+							// technologyVersion: dayworkItem.value.technologicalProcessDetail.technologyVersion
+							technologyVersion: dayworkItem.value.technologyVersion
+						},
+						index: unfitInfos.value.length
+					})
+				}
+			})
+		}
+	}
+	async function getHasInstruction() {
+		console.log(dayworkItem.value)
+		const res = await selectInstructionList({
+			technologicalProcessId: dayworkItem.value.technologicalProcessId,
+			processCode: dayworkItem.value.process.processCode,
+			lotId: dayworkItem.value.lotId
+		})
+		return res.data
+		// 	.then(res=> {
+		// 		console.log(res.data)
+		// 	return res.data
+		// })
+	}
+	// 删除不合格信息
+	const handleDelUnfit = (index) => {
+		let tempInfo = unfitInfos.value[index]
+		console.log(tempInfo)
+		uni.showModal({
+			title: '提示',
+			content: '确定删除该项?',
+			success: function(res) {
+				if (res.confirm) {
+					dayworkItem.value.rejectNum = dayworkItem.value.rejectNum - tempInfo.rejectNum
+					dayworkItem.value.qualifiedNum = parseInt(dayworkItem.value.qualifiedNum) + parseInt(
+						tempInfo.rejectNum)
+					unfitInfos.value.splice(index, 1)
+				} else if (res.cancel) {
+					return
+				}
+			}
+		})
+	}
+
+	/* 更换载具*/
+	function handleChangeCarrier(item) {
+		// uni.$once('refreshQuickReport', () => {
+		// 	init()
+		// })
+		store.dayworkInfo = null
+		uni.navigateTo({
+			url: "/pages/changeBox/index",
+			success: function(res) {
+				// 通过eventChannel向被打开页面传送数据
+				res.eventChannel.emit('sortingFromOpenerPage', {
+					data: dayworkItem.value
+				})
+			}
+		})
+	}
+
+	// 添加咨询信息
+	const handleAddConsultation = () => {
+		isEventTriggered.value = false; // 更新标志位状态
+		// 监听事件
+		uni.$once('addConsulttationEvent', (data) => {
+			if (!isEventTriggered.value) {
+				// 如果事件尚未触发,则执行事件触发逻辑
+				addConsultation(data)
+			}
+
+		})
+		uni.navigateTo({
+			url: "/pages/sortingOutsource/consultation",
+			success: (res) => {
+				// 通过eventChannel向被打开页面传送数据
+				res.eventChannel.emit('acceptDataFromOpenerPage', {
+					data: dayworkItem.value
+				})
+			}
+		})
+	}
+	const checkFinishable = () => {
+		if (consultations.value.findIndex(v => v.status === 0) >= 0) {
+			return false
+		} else {
+			return true
+		}
+	}
+	const showStatus = (status) => {
+		// console.log(status)
+		switch (status) {
+			case 0:
+				return '未确认'
+			case 1:
+				return '不合格'
+			case 2:
+				return '合格'
+			default:
+				return ''
+		}
+	}
+
+	function selectText(item) {
+		// for (var i = 0; i < consul.length; i++) {
+		// 	if (item.status == consul[i].value) {
+		// 		return consul[i].text
+		// 	}
+		// }
+		if (item.consultResultId == 0) {
+			return '待确认'
+		} else {
+			return item.result
+		}
+	}
+
+	const showStatusColor = (status) => {
+		// console.log(status)
+		switch (status) {
+			case 0:
+				return '#fcab53'
+			case 1:
+				return '#fc044f'
+			case 2:
+				return '#1deb19'
+			default:
+				return ''
+		}
+	}
+	const rejectNumberChange = () => {
+		let sumReject = 0
+		unfitInfos.value.forEach(v => {
+			sumReject += v.rejectNum == null ? 0 : Number(v.rejectNum)
+		})
+		dayworkItem.value.rejectNum = sumReject
+		dayworkItem.value.qualifiedNum = dayworkItem.value.prodNum - sumReject
+		console.log(dayworkItem.value)
+	}
+
+	const validHandle = () => {
+		console.log(storageNum.value == "")
+		if (storageNum.value != null && storageNum.value != "" && storageNum.value <= 0) {
+			uni.showToast({
+				icon: 'none',
+				title: "存入数量应大于0",
+				duration: 2000
+			})
+			return false;
+		}
+		for (let i = 0; i < unfitInfos.value.length; i++) {
+			const e = unfitInfos.value[i]
+			if (e.rejectNum == null || e.rejectNum == 0) {
+				uni.showToast({
+					icon: 'none',
+					title: `第${i + 1}条不合格信息未输入不合格数量`
+				})
+				return false
+			}
+		}
+		if (dayworkItem.value.qualifiedNum === null || dayworkItem.value.qualifiedNum === "") {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能为空",
+				duration: 2000
+			})
+			return false;
+		}
+		if (isFinish.value && dayworkItem.value.qualifiedNum == 0) {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能为0",
+				duration: 2000
+			})
+			return false;
+		}
+		if (dayworkItem.value.qualifiedNum > dayworkItem.value.prodNum) {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能超过投产数",
+				duration: 2000
+			})
+			return false;
+		}
+		if (dayworkItem.value.qualifiedNum < 0) {
+			uni.showToast({
+				icon: 'none',
+				title: "合格数不能为负数,请检查不合格信息后提交",
+				duration: 2000
+			})
+			return false;
+		}
+		//只在结束报工的时候判断
+		// if(isFinish.value &&dayworkItem.value.qualifiedNum > (dayworkItem.value.prodNum * (qualifiedNumRatio.value/100))){
+		// 	uni.showToast({
+		// 		icon: 'none',
+		// 		title: "合格数不能超过投产量的"+qualifiedNumRatio.value+"%",
+		// 		duration: 2000
+		// 	})
+		// 	return false;
+		// }
+		return true
+		// unfitInfos.value.forEach((e, i) => {
+		// 	if (e.name)
+		// })
+	}
+	async function handleCheckStock() {
+		let currentProcessStepNumber = dayworkInfo.value.currentProcess.processStepNumber;
+		let lastProcess = dayworkInfo.value.processSequence[dayworkInfo.value.processSequence.length - 1];
+		// 判断当前工序是否是最后一道序
+		if (currentProcessStepNumber === lastProcess.processStepNumber) {
+			// 等待 getTakeStockPeriod() 的 Promise 完成
+			const res = await getTakeStockPeriod({
+				dayworkId: dayworkInfo.value.id
+			});
+			console.log(res.data.length);
+			if (res.data.length > 0) {
+				uni.showToast({
+					icon: 'none',
+					title: "此次盘点未结束,不能结束报工",
+					duration: 2000
+				});
+				return false; // 如果盘点未结束,返回 false
+			}
+		}
+		// 如果不是最后一道工序或盘点已结束,返回 true
+		return true;
+	}
+
+
+	async function handleFinishDaywork() {
+		isFinish.value = true
+		if (!validHandle()) {
+			return
+		}
+		//判断当前批次是否在盘点,如果盘点未结束,则不能结束报工
+		let checkStockResult = await handleCheckStock();
+		console.log(checkStockResult)
+		if (!checkStockResult) {
+			return;
+		}
+		//零存数据
+		if (storageNum.value != null && storageNum.value != "") {
+			if (Object.keys(storageInfo.value).length === 0) {
+				storageInfo.value = {
+					productionPlanDetailId: dayworkItem.value.productionPlanDetailId,
+					productDescription: dayworkItem.value.productDescription,
+					drawingNumber: dayworkItem.value.drawingNumber,
+					lotId: dayworkItem.value.lotId,
+					lotCode: dayworkItem.value.lotCode,
+					deptId: dayworkItem.value.deptId,
+					productId: dayworkItem.value.daywork.productId,
+					technologyVersion: dayworkItem.value.technologyVersion,
+					storageNum: storageNum.value,
+					storagerId: store.userInfo.userId,
+				}
+			} else {
+				storageInfo.value.storageNum = storageNum.value
+			}
+		} else {
+			storageInfo.value = null
+		}
+		//零取数据
+		if (retrievalInfo.value.length > 0) {
+			retrievalInfo.value.forEach(item => {
+				item.retrievalLotId = dayworkItem.value.lotId,
+					item.retrievalLotCode = dayworkItem.value.lotCode,
+					item.retrievalerId = store.userInfo.userId,
+					item.retrievalTime = timestampToTime(new Date())
+			})
+		}
+		const saveData = {
+			rejectList: unfitInfos.value,
+			consult: consultations.value,
+			id: dayworkItem.value.id,
+			prodNum: dayworkItem.value.prodNum,
+			rejectNum: dayworkItem.value.rejectNum,
+			qualifiedNum: dayworkItem.value.qualifiedNum,
+			equipmentDetailId: dayworkItem.value.equipmentDetailId,
+			equipmentDetailCode: dayworkItem.value.equipmentDetailCode,
+			remark: dayworkItem.value.remark,
+			storageInfo: storageInfo.value,
+			retrievalInfo: retrievalInfo.value
+		}
+		const currentTime = Date.now();
+
+		// 检查是否已经过去了 2 秒
+		if (currentTime - lastRequestTimestamp.value < 2000) {
+			// 如果在 2 秒 内已经点击,那么不执行
+			uni.showToast({
+				icon: 'none',
+				title: `请勿重复点击`,
+				duration: 2000
+			})
+			return;
+		}
+		lastRequestTimestamp.value = currentTime;
+		console.log(saveData)
+		finishInner(saveData).then(res => {
+			if (res.code === 200) {
+				uni.navigateBack()
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.message
+				})
+			}
+		})
+	}
+	const handleUpdateDaywork = () => {
+		isFinish.value = false
+		if (!validHandle()) {
+			return
+		}
+		//零存数据
+		if (storageNum.value != null && storageNum.value != "") {
+			if (Object.keys(storageInfo.value).length === 0) {
+				storageInfo.value = {
+					productionPlanDetailId: dayworkItem.value.productionPlanDetailId,
+					productDescription: dayworkItem.value.productDescription,
+					drawingNumber: dayworkItem.value.drawingNumber,
+					lotId: dayworkItem.value.lotId,
+					lotCode: dayworkItem.value.lotCode,
+					deptId: dayworkItem.value.deptId,
+					productId: dayworkItem.value.daywork.productId,
+					technologyVersion: dayworkItem.value.technologyVersion,
+					storageNum: storageNum.value,
+					storagerId: store.userInfo.userId,
+				}
+			} else {
+				storageInfo.value.storageNum = storageNum.value
+			}
+		} else {
+			storageInfo.value = null
+		}
+		//零取数据
+		if (retrievalInfo.value.length > 0) {
+			retrievalInfo.value.forEach(item => {
+				item.retrievalLotId = dayworkItem.value.lotId,
+					item.retrievalLotCode = dayworkItem.value.lotCode,
+					item.retrievalerId = store.userInfo.userId,
+					item.retrievalTime = timestampToTime(new Date())
+			})
+		}
+		const saveData = {
+			rejectList: unfitInfos.value,
+			consult: consultations.value,
+			id: dayworkItem.value.id,
+			prodNum: dayworkItem.value.prodNum,
+			rejectNum: dayworkItem.value.rejectNum,
+			qualifiedNum: dayworkItem.value.qualifiedNum,
+			equipmentDetailId: dayworkItem.value.equipmentDetailId,
+			equipmentDetailCode: dayworkItem.value.equipmentDetailCode,
+			remark: dayworkItem.value.remark,
+			storageInfo: storageInfo.value,
+			retrievalInfo: retrievalInfo.value
+		}
+		console.log(saveData)
+		update(saveData).then(res => {
+			if (res.code === 200) {
+				uni.$emit("formBack")
+				uni.navigateBack()
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.message
+				})
+			}
+		})
+
+	}
+</script>
+
+<style lang="scss">
+	.buttonOp {
+		margin-top: 5px;
+	}
+
+	.page-container {
+		// height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		overflow: auto;
+
+		>.title {
+			font-weight: 700;
+			margin: 24rpx 16rpx;
+		}
+	}
+
+	.add-btn {
+		padding: 12rpx 32rpx;
+		background-color: #a4adb3;
+		color: #ffffff;
+		border-radius: 12rpx;
+		font-size: 24rpx;
+	}
+
+	.lot-info {
+		margin: 32rpx 16rpx 0 16rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border-radius: 8rpx;
+
+		.lot-code {
+			font-size: 32rpx;
+			font-weight: 700;
+			margin-bottom: 16rpx;
+		}
+
+		.product-info {
+			font-size: 28rpx;
+			color: #9f9f9f;
+		}
+	}
+
+	.middle {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: center
+	}
+
+	.segment {
+		width: 80%;
+		background-color: rgba(213, 213, 213, 1);
+		border: 1rpx solid rgba(213, 213, 213, 1);
+		margin: 16px 0;
+	}
+
+	.unfit-title {
+		margin-bottom: 24rpx;
+		justify-content: space-between;
+		align-items: center;
+
+		text {
+			font-size: 28rpx;
+			font-weight: 700;
+		}
+
+		.add-btn {
+			padding: 12rpx 32rpx;
+			background-color: #a4adb3;
+			color: #ffffff;
+			border-radius: 12rpx;
+			font-size: 24rpx;
+		}
+	}
+
+	.save {
+		align-items: center;
+		padding-bottom: 32rpx;
+		justify-content: space-between;
+
+		input {
+
+			height: 56rpx;
+			border: 1px solid #9f9f9f;
+			font-size: 28rpx;
+
+			&.number {
+				width: 60%;
+				text-align: center;
+			}
+		}
+	}
+
+
+	.unfit-container {
+		padding: 24rpx;
+		margin: 0 16rpx;
+		background-color: #ffffff;
+		border-radius: 12rpx;
+
+		.unfit-item-container {
+			position: relative;
+
+			>* {
+				margin-bottom: 24rpx;
+			}
+
+			.title {
+				font-weight: 700;
+				justify-content: space-between;
+				align-items: center;
+
+				image {
+					width: 40rpx;
+					height: 40rpx;
+				}
+			}
+
+			.standard {}
+
+			.result {
+				align-items: center;
+				border-bottom: 1px solid #9f9f9f;
+				padding-bottom: 32rpx;
+
+				.label {
+					flex: 1;
+				}
+
+				input {
+					width: 280rpx;
+					height: 56rpx;
+					border: 1px solid #9f9f9f;
+					font-size: 28rpx;
+
+					&.number {
+						width: 104rpx;
+						text-align: center;
+					}
+				}
+			}
+		}
+
+		.unfit-item-container:last-child {
+			.result {
+				border-bottom: none;
+				padding-bottom: 0;
+			}
+		}
+	}
+
+	.consultation-container {
+		margin: 0 16rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border-radius: 8rpx;
+
+		.consultation-item-container {
+			margin-bottom: 24rpx;
+			border-bottom: 2px solid #888888;
+			padding-bottom: 24rpx;
+		}
+
+		.consultation-item-container:last-child {
+			margin-bottom: 0;
+			border-bottom: 0;
+			padding-bottom: 0;
+		}
+
+		.question,
+		.answer {
+			.label {
+				justify-content: space-between;
+				margin-bottom: 16rpx;
+				font-weight: 700;
+			}
+
+			.content {
+				line-height: 40rpx;
+			}
+		}
+
+		.answer {
+			margin-top: 24rpx;
+		}
+	}
+
+
+	.daywork-container {
+		margin-top: 24rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border: 1px solid #bcbcbc;
+
+		.result {
+			align-items: center;
+
+			.label {
+				width: 112rpx;
+			}
+
+			input {
+				flex: 1;
+				height: 56rpx;
+				border: 1px solid #9f9f9f;
+				font-size: 28rpx;
+				text-align: center;
+			}
+		}
+
+		.remark {
+			margin-top: 24rpx;
+
+			.label {
+				width: 112rpx;
+			}
+
+			textarea {
+				flex: 1;
+				border: 1px solid #9f9f9f;
+				height: 168rpx;
+			}
+		}
+
+		.btns-container {
+			margin-top: 24rpx;
+
+			.bottom-btn {
+				display: flex;
+				flex: 1;
+				height: 80rpx;
+				background-color: #5555ff;
+				color: #ffffff;
+				text-align: center;
+				justify-content: center;
+				align-items: center;
+				border-radius: 8rpx;
+				margin-right: 10rpx;
+
+				&.left-btn {
+					background-color: rgba(85, 85, 255, 1.0);
+				}
+
+				&.right-btn {
+					margin-left: 24rpx;
+				}
+			}
+
+			.finished-btn {
+				display: flex;
+				flex: 1;
+				height: 80rpx;
+				background-color: #fc6565;
+				color: #ffffff;
+				text-align: center;
+				justify-content: center;
+				align-items: center;
+				border-radius: 8rpx;
+			}
+
+			.pause-btn {
+				display: flex;
+				flex: 1;
+				height: 80rpx;
+				background-color: #55d90d;
+				color: #ffffff;
+				text-align: center;
+				justify-content: center;
+				align-items: center;
+				border-radius: 8rpx;
+				margin-left: 12rpx;
+			}
+
+			.question-btn {
+				width: 80rpx;
+				align-items: flex-end;
+
+				image {
+					width: 48rpx;
+					height: 48rpx;
+				}
+
+				text {
+					font-size: 24rpx;
+				}
+			}
+		}
+	}
+
+	.zb-table .item-tr {
+		flex-direction: row;
+	}
+</style>

+ 315 - 0
pages/sortingOutsource/options.vue

@@ -0,0 +1,315 @@
+<template>
+	<view class="page-container" style="position: absolute;left: 0;right: 0;top: 0;bottom: 0">
+		<view class="option-container uni-column" style="display: flex;">
+			<!-- tab-bar -->
+			<view class="tab-bars uni-row">
+				<!-- 				<view :class="currentTabName === 1 ? 'active' : ''" @click.stop="handleTabBarClick(1)">
+							<text>检查指导书</text>
+							<view class="line"></view>
+						</view> -->
+				<view :class="currentTabName === 2 ? 'active' : ''">
+					<text>分选标准</text>
+					<view class="line"></view>
+				</view>
+			</view>
+			<!-- 搜索框 -->
+			<view class="search-container uni-row">
+				<input type="text" v-model="keywords" placeholder="请输入关键字" />
+				<view class="btn" @click="handleSearch()">搜索</view>
+			</view>
+		</view>
+		<view class="uni-row" style="position: absolute;
+    background-color: rgb(255, 255, 255);
+    height: 68%;
+    margin-top: 20px;
+    top:102px;
+    left: 12px;
+    right: 12px;">
+			<view style="width: 100%;height: 100%;overflow: auto;">
+				<view v-if="dataList&& dataList.length == 0" style="align-items: center;margin-top: 30px">暂无分选标准数据
+				</view>
+				<view v-else v-for="(item, index) in dataList" :key="index"
+					:class="{'option-item':true,'selectedOptions':isSelectedOptions(item)}" @click="itemClick(item)">
+					<view class="uni-row">
+						<view class="value">{{ item.standard }}</view>
+						<uni-icons v-if="selection.includes(item)" class="arrow-right" type="checkmarkempty"
+							size="24" />
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="bottom uni-row">
+			<button class="start-batch-btn" type="primary" :disabled="selection.length ==0"
+				@click="handleAdd">添加</button>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onMounted,
+		getCurrentInstance
+	} from 'vue';
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getInstructionInfo
+	} from '@/api/business/sortDaywork.js'
+	import {
+		store
+	} from '@/store/index.js'
+
+	const currentTabName = ref(2)
+	const keywords = ref('')
+	const dataList = ref([])
+	const originalList = ref([])
+	const selection = ref([])
+	const dayworkItem = ref(null)
+
+	onMounted(() => {
+		const instance = getCurrentInstance().proxy
+		const eventChannel = instance.getOpenerEventChannel();
+
+		eventChannel.on('acceptDataFromOpenerPage', function(data) {
+			// console.log('acceptDataFromOpenerPage', data)
+			// 传入当前报工信息 通过当前报工的产品和工序获取检查指导书和分选标准
+			if (data && data.data) {
+				selection.value = []
+				dayworkItem.value = data.data
+				console.log(dayworkItem.value)
+				loadInspection({
+					technologicalProcessId: dayworkItem.value.technologicalProcessId,
+					processCode: dayworkItem.value.process.processCode,
+					lotId: dayworkItem.value.lotId
+				})
+			}
+		})
+	})
+	const loadInspection = (data) => {
+		uni.showLoading({
+			title: '加载中'
+		});
+		// console.log(data)
+		getInstructionInfo(data).then(res => {
+			console.log(res)
+			if (res.code === 200) {
+				dataList.value = res.data
+				originalList.value = res.data
+				uni.hideLoading();
+				// console.log(optionList1.value, res.data.instructions)
+				// console.log(optionList2.value, res.data.standards)
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '分选标准获取失败'
+				})
+				uni.hideLoading();
+			}
+		})
+	}
+
+	function isSelectedOptions(item) {
+		return selection.value.includes(item);
+	}
+
+	function cateClick(item) {
+		selectionCategory.value = item
+		console.log(item)
+		console.log(categoryList.value)
+		let index = categoryList.value.findIndex(v => v.id == item.id)
+		console.log(index)
+		currentData.value = index
+		if (categoryList.value[index].instructionList && categoryList.value[index].instructionList.length > 0) {
+			dataList.value = categoryList.value[index].instructionList
+			originalList.value = categoryList.value[index].instructionList
+		} else {
+			dataList.value = []
+		}
+
+	}
+
+	function itemClick(item) {
+		const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
+		if (buttonIndex > -1) {
+			selection.value.splice(buttonIndex, 1); // 取消选中
+		} else {
+			selection.value.push(item); // 选中
+		}
+	}
+
+	function handleSearch() {
+		if (keywords.value == "") {
+			dataList.value = originalList.value
+		} else {
+			dataList.value = originalList.value.filter(item => item.standard.includes(keywords.value))
+		}
+
+
+	}
+	// 页面生命周期函数
+	onLoad(() => {
+
+	})
+
+
+	// tabbar切换
+
+
+	function handleAdd() {
+		console.log(selection.value)
+		uni.$emit('addUnfitInfoEvent',
+			selection.value
+
+		)
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.selected {
+		border-left: 5px solid #c0c4fc;
+		font-weight: 700;
+		/* 选中之后样式 */
+	}
+
+	.page-container {
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+
+	.option-container {
+		// height: 13%;
+		// height: 120px;
+		// background-color: #ffffff;
+		// padding: 24rpx;
+		// border-radius: 12rpx;
+
+
+		position: fixed;
+		top: 50px;
+		/* height: 13%; */
+		background-color: #fff;
+		padding: .75rem;
+		border-radius: .375rem;
+		left: 12px;
+		right: 12px;
+		height: 80px;
+		z-index: 5;
+	}
+
+	.tab-bars {
+		height: 56rpx;
+
+		>view {
+			flex: 1;
+			text-align: center;
+
+			.line {
+				width: 50%;
+				height: 2px;
+				margin: 8rpx auto 0 auto;
+				background-color: #FFFFFF;
+			}
+
+			&.active {
+				.line {
+					background-color: #1684FC;
+				}
+			}
+		}
+	}
+
+	.search-container {
+		margin-top: 16rpx;
+		align-items: center;
+
+		input {
+			flex: 1;
+			height: 72rpx;
+			border: 1px solid #bbbbbb;
+			padding: 0 8rpx;
+			box-sizing: border-box;
+		}
+
+		.btn {
+			display: flex;
+			flex-direction: row;
+			width: 112rpx;
+			height: 72rpx;
+			align-items: center;
+			justify-content: center;
+			background-color: #1684FC;
+			color: #ffffff;
+		}
+	}
+
+	.option-item {
+		position: relative;
+		margin-top: 24rpx;
+		padding-bottom: 8rpx;
+		border-bottom: 1px solid #BBBBBB;
+		margin-left: 24rpx;
+
+		.uni-row {
+			padding-bottom: 16rpx;
+
+			.label {
+				width: 144rpx;
+			}
+
+			.value {
+				flex: 1;
+			}
+		}
+
+		.uni-row:first-child {
+			font-size: 32rpx;
+
+		}
+
+		.arrow-right {
+			position: absolute;
+			right: 24rpx;
+		}
+	}
+
+	.uniui-checkmarkempty[data-v-d31e1c47]:before {
+		color: #1684FC;
+	}
+
+	.selectedOptions {
+		color: #1684FC;
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+	}
+</style>

+ 344 - 0
pages/sortingOutsource/specialOptions.vue

@@ -0,0 +1,344 @@
+<template>
+	<view class="page-container" style="position: absolute;left: 0;right: 0;top: 0;bottom: 0">
+		<view class="option-container uni-column" style="display: flex;">
+			<!-- tab-bar -->
+			<view class="tab-bars uni-row">
+				<!-- 				<view :class="currentTabName === 1 ? 'active' : ''" @click.stop="handleTabBarClick(1)">
+							<text>检查指导书</text>
+							<view class="line"></view>
+						</view> -->
+				<view :class="currentTabName === 2 ? 'active' : ''">
+					<text>分选标准</text>
+					<view class="line"></view>
+				</view>
+			</view>
+			<!-- 搜索框 -->
+			<view class="search-container uni-row">
+				<input type="text" v-model="keywords" placeholder="请输入关键字" />
+				<view class="btn" @click="handleSearch()">搜索</view>
+			</view>
+		</view>
+		<view v-if="categoryList && categoryList.length == 0" style="align-items: center;margin-top: 30px;">暂无分选标准
+		</view>
+		<!-- 		<view v-else class="uni-row" 
+			style="background-color:#ffffff;height: 76%;padding-bottom: 12px;margin-bottom:65px;margin-top: 8px;"> -->
+		<view v-else class="uni-row" style="position: absolute;
+    background-color: rgb(255, 255, 255);
+    height: 68%;
+    margin-top: 20px;
+    top: 102px;
+    left: 12px;
+    right: 12px;">
+			<view style="width: 30%;height: 95%;overflow: auto;">
+				<view v-for="(item, index) in categoryList" :key="index"
+					:class="{'category-item':true,'selected':isSelected(item)}" @click="cateClick(item)">
+					<view class="uni-row">
+						<view class="value">{{ item.name }}</view>
+					</view>
+				</view>
+			</view>
+			<view style="width: 69%;height: 95%;overflow: auto;">
+				<view v-if="dataList&& dataList.length == 0" style="align-items: center;margin-top: 30px">暂无分选标准数据
+				</view>
+				<view v-else v-for="(item, index) in dataList" :key="index"
+					:class="{'option-item':true,'selectedOptions':isSelectedOptions(item)}" @click="itemClick(item)">
+					<view class="uni-row">
+						<view class="value">{{ item.standard }}</view>
+						<uni-icons v-if="selection.includes(item)" class="arrow-right" type="checkmarkempty"
+							size="24" />
+					</view>
+				</view>
+			</view>
+		</view>
+		<view class="bottom uni-row">
+			<button class="start-batch-btn" type="primary" :disabled="selection.length ==0"
+				@click="handleAdd">添加</button>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onMounted,
+		getCurrentInstance
+	} from 'vue';
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getStandardList
+	} from '@/api/business/sortDaywork.js'
+	import {
+		store
+	} from '@/store/index.js'
+
+	const currentTabName = ref(2)
+	const keywords = ref('')
+	const currentData = ref(null)
+	const categoryList = ref([])
+	const dataList = ref([])
+	const originalList = ref([])
+	const selectionCategory = ref(null)
+	const selection = ref([])
+
+	onMounted(() => {
+		const instance = getCurrentInstance().proxy
+		const eventChannel = instance.getOpenerEventChannel();
+
+		eventChannel.on('acceptDataFromOpenerPage', function(data) {
+			// console.log('acceptDataFromOpenerPage', data)
+			// 传入当前报工信息 通过当前报工的产品和工序获取检查指导书和分选标准
+			if (data && data.data) {
+				selection.value = []
+				getStandard()
+			}
+		})
+	})
+
+	function getStandard() {
+		getStandardList({
+			tenantId: store.userInfo.tenantId
+		}).then(res => {
+			categoryList.value = res.data
+			if (categoryList.value && categoryList.value.length > 0) {
+				selectionCategory.value = categoryList.value[0]
+				if (categoryList.value[0].instructionList && categoryList.value[0].instructionList.length > 0) {
+					dataList.value = categoryList.value[0].instructionList
+					originalList.value = categoryList.value[0].instructionList
+				}
+			}
+		})
+	}
+
+	function isSelected(item) {
+		return selectionCategory.value == item;
+	}
+
+	function isSelectedOptions(item) {
+		return selection.value.includes(item);
+	}
+
+	function cateClick(item) {
+		selectionCategory.value = item
+		console.log(item)
+		console.log(categoryList.value)
+		let index = categoryList.value.findIndex(v => v.id == item.id)
+		console.log(index)
+		currentData.value = index
+		if (categoryList.value[index].instructionList && categoryList.value[index].instructionList.length > 0) {
+			dataList.value = categoryList.value[index].instructionList
+			originalList.value = categoryList.value[index].instructionList
+		} else {
+			dataList.value = []
+		}
+
+	}
+
+	function itemClick(item) {
+		const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
+		if (buttonIndex > -1) {
+			selection.value.splice(buttonIndex, 1); // 取消选中
+		} else {
+			selection.value.push(item); // 选中
+		}
+	}
+
+	function handleSearch() {
+		if (keywords.value == "") {
+			dataList.value = originalList.value
+		} else {
+			dataList.value = originalList.value.filter(item => item.standard.includes(keywords.value))
+		}
+
+
+	}
+	// 页面生命周期函数
+	onLoad(() => {
+
+	})
+
+
+	// tabbar切换
+
+
+	function handleAdd() {
+		console.log(selection.value)
+		uni.$emit('addUnfitInfoEvent',
+			selection.value
+
+		)
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.selected {
+		border-left: 5px solid #c0c4fc;
+		font-weight: 700;
+		/* 选中之后样式 */
+	}
+
+	.page-container {
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+
+	.option-container {
+		// height: 13%;
+		// height: 120px;
+		// background-color: #ffffff;
+		// padding: 24rpx;
+		// border-radius: 12rpx;
+
+
+		position: fixed;
+		top: 50px;
+		/* height: 13%; */
+		background-color: #fff;
+		padding: .75rem;
+		border-radius: .375rem;
+		left: 12px;
+		right: 12px;
+		height: 80px;
+		z-index: 5;
+	}
+
+	.tab-bars {
+		height: 56rpx;
+
+		>view {
+			flex: 1;
+			text-align: center;
+
+			.line {
+				width: 50%;
+				height: 2px;
+				margin: 8rpx auto 0 auto;
+				background-color: #FFFFFF;
+			}
+
+			&.active {
+				.line {
+					background-color: #1684FC;
+				}
+			}
+		}
+	}
+
+	.search-container {
+		margin-top: 16rpx;
+		align-items: center;
+
+		input {
+			flex: 1;
+			height: 72rpx;
+			border: 1px solid #bbbbbb;
+			padding: 0 8rpx;
+			box-sizing: border-box;
+		}
+
+		.btn {
+			display: flex;
+			flex-direction: row;
+			width: 112rpx;
+			height: 72rpx;
+			align-items: center;
+			justify-content: center;
+			background-color: #1684FC;
+			color: #ffffff;
+		}
+	}
+
+	.category-item {
+		position: relative;
+		margin-top: 24rpx;
+		padding-bottom: 8rpx;
+		align-items: center;
+
+		.uni-row {
+			padding-bottom: 16rpx;
+
+			.label {
+				width: 144rpx;
+			}
+
+			.value {
+				flex: 1;
+			}
+		}
+
+		.uni-row:first-child {
+			font-size: 32rpx;
+		}
+
+	}
+
+	.option-item {
+		position: relative;
+		margin-top: 24rpx;
+		padding-bottom: 8rpx;
+		border-bottom: 1px solid #BBBBBB;
+		margin-left: 84rpx;
+
+		.uni-row {
+			padding-bottom: 16rpx;
+
+			.label {
+				width: 144rpx;
+			}
+
+			.value {
+				flex: 1;
+			}
+		}
+
+		.uni-row:first-child {
+			font-size: 32rpx;
+
+		}
+
+		.arrow-right {
+			position: absolute;
+			right: 24rpx;
+		}
+	}
+
+	.uniui-checkmarkempty[data-v-d31e1c47]:before {
+		color: #1684FC;
+	}
+
+	.selectedOptions {
+		color: #1684FC;
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+	}
+</style>

+ 174 - 0
pages/sortingOutsource/storageRetrieval.vue

@@ -0,0 +1,174 @@
+<template>
+	<view class="page-container uni-column" >
+		<!-- 零存库部分 -->
+		<view class="title unfit-title uni-row">
+			<view class="title">零取</view>
+		</view>
+		<view class="consultation-container uni-column" style="margin-bottom: 200rpx;padding-bottom: 140rpx">
+			
+			<view style="width: 100%;">
+				<zb-table 
+				    :columns="column1"
+				    :stripe="true"
+					:fit="true"
+					@toggleRowSelection="selectionChange"
+					 @toggleAllSelection="toggleAllSelection"
+				    :data="listData"></zb-table>
+<!-- 				<uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
+					@selection-change="selectionChange">
+					<uni-tr>
+						<uni-th style="font-size: 25rpx;" width="100" align="center">批次号</uni-th>
+						<uni-th style="font-size: 25rpx;" width="100" align="center">操作者</uni-th>
+						<uni-th style="font-size: 25rpx;" width="80" align="center">数量</uni-th>
+					</uni-tr>
+					<uni-tr v-for="(item, index) in listData" :key="index">
+						<uni-th style="font-size: 24rpx;" width="100" align="center">{{ item.lotCode }}</uni-th>
+						<uni-th style="font-size: 24rpx;" width="100" align="center">{{ item.storagerName }}</uni-th>
+						<uni-th style="font-size: 24rpx;" width="80" align="center">{{ item.storageNum }}</uni-th>
+
+					</uni-tr>
+				</uni-table> -->
+				</view>
+				</view>
+				<view class="bottom uni-row">
+					<button class="start-batch-btn" style="margin-right: 10rpx;" type="primary"
+					  :disabled="selections.length == 0"	@click="handleAdd">确认取出</button>
+				</view>
+			</view>
+			
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onMounted,
+		getCurrentInstance
+	} from 'vue';
+
+	import {
+		getStorageRetrievalList
+	} from '@/api/business/storageRetrieval.js'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+
+	const selections = ref([])
+	const listData = ref([])
+	const column1 = [
+		{ type:'selection', width:50 },
+	    { name: 'lotCode', label: '批次号',align:'center'},
+	    { name: 'storagerName', label: '操作者',align:'center' },
+{ name: 'storageNum', label: '数量',align:'center' },
+	]
+
+	/***************************** 页面生命周期函数 *****************************/
+
+	onLoad((options) => {
+		 const data = decodeURIComponent(options.data);
+		
+		  // 将解码后的字符串转换回对象
+		  const lotInfo = JSON.parse(data);
+		console.log(lotInfo)
+		init(lotInfo)
+		})
+
+	/***************************** 定义了一些方法 *****************************/
+	const init = (data) => {
+		console.log(data)
+		getStorageRetrievalList(data).then(res =>{
+			listData.value = res.rows
+		})
+	}
+	function selectionChange(checked,arr) {
+		console.log(checked,arr)
+		 getSelectionList(arr)
+	}
+	function getSelectionList(data) {
+		selections.value = data
+		console.log(selections.value)
+	}
+	function toggleAllSelection(checked,arr) {
+		getSelectionList(arr)
+	}
+	//选择带回
+	function handleAdd() {
+		uni.$emit('addInfoEvent', {
+			data:selections.value
+		})
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.unfit-title{
+		height: 30rpx;
+		position: fixed;
+		top: 30rpx;
+	}
+	.page-container {
+		height: 90%;
+		background-color: #ffffff;
+		font-size: 28rpx;
+
+		>.title {
+			position: relative;
+			top: 0;
+			font-weight: 700;
+			margin: 24rpx 16rpx;
+		}
+	}
+
+	.unfit-title {
+		margin-bottom: 24rpx;
+		justify-content: space-between;
+		align-items: center;
+
+		text {
+			font-size: 28rpx;
+			font-weight: 700;
+		}
+
+	}
+
+	.bottom {
+		height: 10%;
+		position: fixed;
+		right: 0;
+		bottom: 0;
+		left: 0;
+		height: 100rpx;
+		border-top: 1px solid #999999;
+		padding: 16rpx 32rpx;
+		align-items: center;
+		background-color: #fff;
+		justify-content: space-evenly;
+		z-index: 99;
+
+		.start-batch-btn {
+			flex: 1;
+			height: 80rpx;
+			line-height: 80rpx;
+			border-radius: 8rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+		}
+	}
+	.consultation-container {
+		margin: 0 16rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border-radius: 8rpx;
+	
+	}
+	.zb-table .item-tr {
+		flex-direction: row;
+	}
+</style>

+ 214 - 0
pages/sortingOutsource/technicianOptions.vue

@@ -0,0 +1,214 @@
+<template>
+	<view class="page-container uni-column" style="position: absolute;left: 0;right: 0;top: 0;bottom: 0">
+		<view class="option-container uni-column" style="display: flex;">
+			<!-- tab-bar -->
+			<view class="tab-bars">
+				<!-- 				<view style="text-align: center;">
+					<text style="font-weight: bold;">技术负责人</text>
+					<view class="line"></view>
+				</view> -->
+				<view class="search-container uni-row">
+					<input type="text" v-model="keywords" placeholder="请输入关键字" />
+					<view class="btn" @click="handleSearch()">搜索</view>
+				</view>
+			</view>
+			<!-- 搜索框 -->
+
+
+		</view>
+		<view class="uni-row" style=" background-color: rgb(255, 255, 255);
+    padding-bottom: 12px;
+    margin-top: 88px;overflow: auto;">
+			<view style="width: 100%;height: 100%;overflow: auto;">
+				<view v-if="optionList&& optionList.length == 0" style="align-items: center;margin-top: 30px">暂无技术员
+				</view>
+				<!-- 选项 -->
+				<view class="option-item" v-for="(item, index) in optionList" :key="index"
+					@click="handleOptionChecked(item)">
+					<view class="uni-row">
+						<view class="value">{{ item.nickName }}</view>
+					</view>
+					<uni-icons class="arrow-right" type="right" size="24" />
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onMounted,
+		getCurrentInstance
+	} from 'vue';
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getTechnicianList
+	} from '@/api/dept/dept.js'
+
+	const currentTabName = ref(1)
+	const keywords = ref('')
+	const optionList = ref([])
+	onMounted(() => {
+		loadTechnicianList()
+	})
+
+	function handleSearch() {
+		uni.showLoading({
+			title: '加载中'
+		});
+		getTechnicianList({
+			nickName: keywords.value
+		}).then(res => {
+			console.log(res)
+			if (res.code === 200) {
+				optionList.value = res.data
+				uni.hideLoading();
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '技术部无人员'
+				})
+				uni.hideLoading();
+			}
+		})
+
+	}
+
+	const loadTechnicianList = () => {
+		uni.showLoading({
+			title: '加载中'
+		});
+		getTechnicianList().then(res => {
+			console.log(res)
+			if (res.code === 200) {
+				optionList.value = res.data
+				uni.hideLoading();
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: '技术部无人员'
+				})
+				uni.hideLoading();
+			}
+		})
+	}
+
+	const handleOptionChecked = (data) => {
+		console.log(data)
+		uni.$emit('addTechnicianEvent', {
+			technicianId: data.userId,
+			technicianName: data.nickName
+		})
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+
+	.option-container {
+		// height: 13%;
+		// background-color: #ffffff;
+		// padding: 24rpx;
+		// border-radius: 12rpx;
+		background-color: #fff;
+		padding: .75rem;
+		border-radius: .375rem;
+		position: fixed;
+		top: 52px;
+		left: 12px;
+		right: 12px;
+		padding-bottom: 39px;
+		z-index: 5;
+	}
+
+	.tab-bars {
+		height: 56rpx;
+
+		>view {
+			flex: 1;
+			// text-align: center;
+
+			.line {
+				width: 50%;
+				height: 2px;
+				margin: 8rpx auto 0 auto;
+				background-color: #FFFFFF;
+			}
+
+			&.active {
+				.line {
+					background-color: #1684FC;
+				}
+			}
+		}
+	}
+
+	.search-container {
+		margin-top: 16rpx;
+		align-items: center;
+
+		input {
+			flex: 1;
+			height: 72rpx;
+			border: 1px solid #bbbbbb;
+			padding: 0 8rpx;
+			box-sizing: border-box;
+		}
+
+		.btn {
+			display: flex;
+			flex-direction: row;
+			width: 112rpx;
+			height: 72rpx;
+			align-items: center;
+			justify-content: center;
+			background-color: #1684FC;
+			color: #ffffff;
+		}
+	}
+
+	.option-item {
+		position: relative;
+		margin-top: 24rpx;
+		padding-bottom: 8rpx;
+		border-bottom: 1px solid #BBBBBB;
+		margin-left: 24rpx;
+
+		.uni-row {
+			padding-bottom: 16rpx;
+
+			.label {
+				width: 144rpx;
+			}
+
+			.value {
+				flex: 1;
+			}
+		}
+
+		.uni-row:first-child {
+			font-size: 32rpx;
+
+		}
+
+		.arrow-right {
+			position: absolute;
+			right: 24rpx;
+		}
+	}
+</style>