wangxin 1 год назад
Родитель
Сommit
bf9d45f443

+ 73 - 0
api/business/processInspection.js

@@ -0,0 +1,73 @@
+import req from '@/utils/request.js'
+
+/**
+ * 查询用户序检信息
+ * @param userId
+ */
+export function getProcessInspecionList(data) {
+	return req.request({
+		url: '/business/inspecion/list',
+		method: 'post',
+		data: data
+	})
+}
+
+
+
+/**
+ * 查询产品技术负责人
+ */
+export function getProductConsult(data) {
+	return req.request({
+		url: '/business/inspecion/getProductConsult',
+		method: 'post',
+		data: data
+	})
+}
+
+/**
+ * 结束报工保存
+ * @param {Object} data
+ */
+export function saveProcessInspecion(data) {
+	return req.request({
+		url: '/business/inspecion/saveProcessInspecion',
+		method: 'post',
+		data: data
+	})
+}
+
+/**
+ * 查询咨询信息
+ */
+export function selectInspecion(data) {
+	return req.request({
+		url: '/business/inspecion/selectInspecion',
+		method: 'post',
+		data: data
+	})
+}
+
+
+/**
+ * 查询箱号绑定批次
+ */
+export function getCarrierInfo(data) {
+	return req.request({
+		url: '/business/inspecion/getCarrierInfo',
+		method: 'post',
+		data: data
+	})
+}
+
+
+/**
+ * 根据箱号查询批次信息
+ */
+export function getLotInfo(data) {
+	return req.request({
+		url: '/business/inspecion/getLotInfo',
+		method: 'post',
+		data: data
+	})
+}

+ 147 - 0
components/dialog-processInspection/dialog-processInspection.vue

