wangxin 1 rok pred
rodič
commit
168c73ed22

+ 12 - 0
api/business/processInspection.js

@@ -37,6 +37,18 @@ export function saveProcessInspecion(data) {
 	})
 }
 
+/**
+ * 结束报工保存
+ * @param {Object} data
+ */
+export function saveOutsourcedInspecion(data) {
+	return req.request({
+		url: '/business/inspecion/saveOutsourcedInspecion',
+		method: 'post',
+		data: data
+	})
+}
+
 /**
  * 查询咨询信息
  */

+ 144 - 0
pages/outsourcedInspection/consultation.vue

@@ -0,0 +1,144 @@
+<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">{{ lot.lotCode }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">技术负责人</view>
+				<view class="value">{{ lot.product.technicianName }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ lot.productDescription }}</view>
+			</view>
+			<view class="info-row uni-column">
+				<view class="label" style="margin-bottom: 16rpx;">问题描述</view>
+				<view class="value uni-row">
+					<textarea v-model="lot.question"></textarea>
+				</view>
+			</view>
+			<view class="btn uni-row" @click.stop="handleSubmit">提交</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref,
+		onMounted,
+		getCurrentInstance
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		getProductConsult
+	} from '@/api/business/processInspection.js'
+
+	const lot = ref({});
+	const daywork = ref({
+		lot_code: 'D35400554012',
+		product_description: '电机-254.364.14552',
+		question: ''
+	})
+
+	// 页面生命周期函数
+
+	onMounted(() => {
+		const instance = getCurrentInstance().proxy
+		const eventChannel = instance.getOpenerEventChannel();
+
+		eventChannel.on('outsourcedInspectionConsultation', function(data) {
+			console.log('outsourcedInspectionConsultation', data)
+			// 传入当前报工信息 通过当前报工的产品和工序获取检查指导书和分选标准
+			if (data && data.data) {
+				getProductConsult(data.data).then(res => {
+					console.log("res", res);
+					if (res.code == 200) {
+						lot.value = data.data
+						lot.value.product = res.data
+					}
+				})
+
+			}
+		})
+	})
+	onLoad(() => {
+
+	})
+
+	const handleSubmit = () => {
+		if (lot.value.question == null || lot.value.question == '') {
+			uni.showToast({
+				icon: 'none',
+				title: '请输入问题描述'
+			})
+			return
+		}
+		store.processInspection = null;
+		uni.$emit('addWasteConsultationEvent', {
+			question: lot.value.question
+		})
+		uni.navigateBack()
+	}
+</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: 160rpx;
+			}
+
+			.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;
+		}
+	}
+</style>

+ 631 - 0
pages/outsourcedInspection/form.vue

