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/SJ/Add.vue | 1180 ++++++++++++++++++++++++++++++++++------------------------
 1 files changed, 681 insertions(+), 499 deletions(-)

diff --git a/pages/QC/SJ/Add.vue b/pages/QC/SJ/Add.vue
index d1f0357..810f3b3 100644
--- a/pages/QC/SJ/Add.vue
+++ b/pages/QC/SJ/Add.vue
@@ -3,354 +3,504 @@
 		<!-- 澶撮儴淇℃伅 -->
 		<view class="sheet-header">
 			<h1>棣栨妫�楠屽崟</h1>
-			<view class="inspection-number">妫�楠屽崟鍙凤細{{formData.billNo}}</view>
-
-
+			<view class="inspection-number">棣栨鍗曞彿锛歿{formData.billNo}}</view>
 		</view>
 
 		<!-- 鍩烘湰淇℃伅鍖� -->
 		<view class="basic-info">
 			<view class="info-row">
-				<span class="info-label">鍒涘缓浜猴細</span>
-				<span class="info-value">{{formData.fName}}</span>
-			</view>
-			<view class="info-row">
 				<span class="info-label">鍒涘缓鏃堕棿锛�</span>
 				<span class="info-value">{{formData.createTime}}</span>
-				<!--        <span class="info-label">&nbsp;璐熻矗浜猴細</span>
-        <span class="info-value">{{formData.statusUser}}</span> -->
+				<span class="info-label">妫�楠岀被鍨嬶細</span>
+				<span class="info-value">{{formData.SJ_MJ}}</span>
+			</view>
+			<view class="info-row" v-if="isUpdate">
+				<span class="info-label">妫�楠岀被鍨嬶細</span>
+				<picker class="info-picker" :range="SJ_MJList" :value="SJ_MJIndex" @change="onSJ_MJChange">
+					<view>{{ SJ_MJList[SJ_MJIndex] }}</view>
+				</picker>
 			</view>
 		</view>
 
-		<!-- 鐗╂枡淇℃伅鍖� -->
+		<!-- 鐢熶骇淇℃伅鍖� -->
 		<view class="material-info">
 			<view class="info-block">
-				<view class="info-label">鐗╂枡缂栫爜锛�</view>
-				<view class="info-value">{{formData.itemNo}}</view>
+				<view class="info-label">鐢熶骇绾垮埆锛�</view>
+				<superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�"
+					v-model="formData.line" @select="onDaa020Change" class="info-picker-input"></superwei-combox>
+				<view v-else class="info-value">{{formData.line}}</view>
 			</view>
+
+			<view class="info-block">
+				<view class="info-label">鐗╂枡缂栫爜锛�</view>
+				<superwei-combox v-if="isUpdate" :candidates="boardItems" placeholder="璇烽�夋嫨鎴栬緭鍏�"
+					v-model="formData.itemNo" :isJSON="true" keyName="itemName" @select="onItemChange"
+					class="info-picker-input"></superwei-combox>
+				<view v-else class="info-value">{{formData.itemNo}}</view>
+			</view>
+
+			<view class="info-block">
+				<view class="info-label">璁″垝缂栧彿锛�</view>
+				<picker v-if="isUpdate" class="info-picker" name="selector" :range="DAA001List"
+					@change="onDaa001Change">
+					<text>{{ DAA001List[DAA001Index] }}</text>
+				</picker>
+				<view v-else class="info-value">{{formData.daa001}}</view>
+			</view>
+
+			<view class="info-block">
+				<view class="info-label">閿�鍞鍗曞彿锛�</view>
+				<view class="info-value">{{formData.caa015}}</view>
+			</view>
+
+			<view class="info-block">
+				<view class="info-label">瀹㈡埛锛�</view>
+				<view class="info-value">{{formData.cust}}</view>
+			</view>
+
 			<view class="info-block">
 				<view class="info-label">浜у搧鍚嶇О锛�</view>
 				<view class="info-value">{{formData.daa003}}</view>
 			</view>
+
 			<view class="info-block">
 				<view class="info-label">瑙勬牸鍨嬪彿锛�</view>
 				<view class="info-value">{{formData.daa004}}</view>
 			</view>
-			<view class="info-block">
-				<view class="info-label">鐢熶骇绾垮埆锛�</view>
-				<view class="info-value">{{formData.line}}</view>
-			</view>
 
 			<view class="info-block">
-
-				<view class="info-label" v-if="formData.extendNo1!=null">鎶�鏀圭姸鎬侊細</view>
-				<view class="info-value" v-if="formData.extendNo1!=null">{{formData.extendNo1}}</view>
-				<!-- <view class="info-label">椤圭洰锛�</view>
-		<view class="info-value">{{formData.projectCodes}}</view> -->
-
-				<view class="info-label">鏁伴噺锛�</view>
+				<view class="info-label">宸ュ崟鏁伴噺锛�</view>
 				<view class="info-value highlight">{{formData.daa008}}</view>
 			</view>
-			<view class="info-block" v-if="formData.fngDesc!=null">
-				<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 class="info-block" v-if="formData.remarks">
+				<view class="info-label">涓嶅悎鏍兼弿杩帮細</view>
+				<view class="info-value">{{formData.remarks}}</view>
 			</view>
 		</view>
 