@@ -0,0 +1,147 @@
+<template>
+	<dialog-base ref="baseDialog" title="请选择序检批次">
+		<view>
+			<uni-section title="批次" type="line">
+				<uni-data-select v-model="selectedLot" :localdata="lotList" :clear="false"
+					@change="handleLotChange"></uni-data-select>
+			</uni-section>
+		</view>
+
+		<view class="add-btn-container uni-row">
+			<button type="primary" class="btn" @click="handleStart">确定</button>
+		</view>
+	</dialog-base>
+</template>
+
+<script setup>
+	import {
+		ref
+	} from 'vue'
+	import {
+		onLoad
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+
+	const baseDialog = ref(null)
+	const selectedLot = ref("")
+	const lotList = ref([])
+	const emit = defineEmits(['handleSelectProcessInspection'])
+
+
+	// onLoad(() => {
+
+	// })
+
+	function open(data) {
+		lotList.value = data.map(v => ({
+			text: v.lotCode,
+			value: v.lotCode,
+		}))
+
+		baseDialog.value.open();
+	}
+
+	function handleLotChange() {
+		console.log("选中", selectedLot.value);
+	}
+
+	function handleStart() {
+		emit('handleSelectProcessInspection', selectedLot.value);
+		close()
+	}
+
+	function close() {
+		baseDialog.value.close()
+	}
+
+	defineExpose({
+		open
+	})
+</script>
+
+<style lang="scss">
+	.dialog-body {
+		.equipment-container {
+			height: 300rpx;
+			overflow: auto;
+			flex-wrap: wrap;
+			justify-content: flex-start;
+			margin: 24rpx 0 0 7%;
+
+			.item {
+				width: 236rpx;
+				height: 60rpx;
+				text-align: center;
+				line-height: 60rpx;
+				border-radius: 6rpx;
+				margin: 16rpx;
+				flex: 0 0 40%;
+				border: 1px solid #000000;
+			}
+
+			.selected {
+				background-color: #1684fc;
+				color: #FFF;
+			}
+		}
+
+		.add-btn-container {
+			margin-top: 32rpx;
+
+			.btn {
+				flex: 1;
+			}
+		}
+
+		.switch {
+			font-size: 26rpx;
+			align-items: center;
+			justify-content: space-between;
+			margin: 16rpx;
+		}
+
+		.userList {
+			border: 1rpx solid #1684fc;
+			border-radius: 8rpx;
+			max-height: 300rpx;
+			overflow: auto;
+			width: 100%;
+
+			.showUser {
+				justify-content: flex-start;
+				flex-wrap: wrap;
+
+				.user {
+					border: 1rpx solid #999;
+					border-radius: 8rpx;
+					width: 150rpx;
+					height: 50rpx;
+					text-align: center;
+					line-height: 50rpx;
+					margin: 10rpx;
+					overflow: auto;
+				}
+			}
+		}
+
+		.selectedUserList {
+			width: 100%;
+			justify-content: flex-start;
+			flex-wrap: wrap;
+
+			.selectedUser {
+				border: 1rpx solid #999;
+				border-radius: 8rpx;
+				width: 150rpx;
+				height: 50rpx;
+				text-align: center;
+				line-height: 50rpx;
+				margin: 20rpx 20rpx 0 0;
+				justify-content: space-around;
+
+			}
+		}
+	}
+</style>

+ 58 - 14
pages/processInspection/consultation.vue

@@ -4,16 +4,20 @@
 			<view class="title uni-row">咨询</view>
 			<view class="info-row uni-row">
 				<view class="label">批次号</view>
-				<view class="value">{{ daywork.lot_code }}</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">{{ daywork.product_description }}</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="daywork.question"></textarea>
+					<textarea v-model="lot.question"></textarea>
 				</view>
 			</view>
 			<view class="btn uni-row" @click.stop="handleSubmit">提交</view>
@@ -22,23 +26,60 @@
 </template>
 
 <script setup>
-	import { ref } from 'vue'
-	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
-	
+	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('processInspectionConsultation', function(data) {
+			console.log('processInspectionConsultation', 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 = () => {
+		store.processInspection = null;
 		uni.$emit('addWasteConsultationEvent', {
-			question: daywork.value.question
+			question: lot.value.question
 		})
 		uni.navigateBack()
 	}
@@ -52,25 +93,28 @@
 		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;
@@ -79,7 +123,7 @@
 				}
 			}
 		}
-		
+
 		.btn {
 			background-color: #00D068;
 			color: #ffffff;

+ 289 - 75
pages/processInspection/form.vue

@@ -3,26 +3,34 @@
 		<view class="carrier-info uni-column">
 			<view class="carrier-code uni-row">
 				<text>箱号</text>
-				<text style="margin-left: 24rpx;">D2423156000691</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">{{ data.lot_code }}</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">{{ data.product_description }}</view>
+				<view class="value">{{processInspecion.lot. productDescription }}</view>
 			</view>
 			<view class="info-row uni-row">
 				<view class="label">当前工序</view>
-				<view class="value">{{ data.current_process }}</view>
+				<view class="value">{{ processInspecion.lot.processAlias }}</view>
 			</view>
 			<view class="info-row uni-row">
 				<view class="label">投产数量</view>
-				<view class="value">{{ data.production_quantity }}</view>
+				<view class="value">{{ processInspecion.lot.pudName }}</view>
 			</view>
 		</view>
-		
+
 		<!-- 废品信息 -->
 		<view class="title unfit-title uni-row">
 			<text>废品信息</text>
@@ -30,20 +38,28 @@
 		</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">
+				<!-- 暂时注释,后续会使用 -->
+				<!-- <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="standard">检查标准:{{ item.standard }}</view>
+
 				<view class="result uni-row">
 					<view class="label">检查结果</view>
-					<input v-model="item.result" placeholder="请输入检查结果" />
+					<input v-model="item.checkResult" placeholder="请输入检查结果" />
 					<view class="label" style="text-align: right; padding-right: 16rpx;">数量</view>
-					<input class="number" type="number" v-model="item.number" placeholder="" />
+					<input class="number" type="number" v-model="item.rejectNum" placeholder="" />
 				</view>
 			</view>
 		</view>
-		
+
 		<!-- 咨询部分 -->
 		<view class="title">咨询</view>
 		<view class="consultation-container uni-column">
@@ -51,92 +67,248 @@
 				<view class="question uni-column">
 					<view class="label uni-row">
 						<text>问题描述</text>
-						<text style="color: #fcab53">{{ item.answer === '' ? '待回复' : '已回复' }}</text>
+						<text :style="selectType(item)">{{ selectText(item) }}</text>
 					</view>
-					<view class="content">{{ item.question }}</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 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>
-		
+
 		<!-- 报工部分 -->
 		<view class="daywork-container">
+			<!--  此处后续要加上条件限制,当状态为合格或不合格的时候不能修改状态,需要有权限的人来进行修改 -->
 			<view class="result uni-row">
 				<view class="label">检测量</view>
-				<input type="number" placeholder="请输入检测量" />
+				<input type="number" v-model="processInspecion.examiningNum" placeholder="请输入检测量" />
 				<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
-				<input type="number" placeholder="请输入废品量" />
+				<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 />
+				<textarea v-model="processInspecion.remark" />
 			</view>
-			
+
 			<view class="btns-container uni-row">
-				<view class="finished-btn">结束报工</view>
+				<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 } from 'vue'
-	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
-	
-	const data = ref({
-		lot_code: 'D2423156000691',
-		current_process: '热处理',
-		product_description: '产品描述',
-		production_quantity: 300
+	import {
+		ref,
+		onMounted,
+		getCurrentInstance
+
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
+	import {
+		saveProcessInspecion,
+		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 unfitInfos = ref([])
-	const consultations = ref([])
-	
+
+	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('processInspectionFrom', function(data) {
+
+			console.log('acceptDataFromOpenerPage', data)
+			if (data && data.data) {
+				processInspecion.value.lot = data.data;
+
+			}
+		})
+
+	})
+
 	onShow(() => {
-		
+		if (store.processInspection != null) {
+			uni.showLoading({
+				title: '加载中'
+			});
+			processInspecion.value = store.processInspection
+			selectInspecion(processInspecion.value).then(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
+			}
+		}
+	}
+
+	//查询咨询列表
+	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() {
+		processInspecion.value.dayworkItemConsults = consultations.value;
+		processInspecion.value.dayworkItemRejects = unfitInfos.value;
+		processInspecion.value.user = store.userInfo;
+
+		console.log("结束报工保存", processInspecion.value);
+		saveProcessInspecion(processInspecion.value).then(res => {
+			if (res.code == 200) {
+				uni.navigateTo({
+					url: '/pages/processInspection/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,
-			standard: data.standard
+			checkStandard: data.standard
 		}
 		unfitInfos.value.push(info)
 	}
 	const addConsultation = (data) => {
 		const info = {
-			question: data.question,
-			answer: '123'
+			content: data.question,
+			status: 0
 		}
 		consultations.value.push(info)
 	}
-	
+
 	/***************************** 定义了一些事件 *****************************/
 	// 添加不合格信息
 	const handleAddWaste = () => {
-		// 监听事件
-		uni.$once('addWasteInfoEvent',(data)=>{  
-			addWasteInfo(data)
-		})
-		uni.navigateTo({
-			url: "/pages/processInspection/options"
-		})
+		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) {
+			success: function(res) {
 				if (res.confirm) {
 					unfitInfos.value.splice(index, 1)
 				} else if (res.cancel) {
@@ -145,16 +317,26 @@
 			}
 		})
 	}
-	
-	// 添加不合格信息
+
+	// 咨询
 	const handleAddConsultation = () => {
 		// 监听事件
-		uni.$once('addWasteConsultationEvent',(data)=>{  
+		uni.$once('addWasteConsultationEvent', (data) => {
 			addConsultation(data)
 		})
+
 		uni.navigateTo({
-			url: "/pages/processInspection/consultation"
+			url: "/pages/processInspection/consultation",
+			success: (res) => {
+				// 通过eventChannel向被打开页面传送数据
+				res.eventChannel.emit("processInspectionConsultation", {
+					data: processInspecion.value.lot
+				})
+			}
 		})
+		// uni.navigateTo({
+		// 	url: "/pages/processInspection/consultation"
+		// })
 	}
 </script>
 
@@ -163,33 +345,35 @@
 		height: 100%;
 		background-color: #ececec;
 		font-size: 28rpx;
-		
-		> .title {
+
+		>.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;
@@ -199,15 +383,17 @@
 			}
 		}
 	}
+
 	.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;
@@ -216,45 +402,62 @@
 			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 {
+
+			.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;
@@ -262,6 +465,7 @@
 				}
 			}
 		}
+
 		.unfit-item-container:last-child {
 			.result {
 				border-bottom: none;
@@ -269,50 +473,56 @@
 			}
 		}
 	}
+
 	.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 {
+
+		.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;
@@ -321,22 +531,24 @@
 				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;
@@ -348,14 +560,16 @@
 				align-items: center;
 				border-radius: 8rpx;
 			}
+
 			.question-btn {
 				width: 80rpx;
 				align-items: flex-end;
-				
+
 				image {
 					width: 48rpx;
 					height: 48rpx;
 				}
+
 				text {
 					font-size: 24rpx;
 				}

+ 114 - 34
pages/processInspection/index.vue

@@ -2,27 +2,33 @@
 	<view class="page-container uni-column">
 		<view class="search-container uni-row">
 			<input type="text" v-model="keywords" placeholder="请输入关键字" />
-			<view class="btn uni-row">搜索</view>
+			<view class="btn uni-row" @click="getList">搜索</view>
 			<!-- <uni-icons type="scan" size="24" /> -->
 		</view>
 		<view class="scan-btn uni-row" @click.stop="handleAddProcessInspection">新增序检</view>
-		<view class="daywork-item uni-column" v-for="(item, index) in dayworkList" :key="index">
+		<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.lot_code }}</text>
+				<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.carrier_code }}</view>
+					<view class="value">{{ item.carrierCode }}</view>
 					<view class="label">检察员:</view>
-					<view class="value">{{ item.inspector }}</view>
+					<view class="value">{{ item.userName }}</view>
 				</view>
 				<view class="info-row uni-row">
 					<view class="label">检查数量:</view>
-					<view class="value">{{ item.checks_number }}</view>
+					<view class="value">{{ item.examiningNum }}</view>
 					<view class="label">不合格数:</view>
-					<view class="value">{{ item.unacceptable_amount }}</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>
@@ -30,33 +36,102 @@
 </template>
 
 <script setup>
-	import { ref } from 'vue'
-	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
-	
+	import {
+		ref
+	} from 'vue'
+	import {
+		getProcessInspecionList,
+		getLotInfo
+	} from '@/api/business/processInspection.js'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		store
+	} from '@/store/index.js'
 	const keywords = ref('')
