From 27294f1626cdb785fe4c7401dde3266db188ccf4 Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期四, 07 八月 2025 21:42:44 +0800
Subject: [PATCH] 来料检修改,附件图片放大

---
 pages/QC/LLJ/Add.vue |  187 ++++++++++++++++++++++++++++++++--------------
 1 files changed, 129 insertions(+), 58 deletions(-)

diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue
index eb106b4..45778cf 100644
--- a/pages/QC/LLJ/Add.vue
+++ b/pages/QC/LLJ/Add.vue
@@ -72,6 +72,7 @@
 				<option value="瑁呴厤涓嶈壇">瑁呴厤涓嶈壇</option>
 				<option value="瀹夎涓嶈壇">瀹夎涓嶈壇</option>
 			</select>
+			<view v-else class="info-value">{{ badreason }}</view>
 		</view>
 		<view class="dropdown-row">
 			<view class="info-label">鎵�灞炶溅闂达細</view>
@@ -82,6 +83,7 @@
 				<option value="娉ㄥ杞﹂棿">娉ㄥ杞﹂棿</option>
 				<option value="鍏朵粬">鍏朵粬</option>
 			</select>
+			<view v-else class="info-value">{{ WORKSHOP }}</view>
 		</view>
 		<view class="dropdown-row">
 			<view class="info-label">璇勫鐘舵�侊細</view>
@@ -91,8 +93,8 @@
 				<option value="鎸戦��/杩斿伐浣跨敤">鎸戦��/杩斿伐浣跨敤</option>
 				<option value="閫�璐�">閫�璐�</option>
 				<option value="寰呭垽">寰呭垽</option>
-
 			</select>
+			<view v-else class="info-value">{{ PSTYPE }}</view>
 		</view>
 					<view class="info-block" style="margin-top: 10px;">   
 		    <view class="info-label">澶囨敞锛�</view>
@@ -282,7 +284,14 @@
 					
 					<!-- 鍥剧墖鍐呭棰勮 -->
 					<view v-else-if="previewType === 'image'" class="image-preview-container">
-						<image :src="previewContent" mode="widthFix" style="width: 100%; max-height: 400px;"></image>
+						<image 
+							:src="previewContent" 
+							mode="aspectFit" 
+							class="preview-image-clickable"
+							@click="previewImageInPopup"
+							style="width: 100%; max-height: 400px; cursor: pointer;"
+						/>
+						<div class="image-zoom-hint">鐐瑰嚮鍥剧墖鍙斁澶ф煡鐪�</div>
 					</view>
 					
 					<!-- Excel 绛� Office 鏂囦欢鎻愮ず -->
@@ -482,7 +491,8 @@
 			addDefectDescription() {
 				// 娣诲姞涓嶈壇鎻忚堪鐨勯�昏緫
 				this.remarksPopup = !this.remarksPopup;
-				this.remarks = this.formData.remarks;
+				this.remarks = this.formData.remarks || this.remarks || '';
+				console.log('鎵撳紑寮圭獥鏃剁殑remarks鍊�:', this.remarks);
 			},
 			submitInspection() {
 				if (this.PSTYPE == '') {
@@ -561,7 +571,7 @@
 								console.log("瀹屾暣鐨勬彁浜ゆ暟鎹細", this.QcIssueResultDetailes);
 
 								const url = this.$store.state.serverInfo.serverAPI+`/QcIssueResult/GetProcessNo`;
-								if (this.PSTYPE === '鐗归噰/璁╂浣跨敤') {// 鍙戦�� POST 璇锋眰
+								if (this.PSTYPE === '寰呭垽') {// 鍙戦�� POST 璇锋眰
 								uni.request({
 									url: url, // 璇锋眰鍦板潃
 									method: 'POST', // 璇锋眰鏂规硶
@@ -678,14 +688,18 @@
 							...data,
 							emergencyStatus: data.emergency === 1 || data.emergency === "1" || data.emergency === true
 						};
+						// 鍏抽敭锛氳祴鍊煎埌椤甸潰缁戝畾鍙橀噺
+						this.badreason = data.blyy || '';
+						this.PSTYPE = data.pszt || '';
+						this.WORKSHOP = data.sscj || '';
+						this.remarks = data.remarks || ''; // 璁剧疆remarks鍙橀噺
+
 						
 						// 纭繚PHSY瀛楁琚纭缃�
 						this.formData.PHSY = data.PHSY;
+						this.PHSY = data.PHSY || ''; // 鍚屾椂璁剧疆椤甸潰缁戝畾鐨凱HSY鍙橀噺
 						
 						console.log("鍔犺浇鐨勭揣鎬ユ斁琛岀姸鎬�:", this.formData.emergencyStatus);
-						this.badreason = data.blyy;
-						this.PSTYPE = data.pszt;
-						this.WORKSHOP = data.sscj;
 						this.$post({
 							url: "/LLJ/getJYItem",
 							data: {
@@ -737,27 +751,7 @@
 					url: 'SysSubmitFrom?releaseNo=' + releaseNo + '&userID=' + this.$loginInfo.account
 				});
 			},
-			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);
-					}
-				})
-			},
+
 
 			drawingConfirm() {
 				this.drawingShow = false
@@ -1240,14 +1234,12 @@
 			            });
 			        },
 					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) {
@@ -1267,10 +1259,8 @@
 				this.isInteger = true;
 			},
 			editDestruction() {
-				// 楠岃瘉杈撳叆鏄惁涓烘暣鏁�
 				if(this.PHSY === '') {
 					this.isInteger = true;
-					// 濡傛灉涓虹┖锛屼紶閫掔┖瀛楃涓诧紝鍚庣浼氬鐞嗕负null
 				} else {
 					const isInteger = /^-?\d+$/.test(this.PHSY);
 					this.isInteger = isInteger;
@@ -1278,19 +1268,16 @@
 						return;
 					}
 				}
