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/Add.vue |  177 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 156 insertions(+), 21 deletions(-)

diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue
index 73e4d0b..030990e 100644
--- a/pages/QC/LLJ/Add.vue
+++ b/pages/QC/LLJ/Add.vue
@@ -1,14 +1,14 @@
 <template>
 	<view class="inspection-sheet">
-		<!-- 澶撮儴淇℃伅 -->
-		<view class="sheet-header">
-			<h1>鏉ユ枡妫�楠屽崟</h1>
-			<view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view>
-			<!--瀹為獙瀹ら�佹 -->
-			<view style="text-align: right;" class="action-buttons">
-				<a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a>
+			<!-- 澶撮儴淇℃伅 -->
+			<view class="sheet-header">
+				<h1>鏉ユ枡妫�楠屽崟</h1>
+				<view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view>
+				<!--瀹為獙瀹ら�佹 -->
+				<view style="text-align: right;" class="action-buttons">
+					<a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a>
+				</view>
 			</view>
-		</view>
 
 		<!-- 鍩烘湰淇℃伅鍖� -->
 		<view class="basic-info">
@@ -56,10 +56,6 @@
 				<view class="info-label">涓嶈壇鎻忚堪锛�</view>
 				<view class="info-value">{{formData.fngDesc}}</view>
 			</view>
-			<view class="info-block" v-if="formData.newFngDesc!=null">
-				<view class="info-label">涓婃涓嶈壇锛�</view>
-				<view class="info-value">{{formData.newFngDesc}}</view>
-			</view>
 		</view>
 		<view class="dropdown-row">
 			<view class="info-label">涓嶈壇鍘熷洜锛�</view>
@@ -90,7 +86,7 @@
 		</view>
 		<view class="info-block" style="margin-top: 10px;">   
 		    <view class="info-label">鐮村潖瀹為獙鏁伴噺锛�</view>
-		    <view class="info-value highlight">{{formData.phsy}}</view>
+		    <view class="info-value highlight">{{formData.PHSY || formData.phsy || ''}}</view>
 		</view>
 
 		<!-- 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖� -->
@@ -140,6 +136,7 @@
 			<button class="action-btn small" @click="addDestruction" v-if="this.current">鐮村潖瀹為獙</button>
 			<button class="action-btn small" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button>
 			<button class="action-btn small" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button>
+			<button class="action-btn small" @click="getBom">Bom鐢ㄦ枡娓呭崟</button>
 			<button class="action-btn small" @click="viewAttachmentInfo">鏌ョ湅闄勪欢淇℃伅</button>
 			<button class="action-btn small" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button>
 			<button class="action-btn small primary" @click="submitInspection" v-if="this.current">妫�楠屾彁浜�</button>
@@ -173,6 +170,32 @@
 				<button @click="clearDestruction">娓呴櫎</button>
 				<button @click="destructionPopup = !destructionPopup">鍙栨秷</button>
 			</view>
+		</view>
+		
+		<view class="barcode">
+			<u-modal :show="itemShow" title="鐗╂枡鏄庣粏" @confirm="drawingConfirm" @cancel="drawingCancel"
+				showCancelButton :z-index="1000">
+				<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁" style="margin-left: 5px;margin-right: 5px;height: 400px;max-height: 60vh;overflow-y: auto;">
+					<uni-tr>
+						<uni-th align="center">鏂欏彿</uni-th>
+						<uni-th align="center" width="90">鍚嶇О</uni-th>
+						<uni-th align="center" width="90">瑙勬牸鍨嬪彿</uni-th>
+						<uni-th align="center" width="150">璋冨彇PLM鍥剧焊</uni-th>
+					</uni-tr>
+					<uni-tr v-for="(item,index) in (drawing || [])" style="height: 100px;">
+						<uni-td align="center">{{item.itemNo}}</uni-td>
+						<uni-td align="center" style="font-size:25px;">
+							<div >{{item.itemName}}</div>
+						</uni-td>
+						<uni-td align="center" style="font-size:25px;">
+							<div>{{item.itemModel}}</div>
+						</uni-td>
+						<uni-td align="center" class="click-wd">
+							<div @click="fetchDrawingNumber">璋冨彇鍥剧焊</div>
+						</uni-td>
+					</uni-tr>
+				</uni-table>
+			</u-modal>
 		</view>
 		
 		<view class="barcode">
@@ -342,6 +365,7 @@
 				current: true,
 				drawing: [],
 				drawingShow: false,