-	const dayworkList = ref([])
-	
+	const inspecionList = ref([])
+
+	const range = [{
+		value: 0,
+		text: "待确认",
+		type: "color: #fcab53"
+	}, {
+		value: 1,
+		text: "合格",
+		type: "color: #55ff7f"
+	}, {
+		value: 2,
+		text: "不合格",
+		type: "color: #ff0c2c"
+	}]
+
+	const quer = ref({}) //用于查询
+
+
 	/***************************** 页面生命周期函数 *****************************/
 	onShow(() => {
-		dayworkList.value = [
-			{
-				lot_code: 'D2423156000691',
-				carrier_code: '000010',
-				inspector: '张蕾',
-				checks_number: 20,
-				unacceptable_amount: 3
-			},
-			{
-				lot_code: 'D2423156000691',
-				carrier_code: '000010',
-				inspector: '张蕾',
-				checks_number: 20,
-				unacceptable_amount: 3
+		uni.showLoading({
+			title: '加载中'
+		});
+		console.log("store", store.userInfo);
+		quer.value.userId = store.userInfo.userId;
+		getProcessInspecionList(quer.value).then(res => {
+			console.log("res", res);
+			if (res.code == 200) {
+				inspecionList.value = res.rows;
+				uni.hideLoading();
 			}
-		]
+
+		});
 	})
-	
+
 	/***************************** 定义了一些方法 *****************************/
+	function getList() {
+
+		uni.showLoading({
+			title: '加载中'
+		});
+		quer.value.keyword = keywords.value
+		getProcessInspecionList(quer.value).then(res => {
+			console.log("res", res);
+			if (res.code == 200) {
+				inspecionList.value = res.rows;
+				uni.hideLoading();
+			}
+
+		});
+	}
+
+	//查看序捡详情
+	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,
@@ -66,7 +141,7 @@
 		}
 		unfitInfos.value.push(info)
 	}
