From 816ab1967ee766e3e3f3631c08371f2e7704408e Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期三, 24 九月 2025 16:48:39 +0800
Subject: [PATCH] IQC穴数,RKJ,SJ,XJ

---
 pages/QC/LLJ/detail.vue |  193 ++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 171 insertions(+), 22 deletions(-)

diff --git a/pages/QC/LLJ/detail.vue b/pages/QC/LLJ/detail.vue
index 0b40165..0880f4c 100644
--- a/pages/QC/LLJ/detail.vue
+++ b/pages/QC/LLJ/detail.vue
@@ -25,6 +25,10 @@
 							<view class="info-label">椤圭洰鍚嶇О</view>
 							<view class="info-value">{{ formData.fcheckItem }}</view>
 						</view>
+						<view v-if="parseHoleCount(formData.fcheckItem)" class="info-item">
+							<view class="info-label">绌存暟</view>
+							<view class="info-value hole-count">{{ parseHoleCount(formData.fcheckItem) }}绌�</view>
+						</view>
 						<view class="info-item">
 							<view class="info-label">妫�楠屽伐鍏�</view>
 							<view class="info-value">{{ formData.fcheckTool }}</view>
@@ -204,29 +208,62 @@
 
 			<!-- 缁撴灉琛ㄦ牸 -->
 			<view v-if="tableData.length>0" class="table-container">
-				<view class="table-header">
+				<!-- 鏈夌┐鏁版椂鐨勮〃鏍煎ご閮� -->
+				<view v-if="parseHoleCount(formData.fcheckItem)" class="table-header">
+					<view class="th">缂栧彿</view>
+					<view class="th">绌村彿</view>
+					<view class="th">璁板綍鍊�</view>
+					<view class="th">妫�楠岀粨鏋�<i style="color: rgb(0 212 68);"
+							v-if="!(tableData.length < formData.checkQyt)">锛堣緭鍏ュ凡瀹屾垚锛�</i></view>
+					<view class="th" v-if="current">鎿嶄綔</view>
+				</view>
+				
+				<!-- 鏃犵┐鏁版椂鐨勮〃鏍煎ご閮� -->
+				<view v-else class="table-header">
 					<view class="th">缂栧彿</view>
 					<view class="th">妫�楠岀粨鏋�<i style="color: rgb(0 212 68);"
 							v-if="!(tableData.length < formData.checkQyt)">锛堣緭鍏ュ凡瀹屾垚锛�</i></view>
 					<view class="th" v-if="current">鎿嶄綔</view>
 				</view>
 
-				<view v-for="(item, index) in tableData" :key="index" class="table-row">
-					<view class="td">{{ index + 1 }}</view>
-					<view class="td">
-						<view :class="['result-badge', item.fcheckResu]">
-							{{ item.fcheckResu }}
+				<!-- 鏈夌┐鏁版椂鐨勮〃鏍艰 -->
+				<template v-if="parseHoleCount(formData.fcheckItem)">
+					<view v-for="(item, index) in completeHoleList" :key="index" class="table-row">
+						<view class="td">{{ index + 1 }}</view>
+						<view class="td">{{ item.holeNumber }}绌�</view>
+						<view class="td">{{ item.recordValue }}</view>
+						<view class="td">
+							<view :class="['result-badge', getResultBadgeClass(item.resultStatus)]">
+								{{ item.resultStatus }}
+							</view>
+						</view>
+						<view class="td" v-if="current">
+							<button v-if="!item.isDefault && isNumber" class="btn danger-btn" @tap="toDetail(item)">
+								淇敼
+							</button>
 						</view>
 					</view>
