Browse Source

Merge remote-tracking branch 'origin/master'

guoyujia 1 year ago
parent
commit
7ee2332b43

+ 51 - 42
pages.json

@@ -80,60 +80,69 @@
 			"style": {
 				"navigationBarTitleText": "快速报工"
 			}
+		},
+		{
+			"path": "pages/sorting/form",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+			}
+		},
+		{
+			"path": "pages/sorting/options",
+			"style": {
+				"navigationBarTitleText": "检查项选择"
+			}
+		},
+		{
+			"path": "pages/sorting/consultation",
+			"style": {
+				"navigationBarTitleText": "分选报工"
+			}
+		},
+		{
+			"path": "pages/processInspection/index",
+			"style": {
+				"navigationBarTitleText": "序检"
+			}
+		},
+		{
+			"path": "pages/processInspection/form",
+			"style": {
+				"navigationBarTitleText": "序检"
+			}
+		},
+		{
+			"path": "pages/processInspection/scan",
+			"style": {
+				"navigationBarTitleText": "序检"
+			}
+		},
+		{
+			"path": "pages/processInspection/options",
+			"style": {
+				"navigationBarTitleText": "检查项选择"
+			}
+		},
+		{
+			"path": "pages/processInspection/consultation",
+			"style": {
+				"navigationBarTitleText": "序检"
+			}
 		}
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "uni-app",
-		"navigationBarBackgroundColor": "rgba(255, 255, 255,1)",
+		"navigationBarBackgroundColor": "rgba(255, 255, 255, 1)",
 		"backgroundColor": "#F8F8F8"
 	},
 	"uniIdRouter": {},
 	"condition": { //模式配置,仅开发期间生效
 		"current": 0, //当前激活的模式(list 的索引项)
-		"list": [{
-				"name": "", //模式名称
-				"path": "pages/index/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/dashboard/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/batchReporting/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/handlingList/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/startTurnover/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/productionPlan/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/changeBox/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
-			{
-				"name": "", //模式名称
-				"path": "pages/recerptSfprod/index",
-				"query": "" //启动参数,在页面的onLoad函数里面得到
-			},
+		"list": [
 			{
 				"name": "", //模式名称
-				"path": "pages/reportingForWork/index",
+				"path": "pages/processInspection/index",
 				"query": "" //启动参数,在页面的onLoad函数里面得到
 			}
 		]

+ 10 - 0
pages/dashboard/index.vue

@@ -34,6 +34,9 @@
 		<view class="business-btn uni-row" v-if="showOther" @click="handleToSorting">
 			<text class="label">分选报工</text>
 		</view>
+		<view class="business-btn uni-row" v-if="showOther" @click="handleToProcessInspection">
+			<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>
@@ -214,6 +217,13 @@
 			})
 		}
 	}
