From 7c2192a2f000d94add173b77b6bd4c8c4fc6a5e4 Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期三, 17 九月 2025 09:41:47 +0800
Subject: [PATCH] SJ穴模数

---
 pages/QC/LLJ/List.vue |   91 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 77 insertions(+), 14 deletions(-)

diff --git a/pages/QC/LLJ/List.vue b/pages/QC/LLJ/List.vue
index 3011dc8..27c565e 100644
--- a/pages/QC/LLJ/List.vue
+++ b/pages/QC/LLJ/List.vue
@@ -78,6 +78,7 @@
 							<text class="info-label">鏁伴噺</text>
 							<text class="info-content highlight">{{item.fcovertQty}}</text>
 						</view>
+
 					</view>
 					<view class="info-row">
 						<view class="info-item">
@@ -86,10 +87,7 @@
 						</view>
 					</view>
 					<view class="info-row">
-						<view class="info-item" v-if="item.newFngDesc!=null">
-							<text class="info-label">涓婃涓嶈壇鎻忚堪</text>
-							<text class="info-content">{{item.newFngDesc}}</text>
-						</view>
+						
 						<view class="info-item" v-if="item.fngDesc!=null">
 							<text class="info-label">涓嶈壇鎻忚堪</text>
 							<text class="info-content">{{item.fngDesc}}</text>