-					<view class="td" v-if="current">
-						<button v-if="!isNumber" class="btn danger-btn" @tap="toggleResult(item)">
-							{{ editResult(item.fcheckResu) }}
-						</button>
-						<button v-if="isNumber" class="btn danger-btn" @tap="toDetail(item)">
-							淇敼
-						</button>
+				</template>
+				
+				<!-- 鏃犵┐鏁版椂鐨勮〃鏍艰 -->
+				<template v-else>
+					<view v-for="(item, index) in tableData" :key="index" class="table-row">
+						<view class="td">{{ index + 1 }}</view>
+						<view class="td">
+							<view :class="['result-badge', item.fcheckResu]">
+								{{ item.fcheckResu }}
+							</view>
+						</view>
+						<view class="td" v-if="current">
+							<button v-if="!isNumber" class="btn danger-btn" @tap="toggleResult(item)">
+								{{ editResult(item.fcheckResu) }}
+							</button>
+							<button v-if="isNumber" class="btn danger-btn" @tap="toDetail(item)">
+								淇敼
+							</button>
+						</view>
 					</view>
-				</view>
+				</template>
 			</view>
 			<view v-if="remarksPopup" class="overlay">
 				<view class="popup">
@@ -305,7 +342,100 @@
 				isFocus: false, // 鏂板锛屾帶鍒惰緭鍏ユ鑱氱劍
 			}
 		},