+	
+	// 工序检查
+	function handleToProcessInspection() {
+		uni.navigateTo({
+			url: '/pages/productionPlan/index'
+		})
+	}
 
 	function handleToHandlingList() {
 		console.log(store)

+ 93 - 0
pages/processInspection/consultation.vue

@@ -0,0 +1,93 @@
+<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">{{ daywork.lot_code }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ daywork.product_description }}</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>
+				</view>
+			</view>
+			<view class="btn uni-row" @click.stop="handleSubmit">提交</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const daywork = ref({
+		lot_code: 'D35400554012',
+		product_description: '电机-254.364.14552',
+		question: ''
+	})
+	
+	// 页面生命周期函数
+	onLoad(() => {
+		
+	})
+	
+	const handleSubmit = () => {
+		uni.$emit('addWasteConsultationEvent', {
+			question: daywork.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>

+ 365 - 0
pages/processInspection/form.vue

@@ -0,0 +1,365 @@
+<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;">D2423156000691</text>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">批次号</view>
+				<view class="value">{{ data.lot_code }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ data.product_description }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">当前工序</view>
+				<view class="value">{{ data.current_process }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">投产数量</view>
+				<view class="value">{{ data.production_quantity }}</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="result uni-row">
+					<view class="label">检查结果</view>
+					<input v-model="item.result" placeholder="请输入检查结果" />
+					<view class="label" style="text-align: right; padding-right: 16rpx;">数量</view>
+					<input class="number" type="number" v-model="item.number" 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="color: #fcab53">{{ item.answer === '' ? '待回复' : '已回复' }}</text>
+					</view>
+					<view class="content">{{ item.question }}</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" placeholder="请输入检测量" />
+				<view class="label" style="text-align: right; padding-right: 24rpx">废品量</view>
+				<input type="number" placeholder="请输入废品量" />
+			</view>
+			<view class="remark uni-row">
+				<view class="label">备注</view>
+				<textarea />
+			</view>
+			
+			<view class="btns-container uni-row">
+				<view class="finished-btn">结束报工</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
+	})
+	const unfitInfos = ref([])
+	const consultations = ref([])
+	
+	/***************************** 页面生命周期函数 *****************************/
+	onShow(() => {
+		
+	})
+	
+	/***************************** 定义了一些方法 *****************************/
+	const addWasteInfo = (data) => {
+		const info = {
+			title: data.title,
+			standard: data.standard
+		}
+		unfitInfos.value.push(info)
+	}
+	const addConsultation = (data) => {
+		const info = {
+			question: data.question,
+			answer: '123'
+		}
+		consultations.value.push(info)
+	}
+	
+	/***************************** 定义了一些事件 *****************************/
+	// 添加不合格信息
+	const handleAddWaste = () => {
+		// 监听事件
+		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('addWasteConsultationEvent',(data)=>{  
+			addConsultation(data)
+		})
+		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 {
+			}
+			.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>

+ 167 - 0
pages/processInspection/index.vue

@@ -0,0 +1,167 @@
+<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">搜索</view>
+			<!-- <uni-icons type="scan" size="24" /> -->
+		</view>
+		<view class="scan-btn uni-row" @click.stop="handleScanCode">扫描箱号</view>
+		<view class="daywork-item uni-column" v-for="(item, index) in dayworkList" :key="index">
+			<view class="lot-code uni-row">
+				<text>批次号:{{ item.lot_code }}</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="label">检察员:</view>
+					<view class="value">{{ item.inspector }}</view>
+				</view>
+				<view class="info-row uni-row">
+					<view class="label">检查数量:</view>
+					<view class="value">{{ item.checks_number }}</view>
+					<view class="label">不合格数:</view>
+					<view class="value">{{ item.unacceptable_amount }}</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const keywords = ref('')
+	const dayworkList = 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
+			}
+		]
+	})
+	
+	/***************************** 定义了一些方法 *****************************/
+	const addProcessInspection = (data) => {
+		const info = {
+			title: data.title,
+			standard: data.standard,
+			result: '',
+			number: 1
+		}
+		unfitInfos.value.push(info)
+	}
+	
+	/***************************** 定义了一些事件 *****************************/
+	// 扫码
+	const handleScanCode = () => {
+		uni.scanCode({
+			onlyFromCamera: true,
+			success: function (res) {
+				if (res.scanType !== 'QR_CODE') {
+					uni.showToast({
+						icon: 'none',
+						title: '二维码未识别成功',
+						duration: 2000
+					})
+					return
+				}
+				console.log(res)
+				const result = JSON.parse(res.result)
+				uni.navigateTo({
+					url: '/pages/processInspection/scan?carrierId=' + result.carrierId + '&carrierCode=' + result.carrierCode
+				})
+			}
+		});
+	}
+	// 添加不合格信息
+	const handleShowUnfit = () => {
+		uni.navigateTo({
+			url: "/pages/processInspection/form"
+		})
+	}
+</script>
+
+<style lang="scss">
+	.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: #00D068;
+		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/processInspection/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>

+ 106 - 0
pages/processInspection/scan.vue