-		<!-- 鎿嶄綔鎸夐挳鍖� -->
-		<!--    <view class="action-buttons" v-if="this.current" >
-      <button class="secondary-btn" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button>
-    </view> -->
-
 		<!-- 妫�楠岄」鐩〃鏍� -->
-		<view class="inspection-table">
+		<view class="inspection-table" v-if="tableData.length > 0">
 			<table>
 				<thead>
 					<tr>
-						<th width="15%" style="text-align: center;">妫�楠岄」鐩�</th>
-						<th width="50%" style="text-align: center;">璐ㄩ噺瑕佹眰</th>
-						<th width="20%" style="text-align: center;">璁板綍(鐐瑰嚮)</th>
+						<th width="20%" style="text-align: center;">妫�楠岄」鐩�</th>
+						<th width="50%" style="text-align: center;">妫�楠屾弿杩�</th>
+						<th width="15%" style="text-align: center;">璁板綍(鐐瑰嚮)</th>
 					</tr>
 				</thead>
 				<tbody>
 					<tr v-for="(item, index) in tableData" :key="index">
 						<td>{{ item.projName }}</td>
 						<td>
-							<view v-if="item.result=='鍚堟牸'" class="watermark approved">{{ getStatusText(item.result) }}
+							<view v-if="item.result=='鍚堟牸'" class="watermark approved">
+								{{ getStatusText(item.result) }}
 							</view>
-							<view v-if="item.result=='涓嶅悎鏍�'" class="watermark rejected">{{ getStatusText(item.result) }}
+							<view v-if="item.result=='涓嶅悎鏍�'" class="watermark rejected">
+								{{ getStatusText(item.result) }}
 							</view>
-							<view v-if="item.result=='鏈畬鎴�'" class="watermark pending">{{ getStatusText(item.result) }}
+							<view v-if="item.result==null || item.result==''" class="watermark pending">
+								{{ getStatusText(item.result) }}
 							</view>
-							<view class="description-text">{{ item.itemMod }}</view>
+							<view class="description-text">妫�楠岄」鐩鎯�</view>
 						</td>
 						<td>
-							<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>
+							<button class="record-btn" @click="toDetail(item)">
+								{{ item.levelNum + '/' + item.isCheck }}
+							</button>
 						</td>
 					</tr>
 				</tbody>
 			</table>
 		</view>
-
 		<!-- 鎿嶄綔鎸夐挳鍖� -->
 		<view class="action-buttons">
-			<button class="secondary-btn" @click="uploadImages">涓婁紶/鏌ョ湅鍥剧墖</button>
-			<button class="secondary-btn" @click="addDefectDescription" v-if="this.current">娣诲姞涓嶈壇鎻忚堪</button>
-			<!-- 棣栨杩欒竟浼氬~瀹屾楠岄」鐩嚜鍔ㄦ彁浜わ紝涓嶇敤鍐欐彁浜ら�昏緫 -->
-			<!-- <button class="primary-btn" @click="submitInspection" v-if="this.current">妫�楠屾彁浜�</button> -->
+			<button class="action-btn primary" v-if="isUpdate && !isShowTable" @click="save">
+				鍒涘缓妫�楠屽崟骞剁敓鎴愰儴鍒嗛粯璁ゅ��
+			</button>
+			<button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="toImage">
+				涓婁紶/鏌ョ湅鍥剧墖
+			</button>
+			<button class="action-btn secondary" v-if="!isUpdate && !isShowTable && formData.xjGenFlag == 0"
+				@click="saveXJ">
+				鐢熸垚宸℃
+			</button>
+			<button class="action-btn danger" v-if="!isUpdate && formData.result == '鏈畬鎴�' && !isShowTable" @click="removeXJ">
+				鍒犻櫎鍗曟嵁
+			</button>
+			<button class="action-btn secondary" v-if="!isUpdate &&  !isShowTable" @click="saveRemarks">
+				娣诲姞涓嶅悎鏍兼弿杩�
+			</button>
+			<button class="action-btn primary" v-if="isShowTable" @click="getTable">
+				鑾峰彇妫�楠岄」鐩�
+			</button>
+			<button class="action-btn primary" v-if="isShowTable && isUpdate" @click="saveTable">
+				鐢熸垚妫�楠岄」鐩�
+			</button>
 		</view>
+		<!-- 寮瑰嚭妗� -->
 		<view v-if="remarksPopup" 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="remarks" />
+				<view class="popup-header">
+					<h3>淇敼涓嶅悎鏍兼弿杩�</h3>
+				</view>
+				<view class="popup-content">
+					<view class="info-block">
+						<view class="info-label">涓嶅悎鏍兼弿杩帮細</view>
+						<input class="info-input" type="text" v-model="remarks" placeholder="璇疯緭鍏ヤ笉鍚堟牸鎻忚堪" />
 					</view>