+		computed: {
+			// 鐢熸垚瀹屾暣鐨勭┐浣嶅垪琛紙鏍规嵁妫�楠屾暟閲忕敓鎴愶紝绌村彿寰幆鏄剧ず锛�
+			completeHoleList() {
+				const holeCount = this.parseHoleCount(this.formData.fcheckItem);
+				if (!holeCount) return this.tableData;
+				
+				const checkQyt = this.formData.checkQyt || 0; // 妫�楠屾暟閲�
+				const completeList = [];
+				
+				// 鏍规嵁妫�楠屾暟閲忕敓鎴愯褰曪紝绌村彿寰幆鏄剧ず
+				for (let i = 1; i <= checkQyt; i++) {
+					// 璁$畻褰撳墠璁板綍鐨勭┐鍙凤紙寰幆鏄剧ず锛�
+					const holeNumber = ((i - 1) % holeCount) + 1;
+					
+					// 鏌ユ壘鏄惁宸叉湁璇ヤ綅缃殑璁板綍
+					const existingRecord = this.tableData.find((item, index) => {
+						return index === i - 1; // 鎸夐『搴忓尮閰�
+					});
+					
+					if (existingRecord) {
+						// 濡傛灉宸叉湁璁板綍锛屼娇鐢ㄧ幇鏈夋暟鎹�
+						completeList.push({
+							...existingRecord,
+							holeNumber: holeNumber,
+							recordValue: existingRecord.fcheckResu || 'N/A',
+							resultStatus: this.getResultStatus(existingRecord.fcheckResu) || '鏈~鍐�'
+						});
+					} else {
+						// 濡傛灉娌℃湁璁板綍锛屽垱寤洪粯璁よ褰�
+						completeList.push({
+							id: null,
+							holeNumber: holeNumber,
+							recordValue: 'N/A',
+							resultStatus: '鏈~鍐�',
+							fcheckResu: null,
+							isDefault: true // 鏍囪涓洪粯璁よ褰�
+						});
+					}
+				}
+				return completeList;
+			}
+		},
 		methods: {
+			// 瑙f瀽妫�楠岄」鐩悕绉颁腑鐨勭┐鏁�
+			parseHoleCount(checkItemName) {
+				if (!checkItemName) return null;
+				
+				// 鍖归厤鏍煎紡锛氬昂瀵告鏌ワ紙5绌达級鎴� 灏哄妫�鏌�(5绌�)
+				const match = checkItemName.match(/[锛�(](\d+)绌碵锛�)]/);
+				return match ? parseInt(match[1]) : null;
+			},
+			
+			// 鏍规嵁璁板綍鍊煎垽鏂楠岀粨鏋滅姸鎬�
+			getResultStatus(recordValue) {
+				if (!recordValue) return '';
+				
+				// 濡傛灉鏈変笂涓嬮檺锛屾牴鎹暟鍊煎垽鏂�
+				if (this.formData.fupAllow && this.formData.fdownAllow) {
+					const numValue = parseFloat(recordValue);
+					if (isNaN(numValue)) return recordValue;
+					
+					if (numValue >= parseFloat(this.formData.fdownAllow) && 
+						numValue <= parseFloat(this.formData.fupAllow)) {
+						return 'OK';
+					} else {
+						return 'NG';
+					}
+				}
+				
+				// 鏃犱笂涓嬮檺鏃讹紝鐩存帴杩斿洖璁板綍鍊�
+				return recordValue;
+			},
+			
+			// 鑾峰彇妫�楠岀粨鏋滃窘绔犵殑鏍峰紡绫�
+			getResultBadgeClass(resultStatus) {
+				switch(resultStatus) {
+					case 'OK':
+						return 'OK';
+					case 'NG':
+						return 'NG';
+					case '鏈~鍐�':
+						return 'pending';
+					default:
+						return 'default';
+				}
+			},
+			
+			// 娣诲姞鏂拌褰曪紙鐢ㄤ簬鏈~鍐欑殑绌翠綅锛�
+			addNewRecord(item) {
+				// 杩欓噷鍙互瑙﹀彂濉啓閫昏緫锛屾瘮濡傚脊鍑鸿緭鍏ユ鎴栬烦杞埌濉啓椤甸潰
+				// 鏆傛椂鍏堟樉绀烘彁绀�
+				this.$showMessage(`璇峰~鍐欑${item.holeNumber}绌寸殑妫�楠岀粨鏋渀);
+			},
+			
 			// 闃叉姈鑷姩淇濆瓨鏂规硶
 			autoSaveResult() {
 				// 娓呴櫎涔嬪墠鐨勫畾鏃跺櫒
@@ -504,7 +634,6 @@
 				this.remarksPopup = true;
 			},
 			saveResult() {
-
 				let count = this.formData.checkQyt;
 				let fstand = "鈭�";
 
@@ -522,8 +651,8 @@
 					}
 					
 					if (!/^-?\d+(\.\d+)?$/.test(this.formData.fcheckResu)) {
-					            this.$showMessage("璇疯緭鍏ユ纭殑鏁板�硷紒");
-					            return;
+						this.$showMessage("璇疯緭鍏ユ纭殑鏁板�硷紒");
+						return;
 					}
 					if (parseFloat(this.formData.fcheckResu) >= parseFloat(this.formData.fdownAllow) && parseFloat(this
 							.formData
@@ -573,6 +702,7 @@
 				})
 
 			},
+			
 			goBack() {
 				uni.navigateBack()
 			},
@@ -603,11 +733,8 @@
 				})
 			},
 			editResult(fcheckResu) {
-				if (fcheckResu == 'OK') {
-					return "鏀逛负涓嶅悎鏍�";
-				} else {
-					return "鏀逛负鍚堟牸";
-				}
+				// 缁熶竴鏄剧ず"鏀逛负涓嶅悎鏍�"
+				return "鏀逛负涓嶅悎鏍�";
 			},
 			toDetail(item) {
 				this.showPopup = !this.showPopup;
@@ -952,6 +1079,7 @@
 				flex: 1;
 				padding: 12px;
 				font-weight: bold;
+				text-align: center;
 			}
 		}
 
@@ -968,6 +1096,8 @@
 				flex: 1;
 				display: flex;
 				align-items: center;
+				justify-content: center;
+				text-align: center;
 			}
 		}
 	}
@@ -987,6 +1117,16 @@
 		&.NG {
 			background-color: rgba($danger-color, 0.1);
 			color: $danger-color;
+		}
+		
+		&.pending {
+			background-color: rgba(#f39c12, 0.1);
+			color: #f39c12;
+		}
+		
+		&.default {
+			background-color: rgba(#909399, 0.1);
+			color: #909399;
 		}
 	}
 
@@ -1081,4 +1221,13 @@
 		opacity: 0.6;
 		cursor: not-allowed;
 	}
+
+	.hole-count {
+		color: #409EFF;
+		font-weight: bold;
+		background-color: rgba(64, 158, 255, 0.1);
+		padding: 2px 8px;
+		border-radius: 4px;
+		display: inline-block;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3