@@ -0,0 +1,106 @@
+<template>
+	<view class="page-container uni-column">
+		<view class="consultation-container uni-column">
+			<view class="title uni-row">箱号:{{ data.carrier_code }}</view>
+			<view class="info-row uni-row">
+				<view class="label">批次号</view>
+				<view class="value">{{ data.lot_code }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ data.product_description }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">当前工序</view>
+				<view class="value">{{ data.current_process }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">投产数量</view>
+				<view class="value">{{ data.production_quantity }}</view>
+			</view>
+			<view class="btn uni-row" style="background-color: #ff5555; margin-top: 48rpx;" @click.stop="handleSubmit('err')">填写序检不合格结果</view>
+			<view class="btn uni-row" @click.stop="handleSubmit('ok')">合格,无异常</view>
+		</view>
+	</view>
+</template>
+
+<script setup>
+	import { ref } from 'vue'
+	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
+	
+	const data = ref({
+		carrier_id: '',
+		carrier_code: '',
+		lot_id: 'D2423156000691',
+		lot_code: 'D2423156000691',
+		product_description: '',
+		current_process: '热处理',
+		production_quantity: 300
+	})
+	
+	// 页面生命周期函数
+	onLoad((option) => {
+		console.log(option)
+		data.value.carrier_id = option.carrierId
+		data.value.carrier_code = option.carrierCode
+	})
+	
+	const handleSubmit = (type) => {
+		if (type === 'err') {
+			uni.navigateTo({
+				url: '/pages/processInspection/form?lotId=' + data.value.lot_id + '&lotCode=' + data.value.lot_code
+			})
+		}
+		if (type === 'ok') {
+			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: 0 24rpx 24rpx 24rpx;
+			height: 64rpx;
+			justify-content: center;
+			align-items: center;
+		}
+	}
+</style>

+ 48 - 103
pages/sorting/consultation.vue

@@ -1,6 +1,23 @@
 <template>
 	<view class="page-container uni-column">
-		<view class="title uni-row">咨询</view>
+		<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">{{ daywork.lot_code }}</view>
+			</view>
+			<view class="info-row uni-row">
+				<view class="label">产品描述</view>
+				<view class="value">{{ daywork.product_description }}</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>
+				</view>
+			</view>
+			<view class="btn uni-row" @click.stop="handleSubmit">提交</view>
+		</view>
 	</view>
 </template>
 
@@ -8,56 +25,20 @@
 	import { ref } from 'vue'
 	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
 	
-	const keywords = ref('')
-	const optionList = ref([])
-	// 检查指导书
-	const optionList1 = ref([])
-	// 分选标准
-	const optionList2 = ref([])
+	const daywork = ref({
+		lot_code: 'D35400554012',
+		product_description: '电机-254.364.14552',
+		question: ''
+	})
 	
 	// 页面生命周期函数
 	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('addUnfitInfoEvent', {
-			title: data.title,
-			standard: data.standard
+	const handleSubmit = () => {
+		uni.$emit('addConsulttationEvent', {
+			question: daywork.value.question
 		})
 		uni.navigateBack()
 	}
@@ -71,78 +52,42 @@
 		padding: 24rpx;
 		box-sizing: border-box;
 	}
-	.option-container {
+	.consultation-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;
+		.title {
 			justify-content: center;
-			background-color: #1684FC;
-			color: #ffffff;
+			font-size: 32rpx;
+			font-weight: 700;
 		}
-	}
-	.option-item {
-		position: relative;
-		margin-top: 24rpx;
-		padding-bottom: 8rpx;
-		border-bottom: 1px solid #BBBBBB;
-		
-		.uni-row {
-			padding-bottom: 16rpx;
+		.info-row {
+			margin-top: 24rpx;
 			
 			.label {
-				width: 144rpx;
+				width: 160rpx;
 			}
 			.value {
 				flex: 1;
+				
+				textarea {
+					flex: 1;
+					border: 1px solid #888888;
+					box-sizing: border-box;
+					padding: 16rpx;
+				}
 			}
 		}
-		.uni-row:first-child {
-			font-size: 32rpx;
-			font-weight: 700;
-		}
 		
-		.arrow-right {
-			position: absolute;
-			top: 24rpx;
-			right: 24rpx;
+		.btn {
+			background-color: #00D068;
+			color: #ffffff;
+			border-radius: 8rpx;
+			margin: 24rpx;
+			height: 64rpx;
+			justify-content: center;
+			align-items: center;
 		}
 	}
 </style>

+ 17 - 4
pages/sorting/form.vue

@@ -42,7 +42,7 @@
 					</view>
 					<view class="content">{{ item.question }}</view>
 				</view>
-				<view class="answer">
+				<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>
@@ -80,9 +80,11 @@
 	const unfitInfos = ref([])
 	const consultations = ref([])
 	
+	/***************************** 页面生命周期函数 *****************************/
 	onShow(() => {
 		
 	})
+	
 	/***************************** 定义了一些方法 *****************************/
 	const addUnfitInfo = (data) => {
 		const info = {
@@ -95,10 +97,10 @@
 	}
 	const addConsultation = (data) => {
 		const info = {
-			question: data.title,
-			answer: ''
+			question: data.question,
+			answer: '123'
 		}
-		unfitInfos.value.push(info)
+		consultations.value.push(info)
 	}
 	
 	/***************************** 定义了一些事件 *****************************/
@@ -242,6 +244,17 @@
 		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;