@@ -0,0 +1,631 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="carrier-info uni-column">
+			<view class="carrier-code uni-row">
+				<text>箱号</text>
+				<text style="margin-left: 24rpx;">{{processInspecion.lot.allCarrierName}}</text>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">图号</view>
+				<view class="value">{{ processInspecion.lot.drawingNumber }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">批次号</view>
+				<view class="value">{{ processInspecion.lot.lotCode }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">工艺版本</view>
+				<view class="value">{{ processInspecion.lot.technologyVersion }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{processInspecion.lot. productDescription }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">当前工序</view>
+				<view class="value">{{ processInspecion.lot.processAlias }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">投产数量</view>
+				<view class="value">{{ processInspecion.lot.pudName }}</view>
+			</view>
+		</view>
+
+		<!-- 废品信息 -->
+		<view class="title unfit-title uni-row">
+			<text>废品信息</text>
+			<view class="add-btn" @click="handleAddWaste">添加</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.title }}</text>
+					<uni-icons type="trash" size="24" color="#fc6565" @click="handleDelWaste(index)" />
+				</view> -->
+				<!-- <view class="standard">检查标准:{{ item.standard }}</view> -->
+				<view class="resu uni-row">
+					<view class="label">检查标准</view>
+					<input v-model="item.checkStandard" placeholder="请输入检查标准" />
+					<uni-icons type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
+						@click="handleDelWaste(index)" />
+				</view>
+
+				<view class="result uni-row">
+					<view class="label">检查结果</view>
+					<input v-model="item.checkResult" placeholder="请输入检查结果" />
+					<view class="label" style="text-align: right; padding-right: 16rpx;">数量
+					</view>
+					<input class="number" type="number" @blur="rejectNumberChange" v-model="item.rejectNum"
+						placeholder="" />
+				</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="selectType(item)">{{ 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="daywork-container">
+			<!--  此处后续要加上条件限制,当状态为合格或不合格的时候不能修改状态,需要有权限的人来进行修改 -->
+			<view class="result uni-row">
+				<view class="label">检测量</view>
+				<input type="number" v-model="processInspecion.examiningNum" placeholder="请输入检测量" />
+				<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
+				<input type="number" v-model="processInspecion.rejectNum" placeholder="请输入废品量" />
+			</view>
+			<view class="result uni-row">
+				<view class="label" style="margin-top: 20rpx; margin-right: 10rpx;">序检状态</view>
+				<uni-data-checkbox style="margin-top: 20rpx;" v-model="processInspecion.status" :localdata="range"
+					@change="change"></uni-data-checkbox>
+			</view>
+			<view class="remark uni-row">
+				<view class="label">备注</view>
+				<textarea v-model="processInspecion.remark" />
+			</view>
+
+			<view class="btns-container uni-row">
+				<view class="finished-btn" @click="endWork">结束报工</view>
+				<view class="question-btn uni-column" @click.stop="handleAddConsultation">
+					<uni-icons type="headphones" size="24" />
+					<text>咨询</text>
+				</view>
+			</view>
+
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref,
+		onMounted,
+		getCurrentInstance
+
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		saveOutsourcedInspecion,
+		selectInspecion
+	} from '@/api/business/processInspection.js'
+	const lot = ref({})
+	const unfitInfos = ref([]) //废品信息
+	const consultations = ref([]) //咨询信息
+	const processInspecion = ref({
+		remark: "",
+		rejectNum: 0,
+		examiningNum: 0,
+		status: 0,
+	})
+
+	const consul = [{
+		value: 0,
+		text: "待确认",
+		type: "color: #fcab53"
+	}, {
+		value: 2,
+		text: "合格",
+		type: "color: #55ff7f"
+	}, {
+		value: 1,
+		text: "不合格",
+		type: "color: #ff0c2c"
+	}]
+
+	const range = [{
+		value: 0,
+		text: "待确认",
+		type: "color: #fcab53"
+	}, {
+		value: 1,
+		text: "合格",
+		type: "color: #55ff7f"
+	}, {
+		value: 2,
+		text: "不合格",
+		type: "color: #ff0c2c"
+	}]
+
+	/***************************** 页面生命周期函数 *****************************/
+
+	onMounted(() => {
+		const instance = getCurrentInstance().proxy
+		const eventChannel = instance.getOpenerEventChannel();
+		eventChannel.on('outsourcedInspectionFrom', function(data) {
+			console.log('outsourcedInspectionFrom', data)
+			if (data && data.data) {
+				processInspecion.value.lot = data.data;
+
+			}
+		})
+
+	})
+
+	onShow(() => {
+		console.log("打开页面");
+		if (store.processInspection != null) {
+			uni.showLoading({
+				title: '加载中'
+			});
+			processInspecion.value = store.processInspection
+			selectInspecion(processInspecion.value).then(res => {
+				console.log("res", res);
+				if (res.code == 200) {
+					processInspecion.value = res.data;
+					unfitInfos.value = res.data.dayworkItemRejects;
+					consultations.value = res.data.dayworkItemConsults;
+					console.log("res", res);
+					uni.hideLoading();
+					// getInspecion();
+				} else {
+					uni.showToast({
+						icon: 'none',
+						title: res.msg,
+						duration: 2000
+					})
+				}
+			});
+		}
+	})
+
+	/***************************** 定义了一些方法 *****************************/
+	//咨询文本
+	function selectText(item) {
+		for (var i = 0; i < consul.length; i++) {
+			if (item.status == consul[i].value) {
+				return consul[i].text
+			}
+		}
+	}
+
+	const rejectNumberChange = () => {
+		let sumReject = 0
+		unfitInfos.value.forEach(v => {
+			sumReject += Number(v.rejectNum)
+		})
+		processInspecion.value.rejectNum = sumReject
+		console.log(processInspecion.value)
+	}
+
+	//查询咨询列表
+	function getInspecion() {
+		processInspecion.value = store.processInspection
+		selectInspecion(processInspecion.value).then(res => {
+			console.log("咨询", res);
+			if (res.code == 200) {
+				console.log("res", res);
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg,
+					duration: 2000
+				})
+			}
+		});
+	}
+
+	//结束报工按钮
+	function endWork() {
+		let unf = unfitInfos.value;
+		for (var i = 0; i < unfitInfos.value.length; i++) {
+			if (!unf.checkStandard && !unf.checkResult && !unf.rejectNum) {
+				uni.showToast({
+					icon: 'none',
+					title: "废品信息不能为空",
+					duration: 2000
+				})
+				return;
+			}
+		}
+
+		let sumReject = 0
+		unfitInfos.value.forEach(v => {
+			sumReject += Number(v.rejectNum)
+		})
+		if (processInspecion.value.rejectNum != sumReject) {
+			uni.showToast({
+				icon: 'none',
+				title: "废品量与废品信息不一致",
+				duration: 2000
+			})
+			return;
+		}
+
+		save();
+
+
+	}
+
+
+	function save() {
+
+		let pages = getCurrentPages();
+		processInspecion.value.dayworkItemConsults = consultations.value;
+		processInspecion.value.dayworkItemRejects = unfitInfos.value;
+		processInspecion.value.user = store.userInfo;
+
+		saveOutsourcedInspecion(processInspecion.value).then(res => {
+			if (res.code == 200) {
+				let index = 0;
+
+				for (let i = 0; i < pages.length; i++) {
+
+					if (pages[i].$page.fullPath == "/pages/outsourcedInspection/index") {
+
+						index = pages.length - i - 1;
+					}
+				}
+				console.log("index", index);
+				uni.navigateBack({
+					delta: index
+				});
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg,
+					duration: 2000
+				})
+			}
+		});
+	}
+
+
+
+
+	//咨询样式
+	function selectType(item) {
+		for (var i = 0; i < consul.length; i++) {
+			if (item.status == consul[i].value) {
+				return consul[i].type
+			}
+		}
+	}
+
+	const addWasteInfo = (data) => {
+		const info = {
+			title: data.title,
+			checkStandard: data.standard
+		}
+		unfitInfos.value.push(info)
+	}
+	const addConsultation = (data) => {
+		const info = {
+			content: data.question,
+			status: 0
+		}
+		consultations.value.push(info)
+	}
+
+	/***************************** 定义了一些事件 *****************************/
+	// 添加不合格信息
+	const handleAddWaste = () => {
+		let info = {}
+		unfitInfos.value.push(info)
+
+		// 监听事件,暂时不用,后续会使用
+		// uni.$once('addWasteInfoEvent', (data) => {
+		// 	addWasteInfo(data)
+		// })
+		// uni.navigateTo({
+		// 	url: "/pages/processInspection/options"
+		// })
+	}
+	// 删除不合格信息
+	const handleDelWaste = (index) => {
+		uni.showModal({
+			title: '提示',
+			content: '确定删除该项?',
+			success: function(res) {
+				if (res.confirm) {
+					unfitInfos.value.splice(index, 1)
+				} else if (res.cancel) {
+					return
+				}
+			}
+		})
+	}
+
+	// 咨询
+	const handleAddConsultation = () => {
+		// 监听事件
+		uni.$once('wasteConsultationEvent', (data) => {
+			addConsultation(data)
+		})
+
+		uni.navigateTo({
+			url: "/pages/outsourcedInspection/consultation",
+			success: (res) => {
+				// 通过eventChannel向被打开页面传送数据
+				res.eventChannel.emit("outsourcedInspectionConsultation", {
+					data: processInspecion.value.lot
+				})
+			}
+		})
+		// uni.navigateTo({
+		// 	url: "/pages/processInspection/consultation"
+		// })
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+
+		>.title {
+			font-weight: 700;
+			margin: 24rpx 16rpx;
+		}
+	}
+
+	.carrier-info {
+		margin: 32rpx 16rpx 0 16rpx;
+		padding: 24rpx;
+		background-color: #ffffff;
+		border-radius: 8rpx;
+
+		.carrier-code {
+			font-size: 32rpx;
+			font-weight: 700;
+		}
+
+		.info-row {
+			margin-top: 16rpx;
+			color: #767676;
+
+			.label {
+				width: 160rpx;
+			}
+
+			.value {
+				flex: 1;
+
+				textarea {
+					flex: 1;
+					border: 1px solid #888888;
+					box-sizing: border-box;
+					padding: 16rpx;
+				}
+			}
+		}
+	}
+
+	.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;
+		}
+	}
+
+	.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 {}
+
+			.resu {
+				width: 100%;
+				align-items: center;
+
+				input {
+					margin-left: 20rpx;
+					width: 200rpx;
+					height: 56rpx;
+					flex: 1;
+					border: 1px solid #9f9f9f;
+					font-size: 28rpx;
+				}
+			}
+
+			.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;
+
+			.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;
+			}
+
+			.question-btn {
+				width: 80rpx;
+				align-items: flex-end;
+
+				image {
+					width: 48rpx;
+					height: 48rpx;
+				}
+
+				text {
+					font-size: 24rpx;
+				}
+			}
+		}
+	}
+</style>