-	
+
 	/***************************** 定义了一些事件 *****************************/
 	// 新增序检
 	const handleAddProcessInspection = () => {
@@ -90,10 +165,11 @@
 		padding: 24rpx;
 		box-sizing: border-box;
 	}
+
 	.search-container {
 		border-radius: 12rpx;
 		align-items: center;
-		
+
 		input {
 			flex: 1;
 			background-color: #ffffff;
@@ -101,6 +177,7 @@
 			box-sizing: border-box;
 			padding: 0 16rpx;
 		}
+
 		.btn {
 			width: 120rpx;
 			height: 64rpx;
@@ -112,6 +189,7 @@
 			align-items: center;
 		}
 	}
+
 	.scan-btn {
 		height: 64rpx;
 		margin: 32rpx 32rpx 0 32rpx;
@@ -121,28 +199,30 @@
 		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;
 				}

+ 138 - 35
pages/processInspection/scan.vue

@@ -1,22 +1,27 @@
 <template>
 	<view class="page-container uni-column">
 		<view class="consultation-container uni-column">
-			<view class="title uni-row">箱号:{{ data.carrier_code }}</view>
+			<view class="title uni-row">箱号:{{ lot.carrierCode }}</view>
 			<view class="info-row uni-row">
 				<view class="label">批次号</view>
-				<view class="value">{{ data.lot_code }}</view>
+				<view class="value">{{ lot.lotCode }}</view>
 			</view>
 			<view class="info-row uni-row">
 				<view class="label">产品描述</view>
-				<view class="value">{{ data.product_description }}</view>
+				<view class="value">{{ lot.productDescription }}</view>
 			</view>