-
-				</form>
-				<button class="updateBut" @click="editRemarks">淇敼</button>
-				<button @click="remarksPopup = !remarksPopup">鍙栨秷</button>
+				</view>
+				<view class="popup-actions">
+					<button class="action-btn primary" @click="editRemarks">淇敼</button>
+					<button class="action-btn secondary" @click="remarksPopup = !remarksPopup">鍙栨秷</button>
+				</view>
 			</view>
 		</view>
 	</view>
 </template>
-
 <script>
 	export default {
 		data() {
 			return {
 				formData: {
+					createTime: "",
 					id: "",
-					releaseNo: "",
-					createBy: "",
-					createDate: "",
-					lotNo: "",
-					itemNo: "",
 					billNo: "",
-					fcovertQty: "",
-					detailMem: "",
-					taskNo: "",
-					fcheckResu: "",
-					boardModel: "",
-					planQty: "",
-					mocode: "",
-					boardStyle: ""
+					itemNo: "",
+					itemName: "",
+					workshopCode: "",
+					workshopName: "",
+					line: "",
+					lineName: "",
+					comments: "",
+					statusUser: "",
+					SJ_MJ: '棣栨',
 				},
+
+				DAA020List: [],
+
+				DAA001List: [],
+				schemeResult: [],
+				DAA001Index: -1,
+
+				ItemList: [],
+
+				boardItems: [],
+
+				womdaaList: [],
+
 				tableData: [],
+
+				isSubmit: true,
+
+				isUpdate: true,
+
+				isShowTable: false,
+
+				remarks: "",
 				remarksPopup: false,
-				current: true
-			}
+
+				SJ_MJList: ['棣栨', '鏈'],
+				SJ_MJIndex: 0,
+			};
 		},
 		onLoad(options) {
 			//options涓寘鍚簡url闄勫甫鐨勫弬鏁�
+
 			let params = options;
 
 			if (params["id"]) {
+				this.isUpdate = false;
 				this.formData.id = params["id"];
-				this.formData.releaseNo = params["releaseNo"];
-				this.formData.lotNo = params["lotNo"];
-				this.msgId = params["msgId"];
-
-				if (params["current"] === 'A') {
-					this.current = true;
-				} else if (params["current"] === 'B') {
-					this.current = false;
-				}
-
-				if (this.msgId > 0) {
-					this.msgRead();
-				}
-
+				this.formData.billNo = params["billNo"];
+				this.init();
 			} else {
 				//鍒濆鍖栨楠屽崟鍙�
 				this.$post({
-					url: "/LLJ/getMaxReleaseNo"
+					url: "/SJ/GetMaxBillNo"
 				}).then(res => {
-					this.formData.releaseNo = res.data.tbBillList;
-					this.formData.createBy = this.$loginInfo.account;
-					this.formData.createDate = this.$getDate("yyyy-mm-dd");
+					this.formData.billNo = res.data.tbBillList;
+					this.formData.createTime = this.$getDate("yyyy-mm-dd");
 				});
 
+				//浜у搧缂栫爜涓嬫媺妗嗙殑鍒濆鍖�
+				this.$post({
+					url: "/XJ/getLineAll"
+				}).then(res => {
+					this.lineList = res.data.tbBillList;
+					this.DAA020List = res.data.tbBillList.map(item => item.lineName);
+					this.formData.itemNo = "";
+					this.formData.itemName = "";
+					this.formData.workshopCode = "";
+					this.formData.workshopName = "";
+					this.formData.line = "";
+					this.formData.lineName = "";
+					this.formData.pbaid = null;
+				})
 			}
-
 		},
 		methods: {
+			getResultClass(result) {
+				if (result === '鍚堟牸') return 'result-pass';
+				if (result === '涓嶅悎鏍�') return 'result-fail';
+				return 'result-pending';
+			},
 			getStatusText(status) {
-				const statusMap = {
-					approved: '鍚堟牸',
-					rejected: '涓嶅悎鏍�',
-					pending: '寰呯‘璁�'
-				}
-				if (status == '鏈畬鎴�') {
-					return statusMap['pending'] || ''
-				} else if (status == '鍚堟牸') {
-					return statusMap['approved'] || ''
-				} else {
-					return statusMap['rejected'] || ''
-				}
-
+				if (status === '鍚堟牸') return '鍚堟牸';
+				if (status === '涓嶅悎鏍�') return '涓嶅悎鏍�';
+				return '鏈畬鎴�';
 			},
-			getInspectionItems() {
-				// 鑾峰彇妫�楠岄」鐩殑閫昏緫
-				this.$post({
-					url: "/LLJ/setJYItem",
-					data: {
-						itemNo: this.formData.itemNo,
-						quantity: this.formData.fcovertQty,
-						releaseNo: this.formData.releaseNo
-					}
-				}).then(res => {
-					if (res.status == 0) {
-						uni.showToast({
-							title: res.message.toString(),
-							//灏嗗�艰缃负 success 鎴栬�呯洿鎺ヤ笉鐢ㄥ啓icon杩欎釜鍙傛暟
-							icon: 'success',
-							//鏄剧ず鎸佺画鏃堕棿涓� 2绉�
-							duration: 2000
-						})
-						// 濡傛灉鏈夐〉闈㈣烦杞紝闇�瑕佺敤瀹氭椂鍣ㄥ欢杩�
-						setTimeout(() => {
-							this.init();
-						}, 2000);
-
-					} else {
-						uni.showToast({
-							title: res.message.toString(),
-							//灏嗗�艰缃负 success 鎴栬�呯洿鎺ヤ笉鐢ㄥ啓icon杩欎釜鍙傛暟
-							icon: 'error',
-							//鏄剧ず鎸佺画鏃堕棿涓� 2绉�
-							duration: 2000
-						})
-					}
-				});
-			},
-			fillRecord(item, index) {
-				// 濉啓璁板綍鐨勯�昏緫
-				uni.navigateTo({
-					url: 'detail?mainId=' + item.id + '&formID=' + this.formData.id + '&releaseNo=' + this.formData
-						.billNo + '&index=' + index + '&current=' + this.current
-				});
-			},
-			uploadImages() {
-				// 涓婁紶/鏌ョ湅鍥剧墖鐨勯�昏緫
-				uni.navigateTo({
-					url: 'ImageItem?id=' + this.formData.id
-				});
-			},
-			addDefectDescription() {
-				// 娣诲姞涓嶈壇鎻忚堪鐨勯�昏緫
-				this.remarksPopup = !this.remarksPopup;
-				this.remarks = this.formData.remarks;
-			},
-			submitInspection() {
-				// 妫�楠屾彁浜ょ殑閫昏緫
-				this.$post({
-					url: "/LLJ/IqcQaSubmit",
-					data: {
-						userNo: this.$loginInfo.account,
-						releaseNo: this.formData.releaseNo
-					}
-				}).then(res => {
-					if (res.status == 0) {
-
-						uni.showToast({
-							title: res.message.toString(),
-							icon: 'success',
-							duration: 2000
-						})
-						// 濡傛灉鏈夐〉闈㈣烦杞紝闇�瑕佺敤瀹氭椂鍣ㄥ欢杩�
-						setTimeout(() => {
-							uni.navigateTo({
-								url: 'List'
-							});
-						}, 2000); // 淇濇寔涓� duration 鐩稿悓鐨勬椂闀�
-
-					} else {
-						uni.showModal({
-							title: "鎻愮ず",
-							content: res.message.toString(),
-							confirmText: "纭畾",
-							showCancel: false,
-							success: (res) => {
-
-							}
-						})
-					}
-				})
-			},
-			onShow() {
-				//姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
+			removeXJ() {
 				if (this.formData.id) {
-					this.init();
+					this.$post({
+						url: "/SJ/removeSJ",
+						data: {
+							id: this.formData.id
+						}
+					}).then(res => {
+						if (res.data.tbBillList > 0) {
+							this.$showMessage("鍒犻櫎鎴愬姛");
+							//鍏抽棴褰撳墠椤甸潰锛岃繑鍥炰笂涓�椤甸潰鎴栧绾ч〉闈�
+							uni.navigateBack();
+						} else {
+							this.$showMessage("鍒犻櫎澶辫触");
+						}
+					});
+				} else {
+					this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�");
+				}
+			},
+
+			saveXJ() {
+				//qaSubmit
+				if (this.formData.id) {
+					this.$post({
+						url: "/SJ/qaSubmit",
+						data: {
+							id: this.formData.id,
+							userNo: this.$loginInfo.account
+						}
+					}).then(res => {
+						if (res.data.tbBillList) {
+							this.$showMessage("宸℃鐢熸垚鎴愬姛");
+							this.init();
+						}
+					});
 				}
 			},
 			init() {
-				let userName = this.$loginInfo.account;
+				if (this.formData.id) {
+					this.$post({
+						url: "/SJ/GetPage",
+						data: {
+							pageIndex: 1,
+							limit: 1,
+							id: this.formData.id
+						}
+					}).then(res => {
+						let tbBillListElement = res.data.tbBillList[0];
+						if (tbBillListElement) {
+							this.formData = tbBillListElement;
+							this.$post({
+								url: "/SJ/getQSItems",
+								data: {
+									pid: this.formData.id
+								}
+							}).then(res => {
+								this.tableData = res.data.tbBillList;
+
+								this.tableData.sort((a, b) => {
+									if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') {
+										return -1;
+									} else if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') {
+										return 1;
+									} else {
+										return 0;
+									}
+								});
+
+								if (this.tableData.length <= 0) {
+									this.isShowTable = true;
+								}
+							})
+						}
+					})
+				}
+			},
+			onDaa020Change(event) {
+				//鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧�
+				//this.formData.line = event;
+
+				this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo;
+
+				this.formData.line = this.lineNo;
+
+				this.formData.itemNo = '';
+				this.formData.daa001 = '';
 
 				this.$post({
-					url: "/SJ/GetPage",
+					url: "/XJ/getBoardItem",
 					data: {
-						pageIndex: 1,
-						limit: 1,
-						id: this.formData.id
+						lineNo: this.lineNo
+					}
+				}).then(res => {
+					//濉厖宸ュ崟鍙风殑鏁版嵁婧�
+					this.boardItems = res.data.tbBillList;
+
+					this.ItemList = this.boardItems.map(item => item.itemName);
+				})
+
+			},
+			onItemChange(event) {
+
+				this.formData.itemNo = event.itemNo;
+
+				this.$post({
+					url: "/XJ/getDaa001",
+					data: {
+						daa020: this.lineNo,
+						item: this.formData.itemNo
+					}
+				}).then(res => {
+					//濉厖宸ュ崟鍙风殑鏁版嵁婧�
+					this.schemeResult = res.data.tbBillList;
+					this.DAA001List = this.schemeResult.map(s => s.daa001);
+					//鍙樹负榛樿绌哄�肩殑鐘舵��
+					this.DAA001Index = -1;
+					this.formData.daa001 = "";
+				})
+			},
+			//閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅
+			onDaa001Change(event) {
+				this.DAA001Index = event.mp.detail.value;
+
+				this.formData.daa001 = this.schemeResult[this.DAA001Index].daa001;
+
+				//琛ㄥ崟涓殑閮ㄥ垎瀛楁璧嬪��
+				this.$post({
+					url: "/XJ/getItem",
+					data: {
+						daa001: this.formData.daa001
 					}
 				}).then(res => {
 					let data = res.data.tbBillList[0];
-					if (data) {
-						this.formData = data;
-
-						this.$post({
-							url: "/SJ/getQSItems",
-							data: {
-								pid: this.formData.id
-							}
-						}).then(res1 => {
-							let tableData = res1.data.tbBillList
-							//褰撳凡妫�楠屼釜鏁伴兘涓嶄负绌烘椂鎸夌収妫�娴嬬粨鏋勬帓搴�
-							tableData.sort((a, b) => {
-								if (a.result === '鏈畬鎴�' && b.result === '鍚堟牸') {
-									return -1;
-								} else if (a.result === '鍚堟牸' && b.result === '鏈畬鎴�') {
-									return 1;
-								} else {
-									return 0;
-								}
-							});
-							this.tableData = tableData;
-							if (this.tableData.length === 0) {
-								this.isShowTable = true;
-							}
-							this.tableData.forEach((item, index) => {
-								this.$set(item, 'current', this.current);
-
-							});
-
-						})
+					//褰撹繑鍥炵殑缁撴灉闆嗕负绌烘椂缃┖鍘熸湁鐨勫��
+					if (!data) {
+						this.formData.billNo = "";
+						this.formData.taskNo = "";
+						this.formData.itemNo = "";
+						this.tableData = [];
+						return;
 					}
+					//涓嶄负绌烘椂璧嬪��
+					this.formData.daa001 = data.daa001;
+					this.formData.daa003 = data.daa003;
+					this.formData.daa004 = data.daa004;
+					this.formData.daa008 = data.daa008;
+					this.formData.pbaid = data.id;
+
+
+					this.$post({
+						url: "/SJ/SetQSItems",
+						data: {
+							itemNo: this.formData.itemNo,
+							lineNo: this.lineNo
+						}
+					}).then(res => {
+						if (res.data.tbBillList.length > 0) {
+							this.tableData = res.data.tbBillList; // 鍦ㄧ澶村嚱鏁颁腑锛宼his 鎸囧悜澶栧眰浣滅敤鍩熺殑 this
+							this.isSubmit = false;
+						} else {
+							this.$showMessage("姝ょ墿鏂欐病鏈夊惎鐢ㄧ殑妫�楠岄」鐩紝璇风淮鎶�!");
+							this.isSubmit = true;
+							this.tableData = [];
+						}
+					});
+
 				});
 			},
-			msgRead() {
-				msgRead(this.msgId, this.$loginInfo.account);
-			},
-			//鍘绘枃浠跺垪琛ㄩ〉闈紙鏂囦欢绫诲瀷锛岀墿鏂欑紪鍙凤級
-			toFileUrlByU9List(type, u9No) {
-				if (type === 1) {
-					uni.navigateTo({
-						url: 'FileUrlByU9List?type=' + type + '&itemID=' + u9No
+			toDetail(item) {
+				if (this.isUpdate) {
+					uni.showToast({
+						icon: "none",
+						title: "璇峰厛鐢熸垚妫�楠岄」鐩�",
+						duration: 2000,
 					});
 				} else {
 					uni.navigateTo({
-						url: 'FileUrlByU9List2?type=' + type + '&itemID=' + u9No
+						url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData
+							.id
 					});
 				}
 			},
+			getTable() {
+				this.$post({
+					url: "/SJ/SetQSItems",
+					data: {
+						itemNo: this.formData.itemNo,
+						lineNo: this.formData.line
+					}
+				}).then(res => {
+					if (res.data.tbBillList.length > 0) {
+						this.tableData = res.data.tbBillList; // 鍦ㄧ澶村嚱鏁颁腑锛宼his 鎸囧悜澶栧眰浣滅敤鍩熺殑 this
+						this.isShowTable = true;
+						this.isUpdate = true;
+					} else {
+						this.$showMessage("姝ょ墿鏂欐病鏈夊惎鐢ㄧ殑妫�楠岄」鐩紝璇风淮鎶�!");
+						this.isShowTable = true;
+						this.isUpdate = false;
+						this.tableData = [];
+					}
+				});
+			},
+			saveTable() {
+				if (this.tableData.length === 0) {
+					return;
+				}
 
+				this.$post({
+					url: "/SJ/SaveItem",
+					data: {
+						gid: this.formData.id,
+						items: this.tableData,
+						statusUser: this.$loginInfo.account
+					}
+				}).then(res => {
+					this.tableData = res.data.tbBillList.items;
+					this.isShowTable = false;
+					this.isUpdate = false;
+				})
+			},
+			save() {
+
+				if (this.tableData.length === 0) {
+					this.$showMessage(this.formData.itemNo + "鐗╂枡娌℃湁妫�楠岄」鐩�");
+					return;
+				}
+
+				if (!this.formData.daa001) {
+					this.$showMessage("璇烽�夋嫨璁″垝缂栧彿");
+					return;
+				}
+
+				this.formData.statusUser = this.$loginInfo.account;
+
+				this.$post({
+					url: "/SJ/Save",
+					data: {
+						from: this.formData,
+						items: this.tableData
+					}
+				}).then(res => {
+					this.formData = res.data.tbBillList.result;
+					this.tableData = res.data.tbBillList.items;
+					this.isUpdate = false;
+				})
+			},
+			saveRemarks() {
+				this.remarksPopup = !this.remarksPopup;
+				this.remarks = this.formData.remarks;
+			},
 			editRemarks() {
 				if (this.remarks) {
 					//saveRemarksGid
@@ -367,309 +517,341 @@
 							this.$showMessage("淇濆瓨鎴愬姛");
 						}
 					})
-				} else {
-					this.$post({
-						url: "/SJ/saveRemarksGid",
-						data: {
-							gid: this.formData.id,
-							remarks: ''
-						}
-					}).then(res => {
-						if (res.data.tbBillList > 0) {
-							this.formData.remarks = this.remarks;
-							this.remarksPopup = !this.remarksPopup;
-							this.$showMessage("淇濆瓨鎴愬姛");
-						}
-					})
 				}
 			},
+			toImage() {
+				uni.navigateTo({
+					url: 'ImageItem?id=' + this.formData.id
+				});
+			},
+			onSJ_MJChange(e) {
+				this.SJ_MJIndex = e.mp.detail.value;
+				this.formData.SJ_MJ = this.SJ_MJList[this.SJ_MJIndex];
+			},
+		},
+		onShow() {
+			//姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
+			this.init();
 		}
-	}
+	};
 </script>
 