+ 322 - 0
pages/outsourcedInspection/index.vue

@@ -0,0 +1,322 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="search-container uni-row">
+			<input type="text" v-model="keywords" placeholder="请输入关键字" />
+			<view class="btn uni-row" @click="getList">搜索</view>
+			<!-- <uni-icons type="scan" size="24" /> -->
+		</view>
+
+		<view class="time-controls" style="margin-top: 10rpx;">
+			<uni-section title="检查日期:" type="square" class="uni-row sta">
+				<input v-model="startTime" type="date" @input="timeSizer" />
+			</uni-section>
+		</view>
+
+		<view class="scan-btn uni-row" style="min-height: 80rpx;" @click.stop="handleAddOutsourcedInspection">新增序检
+		</view>
+		<view class="daywork-item uni-column" v-for="(item, index) in inspecionList" :key="index"
+			@click="handleSelection(item)">
+			<view class="lot-code uni-row">
+				<text>批次号:{{ item.lotCode }}</text>
+				<text :style="selectType(item)">{{ selectText(item) }}</text>
+				<uni-icons type="right" size="16" />
+			</view>
+			<view class="info">
+				<view class="info-row uni-row">
+					<view class="label">序检箱号:</view>
+					<view class="value">{{ item.carrierCode }}</view>
+					<view class="label">检察员:</view>
+					<view class="value">{{ item.nickName }}</view>
+				</view>
+				<view class="info-row uni-row">
+					<view class="label">检查数量:</view>
+					<view class="value">{{ item.examiningNum }}</view>
+					<view class="label">不合格数:</view>
+					<view class="value">{{ item.rejectNum }}</view>
+				</view>
+				<view class="info-row uni-row">
+					<view class="label">产品描述:</view>
+					<view class="value">{{ item.productDescription }}</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		getProcessInspecionList,
+		getLotInfo
+	} from '@/api/business/processInspection.js'
+	import {
+		timestampToTime,
+		toHHmmss
+	} from '@/utils/common.js'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		getToken
+	} from '@/utils/auth'
+	import path from '@/api/base/path.js'
+	const keywords = ref('')
+	const inspecionList = ref([]); //时间后筛选数组
+	const original = ref([]); //原始数组
+	const startTime = ref(new Date().toISOString().split('T')[0])
+
+	const range = [{
+		value: 0,
+		text: "待确认",
+		type: "color: #fcab53"
+	}, {
+		value: 1,
+		text: "合格",
+		type: "color: #55ff7f"
+	}, {
+		value: 2,
+		text: "不合格",
+		type: "color: #ff0c2c"
+	}]
+
+	const quer = ref({}) //用于查询
+
+
+	/***************************** 页面生命周期函数 *****************************/
+	onShow(() => {
+		uni.showLoading({
+			title: '加载中'
+		});
+		quer.value.userId = store.userInfo.userId;
+		getP2();
+		getProcessInspecionList(quer.value).then(res => {
+			console.log("res", res);
+			if (res.code == 200) {
+				original.value = res.rows;
+				timeSizer();
+				uni.hideLoading();
+				// uni.hideLoading();
+			}
+
+		});
+	})
+
+	/***************************** 定义了一些方法 *****************************/
+	//查询P2中外协完成后需要检查的工序
+	function getP2() {
+		let token = 'Bearer ' + getToken();
+		let header = {
+			Authorization: token
+		}
+		uni.request({
+			url: path.furnaceNoURL + '/business/sfc10300/getP2ProcessWrbz/' + "Y",
+			method: 'GET',
+			header,
+			sslVerify: false,
+			success: (res) => {
+				console.log("P2查询", res);
+				//将工序编码保存到store中
+				store.outsourcedCode = res.data.rows.map(item => item.prcode);
+				console.log("store", store.outsourcedCode);
+			},
+			fail: (err) => {
+				console.log(err)
+			}
+		})
+	}
+
+	//时间筛选
+	function timeSizer() {
+		inspecionList.value = filterSameDayItems(original.value, startTime.value);
+	}
+
+	// 筛选函数
+	const filterSameDayItems = (inspectionList, startTime) => {
+
+		// 使用filter方法筛选出与startTime同一天的元素
+		const filteredList = inspectionList.filter(item => {
+			// 将数组中每个元素的date属性转换为不包含时分秒的字符串
+			const itemDateString = item.createTime.split(' ')[0];
+			// 比较两个日期字符串是否相同
+			return itemDateString === startTime;
+		});
+		return filteredList;
+	};
+
+
+	function isSameDate(date1, date2) {
+		// 使用Date对象的toISOString()方法来格式化日期,并去除时分秒部分
+		const formatDate = (date) => date.toISOString().split('T')[0];
+
+		// 比较两个日期的年月日部分是否相同
+		return formatDate(date1) === formatDate(date2);
+	}
+
+	//查看序捡详情
+	function handleSelection(item) {
+		store.processInspection = item;
+		uni.navigateTo({
+			url: '/pages/processInspection/form'
+		})
+	}
+
+	//状态文本
+	function selectText(item) {
+		for (var i = 0; i < range.length; i++) {
+			if (item.status == range[i].value) {
+				return range[i].text
+			}
+		}
+	}
+
+	//状态样式
+	function selectType(item) {
+		for (var i = 0; i < range.length; i++) {
+			if (item.status == range[i].value) {
+				return range[i].type
+			}
+		}
+	}
+
+	const addProcessInspection = (data) => {
+		const info = {
+			title: data.title,
+			standard: data.standard,
+			result: '',
+			number: 1
+		}
+		unfitInfos.value.push(info)
+	}
+
+	/***************************** 定义了一些事件 *****************************/
+	// 新增序检
+	const handleAddOutsourcedInspection = () => {
+		uni.navigateTo({
+			url: '/pages/outsourcedInspection/scan'
+		})
+	}
+	// 添加不合格信息
+	const handleShowUnfit = () => {
+		uni.navigateTo({
+			url: '/pages/outsourcedInspection/form'
+		})
+	}
+</script>
+
+<style lang="scss">
+	.time-controls {
+		.title {
+			margin: 20% auto 40% auto;
+
+			.first {
+				font-size: 48rpx;
+				margin: 0 auto;
+			}
+
+			.second {
+				color: red;
+				font-size: 24rpx;
+				margin: 10rpx auto 0 auto;
+			}
+		}
+
+		.sta {
+			justify-content: center;
+			align-items: center;
+
+			input {
+				border: 1rpx solid gray;
+				border-radius: 8rpx;
+				width: 400rpx;
+				height: 64rpx;
+			}
+		}
+
+		button {
+			width: 78%;
+			background-color: #1684fc;
+			color: white;
+			margin: 0 auto;
+		}
+	}
+
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+
+	.search-container {
+		border-radius: 12rpx;
+		align-items: center;
+
+		input {
+			flex: 1;
+			background-color: #ffffff;
+			height: 64rpx;
+			box-sizing: border-box;
+			padding: 0 16rpx;
+		}
+
+		.btn {
+			width: 120rpx;
+			height: 64rpx;
+			background-color: #1684FC;
+			justify-content: center;
+			font-size: 24rpx;
+			color: #ffffff;
+			justify-content: center;
+			align-items: center;
+		}
+	}
+
+	.scan-btn {
+		height: 64rpx;
+		margin: 32rpx 32rpx 0 32rpx;
+		color: #ffffff;
+		background-color: #f47c3c;
+		align-items: center;
+		justify-content: center;
+		border-radius: 8rpx;
+	}
+
+	.daywork-item {
+		padding: 24rpx;
+		background-color: #ffffff;
+		margin-top: 24rpx;
+		border-radius: 8rpx;
+
+		.lot-code {
+			align-items: center;
+			justify-content: space-between;
+			font-weight: 700;
+		}
+
+		.info {
+			font-size: 24rpx;
+			color: #767676;
+
+			.info-row {
+				margin-top: 16rpx;
+
+				.label {
+					width: 120rpx;
+				}
+
+				.value {
+					flex: 1;
+				}
+			}
+		}
+	}
+</style>