+				itemShow: false,
 				badreason: '',
 				PSTYPE: '',
 				WORKSHOP: '',
@@ -372,6 +396,19 @@
 				previewItemNo: '',
 				previewType: '', // 'text', 'image', 'excel', 'unsupported'
 				
+			}
+		},
+		computed: {
+			isUnmaintainedAndNotEmergency() {
+				// 鍒ゆ柇琛ㄥ崟鏄惁鏈淮鎶や笖涓嶆槸绱ф�ユ斁琛�
+				// 鏈淮鎶ょ殑鏉′欢锛歵ableData涓虹┖鎴栨墍鏈夋楠岄」鐩兘鏈畬鎴�
+				const isUnmaintained = this.tableData.length === 0 || 
+					this.tableData.every(item => item.fcheckResu === null || item.fcheckResu === '');
+				
+				// 涓嶆槸绱ф�ユ斁琛岀殑鏉′欢锛歟mergencyStatus涓篺alse
+				const isNotEmergency = !this.formData.emergencyStatus;
+				
+				return isUnmaintained && isNotEmergency;
 			}
 		},
 		onLoad(options) {
@@ -577,7 +614,7 @@
 
 								// 缁熶竴鎺ㄩ�佺粰HMCS锛屼笉绠″摢涓处鍙�
 								this.QcIssueResultDetailes = {
-									fbatchQty: this.formData.fbatchQty,
+									fbatchQty: this.formData.fcovertQty,
 									itemName: this.formData.itemName,
 									itemNo: this.formData.itemNo,
 									suppName: this.formData.suppName,
@@ -725,9 +762,9 @@
 						this.pstypeIndex = this.pstypeOptions.indexOf(this.PSTYPE);
 
 						
-						// 纭繚PHSY瀛楁琚纭缃�
-						this.formData.PHSY = data.PHSY;
-						this.PHSY = data.PHSY || ''; // 鍚屾椂璁剧疆椤甸潰缁戝畾鐨凱HSY鍙橀噺
+						// 纭繚PHSY瀛楁琚纭缃紙鍏煎澶у皬鍐欙級
+						this.formData.PHSY = data.PHSY || data.phsy;
+						this.PHSY = (data.PHSY || data.phsy || '').toString(); // 鍚屾椂璁剧疆椤甸潰缁戝畾鐨凱HSY鍙橀噺
 						
 						console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus);
 						this.$post({
@@ -740,6 +777,16 @@
 							let tableData = res1.data.tbBillList
 							//褰撳凡妫�楠屼釜鏁伴兘涓嶄负绌烘椂鎸夌収妫�娴嬬粨鏋勬帓搴�
 							tableData.sort((a, b) => {
+								// 棣栧厛鎸塅stand鎺掑簭锛欶stand涓嶄负绌虹殑鎺掑湪鍓嶉潰
+								const aHasFstand = a.fstand !== null && a.fstand !== undefined;
+								const bHasFstand = b.fstand !== null && b.fstand !== undefined;
+								if (aHasFstand && !bHasFstand) {
+									return -1;
+								} else if (!aHasFstand && bHasFstand) {
+									return 1;
+								}
+								
+								// 鐒跺悗鎸夋楠岀粨鏋滄帓搴�
 								if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') {
 									return -1;
 								} else if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') {
@@ -787,11 +834,13 @@
 				this.drawingShow = false
 				this.imageShow = false
 				this.productionShow = false
+				this.itemShow=false
 			},
 			drawingCancel() {
 				this.drawingShow = false
 				this.imageShow = false
 				this.productionShow = false
+				this.itemShow=false
 			},
 
 			fetchDrawingNumber() {
@@ -841,7 +890,7 @@
 				});
 				this.drawingShow = true
 			},
-
+			
 
 			//鍥剧焊鐩稿叧鏂囨。
 			openDrawings(item) {
@@ -1287,19 +1336,31 @@
 			addDestruction() {
 				// 娣诲姞鐮村潖瀹為獙鐨勯�昏緫
 				this.destructionPopup = !this.destructionPopup;
+				// 淇锛氱‘淇漃HSY鍙橀噺姝g‘鍒濆鍖�
 				this.PHSY = this.formData.PHSY || '';
 				this.isInteger = true;
 			},
 			editDestruction() {
+				// 楠岃瘉杈撳叆鏄惁涓烘暣鏁版垨绌哄瓧绗︿覆
 				if(this.PHSY === '') {
 					this.isInteger = true;
 				} else {
 					const isInteger = /^-?\d+$/.test(this.PHSY);
 					this.isInteger = isInteger;
 					if (!isInteger) {
+						uni.showToast({
+							title: '璇疯緭鍏ユ暣鏁板�兼垨鐣欑┖',
+							icon: 'none',
+							duration: 2000
+						});
 						return;
 					}
 				}
+			
+				// 鏄剧ず鍔犺浇鎻愮ず
+				uni.showLoading({
+					title: '淇濆瓨涓�...'
+				});
 			
 				this.$post({
 					url: "/LLJ/savePhsyGid",
@@ -1309,20 +1370,42 @@
 						PHSY: this.PHSY
 					}
 				}).then(res => {
-					if (res.data.tbBillList > 0) {
+					uni.hideLoading();
+					if (res.data && res.data.tbBillList > 0) {
 						this.formData.PHSY = this.PHSY === '' ? null : this.PHSY;
 						this.destructionPopup = false;
+						uni.showToast({
+							title: '淇濆瓨鎴愬姛',
+							icon: 'success',
+							duration: 2000
+						});
 						// 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾
 						setTimeout(() => {
 							this.init();
 						}, 500);
+					} else {
+						uni.showToast({
+							title: '淇濆瓨澶辫触',
+							icon: 'none',
+							duration: 2000
+						});
 					}
 				}).catch(err => {
+					uni.hideLoading();
 					console.error('淇濆瓨澶辫触锛�', err);
+					uni.showToast({
+						title: '淇濆瓨澶辫触锛岃閲嶈瘯',
+						icon: 'none',
+						duration: 2000
+					});
 				})
 			},
 			clearDestruction() {
-				this.PHSY = '';
+				// 鏄剧ず鍔犺浇鎻愮ず
+				uni.showLoading({
+					title: '娓呴櫎涓�...'
+				});
+				
 				this.$post({
 					url: "/LLJ/savePhsyGid",
 					data: {
@@ -1331,16 +1414,35 @@
 						PHSY: ''
 					}
 				}).then(res => {
-					if (res.data.tbBillList > 0) {
+					uni.hideLoading();
+					if (res.data && res.data.tbBillList > 0) {
 						this.formData.PHSY = null;
+						this.PHSY = '';
 						this.destructionPopup = false;
+						uni.showToast({
+							title: '娓呴櫎鎴愬姛',
+							icon: 'success',
+							duration: 2000
+						});
 						// 绔嬪嵆閲嶆柊鍔犺浇鏁版嵁纭繚鍚屾
 						setTimeout(() => {
 							this.init();
 						}, 500);
+					} else {
+						uni.showToast({
+							title: '娓呴櫎澶辫触',
+							icon: 'none',
+							duration: 2000
+						});
 					}
 				}).catch(err => {
+					uni.hideLoading();
 					console.error('娓呴櫎澶辫触锛�', err);
+					uni.showToast({
+						title: '娓呴櫎澶辫触锛岃閲嶈瘯',
+						icon: 'none',
+						duration: 2000
+					});
 				})
 			},
 			viewAttachmentInfo() {
@@ -1924,6 +2026,39 @@
 		box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
 		min-height: 100vh;
 		position: relative;
+		transition: all 0.3s ease;
+	}
+
+	/* 鏈淮鎶や笖闈炵揣鎬ユ斁琛岃〃鍗曠殑绱壊鏍峰紡 */
+	.inspection-sheet.unmaintained-form {
+		background: linear-gradient(135deg, #f8f4ff 0%, #f0e6ff 100%);
+		border: 2px solid #9c27b0;
+		box-shadow: 0 0 20px rgba(156, 39, 176, 0.2);
+	}
+
+	.inspection-sheet.unmaintained-form .sheet-header {
+		border-bottom: 2px solid #9c27b0;
+	}
+
+	.inspection-sheet.unmaintained-form .sheet-header h1 {
+		color: #6a1b9a;
+	}
+
+	.inspection-sheet.unmaintained-form .inspection-number {
+		color: #9c27b0;
+	}
+
+	.inspection-sheet.unmaintained-form .material-info {
+		border: 1px solid #e1bee7;
+		background-color: rgba(156, 39, 176, 0.05);
+	}
+
+	.inspection-sheet.unmaintained-form .info-label {
+		color: #6a1b9a;
+	}
+
+	.inspection-sheet.unmaintained-form .info-value {
+		color: #4a148c;
 	}
 
 	/* 澶撮儴鏍峰紡 */

--
Gitblit v1.9.3