-<style>
-	/* 鍩虹鏍峰紡 */
-	.inspection-sheet {
-		font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
-		max-width: 1000px;
-		margin: 0 auto;
-		padding: 20px;
-		background-color: #fff;
-		box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
-	}
+<style scoped>
+/* 鍩虹鏍峰紡 */
+.inspection-sheet {
+  padding: 10px;
+  background-color: #f5f7fa;
+  min-height: 100vh;
+}
 
-	/* 澶撮儴鏍峰紡 */
-	.sheet-header {
-		text-align: center;
-		margin-bottom: 20px;
-		padding-bottom: 15px;
-		border-bottom: 2px solid #e0e0e0;
-	}
+/* 澶撮儴鏍峰紡 */
+.sheet-header {
+  background-color: white;
+  padding: 20px;
+  border-radius: 8px;
+  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+  margin-bottom: 20px;
+}
 
-	.sheet-header h1 {
-		color: #2c3e50;
-		font-size: 24px;
-		margin-bottom: 5px;
-	}
+.sheet-header h1 {
+  font-size: 24px;
+  font-weight: 600;
+  color: #2c3e50;
+  margin-bottom: 10px;
+}
 
-	.inspection-number {
-		font-size: 16px;
-		font-weight: bold;
-		color: #3498db;
-	}
+.inspection-number {
+  font-size: 16px;
+  color: #3498db;
+  font-weight: 500;
+}
 