-				
-				// 淇濆瓨鐮村潖瀹為獙鏁伴噺
+			
 				this.$post({
-					url: "/LLJ/saveRemarksGid",
+					url: "/LLJ/savePhsyGid",
 					data: {
 						gid: this.formData.id,
 						releaseNo: this.formData.releaseNo,
-						PHSY: this.PHSY // 鍙互鏄┖瀛楃涓叉垨鏈夋晥鏁存暟
-						// 涓嶅啀鍖呭惈remarks瀛楁
+						PHSY: this.PHSY
 					}
 				}).then(res => {
 					if (res.data.tbBillList > 0) {
-						// 濡傛灉杈撳叆涓虹┖锛岃缃负null浠ヤ究涓嶆樉绀�
 						this.formData.PHSY = this.PHSY === '' ? null : this.PHSY;
 						this.destructionPopup = false;
 						this.$showMessage("淇濆瓨鎴愬姛");
@@ -1301,18 +1288,17 @@
 				})
 			},
 			clearDestruction() {
-				// 娓呴櫎鐮村潖瀹為獙鏁伴噺
 				this.PHSY = '';
 				this.$post({
-					url: "/LLJ/saveRemarksGid",
+					url: "/LLJ/savePhsyGid",
 					data: {
 						gid: this.formData.id,
 						releaseNo: this.formData.releaseNo,
-						PHSY: '' // 绌哄瓧绗︿覆锛屽悗绔細澶勭悊涓簄ull
+						PHSY: ''
 					}
 				}).then(res => {
 					if (res.data.tbBillList > 0) {
-						this.formData.PHSY = null; // 纭繚鍓嶇涔熶负null锛屼笉鏄剧ず
+						this.formData.PHSY = null;
 						this.destructionPopup = false;
 						this.$showMessage("娓呴櫎鎴愬姛");
 						setTimeout(() => {
@@ -1548,6 +1534,36 @@
 				const item = { fattach: this.previewTitle, itemNo: this.previewItemNo };
 				this.downloadAttachment(item);
 				this.closeFilePreview();
+			},
+			
+			// 鍦ㄥ脊绐椾腑棰勮鍥剧墖锛堟斁澶у姛鑳斤級
+			previewImageInPopup() {
+				// 浣跨敤uni.previewImage API瀹炵幇鍥剧墖鏀惧ぇ棰勮
+				uni.previewImage({
+					current: this.previewContent, // 褰撳墠鏄剧ず鍥剧墖鐨勯摼鎺�
+					urls: [this.previewContent], // 闇�瑕侀瑙堢殑鍥剧墖閾炬帴鍒楄〃
+					loop: false, // 鏄惁寮�鍚浘鐗囪疆鎾�
+					indicator: 'default', // 鍥剧墖鎸囩ず鍣ㄧ被鍨�
+					longPressActions: {
+						itemList: ['鍙戦�佺粰鏈嬪弸', '淇濆瓨鍥剧墖', '鏀惰棌'],
+						success: function (data) {
+							console.log('閫変腑浜嗙' + (data.tapIndex + 1) + '涓寜閽�');
+						},
+						fail: function (err) {
+							console.log(err.errMsg);
+						}
+					},
+					success: () => {
+						console.log('鍥剧墖棰勮鎴愬姛');
+					},
+					fail: (err) => {
+						console.error('鍥剧墖棰勮澶辫触:', err);
+						uni.showToast({
+							title: '鍥剧墖棰勮澶辫触',
+							icon: 'none'
+						});
+					}
+				});
 			},
 			
 			// 棰勮Office鏂囦欢
@@ -1858,13 +1874,13 @@
 			},
 			saveRemarksGid() {
 			  this.$post({
-				url: "/LLJ/saveRemarksGid",
+				url: "/LLJ/saveDropdownFields",
 				data: {
 				  gid: this.formData.id,
 				  releaseNo: this.formData.releaseNo,
-				  BLYY: this.badreason,
-				  SSCJ: this.WORKSHOP,
-				  PSZT: this.PSTYPE
+				  BLYY: this.badreason || '',
+				  SSCJ: this.WORKSHOP || '',
+				  PSZT: this.PSTYPE || ''
 				}
 			  }).then(res => {
 				if (res.data.tbBillList > 0) {
@@ -1882,7 +1898,7 @@
 		font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
 		max-width: 1000px;
 		margin: 0 auto;
-		padding: 20px;
+		padding: 20px 20px 100px 20px; /* 搴曢儴澧炲姞鍐呰竟璺濅负鍥哄畾鎸夐挳鐣欑┖闂� */
 		background-color: #fff;
 		box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
 		min-height: 100vh;
@@ -2022,11 +2038,19 @@
 	/* 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖烘牱寮� */
 .bottom-action-buttons {
 	display: flex;
-	justify-content: flex-end;
-	gap: 10px;
-	margin: 20px 0;
-	padding: 10px;
+	justify-content: center;
+	gap: 8px;
+	padding: 12px;
 	flex-wrap: wrap;
+	align-items: center;
+	position: fixed; /* 鍥哄畾鍦ㄥ睆骞曞簳閮� */
+	bottom: 0; /* 璺濈搴曢儴0px */
+	left: 0; /* 璺濈宸﹁竟0px */
+	right: 0; /* 璺濈鍙宠竟0px */
+	background-color: #fff; /* 鑳屾櫙鑹� */
+	border-top: 1px solid #e9ecef; /* 椤堕儴杈规 */
+	z-index: 1000; /* 纭繚鍦ㄦ渶涓婂眰 */
+	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* 椤堕儴闃村奖 */
 }
 
 	.action-btn {
@@ -2062,9 +2086,14 @@
 
 	/* 灏忓昂瀵告寜閽牱寮� */
 	.action-btn.small {
-		padding: 8px 12px;
-		font-size: 12px;
-		min-height: 36px;
+		padding: 10px 12px;
+		font-size: 14px;
+		min-height: 44px;
+		white-space: nowrap;
+		flex-shrink: 0;
+		min-width: 80px;
+		max-width: 120px;
+		flex: 1;
 	}
 
 	/* 鍘熸湁鎸夐挳鏍峰紡淇濇寔鍏煎 */
@@ -2527,12 +2556,27 @@
 		}
 
 		.bottom-action-buttons {
-			flex-direction: column;
-			align-items: stretch;
+			flex-direction: row;
+			align-items: center;
+			justify-content: center;
+			padding: 8px;
+			gap: 6px;
+			position: fixed; /* 淇濇寔鍥哄畾鍦ㄥ睆骞曞簳閮� */
+			bottom: 0;
+			left: 0;
+			right: 0;
+			background-color: #fff;
+			border-top: 1px solid #e9ecef;
+			z-index: 1000;
+			box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
 		}
 
-		.action-btn {
-			width: 100%;
+		.action-btn.small {
+			min-width: 70px;
+			max-width: 100px;
+			padding: 8px 10px;
+			font-size: 13px;
+			min-height: 40px;
 		}
 
 		.inspection-table table {
@@ -2540,4 +2584,31 @@
 			overflow-x: auto;
 		}
 	}
+	
+	/* 鍥剧墖鏀惧ぇ棰勮鐩稿叧鏍峰紡 */
+	.preview-image-clickable {
+		transition: transform 0.2s ease;
+		border-radius: 8px;
+		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+	}
+	
+	.preview-image-clickable:hover {
+		transform: scale(1.02);
+		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
+	}
+	
+	.image-zoom-hint {
+		text-align: center;
+		margin-top: 8px;
+		font-size: 12px;
+		color: #666;
+		font-style: italic;
+	}
+	
+	.image-preview-container {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3