From 1bcee828a3340d5f5642b3dbcf4cd9733072b7aa Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期一, 21 七月 2025 14:24:35 +0800
Subject: [PATCH] LLJ检验结果录入优化:添加自动保存和回车保存功能

---
 pages/QC/LLJ/Add.vue | 1553 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 1,378 insertions(+), 175 deletions(-)

diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue
index b558a5a..52ddd2a 100644
--- a/pages/QC/LLJ/Add.vue
+++ b/pages/QC/LLJ/Add.vue
@@ -4,9 +4,10 @@
 		<view class="sheet-header">
 			<h1>鏉ユ枡妫�楠屽崟</h1>
 			<view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view>
-			<!-- 閫犳ⅵ鑰呯壒娈婂姛鑳� -->
-			<view style="text-align: right;" v-if="this.current"><a class="sysLike"
-					@click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a></view>
+			<!--瀹為獙瀹ら�佹 -->
+			<view style="text-align: right;" class="action-buttons">
+				<a class="sysLike" v-if="this.current" @click="toSysSubmitFrom(formData.releaseNo)">瀹為獙瀹ら�佹</a>
+			</view>
 		</view>
 
 		<!-- 鍩烘湰淇℃伅鍖� -->
@@ -88,26 +89,31 @@
 
 			</select>
 		</view>
-		<view class="dropdown-row">
-			<view class="info-label">澶囨敞锛�</view>
-			<input type="text" id="remark" v-model="REMARK" placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" />
+					<view class="info-block" style="margin-top: 10px;">   
+		    <view class="info-label">澶囨敞锛�</view>
+		    <input type="text" id="lotNo1" v-model="formData.lotNo1" 
+		                       placeholder="璇疯緭鍏ュ娉ㄤ俊鎭�" 
+		                       style="color: red; font-weight: bold;"/> 
 		</view>
-
-
-
-		<!-- 鎿嶄綔鎸夐挳鍖� -->
-		<view class="action-buttons" v-if="this.current">
-			<button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button>
+		<view class="info-block" style="margin-top: 10px;">   
+		    <view class="info-label">鐮村潖瀹為獙鏁伴噺锛�</view>
+		    <view class="info-value highlight">{{formData.phsy}}</view>
 		</view>
+		
+
+
+
+		
+
 
 		<!-- 妫�楠岄」鐩〃鏍� -->
 		<view class="inspection-table">
 			<table>
 				<thead>
 					<tr>
-						<th width="15%" style="text-align: center;">妫�楠岄」鐩�</th>
+						<th width="20%" style="text-align: center;">妫�楠岄」鐩�</th>
 						<th width="50%" style="text-align: center;">妫�楠屾弿杩�</th>
-						<th width="20%" style="text-align: center;">璁板綍(鐐瑰嚮)</th>
+						<th width="15%" style="text-align: center;">璁板綍(鐐瑰嚮)</th>
 					</tr>
 				</thead>
 				<tbody>
@@ -129,17 +135,28 @@
 							<button v-if="item.current" class="record-btn" @click="fillRecord(item,index)">濉啓</button>
 							<button v-if="!item.current" class="record-btn" @click="fillRecord(item,index)">鏌ョ湅</button>
 						</td>
+						
 					</tr>
 				</tbody>
 			</table>
 		</view>
 
-		<!-- 鎿嶄綔鎸夐挳鍖� -->
-		<view class="action-buttons">
-			<button class="secondary-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button>
-			<button class="secondary-btn" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button>
-			<button class="secondary-btn" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button>
-			<button class="primary-btn" @click="submitInspection" v-if="this.current">妫�楠屾彁浜�</button>
+		<!-- 椤甸潰鍐呭鍖哄煙 -->
+		<view class="content-wrapper">
+			<!-- 涓哄簳閮ㄦ寜閽暀鍑虹┖闂� -->
+		</view>
+		
+		<!-- 鍥哄畾鍦ㄥ簳閮ㄧ殑鎿嶄綔鎸夐挳鍖� -->
+		<view class="fixed-action-buttons">
+			<button class="action-btn" @click="handleEmergencyRelease" v-if="this.current">绱ф�ユ斁琛�</button>
+			<button class="action-btn" @click="handleWithdraw" v-if="this.current">鎾ゅ洖</button>
+			<button class="action-btn" @click="getInspectionItems" v-if="this.current">鑾峰彇妫�楠岄」鐩�</button>
+			<button class="action-btn" @click="addDestruction" v-if="this.current">鐮村潖瀹為獙</button>
+			<button class="action-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button>
+			<button class="action-btn" @click="fetchDrawingNumber">璋冨彇PLM鍥剧焊</button>
+			<button class="action-btn" @click="viewAttachmentInfo">鏌ョ湅闄勪欢淇℃伅</button>
+			<button class="action-btn" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button>
+			<button class="action-btn primary" @click="submitInspection" v-if="this.current">妫�楠屾彁浜�</button>
 		</view>
 		<view v-if="remarksPopup" class="overlay">
 			<view class="popup">
@@ -155,11 +172,27 @@
 				<button @click="remarksPopup = !remarksPopup">鍙栨秷</button>
 			</view>
 		</view>
-
+		
+		<view v-if="destructionPopup" class="overlay">
+			<view class="popup">
+				<h3>鐮村潖瀹為獙鏁伴噺</h3>
+				<form>
+					<view class="form-group">
+						<label class="form-label">鐮村潖瀹為獙鏁伴噺:</label>
+						<input class="form-input" type="text" v-model="PHSY" placeholder="鐣欑┖琛ㄧず娓呴櫎鏁伴噺" />
+					</view>
+				</form>
+				<div v-if="!isInteger" class="error-message">璇疯緭鍏ユ暣鏁板�兼垨鐣欑┖</div>
+				<button class="updateBut" @click="editDestruction">淇敼</button>
+				<button @click="clearDestruction">娓呴櫎</button>
+				<button @click="destructionPopup = !destructionPopup">鍙栨秷</button>
+			</view>
+		</view>
+		
 		<view class="barcode">
 			<u-modal :show="drawingShow" title="鍥剧焊鏄庣粏" @confirm="drawingConfirm" @cancel="drawingCancel"
-				showCancelButton>
-				<uni-table border stripe emptyText="鏆傛棤鏇村鏁版嵁" style="margin-left: 5px;margin-right: 5px;height: 500px;">
+				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">鏈夋棤鍏宠仈PDF鏂囦欢</uni-th>
@@ -183,8 +216,99 @@
 				</uni-table>
 			</u-modal>
 		</view>
