From 676db89a661ba8af8da04f4503c39b1bc0d2c25e Mon Sep 17 00:00:00 2001
From: xwt <2740516069@qq.com>
Date: 星期二, 10 六月 2025 16:11:04 +0800
Subject: [PATCH] bug修改

---
 pages/QC/LLJ/Add.vue |  292 ++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 244 insertions(+), 48 deletions(-)

diff --git a/pages/QC/LLJ/Add.vue b/pages/QC/LLJ/Add.vue
index b558a5a..3d0778d 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,33 @@
 
 			</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>
+		            <button class="secondary-btn" @click="handleEmergencyRelease">绱ф�ユ斁琛�</button>
+		            <button class="secondary-btn" @click="handleWithdraw">鎾ゅ洖</button>
+		            <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button>
 		</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,6 +137,7 @@
 							<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>
@@ -155,7 +164,8 @@
 				<button @click="remarksPopup = !remarksPopup">鍙栨秷</button>
 			</view>
 		</view>
-
+		
+		
 		<view class="barcode">
 			<u-modal :show="drawingShow" title="鍥剧焊鏄庣粏" @confirm="drawingConfirm" @cancel="drawingCancel"
 				showCancelButton>
@@ -183,8 +193,8 @@
 				</uni-table>
 			</u-modal>
 		</view>
-
 	</view>
+	
 </template>
 
 <script>
@@ -207,10 +217,19 @@
 					planQty: "",
 					mocode: "",
 					boardStyle: "",
-					itemId: ""
+					itemId: "",
+					emergencyStatus: false,
+					lotNo1: '', 
+					emergency:'',
+					permissionModalVisible: false,
+					permissionAccount: '',
+					hasEmergencyPermission: false,
+					showPopup: false,
+					
 				},
 				tableData: [],
 				remarksPopup: false,
+				meomPopup: false,
 				current: true,
 				drawing: [],
 				drawingShow: false,
@@ -220,18 +239,25 @@
 				REMARK: '',
 				checkState: false,
 				writeStatu: true,
-				fileName:''
+				fileName:'',
+				originalRemarks: '',
+				hasEmergencyPermission: false,
+				
 			}
 		},
 		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 +280,7 @@
 				});
 
 			}
+			 if (this.$loginInfo.account === 'PL017') {this.hasEmergencyPermission = true;}
 
 		},
 		methods: {
@@ -306,6 +333,7 @@
 					}
 				});
 			},
+			
 			fillRecord(item, index) {
 				// 濉啓璁板綍鐨勯�昏緫
 				uni.navigateTo({
@@ -346,7 +374,7 @@
 
 					if (this.formData.fngDesc == '' || this.writeStatu == false) {
 						uni.showToast({
-							title: '鏈~鍐欎笉鑹弿杩版垨涓変釜閫夋嫨妗嗘湭閫夋嫨瀹�',
+							title: '鏈~鍐欎笉鑹弿杩版垨涓嶈壇鍘熷洜鎴栨墍灞炶溅闂存垨璇勫鐘舵��',
 							icon: 'none'
 						});
 					} else {
@@ -397,7 +425,7 @@
 
 								console.log(this.QcIssueResultDetailes)
 
-								const url = `http://192.168.1.22:10054/api/QcIssueResult/GetProcessNo`;
+								const url = this.$store.state.serverInfo.serverAPI+`/QcIssueResult/GetProcessNo`;
 								// 鍙戦�� POST 璇锋眰
 								uni.request({
 									url: url, // 璇锋眰鍦板潃
@@ -508,7 +536,10 @@
 				}).then(res => {
 					let data = res.data.tbBillList[0];
 					if (data) {
-						this.formData = data;
+						this.formData = {
+							...data,
+							emergencyStatus: data.emergency
+						};
 
 						this.$post({
 							url: "/LLJ/getJYItem",
@@ -520,9 +551,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;
@@ -632,22 +663,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 +713,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 +1017,169 @@
 				// 		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;
+			                                    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;
+			                                    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() {
+					            if (this.remarks) {
+					                // 鍙繚瀛樹慨鏀圭殑閮ㄥ垎
+					                const modifiedRemarks = this.remarks !== this.originalRemarks ? this.remarks : '';
+					
+					                this.$post({
+					                    url: "/LLJ/saveRemarksGid",
+					                    data: {
+					                        gid: this.formData.id,
+					                        remarks: modifiedRemarks,
+					                        releaseNo: this.formData.releaseNo,
+					                    }
+					                }).then(res => {
+					                    if (res.data.tbBillList > 0) {
+					                        this.formData.remarks = this.remarks;
+					                        this.originalRemarks = 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.originalRemarks = 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);
+					                    }
+					                })
+					            }
+					        },
+							
 		}
 	}
 </script>
@@ -1078,12 +1273,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 {
@@ -1124,13 +1316,31 @@
 	/* 鎸夐挳鏍峰紡 */
 	.action-buttons {
 		display: flex;
-		justify-content: flex-end;
 		gap: 10px;
-		margin-top: 20px;
+		margin: 15px 0;
+		justify-content: flex-end;
 	}
 
-	.primary-btn,
 	.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 +1349,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 {

--
Gitblit v1.9.3