+ 178 - 0
pages/outsourcedInspection/options.vue

@@ -0,0 +1,178 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="option-container uni-column">
+			<!-- 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' : ''" @click.stop="handleTabBarClick(2)">
+					<text>分选标准</text>
+					<view class="line"></view>
+				</view>
+			</view>
+			<!-- 搜索框 -->
+			<view class="search-container uni-row">
+				<input type="text" v-model="keywords" placeholder="请输入编号/关键字" />
+				<view class="btn">搜索</view>
+			</view>
+			<!-- 选项 -->
+			<view class="option-item" v-for="(item, index) in optionList" :key="index" @click="handleOptionChecked(item)">
+				<view class="uni-row">
+					<view class="label">检查项</view>
+					<view class="value">{{ item.title }}</view>
+				</view>
+				<view class="uni-row">
+					<view class="label">检查标准</view>
+					<view class="value">{{ item.standard }}</view>
+				</view>
+				<uni-icons class="arrow-right" type="right" size="24" />
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const currentTabName = ref(1)
+	const keywords = ref('')
+	const optionList = ref([])
+	// 检查指导书
+	const optionList1 = ref([])
+	// 分选标准
+	const optionList2 = ref([])
+	
+	// 页面生命周期函数
+	onLoad(() => {
+		optionList1.value = [
+			{
+				title: '001 台阶径',
+				standard: '角偏 < 0.05'
+			},
+			{
+				title: '002 台阶径',
+				standard: '角偏 < 0.04'
+			}
+		]
+		
+		optionList2.value = [
+			{
+				title: '划痕',
+				standard: '划痕描述'
+			},
+			{
+				title: '划伤',
+				standard: '划伤描述'
+			}
+		]
+		
+		optionList.value = optionList1.value
+	})
+	
+	// tabbar切换
+	const handleTabBarClick = (val) => {
+		switch (val) {
+			case 1:
+				optionList.value = optionList1.value
+				break
+			case 2:
+				optionList.value = optionList2.value
+		}
+		currentTabName.value = val
+	}
+	
+	const handleOptionChecked = (data) => {
+		uni.$emit('addWasteInfoEvent', {
+			title: data.title,
+			standard: data.standard
+		})
+		uni.navigateBack()
+	}
+</script>
+
+<style lang="scss">
+	.page-container {
+		height: 100%;
+		background-color: #ececec;
+		font-size: 28rpx;
+		padding: 24rpx;
+		box-sizing: border-box;
+	}
+	.option-container {
+		background-color: #ffffff;
+		padding: 24rpx;
+		border-radius: 12rpx;
+	}
+	.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;
+		
+		.uni-row {
+			padding-bottom: 16rpx;
+			
+			.label {
+				width: 144rpx;
+			}
+			.value {
+				flex: 1;
+			}
+		}
+		.uni-row:first-child {
+			font-size: 32rpx;
+			font-weight: 700;
+		}
+		
+		.arrow-right {
+			position: absolute;
+			top: 24rpx;
+			right: 24rpx;
+		}
+	}
+</style>