-	/* 鍩烘湰淇℃伅鍖烘牱寮� */
-	.basic-info,
-	.material-info {
-		margin-bottom: 20px;
-	}
+/* 鍩烘湰淇℃伅鍖� */
+.basic-info {
+  background-color: white;
+  padding: 20px;
+  border-radius: 8px;
+  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+  margin-bottom: 20px;
+}
 
-	.info-row {
-		display: flex;
-		margin-bottom: 10px;
-		flex-wrap: wrap;
-	}
+.info-row {
+  display: flex;
+  align-items: center;
+  margin-bottom: 15px;
+}
 
-	.info-label {
-		font-weight: bold;
-		color: #34495e;
-		min-width: 80px;
-		margin-right: 5px;
-	}
+.info-label {
+  font-size: 14px;
+  color: #7f8c8d;
+  margin-right: 10px;
+  min-width: 80px;
+}
 
-	.info-value {
-		color: #2c3e50;
-		margin-right: 20px;
-	}
+.info-value {
+  font-size: 14px;
+  color: #2c3e50;
+  margin-right: 20px;
+}
 
-	.highlight {
-		font-weight: bold;
-		color: #e74c3c;
-	}
+.info-picker {
+  padding: 8px 12px;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+  background-color: white;
+  font-size: 14px;
+  margin-right: 20px;
+}
 