+
 			<view class="info-row uni-row">
 				<view class="label">当前工序</view>
-				<view class="value">{{ data.current_process }}</view>
+				<view class="value">{{ lot.processAlias }}</view>
 			</view>
 			<view class="info-row uni-row">
 				<view class="label">投产数量</view>
-				<view class="value">{{ data.production_quantity }}</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">
@@ -25,32 +30,42 @@
 			</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 {
+		ref
+	} from 'vue'
+	import {
+		onLoad,
+		onReady,
+		onUnload,
+		onShow
+	} from '@dcloudio/uni-app'
+	import {
+		getLotInfo,
+		getCarrierInfo
+	} from '@/api/business/processInspection.js'
+	import {
+		store
+	} from '../../store';
 	const carrierCode = ref('')
-	const data = ref({
-		carrier_id: '',
-		carrier_code: '',
-		lot_id: 'D2423156000691',
-		lot_code: 'D2423156000691',
-		product_description: '',
-		current_process: '热处理',
-		production_quantity: 300
-	})
-	
+	const lot = ref({})
+	const query = ref({})
+	const selectProcessInspection = ref(null)
+
+
 	// 页面生命周期函数
 	onLoad(() => {})
-	
+
 	// 扫码
 	const handleScanCode = () => {
 		uni.scanCode({
 			onlyFromCamera: true,
-			success: function (res) {
+			success: function(res) {
 				if (res.scanType !== 'QR_CODE') {
 					uni.showToast({
 						icon: 'none',
@@ -60,23 +75,107 @@
 					return
 				}
 				const result = JSON.parse(res.result)
-				console.log(result)
-				// 此处根据拿到的箱子id,获取到相对应的【 lot_id 】,【 lot_code 】,以及该批次关联的其它箱号
-				// 需要定义一个请求方法,从后端获取
-				data.value.carrier_id = result.carrierId
-				data.value.carrier_code = result.carrierCode
+
+				getCarrierInfo(result).then(resqust => {
+					if (resqust.code == 200) {
+						if (resqust.data.length > 1) {
+							query.value = result;
+							console.log("查询箱号信息", resqust)
+							selectProcessInspection.value.open(resqust.data)
+						} else {
+							uni.showLoading({
+								title: '加载中'
+							});
+
+							// 此处根据拿到的箱子id, 获取到相对应的【 lot_id】,【 lot_code】, 以及该批次关联的其它箱号
+							// 需要定义一个请求方法, 从后端获取
+							getLotInfo(result).then(res => {
+								if (res.code == 200) {
+									lot.value = res.data;
+									lot.value.carrierCode = result.carrierCode
+									carrierCode.value = result.carrierCode;
+									console.log("res", res);
+									uni.hideLoading();
+								} else {
+									uni.showToast({
+										icon: 'none',
+										title: res.msg,
+										duration: 2000
+									})
+								}
+							});
+
+						}
+
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.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 = () => {
-		uni.navigateTo({
-			url: '/pages/processInspection/form?lotId=' + data.value.lot_id + '&lotCode=' + data.value.lot_code
+		lot.value.carrierCode = carrierCode.value
+		uni.showLoading({
+			title: '加载中'
+		});
+		console.log("加载", lot.value);
+		getLotInfo(lot.value).then(res => {
+			if (res.code == 200) {
+				lot.value = res.data;
+				lot.value.carrierCode = carrierCode.value
+				store.processInspection = null;
+				uni.hideLoading();
+				uni.navigateTo({
+					url: "/pages/processInspection/form",
+					success: (res) => {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit("processInspectionFrom", {
+							data: lot.value
+						})
+					}
+				})
+			} else {
+				uni.showToast({
+					icon: 'none',
+					title: res.msg,
+					duration: 2000
+				})
+				return;
+			}
 		})
-		// if (type === 'ok') {
-		// 	uni.navigateBack()
-		// }
+
 	}
 </script>
 
@@ -88,25 +187,28 @@
 		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;
@@ -115,7 +217,7 @@
 				}
 			}
 		}
-		
+
 		.btn {
 			background-color: #1684fc;
 			color: #ffffff;
@@ -125,6 +227,7 @@
 			justify-content: center;
 			align-items: center;
 		}
+
 		input {
 			margin: 48rpx 24rpx 0 24rpx;
 			height: 64rpx;

+ 1 - 0
store/index.js

@@ -13,6 +13,7 @@ export const store = reactive({
 	isPreProcess: false,
 	furnaceNumberInfo: null,
 	normalStatus: true,
+	processInspection: null,
 
 	itemStatus: {
 		/**