+ 232 - 0
pages/outsourcedInspection/scan.vue

@@ -0,0 +1,232 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="consultation-container uni-column">
+			<view class="title uni-row">箱号:{{ lot.carrierCode }}</view>
+			<view class="info-row uni-row">
+				<view class="label">批次号</view>
+				<view class="value">{{ lot.lotCode }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ lot.productDescription }}</view>
+			</view>
+
+			<view class="info-row uni-row">
+				<view class="label">当前工序</view>
+				<view class="value">{{ lot.processAlias }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">投产数量</view>
+				<view class="value">{{ lot.pudName }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">所有箱号</view>
+				<view class="value">{{ lot.allCarrierName }}</view>
+			</view>
+			<input type="text" v-model="carrierCode" placeholder="请输入箱号" />
+			<view class="btn uni-row" style="background-color: #ff5555;" @click.stop="handleScanCode">
+				<uni-icons type="scan" size="16" style="color: #ffffff; margin-right: 8rpx;" />
+				<text>扫描箱码</text>
+			</view>
+			<view class="btn uni-row" style="margin-top: 48rpx;" @click.stop="handleConfirm">确定</view>
+		</view>
+		<dialog-processInspection ref='selectProcessInspection'
+			@handleSelectProcessInspection='handleSelectProcessInspection'></dialog-processInspection>
+	</view>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getLotInfo,
+		getCarrierInfo,
+		getLotOutsourcedInfo
+	} from '@/api/business/processInspection.js'
+	import {
+		store
+	} from '../../store';
+	const carrierCode = ref('')
+	const lot = ref({})
+	const query = ref({})
+	const selectProcessInspection = ref(null)
+
+
+	// 页面生命周期函数
+	onLoad(() => {})
+
+	// 扫码
+	const handleScanCode = () => {
+		console.log("外协检查扫码")
+		uni.scanCode({
+			onlyFromCamera: true,
+			success: function(res) {
+				if (res.scanType !== 'QR_CODE') {
+					uni.showToast({
+						icon: 'none',
+						title: '二维码未识别成功',
+						duration: 2000
+					})
+					return
+				}
+				const result = JSON.parse(res.result)
+
+				result.outsourcedCode = store.outsourcedCode;
+				/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
+				getLotOutsourcedInfo(result).then(resqust => {
+					console.log("想不出来名字的输出", resqust);
+					if (resqust.code == 200) {
+						lot.value = resqust.data;
+						lot.value.carrierCode = result.carrierCode
+						carrierCode.value = result.carrierCode;
+						console.log("resqust", resqust);
+						uni.hideLoading();
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: resqust.msg,
+							duration: 2000
+						})
+					}
+
+				})
+
+			}
+		});
+	}
+
+	//选择批号弹窗带回
+	function handleSelectProcessInspection(data) {
+		console.log("带回", data)
+		query.value.lotCode = data
+		uni.showLoading({
+			title: '加载中'
+		});
+		getLotInfo(query.value).then(res => {
+			if (res.code == 200) {
+				lot.value = res.data;
+				lot.value.carrierCode = query.value.carrierCode
+				carrierCode.value = query.value.carrierCode;
+				console.log("res", res);
+				uni.hideLoading();
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg,
+					duration: 2000
+				})
+			}
+		});
+	}
+
+	// 确定后,将批次id,批次号,传递过去
+	const handleConfirm = () => {
+		if (lot.carrierCode || carrierCode.value !== "") {
+			lot.value.carrierCode = carrierCode.value
+			uni.showLoading({
+				title: '加载中'
+			});
+			lot.value.processCode = store.outsourcedCode;
+			/************************ 根据扫码查询到的数据和需要检查的工序查询信息 ************************/
+			getLotOutsourcedInfo(lot.value).then(resqust => {
+				if (resqust.code == 200) {
+					lot.value = resqust.data;
+					lot.value.carrierCode = resqust.carrierCode
+					carrierCode.value = resqust.carrierCode;
+					store.processInspection = null;
+					console.log("resqust", resqust);
+					uni.hideLoading();
+					uni.navigateTo({
+						url: "/pages/outsourcedInspection/form",
+						success: (resqust) => {
+							// 通过eventChannel向被打开页面传送数据
+							resqust.eventChannel.emit("outsourcedInspectionFrom", {
+								data: lot.value
+							})
+						}
+					})
+				} else {
+					// uni.hideLoading();
+					uni.showToast({
+						icon: 'none',
+						title: resqust.msg,
+						duration: 2000
+					})
+				}
+
+			})
+		} else {
+			uni.showToast({
+				icon: 'none',
+				title: "请输入箱号或扫描箱码",
+				duration: 2000
+			})
+			return;
+		}
+	}
+</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: 160rpx;
+			}
+
+			.value {
+				flex: 1;
+
+				textarea {
+					flex: 1;
+					border: 1px solid #888888;
+					box-sizing: border-box;
+					padding: 16rpx;
+				}
+			}
+		}
+
+		.btn {
+			background-color: #1684fc;
+			color: #ffffff;
+			border-radius: 8rpx;
+			margin: 4rpx 24rpx 24rpx 24rpx;
+			height: 64rpx;
+			justify-content: center;
+			align-items: center;
+		}
+
+		input {
+			margin: 48rpx 24rpx 0 24rpx;
+			height: 64rpx;
+			border: 1px solid #888888;
+			text-align: center;
+		}
+	}
+</style>