-	/* 鐗╂枡淇℃伅鍖烘牱寮� */
-	.material-info {
-		border: 1px solid #eee;
-		padding: 15px;
-		border-radius: 5px;
-	}
+/* 鐗╂枡淇℃伅鍖� */
+.material-info {
+  background-color: white;
+  padding: 20px;
+  border-radius: 8px;
+  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
+  margin-bottom: 20px;
+}
 
-	.info-block {
-		display: flex;
-		align-items: center;
-		margin-bottom: 10px;
-		flex-wrap: wrap;
-	}
+.info-block {
+  display: flex;
+  align-items: center;
+  margin-bottom: 15px;
+}
 
-	.doc-links {
-		margin-left: auto;
-	}
+.info-block .info-label {
+  min-width: 100px;
+  font-size: 14px;
+  color: #7f8c8d;
+}
 
-	.doc-link {
-		color: #3498db;
-		text-decoration: none;
-		margin-left: 15px;
-		padding: 3px 8px;
-		border: 1px solid #3498db;
-		border-radius: 3px;
-		font-size: 12px;
-	}
+.info-block .info-value {
+  font-size: 14px;
+  color: #2c3e50;
+  flex: 1;
+}
 
-	.sysLike {
-		color: #3498db;
-		text-decoration: none;
-		margin-left: 15px;
-		padding: 3px 8px;
-		border-radius: 3px;
-		font-size: 12px;
-	}
+.info-picker-input {
+  flex: 1;
+  padding: 8px 12px;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+  background-color: white;
+  font-size: 14px;
+}
 