-
+		<!-- 闄勪欢璇︽儏寮圭獥 -->
+		<view v-if="showAttachmentDetail" class="overlay">
+			<view class="popup attachment-detail-popup">
+				<h3 class="attachment-popup-title">闄勪欢璇︽儏</h3>
+				<div class="attachment-popup-divider"></div>
+				<div v-if="selectedAttachment" class="attachment-detail-content">
+					<div class="attachment-detail-row"><span class="attachment-label">ID锛�</span><span>{{ Math.trunc(selectedAttachment.id) }}</span></div>
+					<div class="attachment-detail-row"><span class="attachment-label">闄勪欢鍚嶏細</span><span>{{ selectedAttachment.fattach }}</span></div>
+					<div class="attachment-detail-row"><span class="attachment-label">绫诲瀷锛�</span><span>{{ selectedAttachment.ftype }}</span></div>
+					<div class="attachment-detail-row"><span class="attachment-label">鐗堟湰锛�</span><span>{{ selectedAttachment.fversion }}</span></div>
+					<div class="attachment-detail-row"><span class="attachment-label">鍙楁帶鏃ユ湡锛�</span><span>{{ selectedAttachment.fdate }}</span></div>
+					<div class="attachment-detail-row"><span class="attachment-label">涓婁紶浜猴細</span><span>{{ selectedAttachment.createBy }}</span></div>
+					<div class="attachment-detail-row"><span class="attachment-label">涓婁紶鏃堕棿锛�</span><span>{{ selectedAttachment.createDate }}</span></div>
+					<div class="attachment-actions-detail">
+						<button class="attachment-action-btn preview-btn" 
+							@click="previewFtpFile(selectedAttachment)" 
+							v-if="isPreviewable(selectedAttachment.fattach)">
+							馃攳 鍦ㄧ嚎棰勮
+						</button>
+						<button class="attachment-action-btn download-btn" 
+							@click="downloadAttachment(selectedAttachment)">
+							馃摜 涓嬭浇鏂囦欢
+						</button>
+					</div>
+				</div>
+				<div v-else class="attachment-detail-empty">鏆傛棤闄勪欢淇℃伅</div>
+				<button class="attachment-popup-close" @click="closeAttachmentDetail">杩斿洖闄勪欢鍒楄〃</button>
+			</view>
+		</view>
+		<!-- 闄勪欢鍒楄〃寮圭獥 -->
+		<view v-if="showAttachmentPopup" class="overlay">
+			<view class="popup" style="width: 60vw; max-width: 500px;">
+				<h3>闄勪欢鍒楄〃</h3>
+				<div v-if="attachmentsLoading">鍔犺浇涓�...</div>
+				<div v-else-if="attachments.length === 0">鏆傛棤闄勪欢</div>
+				<ul class="attachment-list" v-else>
+					<li v-for="item in attachments" :key="item.id">
+						<div class="attachment-info">
+							<span class="attachment-name" @click="showAttachmentDetailDialog(item)">
+								{{ item.fattach }}
+							</span>
+							<div class="attachment-meta">
+								<span class="attachment-type">{{ item.ftype || '鏈煡绫诲瀷' }}</span>
+							</div>
+						</div>
+						<div class="attachment-actions">
+							<button class="secondary-btn" @click="showAttachmentDetailDialog(item)">璇︽儏</button>
+							<button class="secondary-btn preview-btn" @click="previewFtpFile(item)" 
+								v-if="isPreviewable(item.fattach)">棰勮</button>
+							<button class="secondary-btn" @click="downloadAttachment(item)">涓嬭浇</button>
+						</div>
+					</li>
+				</ul>
+				<button class="attachment-popup-close" @click="closeAttachmentPopup">鍏抽棴</button>
+			</view>
+		</view>
+		
+		<!-- 鏂囦欢棰勮寮圭獥 -->
+		<view v-if="showFilePreviewPopup" class="overlay">
+			<view class="popup file-preview-popup">
+				<h3 class="file-preview-title">{{ previewTitle }}</h3>
+				<div class="file-preview-divider"></div>
+				<div class="file-preview-content">
+					<!-- 鏂囨湰鍐呭棰勮 -->
+					<pre v-if="previewType === 'text'">{{ previewContent }}</pre>
+					
+					<!-- 鍥剧墖鍐呭棰勮 -->
+					<view v-else-if="previewType === 'image'" class="image-preview-container">
+						<image :src="previewContent" mode="widthFix" style="width: 100%; max-height: 400px;"></image>
+					</view>
+					
+					<!-- Excel 绛� Office 鏂囦欢鎻愮ず -->
+					<view v-else-if="previewType === 'excel'" class="unsupported-preview">
+						<view class="unsupported-icon">馃搳</view>
+						<view class="unsupported-text">Excel 鏂囦欢鏆備笉鏀寔鍦ㄧ嚎棰勮</view>
+						<view class="unsupported-hint">璇风偣鍑讳笅杞芥寜閽幏鍙栧畬鏁存枃浠�</view>
+					</view>
+					
+					<!-- 涓嶆敮鎸佺殑鏂囦欢绫诲瀷 -->
+					<view v-else class="unsupported-preview">
+						<view class="unsupported-icon">馃搫</view>
+						<view class="unsupported-text">姝ゆ枃浠舵牸寮忔殏涓嶆敮鎸侀瑙�</view>
+						<view class="unsupported-hint">璇风偣鍑讳笅杞芥寜閽幏鍙栧畬鏁存枃浠�</view>
+					</view>
+				</div>
+				<div class="file-preview-actions">
+					<button v-if="previewType !== 'text'" class="file-preview-btn download-btn" @click="downloadPreviewFile">馃摜 涓嬭浇鏂囦欢</button>
+					<button class="file-preview-btn close-btn" @click="closeFilePreview">鍏抽棴</button>
+				</div>
+			</view>
+		</view>
 	</view>
+	
 </template>
 
 <script>
@@ -207,10 +331,21 @@
 					planQty: "",
 					mocode: "",
 					boardStyle: "",
-					itemId: ""
+					itemId: "",
+					emergencyStatus: false,
+					lotNo1: '', 
+					emergency:'',
+					permissionModalVisible: false,
+					permissionAccount: '',
+					hasEmergencyPermission: false,
+					showPopup: false,
+					PHSY:'',
+					EMERGENCY: '0',
+					
 				},
 				tableData: [],
 				remarksPopup: false,
+				meomPopup: false,
 				current: true,
 				drawing: [],
 				drawingShow: false,
@@ -220,18 +355,38 @@
 				REMARK: '',
 				checkState: false,
 				writeStatu: true,
-				fileName:''
+				fileName:'',
+				originalRemarks: '',
+				hasEmergencyPermission: false,
+				destructionPopup: false,
+				PHSY: '',
+				isInteger: true,
+				attachments: [],
+				showAttachmentPopup: false,
+				attachmentsLoading: false,
+				selectedAttachment: null,
+				showAttachmentDetail: false,
+				showFilePreviewPopup: false,
+				previewContent: '',
+				previewTitle: '',
+				previewItemNo: '',
+				previewType: '', // 'text', 'image', 'excel', 'unsupported'
+				
 			}
 		},
 		onLoad(options) {
 			//options涓寘鍚簡url闄勫甫鐨勫弬鏁�
 			let params = options;
-
+			
+			
+			    
 			if (params["id"]) {
 				this.formData.id = params["id"];
 				this.formData.releaseNo = params["releaseNo"];
 				this.formData.lotNo = params["lotNo"];
 				this.msgId = params["msgId"];
+				this.emergency = params["emergency"]
+				this.meom = params["meom"]
 
 				if (params["current"] === 'A') {
 					this.current = true;
@@ -254,6 +409,11 @@
 				});
 
 			}
+			 if (this.$loginInfo.account === 'PL017') {this.hasEmergencyPermission = true;}
+
+			 // 娴嬭瘯闄勪欢鏈嶅姟鍣ㄨ繛鎺�
+			 
+
 
 		},
 		methods: {
@@ -279,7 +439,8 @@
 					data: {
 						itemNo: this.formData.itemId,
 						quantity: this.formData.fcovertQty,
-						releaseNo: this.formData.releaseNo
+						releaseNo: this.formData.releaseNo,
+						PHSY: this.formData.PHSY
 					}
 				}).then(res => {
 					if (res.status == 0) {
@@ -306,6 +467,7 @@
 					}
 				});
 			},
+			
 			fillRecord(item, index) {
 				// 濉啓璁板綍鐨勯�昏緫
 				uni.navigateTo({
@@ -346,7 +508,7 @@
 
 					if (this.formData.fngDesc == '' || this.writeStatu == false) {
 						uni.showToast({
-							title: '鏈~鍐欎笉鑹弿杩版垨涓変釜閫夋嫨妗嗘湭閫夋嫨瀹�',
+							title: '鏈~鍐欎笉鑹弿杩版垨涓嶈壇鍘熷洜鎴栨墍灞炶溅闂存垨璇勫鐘舵��',
 							icon: 'none'
 						});
 					} else {
@@ -374,7 +536,8 @@
 										staffNo: 'HMCS',
 										// staffNo: this.$loginInfo.account,
 										iqcStatus: this.PSTYPE,
-										department: this.DEPARTMENT
+										department: this.DEPARTMENT,
+										EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫�
 									};
 								}
 								else{
@@ -391,14 +554,16 @@
 										// staffNo: 'HMCS',
 										staffNo: this.$loginInfo.account,
 										iqcStatus: this.PSTYPE,
-										department: this.DEPARTMENT
+										department: this.DEPARTMENT,
+										EMERGENCY: this.formData.emergencyStatus ? "1" : "0" // 纭繚绱ф�ユ斁琛岀姸鎬佹纭紶閫�
 									};
 								}
 
-								console.log(this.QcIssueResultDetailes)
+								console.log("鎻愪氦鐨勭揣鎬ユ斁琛岀姸鎬侊細", this.formData.emergencyStatus ? "1" : "0");
+								console.log("瀹屾暣鐨勬彁浜ゆ暟鎹細", this.QcIssueResultDetailes);
 
-								const url = `http://192.168.1.22:10054/api/QcIssueResult/GetProcessNo`;
-								// 鍙戦�� POST 璇锋眰
+								const url = this.$store.state.serverInfo.serverAPI+`/QcIssueResult/GetProcessNo`;
+								if (this.PSTYPE === '鐗归噰/璁╂浣跨敤') {// 鍙戦�� POST 璇锋眰
 								uni.request({
 									url: url, // 璇锋眰鍦板潃
 									method: 'POST', // 璇锋眰鏂规硶
@@ -415,7 +580,10 @@
 
 										// 濡傛灉鏈夐〉闈㈣烦杞紝闇�瑕佺敤瀹氭椂鍣ㄥ欢杩�
 										setTimeout(() => {
-											uni.navigateTo({
+											// 璁剧疆涓�涓爣璁帮紝鍛婅瘔List椤甸潰闇�瑕佸埛鏂�
+											getApp().globalData = getApp().globalData || {};
+											getApp().globalData.needRefreshList = true;
+											uni.redirectTo({
 												url: 'List'
 											});
 										}, 2000); // 淇濇寔涓� duration 鐩稿悓鐨勬椂闀�
@@ -430,7 +598,7 @@
 										});
 									}
 								});
-
+							}
 								uni.showToast({
 									title: res.message.toString(),
 									icon: 'success',
@@ -469,11 +637,11 @@
 							})
 							// 濡傛灉鏈夐〉闈㈣烦杞紝闇�瑕佺敤瀹氭椂鍣ㄥ欢杩�
 							setTimeout(() => {
-								uni.navigateTo({
-									url: 'List'
-								});
+								// 璁剧疆涓�涓爣璁帮紝鍛婅瘔List椤甸潰闇�瑕佸埛鏂�
+								getApp().globalData = getApp().globalData || {};
+								getApp().globalData.needRefreshList = true;
+								uni.navigateBack();
 							}, 2000); // 淇濇寔涓� duration 鐩稿悓鐨勬椂闀�
-
 						} else {
 							uni.showModal({
 								title: "鎻愮ず",
@@ -508,8 +676,16 @@
 				}).then(res => {
 					let data = res.data.tbBillList[0];
 					if (data) {
-						this.formData = data;
-
+						this.formData = {
+							...data,
+							emergencyStatus: data.emergency === 1 || data.emergency === "1" || data.emergency === true
+						};
+						
+						// 纭繚PHSY瀛楁琚纭缃�
+						this.formData.PHSY = data.PHSY;
+						
+						console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus);
+						
 						this.$post({
 							url: "/LLJ/getJYItem",
 							data: {
@@ -520,9 +696,9 @@
 							let tableData = res1.data.tbBillList
 							//褰撳凡妫�楠屼釜鏁伴兘涓嶄负绌烘椂鎸夌収妫�娴嬬粨鏋勬帓搴�
 							tableData.sort((a, b) => {
-								if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') {
+								if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') {
 									return -1;
-								} else if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') {
+								} else if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') {
 									return 1;
 								} else {
 									return 0;
@@ -562,58 +738,25 @@
 				});
 			},
 			editRemarks() {
-				if (this.remarks) {
-					//saveRemarksGid
-					this.$post({
-						url: "/LLJ/saveRemarksGid",
-						data: {
-							gid: this.formData.id,
-							remarks: this.remarks,
-							releaseNo: this.formData.releaseNo,
-						}
-					}).then(res => {
-						if (res.data.tbBillList > 0) {
-							this.formData.remarks = this.remarks;
-							this.remarksPopup = !this.remarksPopup;
-							this.$showMessage("淇濆瓨鎴愬姛");
-							setTimeout(() => {
-								let pages = getCurrentPages();
-								let beforePage = pages[pages.length - 2];
-								uni.navigateBack({
-									delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤�
-									success: (event) => {
-										beforePage.$vm.reload()
-									}
-								});
-							}, 2000);
-						}
-					})
-				} else {
-					this.$post({
-						url: "/LLJ/saveRemarksGid",
-						data: {
-							gid: this.formData.id,
-							remarks: '',
-							releaseNo: this.formData.releaseNo,
-						}
-					}).then(res => {
-						if (res.data.tbBillList > 0) {
-							this.formData.remarks = this.remarks;
-							this.remarksPopup = !this.remarksPopup;
-							this.$showMessage("淇濆瓨鎴愬姛");
-							setTimeout(() => {
-								let pages = getCurrentPages();
-								let beforePage = pages[pages.length - 2];
-								uni.navigateBack({
-									delta: 1, //杩斿洖鐨勯〉闈㈡暟锛屽鏋滀负1琛ㄧず杩斿洖涓婁竴椤�
-									success: (event) => {
-										beforePage.$vm.reload()
-									}
-								});
-							}, 2000);
-						}
-					})
-				}
+				// 淇濆瓨涓嶈壇鎻忚堪
+				this.$post({
+					url: "/LLJ/saveRemarksGid",
+					data: {
+						gid: this.formData.id,
+						remarks: this.remarks || '',
+						releaseNo: this.formData.releaseNo
+						// 涓嶅啀鍖呭惈PHSY瀛楁
+					}
+				}).then(res => {
+					if (res.data.tbBillList > 0) {
+						this.formData.remarks = this.remarks;
+						this.remarksPopup = !this.remarksPopup;
+						this.$showMessage("淇濆瓨鎴愬姛");
+						setTimeout(() => {
+							this.init();
+						}, 2000);
+					}
+				})
 			},
 
 			drawingConfirm() {
@@ -632,22 +775,24 @@
 				const item = this.formData.itemNo;
 				console.log(this.formData.itemNo)
 				// console.log(item)
-				const url = "http://192.168.1.22:10054/api/PLM/RetrieveDrawings?ItemNo=" + item
+				const url = this.$store.state.serverInfo.serverAPI +"/PLM/RetrieveDrawings?ItemNo=" + item
 
 				// const item = '5.06.04.4002';
 				// const url = "http://192.168.0.100:10054/api/PLM/RetrieveDrawings?ItemNo=" + item
-
+				
+				let _this = this;
+				
 				uni.request({
 					url: url,
 					method: 'POST',
 					success: (response) => {
 						console.log(response)
 						if (response.data.data == '杩斿洖缁撴灉涓虹┖') {
-							this.drawing = null
+							_this.drawing = null
 						} else {
-							this.drawing = response.data.data
+							_this.drawing = response.data.data
 							// 閬嶅巻鏁版嵁锛屽垽鏂枃浠跺悗缂�骞舵坊鍔犲瓧娈�
-							this.drawing.forEach((file) => {
+							_this.drawing.forEach((file) => {
 								// 鑾峰彇鏂囦欢鍚嶇殑鍚庣紑
 								const fileExtension = file.fName.split('.').pop()
 									.toLowerCase();
@@ -680,7 +825,7 @@
 				if (item.fRelevantObject.length > 2) {
 					// 鐢熸垚璇锋眰URL锛堢畝鍖栫紪鐮侀�昏緫锛�
 					const encodedName = encodeURIComponent(item.fName); 
-					const url = `http://192.168.1.22:10054/api/PLM/OpenDrawingsGet?fileId=${item.fRelevantObject}&fName=${encodedName}`;
+					const url = this.$store.state.serverInfo.serverAPI+`/PLM/OpenDrawingsGet?fileId=${item.fRelevantObject}&fName=${encodedName}`;
 					console.log('璇锋眰URL:', url);
 					
 					const now = new Date();
@@ -984,7 +1129,734 @@
 				// 		title: '鏃犲搴擯DF鏂囦欢锛屾墦寮�澶辫触',
 				// 		icon: 'none'
 				// 	});				// }
-			}
+			},
+			// 澶勭悊绱ф�ユ斁琛�
+			handleEmergencyRelease() {
+			            if (this.formData.emergencyStatus) {
+			                uni.showModal({
+			                    title: "鎻愮ず",
+			                    content: '璇ュ崟宸茬揣鎬ユ斁琛岋紝璇峰嬁閲嶅鎿嶄綔',
+			                    showCancel: false
+			                });
+			                return;
+			            }
+			
+			            uni.showModal({
+			                title: '纭',
+			                content: '纭畾瑕佹墽琛岀揣鎬ユ斁琛屽悧锛�',
+			                success: (res) => {
+			                    if (res.confirm) {
+			                        // 璋冪敤鏂扮殑鍚庣鎺ュ彛
+			                        this.$post({
+			                            url: "/LLJ/EmergencyRelease",
+			                            data: {
+			                                id: this.formData.id
+			                            }
+			                        }).then(res => {
+			                            if (res.data && res.status === 0) {
+			                                const result = res.data.tbBillList[0];
+			                                const message = res.data.tbBillList[1];
+											const lotNo1 = res.data.tbBillList[2] || "";
+			
+			                                if (result === "0") {
+			                                    this.formData.emergencyStatus = true;
+												this.originalLotNo1 = lotNo1; 
+												this.formData.lotNo1 = lotNo1;
+												// 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻��
+												this.formData.EMERGENCY = "1";
+												
+			                                    uni.showToast({
+			                                        title: message || '绱ф�ユ斁琛屾垚鍔�',
+			                                        icon: 'success',
+			                                        duration: 2000
+			                                    });
+			                                    this.init();
+			                                } else {
+			                                    uni.showModal({
+			                                        title: "鎻愮ず",
+			                                        content: message || '鎿嶄綔澶辫触',
+			                                        showCancel: false
+			                                    });
+			                                }
+			                            }
+			                        }).catch(error => {
+			                            uni.showModal({
+			                                title: "閿欒",
+			                                content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�',
+			                                showCancel: false
+			                            });
+			                        });
+			                    }
+			                }
+			            });
+			        },
+			
+			        // 澶勭悊鎾ゅ洖
+			        handleWithdraw() {
+			            uni.showModal({
+			                title: '纭',
+			                content: '纭畾瑕佹挙鍥炵揣鎬ユ斁琛屽悧锛�',
+			                success: (res) => {
+			                    if (res.confirm) {
+			                        // 璋冪敤鏂扮殑鍚庣鎺ュ彛
+			                        this.$post({
+			                            url: "/LLJ/WithdrawEmergencyRelease",
+			                            data: {
+			                                id: this.formData.id
+			                            }
+			                        }).then(res => {
+			                            if (res.data && res.status === 0) {
+			                                const result = res.data.tbBillList[0];
+			                                const message = res.data.tbBillList[1];
+			
+			                                if (result === "0") {
+			                                    this.formData.emergencyStatus = false;
+												// 鏇存柊绱ф�ユ斁琛岀姸鎬侊紝纭繚鎻愪氦鏃惰兘姝g‘浼犻��
+												this.formData.EMERGENCY = "0";
+												
+			                                    uni.showToast({
+			                                        title: message || '鎾ゅ洖鎴愬姛',
+			                                        icon: 'success',
+			                                        duration: 2000
+			                                    });
+			                                    this.init();
+			                                } else {
+			                                    uni.showModal({
+			                                        title: "鎻愮ず",
+			                                        content: message || '鎿嶄綔澶辫触',
+			                                        showCancel: false
+			                                    });
+			                                }
+			                            }
+			                        }).catch(error => {
+			                            uni.showModal({
+			                                title: "閿欒",
+			                                content: '缃戠粶閿欒锛岃妫�鏌ョ綉缁滆繛鎺�',
+			                                showCancel: false
+			                            });
+			                        });
+			                    }
+			                }
+			            });
+			        },
+					editRemarks() {
+						// 淇濆瓨涓嶈壇鎻忚堪
+						this.$post({
+							url: "/LLJ/saveRemarksGid",
+							data: {
+								gid: this.formData.id,
+								remarks: this.remarks || '',
+								releaseNo: this.formData.releaseNo
+								// 涓嶅啀鍖呭惈PHSY瀛楁
+							}
+						}).then(res => {
+							if (res.data.tbBillList > 0) {
+								this.formData.remarks = this.remarks;
+								this.remarksPopup = !this.remarksPopup;
+								this.$showMessage("淇濆瓨鎴愬姛");
+								setTimeout(() => {
+									this.init();
+								}, 2000);
+							}
+						})
+					},
+			addDestruction() {
+				// 娣诲姞鐮村潖瀹為獙鐨勯�昏緫
+				this.destructionPopup = !this.destructionPopup;
+				this.PHSY = this.formData.PHSY || '';
+				this.isInteger = true;
+			},
+			editDestruction() {
+				// 楠岃瘉杈撳叆鏄惁涓烘暣鏁�
+				if(this.PHSY === '') {
+					this.isInteger = true;
+					// 濡傛灉涓虹┖锛屼紶閫掔┖瀛楃涓诧紝鍚庣浼氬鐞嗕负null
+				} else {
+					const isInteger = /^-?\d+$/.test(this.PHSY);
+					this.isInteger = isInteger;
+					if (!isInteger) {
+						return;
+					}
+				}
+				
+				// 淇濆瓨鐮村潖瀹為獙鏁伴噺
+				this.$post({
+					url: "/LLJ/saveRemarksGid",
+					data: {
+						gid: this.formData.id,
+						releaseNo: this.formData.releaseNo,
+						PHSY: this.PHSY // 鍙互鏄┖瀛楃涓叉垨鏈夋晥鏁存暟
+						// 涓嶅啀鍖呭惈remarks瀛楁
+					}
+				}).then(res => {
+					if (res.data.tbBillList > 0) {
+						// 濡傛灉杈撳叆涓虹┖锛岃缃负null浠ヤ究涓嶆樉绀�
+						this.formData.PHSY = this.PHSY === '' ? null : this.PHSY;
+						this.destructionPopup = false;
+						this.$showMessage("淇濆瓨鎴愬姛");
+						setTimeout(() => {
+							this.init();
+						}, 2000);
+					}
+				})
+			},
+			clearDestruction() {
+				// 娓呴櫎鐮村潖瀹為獙鏁伴噺
+				this.PHSY = '';
+				this.$post({
+					url: "/LLJ/saveRemarksGid",
+					data: {
+						gid: this.formData.id,
+						releaseNo: this.formData.releaseNo,
+						PHSY: '' // 绌哄瓧绗︿覆锛屽悗绔細澶勭悊涓簄ull
+					}
+				}).then(res => {
+					if (res.data.tbBillList > 0) {
+						this.formData.PHSY = null; // 纭繚鍓嶇涔熶负null锛屼笉鏄剧ず
+						this.destructionPopup = false;
+						this.$showMessage("娓呴櫎鎴愬姛");
+						setTimeout(() => {
+							this.init();
+						}, 2000);
+					}
+				})
+			},
+			viewAttachmentInfo() {
+				this.showAttachmentPopup = true; // 鍏堝脊绐�
+				this.attachmentsLoading = true;
+				this.attachments = [];
+				this.$post({
+					url: "/LLJ/getAttachments",
+					data: { releaseNo: this.formData.releaseNo }
+				}).then(res => {
+					this.attachmentsLoading = false;
+					if (res.status === 0) {
+						this.attachments = res.data.tbBillList;
+						// 涓烘瘡涓檮浠惰缃粯璁ゅ彲鐢ㄧ姸鎬�
+						this.attachments.forEach((item, index) => {
+							this.$set(item, 'ftpAvailable', true); // 榛樿璁や负鏂囦欢鍙敤
+							this.$set(item, 'checking', false);
+						});
+					} else if (res.status === 1 && res.message === "璇ユ楠屽崟鏈笂浼犻檮浠朵俊鎭紒") {
+						uni.showToast({ title: res.message, icon: "none" });
+					} else {
+						uni.showToast({ title: "鑾峰彇闄勪欢澶辫触", icon: "none" });
+					}
+				});
+			},
+			closeAttachmentPopup() {
+				this.showAttachmentPopup = false;
+			},
+			getAttachmentUrl(item) {
+				// 鍘婚櫎鎵�鏈夌┖鐧藉瓧绗︼紙鍖呮嫭涓嫳鏂囩┖鏍笺�佸埗琛ㄧ绛夛級
+				let fileName = item.fattach.replace(/[\s\u3000\r\n]+/g, '').trim();
+				// 缁熶竴浣跨敤FTP涓嬭浇鎺ュ彛锛屽寘鍚獸TP鏈嶅姟鍣ㄥ湴鍧�
+				return this.$store.state.serverInfo.serverAPI + "/LLJ/DownloadFtpFile?itemNo=" + encodeURIComponent(item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + encodeURIComponent(this.$store.state.serverInfo.ftpServer);
+			},
+			showAttachmentDetailDialog(item) {
+				console.log('鏌ョ湅璇︽儏', item);
+				this.selectedAttachment = item;
+				this.showAttachmentPopup = false;
+				this.showAttachmentDetail = true;
+				console.log('showAttachmentDetail:', this.showAttachmentDetail);
+			},
+			closeAttachmentDetail() {
+				this.showAttachmentDetail = false;
+				this.selectedAttachment = null;
+				this.showAttachmentPopup = true;
+			},
+			isPreviewable(filename) {
+				if (!filename) return false;
+				const ext = filename.trim().split('.').pop().toLowerCase();
+				// 鏀寔鍦ㄧ嚎棰勮鐨勬枃浠剁被鍨�
+				return [
+					'pdf',           // PDF鏂囦欢
+					'jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp',  // 鍥剧墖鏂囦欢
+					'txt', 'log', 'md',  // 鏂囨湰鏂囦欢
+					'doc', 'docx',   // Word鏂囨。
+					'xls', 'xlsx',   // Excel琛ㄦ牸
+					'ppt', 'pptx',   // PowerPoint婕旂ず鏂囩
+					'csv'            // CSV鏂囦欢
+				].includes(ext);
+			},
+			// 澶勭悊闄勪欢涓嬭浇閿欒
+			handleAttachmentError(item) {
+				uni.showModal({
+					title: '涓嬭浇澶辫触',
+					content: `鏃犳硶涓嬭浇闄勪欢锛�${item.fattach}\n璇锋鏌ョ綉缁滆繛鎺ユ垨鑱旂郴绠$悊鍛榒,
+					showCancel: false
+				});
+			},
+			// 棰勮FTP鏂囦欢
+			previewFtpFile(item) {
+				const fileName = item.fattach.replace(/[\s\u3000\r\n]+/g, '').trim();
+				const fileExt = fileName.split('.').pop().toLowerCase();
+				
+				// 妫�鏌ユ枃浠剁被鍨嬫槸鍚︽敮鎸侀瑙�
+				if (!this.isPreviewable(fileName)) {
+					uni.showModal({
+						title: '涓嶆敮鎸侀瑙�',
+						content: '璇ユ枃浠剁被鍨嬩笉鏀寔鍦ㄧ嚎棰勮锛岃涓嬭浇鍚庢煡鐪�',
+						showCancel: false
+					});
+					return;
+				}
+				
+				const previewUrl = this.$store.state.serverInfo.serverAPI + "/LLJ/PreviewFtpFile?itemNo=" + encodeURIComponent(item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + encodeURIComponent(this.$store.state.serverInfo.ftpServer);
+				
+				// 鏍规嵁鏂囦欢绫诲瀷杩涜涓嶅悓鐨勯瑙堝鐞�
+				if (['pdf'].includes(fileExt)) {
+					this.previewPdfFile(previewUrl, fileName);
+				} else if (['jpg', 'jpeg', 'png', 'gif', 'bmp'].includes(fileExt)) {
+					this.previewImageFile(previewUrl, fileName);
+				} else if (['txt'].includes(fileExt)) {
+					this.previewTextFile(previewUrl, fileName);
+				} else if (['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx'].includes(fileExt)) {
+					this.previewOfficeFile(previewUrl, fileName);
+				} else {
+					// 灏濊瘯閫氱敤棰勮
+					this.previewGenericFile(previewUrl, fileName);
+				}
+			},
+			
+			// 棰勮PDF鏂囦欢
+			previewPdfFile(url, fileName) {
+				// 鍏堜笅杞絇DF鏂囦欢锛岃浆涓篵ase64鍚庨瑙�
+				uni.request({
+					url: url,
+					method: 'GET',
+					responseType: 'arraybuffer',
+					success: (res) => {
+						if (res.statusCode === 200) {
+							const base64Data = uni.arrayBufferToBase64(res.data);
+							// 瀛樺偍鍒板叏灞�鍙橀噺
+							getApp().globalData.tempPDF = base64Data;
+							uni.navigateTo({
+								url: `/pages/fileView/pdfView`
+							});
+						} else {
+							this.handlePreviewError(res.statusCode, fileName);
+						}
+					},
+					fail: (error) => {
+						this.handlePreviewError(0, fileName, error.errMsg);
+					}
+				});
+			},
+			
+			// 棰勮鍥剧墖鏂囦欢
+			previewImageFile(url, fileName) {
+				// #ifdef APP-PLUS
+				// APP鐜锛氬厛涓嬭浇鍒版湰鍦板啀棰勮锛岄伩鍏嶇綉缁滃浘鐗囧姞杞介棶棰�
+				uni.showLoading({ title: '鍔犺浇鍥剧墖...' });
+				uni.downloadFile({
+					url: url,
+					success: (res) => {
+						uni.hideLoading();
+						if (res.statusCode === 200) {
+							// 浣跨敤鏈湴涓存椂璺緞
+							uni.navigateTo({
+								url: `/pages/fileView/imageView?url=${encodeURIComponent(res.tempFilePath)}`
+							});
+						} else {
+							this.handlePreviewError(res.statusCode, fileName);
+						}
+					},
+					fail: (error) => {
+						uni.hideLoading();
+						this.handlePreviewError(0, fileName, error.errMsg);
+					}
+				});
+				// #endif
+				
+				// #ifdef H5 || MP
+				// H5鍜屽皬绋嬪簭锛氱洿鎺ヤ娇鐢ㄧ綉缁淯RL
+				uni.navigateTo({
+					url: `/pages/fileView/imageView?url=${encodeURIComponent(url)}`
+				});
+				// #endif
+			},
+			
+			// 棰勮鏂囨湰鏂囦欢
+			previewTextFile(url, fileName) {
+				// 鏂囨湰鏂囦欢鐩存帴鏄剧ず鍦ㄥ脊绐椾腑
+				uni.showLoading({ title: '鍔犺浇鏂囦欢鍐呭...' });
+				uni.request({
+					url: url,
+					method: 'GET',
+					success: (res) => {
+						uni.hideLoading();
+						if (res.statusCode === 200) {
+							const fileType = this.getFileType(fileName);
+							
+							if (fileType === 'text') {
+								// 鏂囨湰鏂囦欢锛氭樉绀哄唴瀹�
+								this.showFilePreview(res.data, fileName);
+							} else if (fileType === 'image') {
+								// 鍥剧墖鏂囦欢锛氭樉绀哄浘鐗嘦RL
+								this.showFilePreview(url, fileName);
+							} else {
+								// 鍏朵粬鏂囦欢绫诲瀷锛氭樉绀烘彁绀轰俊鎭�
+								this.showFilePreview('', fileName);
+							}
+						} else {
+							this.handlePreviewError(res.statusCode, fileName);
+						}
+					},
+					fail: (error) => {
+						uni.hideLoading();
+						this.handlePreviewError(0, fileName, error.errMsg);
+					}
+				});
+			},
+			
+			// 妫�娴嬫枃浠剁被鍨�
+			getFileType(fileName) {
+				const fileExt = fileName.split('.').pop().toLowerCase();
+				
+				if (['txt', 'log', 'md', 'csv', 'json', 'xml'].includes(fileExt)) {
+					return 'text';
+				} else if (['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp'].includes(fileExt)) {
+					return 'image';
+				} else if (['xls', 'xlsx', 'doc', 'docx', 'ppt', 'pptx'].includes(fileExt)) {
+					return 'excel';
+				} else {
+					return 'unsupported';
+				}
+			},
+			
+			// 鏄剧ず鏂囦欢棰勮寮圭獥
+			showFilePreview(content, fileName) {
+				this.previewContent = content;
+				this.previewTitle = fileName;
+				this.previewItemNo = this.selectedAttachment?.itemNo || '';
+				this.previewType = this.getFileType(fileName);
+				this.showFilePreviewPopup = true;
+			},
+			
+			// 鍏抽棴鏂囦欢棰勮寮圭獥
+			closeFilePreview() {
+				this.showFilePreviewPopup = false;
+				this.previewContent = '';
+				this.previewTitle = '';
+				this.previewItemNo = '';
+				this.previewType = '';
+			},
+			
+			// 涓嬭浇棰勮鏂囦欢
+			downloadPreviewFile() {
+				const item = { fattach: this.previewTitle, itemNo: this.previewItemNo };
+				this.downloadAttachment(item);
+				this.closeFilePreview();
+			},
+			
+			// 棰勮Office鏂囦欢
+			previewOfficeFile(url, fileName) {
+				// 鍏堟鏌xcel鏂囦欢锛屼娇鐢ㄤ笓闂ㄧ殑Excel棰勮椤甸潰
+				const fileExt = fileName.split('.').pop().toLowerCase();
+				if (['xls', 'xlsx'].includes(fileExt)) {
+					// Excel鏂囦欢棰勮
+					uni.request({
+						url: url,
+						method: 'GET',
+						responseType: 'arraybuffer',
+						success: (res) => {
+							if (res.statusCode === 200) {
+								const base64Data = uni.arrayBufferToBase64(res.data);
+								// 瀛樺偍 Base64 鏁版嵁鍒版湰鍦板瓨鍌�
+								uni.setStorageSync('excelBase64Data', base64Data);
+								uni.navigateTo({
+									url: `/pages/fileView/excelView`
+								});
+							} else {
+								this.handlePreviewError(res.statusCode, fileName);
+							}
+						},
+						fail: (error) => {
+							this.handlePreviewError(0, fileName, error.errMsg);
+						}
+					});
+				} else if (['doc', 'docx'].includes(fileExt)) {
+					// Word鏂囦欢锛屽皾璇曚娇鐢╓ord棰勮椤甸潰鎴栬�呭井杞湪绾块瑙�
+					try {
+						const officePreviewUrl = `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`;
+						// 濡傛灉鏈墂ebView椤甸潰锛屼娇鐢╳ebView棰勮
+						this.previewGenericFile(officePreviewUrl, fileName);
+					} catch (error) {
+						this.handlePreviewError(0, fileName, '涓嶆敮鎸佹Office鏂囦欢绫诲瀷鐨勯瑙�');
+					}
+				} else {
+					// 鍏朵粬Office鏂囦欢锛屼娇鐢ㄥ井杞湪绾块瑙堟湇鍔�
+					const officePreviewUrl = `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`;
+					this.previewGenericFile(officePreviewUrl, fileName);
+				}
+			},
+			
+			// 閫氱敤鏂囦欢棰勮
+			previewGenericFile(url, fileName) {
+				// 鐢变簬娌℃湁閫氱敤鐨剋ebView椤甸潰锛屾樉绀烘彁绀哄苟鎻愪緵涓嬭浇
+				uni.showModal({
+					title: '鏂囦欢棰勮',
+					content: `鏂囦欢 "${fileName}" 闇�瑕佷笅杞藉悗鏌ョ湅锛屾槸鍚︾珛鍗充笅杞斤紵`,
+					showCancel: true,
+					confirmText: '涓嬭浇',
+					cancelText: '鍙栨秷',
+					success: (res) => {
+						if (res.confirm) {
+							const item = { fattach: fileName, itemNo: this.selectedAttachment.itemNo };
+							this.downloadAttachment(item);
+						}
+					}
+				});
+			},
+			
+			// 澶勭悊棰勮閿欒
+			handlePreviewError(statusCode, fileName, errorMsg = '') {
+				let message = '';
+				if (statusCode === 404) {
+					message = `鏂囦欢 ${fileName} 鍦‵TP鏈嶅姟鍣ㄤ笂涓嶅瓨鍦╜;
+				} else if (statusCode === 0) {
+					message = `棰勮澶辫触锛�${errorMsg}`;
+				} else {
+					message = `棰勮澶辫触锛岀姸鎬佺爜锛�${statusCode}`;
+				}
+				
+				uni.showModal({
+					title: '棰勮澶辫触',
+					content: message,
+					showCancel: true,
+					confirmText: '涓嬭浇',
+					cancelText: '鍙栨秷',
+					success: (res) => {
+						if (res.confirm) {
+							// 鐢ㄦ埛閫夋嫨涓嬭浇鏂囦欢
+							const item = { fattach: fileName, itemNo: this.selectedAttachment.itemNo };
+							this.downloadAttachment(item);
+						}
+					}
+				});
+			},
+			
+			downloadAttachment(item) {
+				// 鍘婚櫎鎵�鏈夌┖鏍笺�佸叏瑙掔┖鏍笺�佸洖杞︺�佹崲琛�
+				const fileName = item.fattach.replace(/[\s\u3000\r\n]+/g, '').trim();
+				// 浣跨敤閰嶇疆鐨勬湇鍔″櫒鍦板潃鍜孎TP鏈嶅姟鍣ㄥ湴鍧�
+				const url = this.$store.state.serverInfo.serverAPI + "/LLJ/DownloadFtpFile?itemNo=" + encodeURIComponent(item.itemNo) + "&fileName=" + encodeURIComponent(fileName) + "&ftpServer=" + encodeURIComponent(this.$store.state.serverInfo.ftpServer);
+				
+				// 妫�鏌ヨ繍琛岀幆澧�
+				// #ifdef H5
+				// H5鐜锛氫娇鐢ㄦ祻瑙堝櫒涓嬭浇
+				this.downloadFileInBrowser(url, fileName);
+				// #endif
+				
+				// #ifdef APP-PLUS
+				// APP鐜锛氫娇鐢╱ni.downloadFile
+				this.downloadFileInApp(url, fileName);
+				// #endif
+				
+				// #ifdef MP
+				// 灏忕▼搴忕幆澧冿細浣跨敤uni.downloadFile
+				this.downloadFileInApp(url, fileName);
+				// #endif
+			},
+			
+			// 鍦ㄦ祻瑙堝櫒涓笅杞芥枃浠�
+			downloadFileInBrowser(url, fileName) {
+				uni.showLoading({ title: '姝e湪鍑嗗涓嬭浇...' });
+				
+				// 鏂规硶1锛氬垱寤洪殣钘忕殑a鏍囩涓嬭浇
+				try {
+					const link = document.createElement('a');
+					link.href = url;
+					link.download = fileName;
+					link.style.display = 'none';
+					document.body.appendChild(link);
+					link.click();
+					document.body.removeChild(link);
+					
+					uni.hideLoading();
+					uni.showToast({ 
+						title: '涓嬭浇宸插紑濮�', 
+						icon: 'success',
+						duration: 2000
+					});
+				} catch (error) {
+					console.log('a鏍囩涓嬭浇澶辫触锛屽皾璇晈indow.open鏂瑰紡:', error);
+					// 鏂规硶2锛氫娇鐢╳indow.open
+					try {
+						window.open(url, '_blank');
+						uni.hideLoading();
+						uni.showToast({ 
+							title: '涓嬭浇宸插紑濮�', 
+							icon: 'success',
+							duration: 2000
+						});
+					} catch (error2) {
+						console.log('window.open涓嬭浇澶辫触锛屽皾璇昮etch鏂瑰紡:', error2);
+						// 鏂规硶3锛氫娇鐢╢etch涓嬭浇
+						this.downloadFileWithFetch(url, fileName);
+					}
+				}
+			},
+			
+			// 浣跨敤fetch涓嬭浇鏂囦欢
+			downloadFileWithFetch(url, fileName) {
+				fetch(url)
+					.then(response => {
+						if (!response.ok) {
+							throw new Error(`HTTP error! status: ${response.status}`);
+						}
+						return response.blob();
+					})
+					.then(blob => {
+						// 鍒涘缓blob URL
+						const blobUrl = window.URL.createObjectURL(blob);
+						
+						// 鍒涘缓涓嬭浇閾炬帴
+						const link = document.createElement('a');
+						link.href = blobUrl;
+						link.download = fileName;
+						link.style.display = 'none';
+						document.body.appendChild(link);
+						link.click();
+						document.body.removeChild(link);
+						
+						// 閲婃斁blob URL
+						window.URL.revokeObjectURL(blobUrl);
+						
+						uni.hideLoading();
+						uni.showToast({ 
+							title: '涓嬭浇鎴愬姛', 
+							icon: 'success',
+							duration: 2000
+						});
+					})
+					.catch(error => {
+						console.error('Fetch涓嬭浇澶辫触:', error);
+						uni.hideLoading();
+						if (error.message.includes('404')) {
+							uni.showModal({ 
+								title: '鏂囦欢涓嶅瓨鍦�', 
+								content: `璇ラ檮浠跺湪FTP鏈嶅姟鍣ㄤ笂涓嶅瓨鍦╜,
+								showCancel: false 
+							});
+						} else {
+							uni.showModal({ 
+								title: '涓嬭浇澶辫触', 
+								content: `涓嬭浇澶辫触: ${error.message}`,
+								showCancel: false 
+							});
+						}
+					});
+			},
+			
+			// 鍦ˋPP涓笅杞芥枃浠�
+			downloadFileInApp(url, fileName) {
+				// #ifdef APP-PLUS
+				uni.showLoading({ title: '浠嶧TP鏈嶅姟鍣ㄤ笅杞戒腑...' });
+				
+				// Android 鑾峰彇瀛樺偍璺緞
+				const saveDir = plus.os.name === 'Android' ? plus.io.convertLocalFileSystemURL('_downloads/') : plus.io.convertLocalFileSystemURL('_documents/');
+				const filePath = `${saveDir}${fileName}`;
+				
+				const downloadTask = uni.downloadFile({
+					url: url,
+					filePath: filePath, // 鎸囧畾淇濆瓨璺緞
+					success: (res) => {
+						uni.hideLoading();
+						if (res.statusCode === 200) {
+							const fileInfo = {
+								name: fileName,
+								path: res.filePath || filePath,
+								tempPath: res.tempFilePath
+							};
+							
+							uni.showModal({
+								title: '涓嬭浇鎴愬姛',
+								content: `鏂囦欢宸蹭繚瀛樺埌锛�${fileInfo.path}`,
+								showCancel: true,
+								confirmText: '鎵撳紑鏂囦欢',
+								cancelText: '纭畾',
+								success: (modalRes) => {
+									if (modalRes.confirm) {
+										// 鐢ㄦ埛閫夋嫨鎵撳紑鏂囦欢
+										this.openFileInApp(fileInfo);
+									}
+								}
+							});
+						} else if (res.statusCode === 404) {
+							uni.showModal({ 
+								title: '鏂囦欢涓嶅瓨鍦�', 
+								content: `璇ラ檮浠跺湪FTP鏈嶅姟鍣ㄤ笂涓嶅瓨鍦╜,
+								showCancel: false 
+							});
+						} else {
+							uni.showModal({ 
+								title: '涓嬭浇澶辫触', 
+								content: `鐘舵�佺爜锛�${res.statusCode}`,
+								showCancel: false 
+							});
+						}
+					},
+					fail: (error) => {
+						uni.hideLoading();
+						console.error('涓嬭浇澶辫触:', error);
+						uni.showModal({ 
+							title: '涓嬭浇澶辫触', 
+							content: `缃戠粶閿欒锛�${error.errMsg}`,
+							showCancel: false 
+						});
+					}
+				});
+				
+				// 鐩戝惉涓嬭浇杩涘害
+				downloadTask.onProgressUpdate((res) => {
+					const progress = Math.round(res.progress);
+					uni.showLoading({ 
+						title: `涓嬭浇涓� ${progress}%`,
+						mask: true 
+					});
+				});
+				// #endif
+				
+				// #ifdef MP
+				// 灏忕▼搴忕幆澧冪殑绠�鍖栧疄鐜�
+				uni.showLoading({ title: '涓嬭浇涓�...' });
+				uni.downloadFile({
+					url: url,
+					success: (res) => {
+						uni.hideLoading();
+						if (res.statusCode === 200) {
+							uni.showToast({ title: '涓嬭浇瀹屾垚', icon: 'success' });
+						}
+					},
+					fail: (error) => {
+						uni.hideLoading();
+						uni.showModal({ title: '涓嬭浇澶辫触', content: error.errMsg, showCancel: false });
+					}
+				});
+				// #endif
+			},
+			
+			// APP涓墦寮�鏂囦欢
+			openFileInApp(fileInfo) {
+				// #ifdef APP-PLUS
+				if (typeof plus !== 'undefined') {
+					const filePath = fileInfo.path || fileInfo.tempPath;
+					
+					// 灏濊瘯鎵撳紑鏂囦欢
+					plus.runtime.openFile(filePath, {}, (error) => {
+						console.error('鎵撳紑鏂囦欢澶辫触:', error);
+						uni.showModal({
+							title: '鏃犳硶鎵撳紑',
+							content: '绯荤粺涓病鏈夋壘鍒拌兘鎵撳紑姝ゆ枃浠剁殑搴旂敤绋嬪簭',
+							showCancel: false
+						});
+					});
+				}
+				// #endif
+			},
+
 		}
 	}
 </script>
@@ -995,9 +1867,11 @@
 		font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
 		max-width: 1000px;
 		margin: 0 auto;
-		padding: 20px;
+		padding: 20px 20px 160px 20px; /* 搴曢儴澧炲姞padding涓哄浐瀹氭寜閽暀绌洪棿 */
 		background-color: #fff;
 		box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+		min-height: 100vh;
+		position: relative;
 	}
 
 	/* 澶撮儴鏍峰紡 */
@@ -1078,12 +1952,9 @@
 	}
 
 	.sysLike {
-		color: #3498db;
+		color: #1890ff;
 		text-decoration: none;
-		margin-left: 15px;
-		padding: 3px 8px;
-		border-radius: 3px;
-		font-size: 12px;
+		cursor: pointer;
 	}
 
 	.doc-link:hover {
@@ -1121,16 +1992,87 @@
 		background-color: #f1f5f9;
 	}
 
-	/* 鎸夐挳鏍峰紡 */
-	.action-buttons {
+	/* 鍥哄畾搴曢儴鎸夐挳鏍峰紡 */
+	.fixed-action-buttons {
+		position: fixed;
+		bottom: 0;
+		left: 0;
+		right: 0;
+		background-color: #fff;
+		box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
+		padding: 10px 15px 20px 15px;
+		z-index: 100;
 		display: flex;
-		justify-content: flex-end;
-		gap: 10px;
-		margin-top: 20px;
+		flex-direction: column;
+		gap: 8px;
+		max-height: 150px;
+		overflow-y: auto;
 	}
 
-	.primary-btn,
+	.action-btn {
+		background-color: #ecf0f1;
+		color: #34495e;
+		padding: 12px 15px;
+		border: none;
+		border-radius: 6px;
+		cursor: pointer;
+		font-size: 14px;
+		font-weight: 500;
+		transition: all 0.3s ease;
+		text-align: center;
+		min-height: 44px;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+
+	.action-btn:hover {
+		background-color: #d5dbdb;
+		transform: translateY(-1px);
+	}
+
+	.action-btn.primary {
+		background-color: #3498db;
+		color: #fff;
+	}
+
+	.action-btn.primary:hover {
+		background-color: #2980b9;
+	}
+
+	/* 鍐呭鍖呰鍣紝涓哄簳閮ㄦ寜閽暀鍑虹┖闂� */
+	.content-wrapper {
+		height: 20px; /* 棰濆鐨勭┖鐧藉尯鍩� */
+	}
+
+	/* 鍘熸湁鎸夐挳鏍峰紡淇濇寔鍏煎 */
+	.action-buttons {
+		display: flex;
+		gap: 10px;
+		margin: 15px 0;
+		justify-content: flex-end;
+	}
+
 	.secondary-btn {
+		background-color: #ecf0f1;
+		color: #7f8c8d;
+		padding: 8px 15px;
+		border: none;
+		border-radius: 4px;
+		cursor: pointer;
+	}
+
+	.secondary-btn:hover {
+		background-color: #d5dbdb;
+	}
+
+	.secondary-btn:disabled {
+		background-color: #d9d9d9;
+		cursor: not-allowed;
+		opacity: 0.7;
+	}
+
+	.primary-btn {
 		padding: 10px 20px;
 		border: none;
 		border-radius: 4px;
@@ -1139,22 +2081,8 @@
 		transition: all 0.3s;
 	}
 
-	.primary-btn {
-		background-color: #3498db;
-		color: white;
-	}
-
 	.primary-btn:hover {
 		background-color: #2980b9;
-	}
-
-	.secondary-btn {
-		background-color: #ecf0f1;
-		color: #7f8c8d;
-	}
-
-	.secondary-btn:hover {
-		background-color: #d5dbdb;
 	}
 
 	.record-btn {
@@ -1226,59 +2154,334 @@
 		display: flex;
 		justify-content: center;
 		align-items: center;
-		z-index: 10;
+		z-index: 1000; /* 鎻愰珮灞傜骇锛岀‘淇濆湪鍥哄畾鎸夐挳涓婃柟 */
 	}
 
-	.popup {
-		background-color: #fff;
-		padding: 20px;
-		border: 1px solid #ccc;
-		box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
-		width: 68vw;
-		/* 璁剧疆瀹藉害涓鸿鍙e搴︾殑80% */
-		height: 25vh;
-		/* 璁剧疆楂樺害涓鸿鍙i珮搴︾殑80% */
+	/* 寮圭獥鏁翠綋缇庡寲 */
+	.popup, .attachment-detail-popup {
+		background: #fff;
+		border-radius: 16px;
+		box-shadow: 0 8px 32px rgba(60,60,60,0.18);
+		padding: 28px 28px 18px 28px;
+		border: none;
+		position: relative;
+		min-width: 260px;
+		z-index: 1001; /* 纭繚寮圭獥鍐呭鍦ㄦ渶涓婂眰 */
+		max-height: 80vh; /* 闄愬埗鏈�澶ч珮搴︼紝閬垮厤琚簳閮ㄦ寜閽伄鎸� */
+		overflow-y: auto; /* 鍐呭杩囧鏃跺彲婊氬姩 */
 	}
-
-	.form-group {
+	.attachment-popup-title {
+		font-size: 22px;
+		font-weight: 700;
+		color: #222;
+		margin-bottom: 8px;
+		letter-spacing: 1px;
+		text-align: center;
+	}
+	.attachment-popup-divider {
+		height: 1px;
+		background: linear-gradient(90deg,#e0e7ef 0%,#f5f7fa 100%);
+		margin-bottom: 18px;
+	}
+	.attachment-detail-content {
+		margin-bottom: 18px;
+	}
+	.attachment-detail-row {
 		display: flex;
 		align-items: center;
-		border-bottom: 1px solid #c9c9c9;
+		margin-bottom: 8px;
+		font-size: 15px;
 	}
-
-	.updateBut {
-		background-color: #3498db;
+	.attachment-label {
+		min-width: 80px;
+		color: #1976d2;
+		font-weight: 500;
+		margin-right: 8px;
+	}
+	.attachment-preview-area {
+		margin: 18px 0 8px 0;
+		border-radius: 10px;
+		background: #f8fafc;
+		padding: 10px;
+		box-shadow: 0 2px 8px rgba(60,60,60,0.06);
+	}
+	.attachment-download-area {
+		margin: 18px 0 8px 0;
+		text-align: center;
+	}
+	.attachment-download-link {
+		display: inline-block;
+		padding: 7px 18px;
+		background: linear-gradient(90deg,#4f8cff 0%,#1976d2 100%);
+		color: #fff;
+		border-radius: 6px;
+		font-weight: 500;
+		text-decoration: none;
+		transition: background 0.2s;
+		box-shadow: 0 2px 8px rgba(60,60,60,0.08);
+	}
+	.attachment-download-link:hover {
+		background: linear-gradient(90deg,#1976d2 0%,#4f8cff 100%);
+	}
+	.attachment-detail-empty {
+		color: #888;
+		text-align: center;
+		margin: 30px 0;
+		font-size: 16px;
+	}
+	.attachment-popup-close {
+		margin-top: 18px;
+		width: 100%;
+		background: linear-gradient(90deg,#e0e0e0 0%,#f5f7fa 100%);
+		color: #444;
+		border-radius: 8px;
+		font-size: 16px;
+		padding: 10px 0;
+		border: none;
+		font-weight: 600;
+		letter-spacing: 1px;
+		transition: background 0.2s, color 0.2s;
+		box-shadow: 0 2px 8px rgba(60,60,60,0.06);
+	}
+	.attachment-popup-close:hover {
+		background: linear-gradient(90deg,#bdbdbd 0%,#e0e0e0 100%);
+		color: #1976d2;
+	}
+	
+	/* 闄勪欢璇︽儏椤甸潰鐨勬搷浣滄寜閽� */
+	.attachment-actions-detail {
+		margin: 20px 0;
+		display: flex;
+		gap: 12px;
+		justify-content: center;
+		flex-wrap: wrap;
+	}
+	.attachment-action-btn {
+		padding: 10px 20px;
+		border: none;
+		border-radius: 8px;
+		font-size: 14px;
+		font-weight: 600;
+		cursor: pointer;
+		transition: all 0.3s ease;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		min-width: 120px;
+		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+	}
+	.attachment-action-btn.preview-btn {
+		background: linear-gradient(135deg, #4CAF50, #45a049);
 		color: white;
 	}
-
-	/* 鍝嶅簲寮忚璁� */
-	@media (max-width: 500px) {
-
-		.info-row,
-		.info-block {
-			flex-direction: column;
-			align-items: flex-start;
-		}
-
-		.doc-links {
-			margin-left: 0;
-			margin-top: 10px;
-		}
-
-		.action-buttons {
-			flex-direction: column;
-		}
-
-		.inspection-table table {
-			display: block;
-			overflow-x: auto;
-		}
-
-		.click-wd {
-			color: #056cba;
-			font-size: 1.25rem;
-			text-decoration: underline;
-		}
-
+	.attachment-action-btn.preview-btn:hover {
+		background: linear-gradient(135deg, #45a049, #3d8b40);
+		transform: translateY(-1px);
+		box-shadow: 0 4px 8px rgba(0,0,0,0.15);
+	}
+	.attachment-action-btn.download-btn {
+		background: linear-gradient(135deg, #2196F3, #1976D2);
+		color: white;
+	}
+	.attachment-action-btn.download-btn:hover {
+		background: linear-gradient(135deg, #1976D2, #1565C0);
+		transform: translateY(-1px);
+		box-shadow: 0 4px 8px rgba(0,0,0,0.15);
+	}
+	
+	/* 鏂囦欢棰勮寮圭獥鏍峰紡 */
+	.file-preview-popup {
+		width: 80vw;
+		max-width: 600px;
+		max-height: 70vh;
+		display: flex;
+		flex-direction: column;
+	}
+	
+	/* APP鐜閫傞厤 */
+	/* #ifdef APP-PLUS */
+	.file-preview-popup {
+		width: 85vw;
+		max-height: 75vh;
+	}
+	.file-preview-content {
+		max-height: 350px;
+	}
+	/* #endif */
+	.file-preview-title {
+		font-size: 18px;
+		font-weight: 700;
+		color: #222;
+		margin-bottom: 8px;
+		text-align: center;
+		word-break: break-all;
+	}
+	.file-preview-divider {
+		height: 1px;
+		background: linear-gradient(90deg,#e0e7ef 0%,#f5f7fa 100%);
+		margin-bottom: 16px;
+	}
+	.file-preview-content {
+		flex: 1;
+		max-height: 400px;
+		overflow-y: auto;
+		background: #f8fafc;
+		border-radius: 8px;
+		padding: 16px;
+		margin-bottom: 16px;
+		border: 1px solid #e2e8f0;
+	}
+	.file-preview-content pre {
+		font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
+		font-size: 12px;
+		line-height: 1.5;
+		color: #2d3748;
+		white-space: pre-wrap;
+		word-wrap: break-word;
+		margin: 0;
+	}
+	
+	/* 鍥剧墖棰勮鏍峰紡 */
+	.image-preview-container {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		min-height: 200px;
+	}
+	
+	/* 涓嶆敮鎸佹枃浠剁被鍨嬬殑鎻愮ず鏍峰紡 */
+	.unsupported-preview {
+		text-align: center;
+		padding: 40px 20px;
+		color: #666;
+	}
+	.unsupported-icon {
+		font-size: 48px;
+		margin-bottom: 16px;
+	}
+	.unsupported-text {
+		font-size: 16px;
+		font-weight: 600;
+		color: #333;
+		margin-bottom: 8px;
+	}
+	.unsupported-hint {
+		font-size: 14px;
+		color: #999;
+		line-height: 1.4;
+	}
+	
+	.file-preview-actions {
+		display: flex;
+		gap: 12px;
+		justify-content: center;
+	}
+	.file-preview-btn {
+		padding: 8px 20px;
+		border: none;
+		border-radius: 6px;
+		font-size: 14px;
+		font-weight: 600;
+		cursor: pointer;
+		transition: all 0.3s ease;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		min-width: 120px;
+	}
+	.file-preview-btn.download-btn {
+		background: linear-gradient(135deg, #2196F3, #1976D2);
+		color: white;
+	}
+	.file-preview-btn.download-btn:hover {
+		background: linear-gradient(135deg, #1976D2, #1565C0);
+		transform: translateY(-1px);
+	}
+	.file-preview-btn.close-btn {
+		background: linear-gradient(135deg, #e0e0e0, #bdbdbd);
+		color: #444;
+	}
+	.file-preview-btn.close-btn:hover {
+		background: linear-gradient(135deg, #bdbdbd, #9e9e9e);
+		transform: translateY(-1px);
+	}
+	/* 鍒楄〃寮圭獥缇庡寲锛堜繚鐣欏師鏈夛級 */
+	.attachment-list {
+		padding: 0;
+		margin: 0;
+		list-style: none;
+		max-height: 300px;
+		overflow-y: auto;
+	}
+	.attachment-list li {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 12px 0;
+		border-bottom: 1px solid #f0f0f0;
+	}
+	.attachment-info {
+		flex: 1;
+		margin-right: 10px;
+	}
+	.attachment-name {
+		color: #3498db;
+		cursor: pointer;
+		font-weight: 500;
+		transition: color 0.2s;
+		display: block;
+		margin-bottom: 4px;
+	}
+	.attachment-name:hover {
+		color: #217dbb;
+		text-decoration: underline;
+	}
+	.attachment-meta {
+		font-size: 12px;
+	}
+	.attachment-type {
+		color: #7f8c8d;
+		font-style: italic;
+	}
+	.attachment-actions {
+		display: flex;
+		gap: 8px;
+		flex-shrink: 0;
+	}
+	.attachment-list .secondary-btn {
+		padding: 4px 10px;
+		font-size: 13px;
+		border-radius: 3px;
+		background: #f5f7fa;
+		color: #333;
+		border: 1px solid #dbe2ea;
+		transition: background 0.2s, color 0.2s;
+	}
+	.attachment-list .secondary-btn:hover {
+		background: #e6f0fa;
+		color: #1976d2;
+	}
+	.preview-btn {
+		background: #e8f5e8 !important;
+		color: #2e7d2e !important;
+		border-color: #a5d6a5 !important;
+	}
+	.preview-btn:hover {
+		background: #d4eecc !important;
+		color: #1e5f1e !important;
+	}
+	.attachment-popup-close {
+		margin-top: 18px;
+		width: 100%;
+		background: #e0e0e0;
+		color: #444;
+		border-radius: 4px;
+		font-size: 15px;
+		padding: 8px 0;
+		border: none;
+		transition: background 0.2s;
+	}
+	.attachment-popup-close:hover {
+		background: #bdbdbd;
 	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3