From 1dfbf152be9db7bc8c589a4d0bfba5df8d240585 Mon Sep 17 00:00:00 2001
From: cnf <3200815559@qq.com>
Date: 星期二, 16 九月 2025 13:10:40 +0800
Subject: [PATCH] 首检,来料检修改

---
 pages/QC/RKJ/Add.vue | 3036 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 2,432 insertions(+), 604 deletions(-)

diff --git a/pages/QC/RKJ/Add.vue b/pages/QC/RKJ/Add.vue
index d4a4d1c..ceb1d79 100644
--- a/pages/QC/RKJ/Add.vue
+++ b/pages/QC/RKJ/Add.vue
@@ -1,175 +1,395 @@
 <template>
-    <view class="container">
-      <!-- 澶撮儴 -->
-      <view class="header">
-        <view class="title">鍏ュ簱妫�楠�</view>
-        <view class="order-number">妫�楠屽崟鍙�: {{formData.releaseNo}}</view>
-      </view>
-  
-      <!-- 鍩烘湰淇℃伅 -->
-      <view class="section">
-        <view class="section-header">鍩烘湰淇℃伅</view>
-        <view class="section-body">
-          <view class="info-grid">
-            <view class="info-item">
-              <view class="info-label">妫�楠屽崟鍙�</view>
-              <view class="info-value">{{ formData.releaseNo }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">鍒涘缓浜�</view>
-              <view class="info-value">{{ formData.createBy }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">鍒涘缓鏃堕棿</view>
-              <view class="info-value">{{ formData.createDate }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">鐢熶骇绾垮埆</view>
-              <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�"
-                               v-model="formData.lineName"
-                               @select="onDaa020Change"
-                               class="picker-input"></superwei-combox>
-              <view v-else class="info-value">{{ formData.daa015 }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">宸ュ崟鍙�</view>
-              <superwei-combox v-if="isUpdate" :candidates="DAA001List" placeholder="璇烽�夋嫨鎴栬緭鍏�"
-                               v-model="formData.rBillNo"
-                               @select="onDaa001Change"
-                               class="picker-input"></superwei-combox>
-              <view v-else class="info-value">{{ formData.rBillNo }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">閫佹鎵规</view>
-              <superwei-combox v-if="isUpdate" :candidates="billNoList" placeholder="璇烽�夋嫨"
-                               v-model="formData.billNo"
-                               @select="onBillNoChange"
-                               class="picker-input"></superwei-combox>
-              <view v-else class="info-value">{{ formData.billNo }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">鐗╂枡缂栫爜</view>
-              <view class="info-value">{{ formData.itemNo }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">浜у搧鍚嶇О</view>
-              <view class="info-value">{{ formData.itemName }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">瑙勬牸鍨嬪彿</view>
-              <view class="info-value">{{ formData.itemModel }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">閫佹鏁伴噺</view>
-              <view class="info-value highlight">{{ formData.quantity }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">鎶ュ伐浜�</view>
-              <view class="info-value">{{ formData.bgr }}</view>
-            </view>
-            <view class="info-item">
-              <view class="info-label">妫�楠岀粨鏋�</view>
-              <view class="info-value">{{ formData.fcheckResu }}</view>
-            </view>
-            <view class="info-item" v-if="formData.remarks">
-              <view class="info-label">涓嶅悎鏍兼弿杩�</view>
-              <view class="info-value danger">{{ formData.remarks }}</view>
-            </view>
-          </view>
-        </view>
-      </view>
-    
-      <!-- 妫�楠岄」鐩� -->
-      <view class="section" v-if="tableData.length > 0">
-        <view class="section-header">妫�楠岄」鐩�</view>
-        <view class="section-body">
-          <view class="inspection-table">
-            <table>
-              <thead>
-                <tr>
-                  <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>
-                    <view v-if="item.result=='涓嶅悎鏍�'" class="watermark rejected">
-                      {{ getStatusText(item.result) }}
-                    </view>
-                    <view v-if="item.result==null || item.result=='鏈畬鎴�'" class="watermark pending">
-                      {{ getStatusText(item.result) }}
-                    </view>
-                    <view class="description-text">{{ item.projName }}</view>
-                  </td>
-                  <td>
-                    <button v-if="item.isCheck >= item.levelNum" class="record-btn" @click="toDetail(item)">鏌ョ湅</button>
-                    <button v-else class="record-btn" @click="toDetail(item)">濉啓</button>
-                  </td>
-                </tr>
-              </tbody>
-            </table>
-          </view>
-        </view>
-      </view>
-    
-      <!-- 鎿嶄綔鎸夐挳 -->
-      <view class="action-buttons">
-        <button class="action-btn primary" v-if="isUpdate && !isShowTable" @click="getItem">鐢熸垚妫�楠屽崟</button>
-        <button class="action-btn secondary" v-if="!isUpdate && !isShowTable" @click="toImage">涓婁紶/鏌ョ湅鍥剧墖</button>
-        <button class="action-btn warning" v-if="!isUpdate && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button>
-        <button class="action-btn danger" v-if="!isUpdate && !isShowTable && this.formData.fsubmit != 1" @click="cleanResult">娓呴櫎妫�楠岀粨鏋�</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="showPopup" class="overlay">
-        <view class="popup">
-          <view class="popup-header">
-            <h3>淇敼涓嶅悎鏍兼弿杩�</h3>
-          </view>
-          <view class="popup-content">
-            <view class="input-group">
-              <view class="input-label">涓嶅悎鏍兼弿杩帮細</view>
-              <input class="input-field" type="text" v-model="remarks" placeholder="璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"/>
-            </view>
-          </view>
-          <view class="popup-actions">
-            <button class="action-btn primary" @click="edit">淇敼</button>
-            <button class="action-btn secondary" @click="showPopup = !showPopup">鍙栨秷</button>
-          </view>
-        </view>
-      </view>
-  
-    </view>
-  </template>
+	<!-- 鏂板缓琛ㄥ崟 - 浼樺寲鍚庣殑UI鏍峰紡 -->
+	<view v-if="isUpdate" class="create-form">
+		<view class="form-header">
+			<h2>鏂板缓鍏ュ簱妫�楠屽崟</h2>
+			<p class="form-subtitle">璇锋寜椤哄簭濉啓浠ヤ笅淇℃伅</p>
+		</view>
+		
+		<view class="form-content">
+			<!-- 妫�楠屽崟鍙� -->
+			<view class="form-section">
+				<view class="section-title">鍩烘湰淇℃伅</view>
+				<view class="form-row">
+					<label class="form-label">妫�楠屽崟鍙凤細</label>
+					<span class="form-value">{{formData.releaseNo}}</span>
+				</view>
+			</view>
+			
+			<!-- 閫夋嫨鍖哄煙 -->
+			<view class="form-section">
+				<view class="section-title">閫夋嫨淇℃伅</view>
+				<view class="form-row">
+					<label class="form-label required">宸ヤ綔杞﹂棿锛�</label>
+					<superwei-combox :candidates="departmentList" placeholder="璇烽�夋嫨杞﹂棿"
+									 v-model="formData.workShop"
+									 @select="onDepartmentChange"
+									 class="form-select"></superwei-combox>
+				</view>
+				
+				<view class="form-row">
+					<label class="form-label required">鐢熶骇绾垮埆锛�</label>
+					<superwei-combox v-if="formData.workShop" :candidates="DAA020List" placeholder="璇烽�夋嫨绾夸綋"
+									 v-model="formData.lineName"
+									 @select="onDaa020Change"
+									 class="form-select"></superwei-combox>
+					<span v-else class="form-hint">璇峰厛閫夋嫨宸ヤ綔杞﹂棿</span>
+				</view>
+				
+				<view class="form-row">
+					<label class="form-label required">鐢熶骇宸ュ崟锛�</label>
+					<superwei-combox v-if="formData.lineName" :candidates="DAA001List" placeholder="璇烽�夋嫨宸ュ崟"
+									 v-model="formData.rBillNo"
+									 @select="onDaa001Change"
+									 class="form-select"></superwei-combox>
+					<span v-else class="form-hint">璇峰厛閫夋嫨鐢熶骇绾垮埆</span>
+				</view>
+				
+				<view class="form-row">
+					<label class="form-label required">閫佹鏁伴噺锛�</label>
+					<input type="number" 
+						   v-model="formData.quantity" 
+						   placeholder="璇疯緭鍏ラ�佹鏁伴噺"
+						   class="large-quantity-input"
+						   @input="onQuantityChange"/>
+				</view>
+			</view>
+			
+			<!-- 浜у搧淇℃伅 -->
+			<view class="form-section" v-if="formData.itemName || formData.itemNo || formData.itemModel || formData.planQty">
+				<view class="section-title">浜у搧淇℃伅</view>
+				<view class="form-row" v-if="formData.itemName">
+					<label class="form-label">浜у搧鍚嶇О锛�</label>
+					<span class="form-value">{{formData.itemName}}</span>
+				</view>
+				
+				<view class="form-row" v-if="formData.itemNo">
+					<label class="form-label">鐗╂枡缂栫爜锛�</label>
+					<span class="form-value">{{formData.itemNo}}</span>
+				</view>
+				
+				<view class="form-row" v-if="formData.itemModel">
+					<label class="form-label">瑙勬牸鍨嬪彿锛�</label>
+					<span class="form-value">{{formData.itemModel}}</span>
+				</view>
+				
+				<view class="form-row" v-if="formData.planQty">
+					<label class="form-label">宸ュ崟鏁伴噺锛�</label>
+					<span class="form-value">{{formData.planQty}}</span>
+				</view>
+				
+				<view class="form-row" v-if="formData.rbillNo">
+					<label class="form-label">閫佹鎵规锛�</label>
+					<span class="form-value">{{formData.rbillNo}}</span>
+				</view>
+			</view>
+		</view>
+		
+		<view class="form-actions">
+			<button class="btn-primary" 
+					v-if="!isShowTable && formData.workShop && formData.lineName && formData.rBillNo && formData.quantity" 
+					@click="getItem">
+				<text class="btn-icon">鉁�</text>
+				鐢熸垚妫�楠屽崟
+			</button>
+			<button class="btn-primary" 
+					v-if="isShowTable && isUpdate" 
+					@click="saveTable">
+				<text class="btn-icon">鉁�</text>
+				鐢熸垚妫�楠岄」鐩�
+			</button>
+		</view>
+	</view>
+	
+	<!-- 鏌ョ湅/缂栬緫琛ㄥ崟 - 浣跨敤LLJ绫讳技鐨勬牱寮� -->
+	<view v-else class="inspection-sheet">
+		<!-- 澶撮儴淇℃伅 -->
+		<view class="sheet-header">
+			<h1>鍏ュ簱妫�楠屽崟</h1>
+			<view class="inspection-number">妫�楠屽崟鍙凤細{{formData.releaseNo}}</view>
+		</view>
+
+		<!-- 鍩烘湰淇℃伅鍖� -->
+		<view class="basic-info">
+			<view class="info-row">
+				<span class="info-label">宸ュ崟鍙凤細</span>
+				<span class="info-value">{{formData.billNo || formData.rBillNo}}</span>
+				<span class="info-label">鍒涘缓浜猴細</span>
+				<span class="info-value">{{formData.createBy}}</span>
+			</view>
+			<view class="info-row">
+				<span class="info-label">鍒涘缓鏃堕棿锛�</span>
+				<span class="info-value">{{formData.createDate}}</span>
+				<span class="info-label">&nbsp;鎻愪氦鐘舵�侊細</span>
+				<span class="info-value">{{formData.fsubmit == 1 ? '宸叉彁浜�' : '鏈彁浜�'}}</span>
+			</view>
+		</view>
+
+		<!-- 鐗╂枡淇℃伅鍖� -->
+		<view class="material-info">
+			<view class="info-block">
+				<view class="info-label">鐗╂枡缂栫爜锛�</view>
+				<view class="info-value">{{formData.itemNo}}</view>
+			</view>
+			<view class="info-block">
+				<view class="info-label">浜у搧鍚嶇О锛�</view>
+				<view class="info-value">{{formData.itemName}}</view>
+			</view>
+			<view class="info-block">
+				<view class="info-label">瑙勬牸鍨嬪彿锛�</view>
+				<view class="info-value">{{formData.itemModel}}</view>
+			</view>
+			<view class="info-block">
+				<view class="info-label">閫佹鏁伴噺锛�</view>
+				<view class="info-value highlight">{{formData.quantity}}</view>
+			</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="dropdown-row">
+			<view class="info-label">宸ヤ綔杞﹂棿锛�</view>
+			<view class="info-value">{{formData.workShop}}</view>
+		</view>
+		<view class="dropdown-row">
+			<view class="info-label">鐢熶骇绾垮埆锛�</view>
+			<view class="info-value">{{formData.lineName || formData.daa015}}</view>
+		</view>
+		<view class="dropdown-row">
+			<view class="info-label">鐢熶骇宸ュ崟锛�</view>
+			<view class="info-value">{{formData.billNo || formData.rBillNo}}</view>
+		</view>
+
+		<view class="dropdown-row">
+			<view class="info-label">閫佹鎵规锛�</view>
+			<view class="info-value">{{formData.rbillNo}}</view>
+		</view>
+
+		<!-- 鏂板涓嬫媺妗嗗尯鍩� -->
+		<view class="dropdown-row">
+			<view class="info-label">涓嶈壇鍘熷洜锛�</view>
+			<picker v-if="!isUpdate" :value="badreasonIndex" :range="badreasonOptions" @change="onBadreasonChange">
+				<view class="picker-text" :class="{ 'selected': badreason }">{{ badreason || '璇烽�夋嫨涓嶈壇鍘熷洜' }}</view>
+			</picker>
+			<view v-else class="info-value">{{ badreason }}</view>
+		</view>
+		<view class="dropdown-row">
+			<view class="info-label">鎵�灞炶溅闂达細</view>
+			<picker v-if="!isUpdate" :value="workshopIndex" :range="workshopOptions" @change="onWorkshopChange">
+				<view class="picker-text" :class="{ 'selected': WORKSHOP }">{{ WORKSHOP || '璇烽�夋嫨鎵�灞炶溅闂�' }}</view>
+			</picker>
+			<view v-else class="info-value">{{ WORKSHOP }}</view>
+		</view>
+		<view class="dropdown-row">
+			<view class="info-label">璇勫鐘舵�侊細</view>
+			<picker v-if="!isUpdate" :value="pstypeIndex" :range="pstypeOptions" @change="onPstypeChange">
+				<view class="picker-text" :class="{ 'selected': PSTYPE }">{{ PSTYPE || '璇烽�夋嫨璇勫鐘舵��' }}</view>
+			</picker>
+			<view v-else class="info-value">{{ PSTYPE }}</view>
+		</view>
+		<view class="dropdown-row">
+			<view class="info-label">涓嶈壇鎻忚堪锛�</view>
+			<input v-if="!isUpdate" v-model="formData.fngDesc" placeholder="璇疯緭鍏ヤ笉鑹弿杩�" class="input-field" @blur="saveFngDesc" />
+			<view v-else class="info-value">{{ formData.fngDesc }}</view>
+		</view>
+
+		<!-- 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖� -->
+		<view class="top-action-buttons">
+			<button class="action-btn" v-if="formData.fsubmit != 1" @click="getInspectionItems">鑾峰彇妫�楠岄」鐩�</button>
+		</view>
+
+		<!-- 妫�楠岄」鐩〃鏍� -->
+		<view class="inspection-table" v-if="formData.id">
+			<table>
+				<thead>
+					<tr>
+						<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>
+							<view v-if="item.result=='涓嶅悎鏍�'" class="watermark rejected">
+								{{ getStatusText(item.result) }}
+							</view>
+							<view v-if="item.result==null || item.result=='鏈畬鎴�'" class="watermark pending">
+								{{ getStatusText(item.result) }}
+							</view>
+							<view class="description-text">{{ item.projName }}</view>
+						</td>
+						<td>
+							<button v-if="item.isCheck >= item.levelNum || formData.fsubmit == 1" class="record-btn" @click="toDetail(item)">鏌ョ湅</button>
+							<button v-else class="record-btn" @click="toDetail(item)">濉啓</button>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			<view v-if="tableData.length === 0" class="no-data-tip">
+				<text style="color: #999; font-size: 16px;">璇ユ楠屽崟鏆傛棤妫�楠岄」鐩紝璇风偣鍑�"鑾峰彇妫�楠岄」鐩�"鎸夐挳娣诲姞妫�楠岄」鐩�</text>
+			</view>
+		</view>
+
+		<!-- 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖� -->
+		<view class="bottom-action-buttons">
+			<button class="action-btn small" @click="toImage">涓婁紶/鏌ョ湅鍥剧墖</button>
+			<button class="action-btn small" @click="viewAttachmentInfo">鏌ョ湅闄勪欢淇℃伅</button>
+			<button class="action-btn small" @click="saveRemarks" v-if="formData.fsubmit != 1">娣诲姞涓嶅悎鏍兼弿杩�</button>
+			<button class="action-btn small primary" @click="submitInspection" v-if="formData.fsubmit != 1 && tableData.length > 0">鎻愪氦妫�楠�</button>
+		</view>
+
+		<!-- 淇敼涓嶅悎鏍兼弿杩板脊鍑烘 -->
+		<view v-if="showPopup" 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" placeholder="璇疯緭鍏ヤ笉鍚堟牸鎻忚堪"/>
+					</view>
+				</form>
+				<button class="updateBut" @click="edit">淇敼</button>
+				<button @click="showPopup = !showPopup">鍙栨秷</button>
+			</view>
+		</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="aspectFit" 
+							class="preview-image-clickable"
+							@click="previewImageInPopup"
+							style="width: 100%; max-height: 400px; cursor: pointer;"
+						/>
+						<div class="image-zoom-hint">鐐瑰嚮鍥剧墖鍙斁澶ф煡鐪�</div>
+					</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>
     export default {
       data() {
         return {
-          formData: {
-            id: "",
-            releaseNo: "",
-            createBy: "",
-            createDate: "",
-            daa020: "",
-            itemNo: "",
-            billNo: "",
-            catQty: "",
-            detailMem: "",
-            taskNo: "",
-            fcheckResu: "",
-            remarks: "",
-            rbillNo: ""
-          },
+                     formData: {
+             id: "",
+             releaseNo: "",
+             createBy: "",
+             createDate: "",
+             daa020: "",
+             itemNo: "",
+             itemId: "", // 鐗╂枡ID
+             billNo: "",
+             lineNo: "", // 鐢熶骇绾跨紪鍙�
+             catQty: "",
+             detailMem: "",
+             taskNo: "",
+             fcheckResu: "",
+             fsubmit: "", // 鎻愪氦鐘舵��
+             remarks: "",
+             rbillNo: "",
+             workShop: "", // 宸ヤ綔杞﹂棿
+             lineName: "", // 绾夸綋鍚嶇О
+             quantity: "", // 閫佹鏁伴噺
+             planQty: "", // 宸ュ崟璁″垝鏁伴噺
+             fngDesc: "" // 涓嶈壇鎻忚堪
+           },
     
           DAA020List: [],
     
@@ -192,7 +412,30 @@
           remarks: "",
     
           showPopup: false,
-          billNoList: [],
+          departmentList: [], // 杞﹂棿鍒楄〃
+          selectedDepartmentId: "", // 閫変腑鐨勮溅闂碔D
+          // 闄勪欢鐩稿叧鏁版嵁
+          attachments: [],
+          showAttachmentPopup: false,
+          attachmentsLoading: false,
+          selectedAttachment: null,
+          showAttachmentDetail: false,
+          showFilePreviewPopup: false,
+          previewContent: '',
+          previewTitle: '',
+          previewItemNo: '',
+          previewType: '', // 'text', 'image', 'excel', 'unsupported'
+          
+          // 鏂板涓嬫媺妗嗙浉鍏虫暟鎹�
+          badreason: '',
+          PSTYPE: '',
+          WORKSHOP: '',
+          badreasonOptions: ['', '澶栬涓嶈壇', '灏哄涓嶈壇', '鍖呰涓嶈壇', '鎬ц兘涓嶈壇', '瑁呴厤涓嶈壇', '瀹夎涓嶈壇'],
+          badreasonIndex: 0,
+          workshopOptions: ['', '鐢熶骇涓�閮�', '鐢熶骇浜岄儴', '娉ㄥ杞﹂棿', '鍏朵粬'],
+          workshopIndex: 0,
+          pstypeOptions: ['', '鐗归噰/璁╂浣跨敤', '鎸戦��/杩斿伐浣跨敤', '閫�璐�', '寰呭垽'],
+          pstypeIndex: 0,
         };
       },
       onLoad(options) {
@@ -215,13 +458,12 @@
             this.formData.createBy = this.$loginInfo.account;
             this.formData.createDate = this.$getDate("yyyy-mm-dd");
           });
-    
-          //杞﹂棿涓嬫媺妗嗙殑鍒濆鍖�
+
+          // 鍒濆鍖栬溅闂翠笅鎷夋
           this.$post({
-            url: "/XJ/getLineAll"
+            url: "/RKJ/GetDepartmentsWithLines"
           }).then(res => {
-            this.lineList = res.data.tbBillList;
-            this.DAA020List = res.data.tbBillList.map(item => item.lineName);
+            this.departmentList = res.data.tbBillList.map(item => item.departmentname);
           })
         }
       },
@@ -269,28 +511,77 @@
         },
         getItem() {
     
+          if (!this.formData.workShop) {
+            this.$showMessage("璇烽�夋嫨宸ヤ綔杞﹂棿");
+            return;
+          }
+          
+          if (!this.formData.lineName) {
+            this.$showMessage("璇烽�夋嫨鐢熶骇绾夸綋");
+            return;
+          }
+          
+          if (!this.formData.rBillNo) {
+            this.$showMessage("璇烽�夋嫨鐢熶骇宸ュ崟");
+            return;
+          }
+          
+          if (!this.formData.quantity || parseFloat(this.formData.quantity) <= 0) {
+            this.$showMessage("璇疯緭鍏ユ湁鏁堢殑閫佹鏁伴噺");
+            return;
+          }
+          
+          const quantity = parseFloat(this.formData.quantity);
+          const planQty = parseFloat(this.formData.planQty);
+          
+          if (quantity > planQty) {
+            this.$showMessage("閫佹鏁伴噺涓嶈兘澶т簬宸ュ崟鏁伴噺");
+            return;
+          }
+          
+          // 纭繚蹇呰瀛楁琚纭缃�
+          if (!this.formData.itemId) {
+            this.$showMessage("鐗╂枡ID鑾峰彇澶辫触锛岃閲嶆柊閫夋嫨宸ュ崟");
+            return;
+          }
+          
           if (!this.formData.billNo) {
-            this.$showMessage("璇烽�夋嫨宸ュ崟鍙�");
+            this.$showMessage("宸ュ崟鍙疯幏鍙栧け璐ワ紝璇烽噸鏂伴�夋嫨宸ュ崟");
             return;
           }
-    
-          if (this.isSubmit) {
-            this.$showMessage("姝ょ墿鏂欐棤鍚敤鐨勬楠岄」鐩紝璇风淮鎶�!");
-            return;
-          }
-    
-          this.$post({
-            url: "/RKJ/save",
-            data: {
-              from: this.formData,
-              userNo: this.$loginInfo.account,
-              //moidNum: this.formData.moidNum
-              items: this.tableData
-            }
-          }).then(res => {
+          
+                     // 璁剧疆Daa015瀛楁锛堢敓浜х嚎鍒級
+           this.formData.daa015 = this.formData.lineNo;
+           
+           // 璁剧疆榛樿鎻愪氦鐘舵�佷负鏈彁浜わ紙0锛�
+           this.formData.fsubmit = 0;
+     
+           this.$post({
+             url: "/RKJ/save",
+             data: {
+               from: this.formData,
+               userNo: this.$loginInfo.account,
+               quantity: this.formData.quantity,
+               //moidNum: this.formData.moidNum
+               items: this.tableData
+             }
+           }).then(res => {
             this.formData.id = res.data.tbBillList;
-            this.$showMessage("鐢熸垚妫�楠岄」鐩垚鍔�");
-            this.init();
+            
+            // 淇濆瓨杞﹂棿閫夋嫨淇℃伅
+            if (this.formData.workShop && this.selectedDepartmentId) {
+              this.$post({
+                url: "/RKJ/SaveDepartmentSelection",
+                data: {
+                  id: this.formData.id,
+                  departmentId: this.selectedDepartmentId,
+                  departmentName: this.formData.workShop
+                }
+              });
+            }
+            
+            this.$showMessage("妫�楠屽崟鍒涘缓鎴愬姛锛佽妫�楠屽崟鏈淮鎶ゆ楠岄」鐩紝璇峰厛缁存姢妫�楠岄」鐩紒");
+            // 涓嶈皟鐢╥nit鏂规硶锛岄伩鍏嶆楠屽崟鍙峰彂鐢熷彉鍖�
             this.isUpdate = false;
           });
         },
@@ -298,11 +589,13 @@
         onDaa020Change(event) {
           //鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧�
           this.formData.lineName = event;
-    
-          this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo;
-    
-          this.formData.line = this.lineNo;
-    
+
+          const selectedLine = this.lineList[this.DAA020List.indexOf(event)];
+          this.lineNo = selectedLine.lineno;
+          
+          // 璁剧疆鐢熶骇绾跨紪鍙峰埌formData
+          this.formData.lineNo = this.lineNo;
+
           this.$post({
             url: "/RKJ/getDaa001",
             data: {
@@ -311,46 +604,119 @@
           }).then(res => {
             this.BillNoList = res.data.tbBillList;
             // 宸ュ崟鍙峰幓閲嶏紝鍙樉绀哄敮涓�
-            this.DAA001List = Array.from(new Set(res.data.tbBillList.map(s => s.rBillNo)));
+            this.DAA001List = Array.from(new Set(res.data.tbBillList.map(s => s.daa001)));
             this.formData.rBillNo = "";
-            this.formData.billNo = "";
+            // 涓嶆竻绌洪�佹鏁伴噺锛屼繚鎸佺敤鎴峰凡杈撳叆鐨勫��
             this.formData.itemName = "";
             this.formData.itemNo = "";
-            this.formData.quantity = "";
-            this.billNoList = [];
+            this.formData.itemId = ""; // 娓呯┖鐗╂枡ID
+            this.formData.itemModel = "";
+            this.formData.planQty = "";
+            this.formData.rbillNo = ""; // 娓呯┖閫佹鎵规鍙�
             this.tableData = [];
           })
         },
+        // 杞﹂棿閫夋嫨浜嬩欢
+        onDepartmentChange(event) {
+          this.formData.workShop = event;
+          
+          // 鏍规嵁杞﹂棿鍚嶇О鑾峰彇杞﹂棿ID
+          this.$post({
+            url: "/RKJ/GetDepartmentsWithLines"
+          }).then(res => {
+            const department = res.data.tbBillList.find(item => item.departmentname === event);
+            if (department) {
+              this.selectedDepartmentId = department.departmentid;
+              
+              // 鏍规嵁杞﹂棿ID鑾峰彇绾夸綋鍒楄〃
+              this.$post({
+                url: "/RKJ/GetLinesByDepartment",
+                data: {
+                  departmentId: this.selectedDepartmentId
+                }
+              }).then(lineRes => {
+                console.log("绾夸綋鏁版嵁:", lineRes.data.tbBillList); // 娣诲姞璋冭瘯鏃ュ織
+                this.lineList = lineRes.data.tbBillList;
+                this.DAA020List = lineRes.data.tbBillList.map(item => item.linename);
+                
+                // 娓呯┖鐩稿叧鏁版嵁
+                this.formData.lineName = "";
+                this.formData.lineNo = ""; // 娓呯┖鐢熶骇绾跨紪鍙�
+                this.formData.rBillNo = "";
+                this.formData.billNo = ""; // 娓呯┖宸ュ崟鍙�
+                // 涓嶆竻绌洪�佹鏁伴噺锛屼繚鎸佺敤鎴峰凡杈撳叆鐨勫��
+                this.formData.itemName = "";
+                this.formData.itemNo = "";
+                this.formData.itemId = ""; // 娓呯┖鐗╂枡ID
+                this.formData.itemModel = "";
+                this.formData.planQty = "";
+                this.formData.rbillNo = ""; // 娓呯┖閫佹鎵规鍙�
+                this.tableData = [];
+              });
+            }
+          });
+        },
         //閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅
         onDaa001Change(e) {
-    
           this.formData.rBillNo = e;
-    
-          // 鎵惧嚭鎵�鏈夊睘浜庤宸ュ崟鍙风殑閫佹鎵规
-          this.billNoList = this.BillNoList.filter(item => item.rBillNo === e).map(item => item.billNo);
-          this.formData.billNo = "";
-          this.formData.itemName = "";
-          this.formData.itemNo = "";
-          this.formData.quantity = "";
-          this.tableData = [];
-        },
-        onBillNoChange(e) {
-          this.formData.billNo = e;
-          // 鎵惧埌褰撳墠宸ュ崟鍙�+閫佹鎵规鍙风殑瀹屾暣鏁版嵁
-          let data = this.BillNoList.find(item => item.rBillNo === this.formData.rBillNo && item.billNo === e);
+          
+          // 鎵惧埌褰撳墠宸ュ崟鍙风殑瀹屾暣鏁版嵁
+          let data = this.BillNoList.find(item => item.daa001 === e);
           if (!data) {
             this.formData.itemName = "";
             this.formData.itemNo = "";
+            this.formData.itemId = "";
+            this.formData.billNo = "";
+            this.formData.rbillNo = "";
             this.formData.quantity = "";
             this.formData.itemModel = "";
             this.tableData = [];
             return;
           }
-          this.formData.itemName = data.itemName;
-          this.formData.itemNo = data.itemNo;
-          this.formData.quantity = data.quantity;
-          this.formData.itemModel = data.itemModel || "";
-          // 濡傞渶鑷姩璇锋眰妫�楠岄」鐩紝鍙湪姝ゅ琛ュ厖閫昏緫
+          
+                     // 鑷姩濉厖鐗╂枡淇℃伅
+           this.formData.itemName = data.daa003; // 浜у搧鍚嶇О
+           this.formData.itemNo = data.daa002; // 浜у搧缂栫爜
+           this.formData.itemId = data.itemId || ""; // 鐗╂枡ID
+           this.formData.billNo = data.daa001; // 宸ュ崟鍙蜂綔涓篵illNo
+           this.formData.rbillNo = "鏃犳簮鍗�"; // 閫佹鎵规鍙凤紙浣跨敤榛樿鍊硷級
+           this.formData.itemModel = data.daa004 || ""; // 浜у搧瑙勬牸
+           this.formData.planQty = data.daa008 || ""; // 宸ュ崟鏁伴噺
+          // 涓嶆竻绌洪�佹鏁伴噺锛屼繚鎸佺敤鎴峰凡杈撳叆鐨勫��
+          this.tableData = [];
+        },
+        // 閫佹鏁伴噺鍙樺寲浜嬩欢
+        onQuantityChange(event) {
+          // 濡傛灉杈撳叆涓虹┖锛屼笉杩涜楠岃瘉
+          if (!this.formData.quantity || this.formData.quantity === "") {
+            return;
+          }
+          
+          const quantity = parseFloat(this.formData.quantity);
+          
+          // 妫�鏌ユ槸鍚︿负鏈夋晥鏁板瓧
+          if (isNaN(quantity)) {
+            this.$showMessage("璇疯緭鍏ユ湁鏁堢殑鏁板瓧");
+            this.formData.quantity = "";
+            return;
+          }
+          
+          // 鍙湁鍦ㄨ緭鍏ュ畬鎴愪笖鏁伴噺澶т簬0鏃舵墠杩涜楠岃瘉
+          if (quantity <= 0) {
+            this.$showMessage("閫佹鏁伴噺蹇呴』澶т簬0");
+            this.formData.quantity = "";
+            return;
+          }
+          
+          // 鍙湁鍦ㄥ凡閫夋嫨宸ュ崟涓旀湁宸ュ崟鏁伴噺鏃舵墠杩涜鏁伴噺姣旇緝
+          if (this.formData.planQty) {
+            const planQty = parseFloat(this.formData.planQty);
+            if (!isNaN(planQty) && quantity > planQty) {
+              this.$showMessage("閫佹鏁伴噺涓嶈兘澶т簬宸ュ崟鏁伴噺");
+              this.formData.quantity = "";
+              return;
+            }
+          }
         },
         init() {
           this.$post({
@@ -364,60 +730,178 @@
           }).then(res => {
             let data = res.data.tbBillList[0];
             if (data) {
-              this.formData = data;
-    
-              this.$post({
-                url: "/RKJ/getItems",
-                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;
-                }
-              })
+              // 淇濆瓨鍘熸湁鐨勬楠屽崟鍙�
+              const originalReleaseNo = this.formData.releaseNo;
+              
+              // 鏄犲皠鏁版嵁搴撳瓧娈靛埌鍓嶇瀛楁
+              this.formData.id = data.id;
+              this.formData.releaseNo = data.releaseNo || originalReleaseNo;
+              this.formData.createBy = data.createBy;
+              this.formData.createDate = data.createDate;
+              this.formData.billNo = data.billNo;
+              this.formData.rbillNo = data.rbillNo;
+              this.formData.itemNo = data.itemNo;
+              this.formData.itemId = data.itemId;
+              this.formData.lineNo = data.lineNo;
+              this.formData.quantity = data.quantity;
+                             this.formData.fcheckResu = data.fcheckResu;
+               this.formData.fcheckBy = data.fcheckBy;
+               this.formData.fcheckDate = data.fcheckDate;
+               this.formData.fsubmit = data.fsubmit; // 鎻愪氦鐘舵��
+               this.formData.remarks = data.remarks;
+               this.formData.workShop = data.workShop;
+               this.formData.departmentId = data.departmentId;
+              
+              // 浠庡叧鑱旇〃鑾峰彇鐨勫瓧娈�
+              this.formData.itemName = data.itemName;
+              this.formData.itemModel = data.itemModel;
+              this.formData.daa015 = data.daa015;
+              
+              // 鍔犺浇涓嬫媺妗嗗瓧娈垫暟鎹�
+              this.badreason = data.blyy || '';
+              this.PSTYPE = data.pszt || '';
+              this.WORKSHOP = data.sscj || '';
+              this.formData.fngDesc = data.fngDesc || ''; // 鍔犺浇涓嶈壇鎻忚堪
+              
+              // 璁剧疆 picker 绱㈠紩
+              this.badreasonIndex = this.badreasonOptions.indexOf(this.badreason);
+              this.workshopIndex = this.workshopOptions.indexOf(this.WORKSHOP);
+              this.pstypeIndex = this.pstypeOptions.indexOf(this.PSTYPE);
+              
+              // 璁剧疆鐢熶骇绾垮悕绉帮紙濡傛灉鏈塴ineNo锛�
+              if (this.formData.lineNo && this.formData.workShop) {
+                this.formData.lineName = this.formData.lineNo;
+              }
+              
+              // 鍔犺浇杞﹂棿鍒楄〃鍜岀浉鍏充俊鎭�
+              this.loadDepartmentAndLineInfo();
+              
+              // 鍔犺浇妫�楠岄」鐩�
+              this.loadInspectionItems();
             }
           });
         },
-        toDetail(item) {
-    
-          if (this.isUpdate) {
-            uni.showToast({
-              icon: "none",
-              title: "璇峰厛鐢熸垚妫�楠岄」鐩�",
-              duration: 2000,
-            });
-          } else {
-            uni.navigateTo({
-              url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData
-                  .id + '&itemInId=' + this.formData.itemInId
+        
+        // 鍔犺浇杞﹂棿鍜岀嚎浣撲俊鎭�
+        loadDepartmentAndLineInfo() {
+          this.$post({
+            url: "/RKJ/GetDepartmentsWithLines"
+          }).then(deptRes => {
+            this.departmentList = deptRes.data.tbBillList.map(item => item.departmentname);
+            
+            if (this.formData.workShop) {
+              const department = deptRes.data.tbBillList.find(item => item.departmentname === this.formData.workShop);
+              if (department) {
+                this.selectedDepartmentId = department.departmentid;
+                this.loadLineInfo();
+              }
+            }
+          });
+        },
+        
+        // 鍔犺浇绾夸綋淇℃伅
+        loadLineInfo() {
+          if (this.selectedDepartmentId) {
+            this.$post({
+              url: "/RKJ/GetLinesByDepartment",
+              data: {
+                departmentId: this.selectedDepartmentId
+              }
+            }).then(lineRes => {
+              this.lineList = lineRes.data.tbBillList;
+              this.DAA020List = lineRes.data.tbBillList.map(item => item.linename);
+              
+              if (this.formData.lineNo) {
+                const selectedLine = this.lineList.find(line => line.lineNo === this.formData.lineNo);
+                if (selectedLine) {
+                  this.formData.lineName = selectedLine.lineName;
+                }
+                this.loadWorkOrderInfo();
+              }
             });
           }
         },
+        
+        // 鍔犺浇宸ュ崟淇℃伅
+        loadWorkOrderInfo() {
+          if (this.formData.lineNo) {
+            this.$post({
+              url: "/RKJ/getDaa001",
+              data: {
+                lineNo: this.formData.lineNo
+              }
+            }).then(workOrderRes => {
+              this.BillNoList = workOrderRes.data.tbBillList;
+              this.DAA001List = Array.from(new Set(workOrderRes.data.tbBillList.map(s => s.daa001)));
+            });
+          }
+        },
+        
+        // 鍔犺浇妫�楠岄」鐩�
+        loadInspectionItems() {
+          this.$post({
+            url: "/RKJ/getItems",
+            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) {
+              console.log("娌℃湁鎵惧埌妫�楠岄」鐩�");
+            }
+          }).catch(error => {
+            console.error("鍔犺浇妫�楠岄」鐩け璐�:", error);
+            this.tableData = [];
+          });
+        },
+                 toDetail(item) {
+     
+           if (this.isUpdate) {
+             uni.showToast({
+               icon: "none",
+               title: "璇峰厛鐢熸垚妫�楠岄」鐩�",
+               duration: 2000,
+             });
+           } else if (this.formData.fsubmit == 1) {
+             uni.showToast({
+               icon: "none",
+               title: "璇ユ楠屽崟宸叉彁浜わ紝涓嶈兘淇敼",
+               duration: 2000,
+             });
+           } else {
+             uni.navigateTo({
+               url: 'detail?id=' + item.id + '&billNo=' + this.formData.billNo + '&gid=' + this.formData
+                   .id + '&itemInId=' + this.formData.itemInId
+             });
+           }
+         },
         toImage() {
           uni.navigateTo({
             url: 'ImageItem?id=' + this.formData.id
           });
         },
-        saveRemarks() {
-          this.showPopup = !this.showPopup;
-          this.remarks = this.formData.remarks;
-        },
+                 saveRemarks() {
+           if (this.formData.fsubmit == 1) {
+             this.$showMessage("璇ユ楠屽崟宸叉彁浜わ紝涓嶈兘淇敼涓嶅悎鏍兼弿杩�");
+             return;
+           }
+           this.showPopup = !this.showPopup;
+           this.remarks = this.formData.remarks;
+         },
         edit() {
           if (this.remarks) {
             //saveRemarksGid
@@ -435,22 +919,61 @@
               }
             })
           }
-        },getTable() {
+                         },getInspectionItems() {
+          // 鑾峰彇妫�楠岄」鐩殑閫昏緫 - 璋冪敤瀛樺偍杩囩▼
+          this.$post({
+            url: "/RKJ/genUpdate",
+            data: {
+              id: this.formData.id,
+              no: this.formData.releaseNo,
+              user: this.$loginInfo.account
+            }
+          }).then(res => {
+            if (res.status == 0) {
+              uni.showToast({
+                title: res.data.message || "妫�楠岄」鐩敓鎴愭垚鍔�",
+                icon: 'success',
+                duration: 2000
+              });
+              // 寤惰繜閲嶆柊鍔犺浇鏁版嵁
+              setTimeout(() => {
+                this.init();
+              }, 2000);
+            } else {
+              uni.showToast({
+                title: res.data.message || "妫�楠岄」鐩敓鎴愬け璐�",
+                icon: 'error',
+                duration: 2000
+              });
+            }
+          }).catch(error => {
+            console.error("鑾峰彇妫�楠岄」鐩け璐�:", error);
+            this.$showMessage("鑾峰彇妫�楠岄」鐩け璐ワ紝璇烽噸璇�");
+          });
+        },
+        getTable() {
+          // 纭繚quantity鏈夊��
+          if (!this.formData.quantity || parseFloat(this.formData.quantity) <= 0) {
+            this.$showMessage("璇峰厛杈撳叆鏈夋晥鐨勯�佹鏁伴噺");
+            return;
+          }
+          
           this.$post({
             url: "/RKJ/setJYItem",
             data: {
               itemNo: this.formData.itemNo,
-              quantity:this.formData.quantity
+              quantity: this.formData.quantity
             }
           }).then(res => {
     
             this.tableData = res.data.tbBillList;
             if (this.tableData.length === 0) {
-              this.$showMessage("璇ョ墿鏂欐潯鐮佹病鏈夋楠岄」鐩�");
+              this.$showMessage("璇ョ墿鏂欐湭缁存姢妫�楠岄」鐩紝璇峰厛缁存姢妫�楠岄」鐩紒");
               this.isSubmit = true;
               this.tableData = [];
               this.isShowTable = true;
-              this.isUpdate = false;
+              // 淇濇寔鏂板缓妯″紡锛屼笉鍒囨崲鍒版煡鐪嬫ā寮�
+              this.isUpdate = true;
             } else {
               this.isSubmit = false;
               this.isShowTable = true;
@@ -477,23 +1000,613 @@
             this.init();
           })
         },
-        cleanResult(){
+                 cleanResult(){
+             if (this.formData.fsubmit == 1) {
+                 this.$showMessage("璇ユ楠屽崟宸叉彁浜わ紝涓嶈兘娓呴櫎妫�楠岀粨鏋�");
+                 return;
+             }
+             this.$post({
+               url: "/RKJ/cleanReqResult",
+               data: {
+                 gid: this.formData.id,
+                 userNo: this.$loginInfo.account
+               }
+             }).then(res => {
+                 console.log(res);
+                 if(res.status == 0){
+                     this.init();
+                 }else{
+                     this.$showMessage(res.message);
+                 }
+               
+             })
+         },
+         
+         // 鎻愪氦妫�楠屾柟娉�
+         submitInspection() {
+             // 妫�鏌ユ槸鍚﹀凡鎻愪氦
+             if (this.formData.fsubmit == 1) {
+                 this.$showMessage("璇ユ楠屽崟宸叉彁浜わ紝涓嶈兘閲嶅鎻愪氦");
+                 return;
+             }
+             
+             // 妫�鏌ユ槸鍚︽湁妫�楠岄」鐩�
+             if (this.tableData.length === 0) {
+                 this.$showMessage("璇峰厛鑾峰彇妫�楠岄」鐩�");
+                 return;
+             }
+             
+             // 妫�鏌ユ槸鍚︽墍鏈夋楠岄」鐩兘宸插畬鎴�
+             const unfinishedItems = this.tableData.filter(item => 
+                 item.result === null || item.result === '鏈畬鎴�'
+             );
+             
+             if (unfinishedItems.length > 0) {
+                 this.$showMessage("杩樻湁妫�楠岄」鐩湭瀹屾垚锛岃鍏堝畬鎴愭墍鏈夋楠岄」鐩�");
+                 return;
+             }
+             
+             // 妫�鏌ラ拤閽夋帹閫佹潯浠讹細PSZT涓哄緟鍒わ紝涓斾笉鑹師鍥犮�佷笉鑹弿杩般�佹墍灞炶溅闂翠笉涓虹┖
+             const shouldPushToDingTalk = this.PSTYPE === '寰呭垽' && 
+                                         this.badreason && 
+                                         this.formData.fngDesc && 
+                                         this.WORKSHOP;
+             
+             let confirmMessage = '纭畾瑕佹彁浜ゆ妫�楠屽崟鍚楋紵鎻愪氦鍚庡皢鏃犳硶淇敼銆�';
+             if (shouldPushToDingTalk) {
+                 confirmMessage += '\n\n婊¤冻閽夐拤鎺ㄩ�佹潯浠讹紝灏嗚嚜鍔ㄦ帹閫佸埌閽夐拤瀹℃壒娴佺▼銆�';
+             }
+             
+             // 纭鎻愪氦
+             uni.showModal({
+                 title: '纭鎻愪氦',
+                 content: confirmMessage,
+                 success: (res) => {
+                     if (res.confirm) {
+                         this.$post({
+                             url: "/RKJ/submitInspection",
+                             data: {
+                                 id: this.formData.id,
+                                 userNo: this.$loginInfo.account
+                             }
+                         }).then(res => {
+                             if (res.status == 0) {
+                                 let successMessage = "妫�楠屽崟鎻愪氦鎴愬姛锛�";
+                                 if (shouldPushToDingTalk) {
+                                     successMessage += "\n宸叉帹閫佸埌閽夐拤瀹℃壒娴佺▼銆�";
+                                 }
+                                 this.$showMessage(successMessage);
+                                 // 鏇存柊鏈湴鐘舵��
+                                 this.formData.fsubmit = 1;
+                                 // 鍒锋柊鏁版嵁
+                                 this.init();
+                             } else {
+                                 this.$showMessage(res.message || "鎻愪氦澶辫触");
+                             }
+                         }).catch(error => {
+                             console.error("鎻愪氦澶辫触:", error);
+                             this.$showMessage("鎻愪氦澶辫触锛岃閲嶈瘯");
+                         });
+                     }
+                 }
+             });
+         },
+         viewAttachmentInfo() {
+            this.showAttachmentPopup = true; // 鍏堝脊绐�
+            this.attachmentsLoading = true;
+            this.attachments = [];
             this.$post({
-              url: "/RKJ/cleanReqResult",
-              data: {
-                gid: this.formData.id,
-                userNo: this.$loginInfo.account
-              }
+              url: "/RKJ/getAttachments",
+              data: { itemNo: this.formData.itemNo }
             }).then(res => {
-                console.log(res);
-                if(res.status == 0){
-                    this.init();
-                }else{
-                    this.$showMessage(res.message);
-                }
-              
+              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" });
+              }
+            });
+          },
+        downloadAttachment(item) {
+          // 鍘婚櫎鎵�鏈夌┖鏍笺�佸叏瑙掔┖鏍笺�佸洖杞︺�佹崲琛�
+          const fileName = item.fattach.replace(/[\s\u3000\r\n]+/g, '').trim();
+          // 浣跨敤閰嶇疆鐨勬湇鍔″櫒鍦板潃鍜孎TP鏈嶅姟鍣ㄥ湴鍧�
+          const url = this.$store.state.serverInfo.serverAPI + "/RKJ/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
+        },
+        // 棰勮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 + "/RKJ/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();
+        },
+        
+        // 鍦ㄥ脊绐椾腑棰勮鍥剧墖锛堟斁澶у姛鑳斤級
+        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鏂囦欢
+        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);
+              }
+            }
+          });
       },
       onShow() {
         //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
@@ -501,331 +1614,1046 @@
           this.init();
         }
       },
+        // 闄勪欢鐩稿叧鏂规硶
+        closeAttachmentPopup() {
+          this.showAttachmentPopup = false;
+        },
+        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);
+        },
+        
+        // 涓嬫媺妗嗕簨浠跺鐞嗘柟娉�
+        onBadreasonChange(e) {
+          const index = e.detail.value;
+          this.badreasonIndex = index;
+          this.badreason = this.badreasonOptions[index];
+          this.saveDropdownFields('badreason');
+        },
+        onWorkshopChange(e) {
+          const index = e.detail.value;
+          this.workshopIndex = index;
+          this.WORKSHOP = this.workshopOptions[index];
+          this.saveDropdownFields('WORKSHOP');
+        },
+        onPstypeChange(e) {
+          const index = e.detail.value;
+          this.pstypeIndex = index;
+          this.PSTYPE = this.pstypeOptions[index];
+          this.saveDropdownFields('PSTYPE');
+        },
+        saveDropdownFields(fieldName) {
+          // 鐩存帴淇濆瓨鍒版暟鎹簱
+          const requestData = {
+            gid: this.formData.id,
+            releaseNo: this.formData.releaseNo,
+            BLYY: this.badreason || '',
+            SSCJ: this.WORKSHOP || '',
+            PSZT: this.PSTYPE || ''
+          };
+          console.log('鍙戦�佺殑鏁版嵁:', requestData);
+          console.log('badreason:', this.badreason);
+          console.log('WORKSHOP:', this.WORKSHOP);
+          console.log('PSTYPE:', this.PSTYPE);
+          console.log('閫夋嫨鐨勫瓧娈�:', fieldName);
+          this.$post({
+            url: "/RKJ/saveDropdownFields",
+            data: requestData
+          }).then(res => {
+            if (res && res.data && res.data.data && res.data.data.tbBillList && res.data.data.tbBillList.length > 0) {
+              // 寤惰繜閲嶆柊鍔犺浇鏁版嵁锛岀‘淇濇暟鎹簱鏇存柊瀹屾垚
+              setTimeout(() => {
+                this.init();
+              }, 500);
+            }
+          }).catch(err => {
+            console.error('淇濆瓨澶辫触锛�', err);
+          });
+        },
+        saveFngDesc() {
+          // 淇濆瓨涓嶈壇鎻忚堪鍒版暟鎹簱
+          this.$post({
+            url: "/RKJ/saveFngDesc",
+            data: {
+              gid: this.formData.id,
+              fngDesc: this.formData.fngDesc
+            }
+          }).then(res => {
+            if (res.status == 0) {
+              this.$showMessage("涓嶈壇鎻忚堪淇濆瓨鎴愬姛");
+            } else {
+              this.$showMessage("涓嶈壇鎻忚堪淇濆瓨澶辫触");
+            }
+          }).catch(error => {
+            console.error("淇濆瓨涓嶈壇鎻忚堪澶辫触:", error);
+            this.$showMessage("淇濆瓨涓嶈壇鎻忚堪澶辫触锛岃閲嶈瘯");
+          });
+        }
+      }
     };
     </script>
     