-	.doc-link:hover {
-		background-color: #f0f8ff;
-	}
+.info-input {
+  flex: 1;
+  padding: 8px 12px;
+  border: 1px solid #ddd;
+  border-radius: 4px;
+  background-color: white;
+  font-size: 14px;
+}
 
-	/* 琛ㄦ牸鏍峰紡 */
-	.inspection-table {
-		margin: 25px 0;
-	}
+.highlight {
+  font-weight: 600;
+  color: #e74c3c;
+  font-size: 16px;
+}
 
-	.inspection-table table {
-		width: 100%;
-		border-collapse: collapse;
-	}
+/* 妫�楠岄」鐩〃鏍� */
+.inspection-table {
+  margin: 25px 0;
+}
 
-	.inspection-table th,
-	.inspection-table td {
-		padding: 12px 15px;
-		border: 1px solid #ddd;
-		text-align: left;
-	}
+.inspection-table table {
+  width: 100%;
+  border-collapse: collapse;
+}
 
-	.inspection-table th {
-		background-color: #f8f9fa;
-		font-weight: bold;
-		color: #34495e;
-	}
+.inspection-table th,
+.inspection-table td {
+  padding: 12px 15px;
+  border: 1px solid #ddd;
+  text-align: left;
+}
 
-	.inspection-table tr:nth-child(even) {
-		background-color: #f9f9f9;
-	}
+.inspection-table th {
+  background-color: #f8f9fa;
+  font-weight: bold;
+  color: #34495e;
+}
 
-	.inspection-table tr:hover {
-		background-color: #f1f5f9;
-	}
+.inspection-table tr:nth-child(even) {
+  background-color: #f9f9f9;
+}
 
-	/* 鎸夐挳鏍峰紡 */
-	.action-buttons {
-		display: flex;
-		justify-content: flex-end;
-		gap: 10px;
-		margin-top: 20px;
-	}
+.inspection-table tr:hover {
+  background-color: #f1f5f9;
+}
 
-	.primary-btn,
-	.secondary-btn {
-		padding: 10px 20px;
-		border: none;
-		border-radius: 4px;
-		font-size: 14px;
-		cursor: pointer;
-		transition: all 0.3s;
-	}
+/* 姘村嵃鏍峰紡 */
+.watermark {
+  position: absolute;
+  font-size: 40px;
+  font-weight: bold;
+  opacity: 1;
+  z-index: 1;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%) rotate(-15deg);
+}
 
-	.primary-btn {
-		background-color: #3498db;
-		color: white;
-	}
+.watermark.approved {
+  color: #2ecc71;
+}
 
-	.primary-btn:hover {
-		background-color: #2980b9;
-	}
+.watermark.rejected {
+  color: #e74c3c;
+}
 
-	.secondary-btn {
-		background-color: #ecf0f1;
-		color: #7f8c8d;
-	}
+.watermark.pending {
+  color: #f39c12;
+}
 
-	.secondary-btn:hover {
-		background-color: #d5dbdb;
-	}
+/* 鎻忚堪鏂囨湰瀹瑰櫒 */
+.description-text {
+  position: relative;
+  z-index: 2;
+  background-color: rgba(255, 255, 255, 0.7);
+  padding: 10px;
+  font-size: 14px;
+  color: #2c3e50;
+}
 