@@ -120,7 +118,7 @@
 		data() {
 			return {
 				projectIndex: 0,
-				optionsIndex: 0,
+				optionsIndex: 1, // 榛樿閫夋嫨鐗╂枡缂栧彿
 				projects: ['褰撳墠', '鍏ㄩ儴'],
 				activeTab: 0, // 0-鏈楠�, 1-宸叉楠�
 				uncheckedCount: 0,
@@ -136,6 +134,17 @@
 		},
 		onLoad() {
 			//椤甸潰鍔犺浇鏃惰皟鐢ㄧ殑浜嬩欢
+			// 鍒濆鍖杝electedField锛屽洜涓洪粯璁ら�夋嫨鐗╂枡缂栧彿
+			const fieldMap = {
+				0: 'DEPARTMENTNAME', // 椤圭洰
+				1: 'itemNo', // 鐗╂枡缂栧彿
+				2: 'itemName', // 鐗╂枡鍚嶇О
+				3: 'suppName', // 渚涘簲鍟�
+				4: 'lotNo' ,// 鍒拌揣鍗曞彿
+				5: 'releaseNo' ,// 妫�楠屽崟鍙�
+				6: 'itemModel',//鐗╂枡瑙勬牸
+			};
+			this.selectedField = fieldMap[this.optionsIndex];
 			this.init();
 		},
 		methods: {
@@ -198,9 +207,12 @@
 					// 鍘婚噸澶勭悊 - 鏍规嵁 releaseNo 鍘婚噸
 					const uniqueList = this.removeDuplicatesByReleaseNo(res.data.tbBillList);
 					
+					// 瀵规暟鎹繘琛屾帓搴忓鐞�
+					const sortedList = this.sortInspectionList(uniqueList);
+					
 					if (this.pageIndex === 1) {
 						// 濡傛灉鏄涓�椤碉紝鐩存帴瑕嗙洊鍘熸暟鎹�
-						this.inspectionList = uniqueList;
+						this.inspectionList = sortedList;
 						//娣诲姞Tab淇℃伅锛屽垽鏂槸宸叉杩樻槸鏈鏁版嵁
 						this.inspectionList.forEach((item, index) => {
 							this.$set(item, 'activeTab', this.activeTab);
@@ -209,9 +221,9 @@
 						});
 					} else {
 
-						if (uniqueList.length > 0) {
+						if (sortedList.length > 0) {
 							// 濡傛灉鏄笅涓�椤碉紝杩藉姞鏂版暟鎹�
-							this.inspectionList = [...this.inspectionList, ...uniqueList];
+							this.inspectionList = [...this.inspectionList, ...sortedList];
 							//娣诲姞Tab淇℃伅锛屽垽鏂槸宸叉杩樻槸鏈鏁版嵁
 							this.inspectionList.forEach((item, index) => {
 								this.$set(item, 'activeTab', this.activeTab);
@@ -353,18 +365,18 @@
 			
 			// 鏍规嵁妫�楠岄」鐩暟閲忚幏鍙栫姸鎬佹枃鏈�
 			getStatusText(item) {
-				// 濡傛灉娌℃湁妫�楠岄」鐩紝鏄剧ず"鏈淮鎶�"
-				if (!item.inspectionItemCount || item.inspectionItemCount === 0) {
+				// 浣跨敤JYXM瀛楁鍒ゆ柇鏄惁缁存姢浜嗘楠岄」鐩�
+				if (item.jyxm === 0 || item.jyxm === '0') {
 					return '鏈淮鎶�';
 				}
-				// 濡傛灉鏈夋楠岄」鐩紝鏄剧ず"寰呮楠�"
+				// 濡傛灉缁存姢浜嗘楠岄」鐩紝鏄剧ず"寰呮楠�"
 				return '寰呮楠�';
 			},
 			
 			// 鍒ゆ柇鏄惁涓烘湭缁存姢涓旈潪绱ф�ユ斁琛�
 			isUnmaintainedAndNotEmergency(item) {
-				// 妫�鏌ユ槸鍚︿负鏈淮鎶わ紙娌℃湁妫�楠岄」鐩級
-				const isUnmaintained = !item.inspectionItemCount || item.inspectionItemCount === 0;
+				// 浣跨敤JYXM瀛楁妫�鏌ユ槸鍚︿负鏈淮鎶わ紙0琛ㄧず鏈淮鎶わ級
+				const isUnmaintained = item.jyxm === 0 || item.jyxm === '0';
 				// 妫�鏌ユ槸鍚︿负闈炵揣鎬ユ斁琛�
 				const isNotEmergency = item.lotNo1 !== '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!';
 				return isUnmaintained && isNotEmergency;
@@ -376,6 +388,50 @@
 				// 濡傛灉item.fcode涓簄ull鎴杣ndefined锛岃鏄庤鐗╂枡鏈湪V_LLJ_USER瑙嗗浘涓�
 				// 鎴栬�呰鐗╂枡娌℃湁缁存姢妫�楠屽憳
 				return !item.fcode || item.fcode === null || item.fcode === '';
+			},
+			
+			// 瀵规楠屽崟鍒楄〃杩涜鎺掑簭
+			sortInspectionList(list) {
+				return list.sort((a, b) => {
+					// 绗竴浼樺厛绾э細鐘舵�佸垎缁勶紙鏈彁浜� vs 宸叉彁浜わ級
+					const aIsSubmitted = a.status === '宸叉彁浜�';
+					const bIsSubmitted = b.status === '宸叉彁浜�';
+					
+					if (aIsSubmitted && !bIsSubmitted) return 1; // 宸叉彁浜ょ殑鎺掑湪鍚庨潰
+					if (!aIsSubmitted && bIsSubmitted) return -1; // 鏈彁浜ょ殑鎺掑湪鍓嶉潰
+					
+					// 鏈彁浜ゅ崟鎹殑鎺掑簭閫昏緫
+					if (!aIsSubmitted && !bIsSubmitted) {
+						// 绗竴浼樺厛绾э細绱ф�ユ斁琛�
+						const aIsEmergency = a.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!';
+						const bIsEmergency = b.lotNo1 === '绱ф�ユ斁琛岋紝璇峰嬁楠岄��!';
+						
+						if (aIsEmergency && !bIsEmergency) return -1;
+						if (!aIsEmergency && bIsEmergency) return 1;
+						
+						// 绗簩浼樺厛绾э細鏈淮鎶ゆ楠岄」鐩紙浣跨敤JYXM瀛楁锛�
+						const aIsUnmaintained = a.jyxm === 0 || a.jyxm === '0';
+						const bIsUnmaintained = b.jyxm === 0 || b.jyxm === '0';
+						
+						if (aIsUnmaintained && !bIsUnmaintained) return -1;
+						if (!aIsUnmaintained && bIsUnmaintained) return 1;
+						
+						// 绗笁浼樺厛绾э細鍒涘缓鏃堕棿锛堝垱寤烘椂闂磋秺鏅氳秺闈犲悗锛�
+						const aCreateTime = new Date(a.createDate || 0);
+						const bCreateTime = new Date(b.createDate || 0);
+						return aCreateTime - bCreateTime; // 鍗囧簭锛氭棭鐨勫湪鍓嶏紝鏅氱殑鍦ㄥ悗
+					}
+					
+					// 宸叉彁浜ゅ崟鎹殑鎺掑簭閫昏緫
+					if (aIsSubmitted && bIsSubmitted) {
+						// 鎸夋彁浜ゆ椂闂存帓搴忥紙鎻愪氦鐨勮秺鏅氳秺闈犲墠锛�
+						const aIqcTime = new Date(a.iqcDate || 0);
+						const bIqcTime = new Date(b.iqcDate || 0);
+						return bIqcTime - aIqcTime; // 闄嶅簭锛氭櫄鐨勫湪鍓嶏紝鏃╃殑鍦ㄥ悗
+					}
+					
+					return 0;
+				});
 			}
 		}
 	}
@@ -404,7 +460,7 @@
 	/* 鏂板鎼滅储妗嗘牱寮� */
 	.search-container {
 		display: flex;
-		flex: 1;
+		width: 300px; /* 鍥哄畾瀹藉害 */
 		margin: 0 10px;
 		height: 36px;
 		/* 涓庡叾浠栨帶浠堕珮搴︿竴鑷� */
@@ -417,6 +473,8 @@
 		border-radius: 4px 0 0 4px;
 		font-size: 14px;
 		background-color: white;
+		min-width: 200px; /* 鏈�灏忓搴� */
+		max-width: 250px; /* 鏈�澶у搴� */
 	}
 
 	.search-button {
@@ -604,6 +662,11 @@
 		color: #2c3e50;
 		line-height: 1.5;
 	}
+	
+	.info-content.unmaintained {
+		color: #e74c3c;
+		font-weight: 600;
+	}
 
 	.highlight {
 		font-weight: 600;

--
Gitblit v1.9.3