-    <style scoped>
-    /* 鍩虹鏍峰紡 */
-    .container {
-      padding: 10px;
-      background-color: #f5f7fa;
-      min-height: 100vh;
-    }
-    
-    /* 澶撮儴鏍峰紡 */
-    .header {
-      background-color: white;
-      padding: 20px;
-      border-radius: 8px;
-      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
-      margin-bottom: 20px;
-    }
-    
-    .title {
-      font-size: 24px;
-      font-weight: 600;
-      color: #2c3e50;
-      margin-bottom: 8px;
-    }
-    
-    .order-number {
-      font-size: 14px;
-      color: #3498db;
-      font-weight: 500;
-    }
-    
-    /* 鍖哄煙鏍峰紡 */
-    .section {
-      background-color: white;
-      border-radius: 8px;
-      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
-      margin-bottom: 20px;
-      overflow: hidden;
-    }
-    
-    .section-header {
-      background-color: #f8f9fa;
-      padding: 32px 32px;
-      border-bottom: 1px solid #eee;
-      font-size: 20px;
-      font-weight: 600;
-      color: #2c3e50;
-    }
-    
-    .section-body {
-      padding: 56px 40px;
-    }
-    
-    /* 淇℃伅缃戞牸 */
-    .info-grid {
-      display: grid;
-      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
-      gap: 48px;
-    }
-    
-    .info-item {
-      display: flex;
-      flex-direction: column;
-      gap: 5px;
-    }
-    
-    .info-label {
-      font-size: 16px;
-      font-weight: 600;
-      color: #7f8c8d;
-    }
-    
-    .info-value {
-      font-size: 18px;
-      font-weight: 500;
-      color: #2c3e50;
-    }
-    
-    .info-value.highlight {
-      font-weight: 600;
-      color: #3498db;
-      font-size: 16px;
-    }
-    
-    .info-value.danger {
-      color: #e74c3c;
-      font-weight: 500;
-    }
-    
-    /* 杈撳叆妗嗘牱寮� */
-    .info-input {
-      padding: 14px 20px;
-      border: 1px solid #ddd;
-      border-radius: 4px;
-      font-size: 16px;
-      background-color: white;
-    }
-    
-    /* 閫夋嫨鍣ㄦ牱寮� */
-    .picker-input {
-      border: 1px solid #ddd;
-      border-radius: 4px;
-      padding: 14px 20px;
-      background-color: white;
-      cursor: pointer;
-      font-size: 16px;
-      color: #2c3e50;
-    }
-    
-    /* 妫�楠岄」鐩〃鏍� */
-    .inspection-table {
-      width: 100%;
-      border-radius: 8px;
-      overflow: hidden;
-      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
-      margin: 25px 0;
-    }
-    
-    .inspection-table table {
-      width: 100%;
-      border-collapse: collapse;
-    }
-    
-    .inspection-table th {
-      background-color: #f8f9fa;
-      color: #34495e;
-      padding: 12px 15px;
-      font-weight: bold;
-      text-align: left;
-      border: 1px solid #ddd;
-    }
-    
-    .inspection-table td {
-      padding: 12px 15px;
-      text-align: left;
-      border: 1px solid #ddd;
-    }
-    
-    .inspection-table tr:nth-child(even) {
-      background-color: #f9f9f9;
-    }
-    
-    .inspection-table tr:hover {
-      background-color: #f1f5f9;
-    }
-    
-    /* 姘村嵃鏍峰紡 */
-    .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);
-    }
-    
-    .watermark.approved {
-      color: #2ecc71;
-    }
-    
-    .watermark.rejected {
-      color: #e74c3c;
-    }
-    
-    .watermark.pending {
-      color: #f39c12;
-    }
-    
-    /* 鎻忚堪鏂囨湰瀹瑰櫒 */
-    .description-text {
-      position: relative;
-      z-index: 2;
-      padding: 25px;
-      background-color: rgba(255, 255, 255, 0.7);
-    }
-    
-    /* 璋冩暣琛ㄦ牸鍗曞厓鏍� */
-    .inspection-table td:nth-child(2) {
-      position: relative;
-      overflow: hidden;
-      padding: 0;
-    }
-    
-    .record-btn {
-      padding: 6px 12px;
-      background-color: #f8f9fa;
-      border: 1px solid #ddd;
-      border-radius: 3px;
-      cursor: pointer;
-      transition: all 0.2s;
-      font-size: 14px;
-      color: #333;
-    }
-    
-    .record-btn:hover {
-      background-color: #e9ecef;
-    }
-    
-    
-    /* 鎿嶄綔鎸夐挳 */
-    .action-buttons {
-      display: flex;
-      flex-direction: row;
-      justify-content: flex-end;
-      gap: 20px;
-      margin-bottom: 20px;
-    }
-    
-    .action-btn {
-      padding: 12px 20px;
-      border: none;
-      border-radius: 6px;
-      font-size: 14px;
-      font-weight: 500;
-      cursor: pointer;
-      transition: all 0.2s;
-    }
-    
-    .action-btn.primary {
-      background-color: #3498db;
-      color: white;
-    }
-    
-    .action-btn.secondary {
-      background-color: #95a5a6;
-      color: white;
-    }
-    
-    .action-btn.danger {
-      background-color: #e74c3c;
-      color: white;
-    }
-    
-    .action-btn.warning {
-      background-color: #f39c12;
-      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;
-    }
-    
-    .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;
-    }
-    
-    .popup-header {
-      padding: 20px;
-      border-bottom: 1px solid #eee;
-    }
-    
-    .popup-header h3 {
-      font-size: 18px;
-      font-weight: 600;
-      color: #2c3e50;
-      margin: 0;
-    }
-    
-    .popup-content {
-      padding: 20px;
-    }
-    
-    .input-group {
-      display: flex;
-      flex-direction: column;
-      gap: 8px;
-    }
-    
-    .input-label {
-      font-size: 14px;
-      color: #7f8c8d;
-      font-weight: 500;
-    }
-    
-    .input-field {
-      padding: 8px 12px;
-      border: 1px solid #ddd;
-      border-radius: 4px;
-      font-size: 14px;
-      background-color: white;
-    }
-    
-    .popup-actions {
-      padding: 20px;
-      border-top: 1px solid #eee;
-      display: flex;
-      gap: 10px;
-      justify-content: flex-end;
-    }
-    
-    /* 鍝嶅簲寮忚璁� */
-    @media (max-width: 768px) {
-      .info-grid {
-        grid-template-columns: 1fr;
-        gap: 20px;
-      }
-      
-      .action-buttons {
-        flex-direction: column;
-        justify-content: flex-start;
-        gap: 10px;
-      }
-    }
-    </style>
\ No newline at end of file
+         <style>
+	/* 鏂板缓琛ㄥ崟 - 浼樺寲鍚庣殑UI鏍峰紡 */
+	.create-form {
+		padding: 20px;
+		background-color: #f5f5f5;
+		min-height: 100vh;
+		font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
+	}
+	
+	.form-header {
+		text-align: center;
+		margin-bottom: 30px;
+		padding: 20px;
+		background-color: #fff;
+		border-radius: 8px;
+		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+	}
+	
+	.form-header h2 {
+		color: #2c3e50;
+		font-size: 24px;
+		margin: 0 0 8px 0;
+		font-weight: 600;
+	}
+	
+	.form-subtitle {
+		color: #7f8c8d;
+		font-size: 14px;
+		margin: 0;
+	}
+	
+	.form-content {
+		background-color: #fff;
+		border-radius: 8px;
+		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+		margin-bottom: 20px;
+		overflow: hidden;
+	}
+	
+	.form-section {
+		padding: 20px;
+		border-bottom: 1px solid #ecf0f1;
+	}
+	
+	.form-section:last-child {
+		border-bottom: none;
+	}
+	
+	.section-title {
+		font-size: 16px;
+		font-weight: 600;
+		color: #2c3e50;
+		margin-bottom: 15px;
+		padding-bottom: 8px;
+		border-bottom: 2px solid #3498db;
+		display: flex;
+		align-items: center;
+	}
+	
+	.section-title::before {
+		content: "鈼�";
+		color: #3498db;
+		margin-right: 8px;
+		font-size: 12px;
+	}
+	
+	.form-row {
+		display: flex;
+		align-items: center;
+		margin-bottom: 15px;
+		padding: 12px 0;
+		transition: all 0.3s ease;
+	}
+	
+	.form-row:hover {
+		background-color: #f8f9fa;
+		border-radius: 8px;
+		padding-left: 8px;
+		padding-right: 8px;
+	}
+	
+	.form-row:last-child {
+		margin-bottom: 0;
+	}
+	
+	.form-label {
+		width: 100px;
+		font-weight: 500;
+		color: #34495e;
+		flex-shrink: 0;
+		font-size: 14px;
+		display: flex;
+		align-items: center;
+	}
+	
+	.form-label.required::after {
+		content: " *";
+		color: #e74c3c;
+		font-weight: bold;
+	}
+	
+	.form-value {
+		color: #2c3e50;
+		flex: 1;
+		font-weight: 500;
+		padding: 8px 12px;
+		background-color: #f8f9fa;
+		border-radius: 6px;
+		border: 1px solid #e9ecef;
+	}
+	
+	.form-select {
+		flex: 1;
+		padding: 10px 12px;
+		border: 2px solid #e9ecef;
+		border-radius: 8px;
+		background-color: white;
+		color: #2c3e50;
+		font-size: 14px;
+		transition: all 0.3s ease;
+	}
+	
+	.form-select:focus {
+		border-color: #3498db;
+		box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
+		outline: none;
+	}
+	
+	.form-input {
+		flex: 1;
+		min-width: 200px;
+		padding: 8px 12px;
+		border: 1px solid #ddd;
+		border-radius: 4px;
+		font-size: 14px;
+		background-color: white;
+		box-sizing: border-box;
+	}
+	
+	.large-quantity-input {
+		min-width: 200px !important;
+		padding: 8px 12px !important;
+		font-size: 14px !important;
+		border: 1px solid #ddd !important;
+		border-radius: 4px !important;
+		background-color: white !important;
+		transition: all 0.3s ease;
+		font-weight: normal !important;
+		text-align: left !important;
+		flex: 1;
+	}
+	
+	.large-quantity-input:focus {
+		border-color: #3498db;
+		box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
+		outline: none;
+		background-color: white;
+	}
+	
+	.large-quantity-input::placeholder {
+		color: #95a5a6;
+		font-size: 16px;
+	}
+	
+	.input-field {
+		width: 100%;
+		padding: 8px 12px;
+		border: 1px solid #ddd;
+		border-radius: 4px;
+		font-size: 14px;
+		background-color: white;
+		box-sizing: border-box;
+		min-height: 36px;
+	}
+	
+	.input-field:focus {
+		outline: none;
+		border-color: #3498db;
+		box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
+	}
+	
+	.form-hint {
+		flex: 1;
+		color: #95a5a6;
+		font-size: 14px;
+		font-style: italic;
+		padding: 10px 12px;
+		background-color: #f8f9fa;
+		border-radius: 8px;
+		border: 1px dashed #bdc3c7;
+	}
+	
+	.form-actions {
+		text-align: center;
+		padding: 20px;
+		background-color: #fff;
+		border-radius: 8px;
+		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+	}
+	
+	.btn-primary {
+		background-color: #3498db;
+		color: white;
+		padding: 14px 32px;
+		border: none;
+		border-radius: 8px;
+		font-size: 16px;
+		font-weight: 500;
+		cursor: pointer;
+		transition: all 0.3s ease;
+		display: inline-flex;
+		align-items: center;
+		justify-content: center;
+		gap: 8px;
+		box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
+	}
+	
+	.btn-primary:hover {
+		transform: translateY(-2px);
+		box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
+	}
+	
+	.btn-primary:active {
+		transform: translateY(0);
+	}
+	
+	.btn-primary:disabled {
+		background: #bdc3c7;
+		cursor: not-allowed;
+		transform: none;
+		box-shadow: none;
+	}
+	
+	.btn-icon {
+		font-size: 16px;
+		font-weight: bold;
+	}
+
+	/* 鏌ョ湅/缂栬緫琛ㄥ崟 - LLJ绫讳技鐨勬牱寮� */
+	.inspection-sheet {
+		font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
+		max-width: 1000px;
+		margin: 0 auto;
+		padding: 20px 20px 100px 20px; /* 搴曢儴澧炲姞鍐呰竟璺濅负鍥哄畾鎸夐挳鐣欑┖闂� */
+		background-color: #fff;
+		box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+		min-height: 100vh;
+		position: relative;
+	}
+
+	/* 澶撮儴鏍峰紡 */
+	.sheet-header {
+		text-align: center;
+		margin-bottom: 20px;
+		padding-bottom: 15px;
+		border-bottom: 2px solid #e0e0e0;
+	}
+
+	.sheet-header h1 {
+		color: #2c3e50;
+		font-size: 24px;
+		margin-bottom: 5px;
+	}
+
+	.inspection-number {
+		font-size: 16px;
+		font-weight: bold;
+		color: #3498db;
+	}
+
+	/* 鍩烘湰淇℃伅鍖烘牱寮� */
+	.basic-info,
+	.material-info {
+		margin-bottom: 20px;
+	}
+
+	.info-row {
+		display: flex;
+		margin-bottom: 10px;
+		flex-wrap: wrap;
+	}
+
+	.info-label {
+		font-weight: bold;
+		color: #34495e;
+		min-width: 80px;
+		margin-right: 5px;
+	}
+
+	.info-value {
+		color: #2c3e50;
+		margin-right: 20px;
+	}
+	
+	.picker-text {
+		padding: 6px 10px;
+		border: 1px solid #ddd;
+		border-radius: 4px;
+		background-color: white;
+		color: #999;
+		font-size: 14px;
+		min-height: 32px;
+		display: flex;
+		align-items: center;
+		max-width: 150px;
+	}
+	
+	.picker-text.selected {
+		color: #e74c3c;
+		font-weight: 500;
+	}
+
+	.highlight {
+		font-weight: bold;
+		color: #e74c3c;
+	}
+
+	/* 鐗╂枡淇℃伅鍖烘牱寮� */
+	.material-info {
+		border: 1px solid #eee;
+		padding: 15px;
+		border-radius: 5px;
+	}
+
+	.info-block {
+		display: flex;
+		align-items: center;
+		margin-bottom: 10px;
+		flex-wrap: wrap;
+	}
+
+	.dropdown-row {
+		display: flex;
+		align-items: center;
+		margin-bottom: 10px;
+	}
+
+	/* 琛ㄦ牸鏍峰紡 */
+	.inspection-table {
+		margin: 25px 0;
+	}
+
+	.inspection-table table {
+		width: 100%;
+		border-collapse: collapse;
+	}
+
+	.inspection-table th,
+	.inspection-table td {
+		padding: 12px 15px;
+		border: 1px solid #ddd;
+		text-align: left;
+	}
+
+	.inspection-table th {
+		background-color: #f8f9fa;
+		font-weight: bold;
+		color: #34495e;
+	}
+
+	.inspection-table tr:nth-child(even) {
+		background-color: #f9f9f9;
+	}
+
+	.inspection-table tr:hover {
+		background-color: #f1f5f9;
+	}
+
+	/* 姘村嵃鏍峰紡 */
+	.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);
+	}
+	
+	.watermark.approved {
+		color: #2ecc71;
+	}
+	
+	.watermark.rejected {
+		color: #e74c3c;
+	}
+	
+	.watermark.pending {
+		color: #f39c12;
+	}
+	
+	/* 鎻忚堪鏂囨湰瀹瑰櫒 */
+	.description-text {
+		position: relative;
+		z-index: 2;
+		padding: 25px;
+		background-color: rgba(255, 255, 255, 0.7);
+	}
+	
+	/* 璋冩暣琛ㄦ牸鍗曞厓鏍� */
+	.inspection-table td:nth-child(2) {
+		position: relative;
+		overflow: hidden;
+		padding: 0;
+	}
+
+	/* 琛ㄥ崟涓婃柟鎿嶄綔鎸夐挳鍖烘牱寮� */
+	.top-action-buttons {
+		display: flex;
+		justify-content: flex-end;
+		gap: 10px;
+		margin: 20px 0;
+		padding: 15px;
+		background-color: #f8f9fa;
+		border-radius: 8px;
+		border: 1px solid #e9ecef;
+	}
+
+	/* 琛ㄥ崟涓嬫柟鎿嶄綔鎸夐挳鍖烘牱寮� */
+	.bottom-action-buttons {
+		display: flex;
+		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 {
+		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;
+	}
+
+	/* 灏忓昂瀵告寜閽牱寮� */
+	.action-btn.small {
+		padding: 10px 12px;
+		font-size: 14px;
+		min-height: 44px;
+		white-space: nowrap;
+		flex-shrink: 0;
+		min-width: 80px;
+		max-width: 120px;
+		flex: 1;
+	}
+
+	.record-btn {
+		padding: 6px 12px;
+		background-color: #f8f9fa;
+		border: 1px solid #ddd;
+		border-radius: 3px;
+		cursor: pointer;
+		transition: all 0.2s;
+		font-size: 14px;
+		color: #333;
+	}
+
+	.record-btn:hover {
+		background-color: #e9ecef;
+	}
+
+	/* 寮瑰嚭妗嗘牱寮� */
+	.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;
+	}
+
+	.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;
+		padding: 20px;
+	}
+
+	.popup h3 {
+		font-size: 18px;
+		font-weight: 600;
+		color: #2c3e50;
+		margin: 0 0 20px 0;
+	}
+
+	.form-group {
+		margin-bottom: 15px;
+	}
+
+	.form-label {
+		display: block;
+		font-size: 14px;
+		color: #7f8c8d;
+		font-weight: 500;
+		margin-bottom: 5px;
+	}
+
+	.form-input {
+		width: 100%;
+		padding: 8px 12px;
+		border: 1px solid #ddd;
+		border-radius: 4px;
+		font-size: 14px;
+		background-color: white;
+		box-sizing: border-box;
+	}
+
+	.updateBut {
+		background-color: #3498db;
+		color: white;
+		padding: 10px 20px;
+		border: none;
+		border-radius: 4px;
+		cursor: pointer;
+		font-size: 14px;
+		margin-right: 10px;
+	}
+
+	.updateBut:hover {
+		background-color: #2980b9;
+	}
+
+	/* 鏃犳暟鎹彁绀烘牱寮� */
+	.no-data-tip {
+		text-align: center;
+		padding: 40px 20px;
+		background-color: #f8f9fa;
+		border: 1px dashed #ddd;
+		border-radius: 8px;
+		margin: 20px 0;
+	}
+
+	/* 鍝嶅簲寮忚璁� */
+	@media (max-width: 768px) {
+		.info-row {
+			flex-direction: column;
+		}
+		
+		.info-block {
+			flex-direction: column;
+			align-items: flex-start;
+		}
+		
+		.dropdown-row {
+			flex-direction: column;
+			align-items: flex-start;
+		}
+		
+		.bottom-action-buttons {
+			flex-direction: column;
+			gap: 5px;
+		}
+		
+		.action-btn.small {
+			min-width: 100%;
+			max-width: none;
+		}
+	}
+
+	/* 闄勪欢鐩稿叧鏍峰紡 */
+	.attachment-detail-popup {
+		width: 80vw;
+		max-width: 500px;
+		max-height: 70vh;
+		display: flex;
+		flex-direction: column;
+	}
+	
+	.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;
+		margin-bottom: 8px;
+		font-size: 15px;
+	}
+	
+	.attachment-label {
+		min-width: 80px;
+		color: #1976d2;
+		font-weight: 500;
+		margin-right: 8px;
+	}
+	
+	.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;
+	}
+	
+	.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;
+	}
+	
+	.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;
+	}
+	
+	/* 鍥剧墖鏀惧ぇ棰勮鐩稿叧鏍峰紡 */
+	.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