-	.record-btn {
-		padding: 6px 12px;
-		background-color: #f8f9fa;
-		border: 1px solid #ddd;
-		/* border-radius: 3px; */
-		cursor: pointer;
-		transition: all 0.2s;
-	}
+/* 璋冩暣琛ㄦ牸鍗曞厓鏍� */
+.inspection-table td:nth-child(2) {
+  position: relative;
+  overflow: hidden;
+  padding: 0;
+}
 
-	.record-btn:hover {
-		background-color: #e9ecef;
-	}
+/* 鎸夐挳鏍峰紡 */
+.record-btn {
+  padding: 6px 12px;
+  background-color: #f8f9fa;
+  border: 1px solid #ddd;
+  cursor: pointer;
+  transition: all 0.2s;
+  font-size: 12px;
+}
 
-	/* 姘村嵃鏍峰紡 */
-	.watermark {
-		position: absolute;
-		font-size: 40px;
-		font-weight: bold;
-		opacity: 1;
-		z-index: 1;
-		pointer-events: none;
-		transform: rotate(-15deg);
-		width: 100%;
-		text-align: center;
-		top: 50%;
-		left: 50%;
-		transform: translate(-50%, -50%) rotate(-15deg);
-	}
+.record-btn:hover {
+  background-color: #e9ecef;
+}
 
-	.watermark.approved {
-		color: #2ecc71;
-		/* 缁胯壊 */
-	}
+/* 鎿嶄綔鎸夐挳鍖� */
+.action-buttons {
+  display: flex;
+  flex-direction: column;
+  gap: 10px;
+  margin-bottom: 20px;
+}
 
-	.watermark.rejected {
-		color: #e74c3c;
-		/* 绾㈣壊 */
-	}
+.action-btn {
+  padding: 12px 20px;
+  border: none;
+  border-radius: 6px;
+  font-size: 14px;
+  font-weight: 500;
+  transition: all 0.2s;
+  cursor: pointer;
+}
 
-	.watermark.pending {
-		color: #f39c12;
-		/* 姗欒壊 */
-	}
+.action-btn.primary {
+  background-color: #3498db;
+  color: white;
+}
 
-	/* 鎻忚堪鏂囨湰瀹瑰櫒 */
-	.description-text {
-		position: relative;
-		z-index: 2;
-		padding: 25px;
-		background-color: rgba(255, 255, 255, 0.7);
-	}
+.action-btn.primary:hover {
+  background-color: #2980b9;
+}
 
-	/* 璋冩暣琛ㄦ牸鍗曞厓鏍� */
-	.inspection-table td:nth-child(2) {
-		position: relative;
-		overflow: hidden;
-		padding: 0;
-	}
+.action-btn.secondary {
+  background-color: #95a5a6;
+  color: white;
+}
 
-	.overlay {
-		position: fixed;
-		top: 0;
-		left: 0;
-		width: 100%;
-		height: 100%;
-		background-color: rgba(0, 0, 0, 0.5);
-		display: flex;
-		justify-content: center;
-		align-items: center;
-		z-index: 10;
-	}
+.action-btn.secondary:hover {
+  background-color: #7f8c8d;
+}
 
-	.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% */
-	}
+.action-btn.danger {
+  background-color: #e74c3c;
+  color: white;
+}
 
-	.form-group {
-		display: flex;
-		align-items: center;
-		border-bottom: 1px solid #c9c9c9;
-	}
+.action-btn.danger:hover {
+  background-color: #c0392b;
+}
 
-	.updateBut {
-		background-color: #3498db;
-		color: white;
-	}
+/* 寮瑰嚭妗嗘牱寮� */
+.overlay {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: rgba(0, 0, 0, 0.5);
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  z-index: 1000;
+}
 
-	/* 鍝嶅簲寮忚璁� */
-	@media (max-width: 500px) {
+.popup {
+  background-color: white;
+  border-radius: 8px;
+  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
+  width: 90%;
+  max-width: 400px;
+  max-height: 80vh;
+  overflow-y: auto;
+}
 
-		.info-row,
-		.info-block {
-			flex-direction: column;
-			align-items: flex-start;
-		}
+.popup-header {
+  padding: 20px;
+  border-bottom: 1px solid #eee;
+}
 
-		.doc-links {
-			margin-left: 0;
-			margin-top: 10px;
-		}
+.popup-header h3 {
+  font-size: 18px;
+  font-weight: 600;
+  color: #2c3e50;
+  margin: 0;
+}
 
-		.action-buttons {
-			flex-direction: column;
-		}
+.popup-content {
+  padding: 20px;
+}
 
-		.inspection-table table {
-			display: block;
-			overflow-x: auto;
-		}
-	}
+.popup-actions {
+  padding: 20px;
+  border-top: 1px solid #eee;
+  display: flex;
+  gap: 10px;
+  justify-content: flex-end;
+}
+
+/* 鍝嶅簲寮忚璁� */
+@media (max-width: 768px) {
+  .info-row {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+  
+  .info-label {
+    margin-bottom: 5px;
+  }
+  
+  .project-item {
+    flex-direction: column;
+    align-items: flex-start;
+  }
+  
+  .project-actions {
+    margin-top: 10px;
+    width: 100%;
+  }
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3