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 | 3190 ++++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 2,630 insertions(+), 560 deletions(-)
diff --git a/pages/QC/RKJ/Add.vue b/pages/QC/RKJ/Add.vue
index 1fe4639..ceb1d79 100644
--- a/pages/QC/RKJ/Add.vue
+++ b/pages/QC/RKJ/Add.vue
@@ -1,589 +1,2659 @@
<template>
- <view>
- <view class="form-container">
- <form :modelValue="formData">
- <view class="form-group">
- <label class="form-label">妫�楠屽崟鍙�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.releaseNo"/>
- </view>
- <view class="form-group">
- <label class="form-label">鍒涘缓浜�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.createBy"/>
- </view>
- <view class="form-group">
- <label class="form-label">鍒涘缓鏃堕棿:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.createDate"/>
- </view>
- <view class="uni-form-item uni-column form-item edit">
- <text class="form-label">鐢熶骇绾垮埆:</text>
- <superwei-combox v-if="isUpdate" :candidates="DAA020List" placeholder="璇烽�夋嫨鎴栬緭鍏�"
- v-model="formData.lineName"
- @select="onDaa020Change"
- class="picker form-input"
- style="border: none;"></superwei-combox>
- <input v-else class="form-input" disabled="true" type="text" v-model="formData.daa015"/>
- </view>
-
- <view class="uni-form-item uni-column form-item edit">
- <text class="form-label">宸ュ崟鍙�:</text>
- <superwei-combox v-if="isUpdate" :candidates="DAA001List" placeholder="璇烽�夋嫨鎴栬緭鍏�"
- v-model="formData.billNo"
- @select="onDaa001Change"
- class="picker form-input"
- style="border: none;"></superwei-combox>
- <input v-else class="form-input" disabled="true" type="text" v-model="formData.billNo"/>
- </view>
- <view class="form-group">
- <label class="form-label">閫佹鎵规:</label>
- <input class="form-input" type="text" v-model="formData.rbillNo" :readonly="true" />
- </view>
- <view class="form-group">
- <label class="form-label">鐗╂枡缂栫爜:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.itemNo"/>
- </view>
- <view class="uni-title-sub uni-ellipsis-2">
- <view class="form-group">
- <label class="form-label">浜у搧鍚嶇О:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.itemName"/>
- </view>
- </view>
- <view class="form-group">
- <label class="form-label">瑙勬牸鍨嬪彿:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.itemModel"/>
- </view>
- <view class="form-group">
- <label class="form-label">閫佹鏁伴噺:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.quantity"/>
- </view>
- <view class="form-group">
- <label class="form-label">鎶ュ伐浜�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.bgr"/>
- </view>
- <view class="form-group">
- <label class="form-label">妫�楠岀粨鏋�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.fcheckResu"/>
- </view>
- <view class="form-group">
- <label class="form-label">涓嶅悎鏍兼弿杩�:</label>
- <input class="form-input" disabled="true" type="text" v-model="formData.remarks"/>
- </view>
- </form>
- </view>
-
- <view class="list-container">
- <uni-table ref="table" border emptyText="鏆傛棤鏇村鏁版嵁">
- <uni-tr>
- <uni-th align="center" class="th" style="color: #FFFFFF;">妫�楠岄」鐩�</uni-th>
- <uni-th align="center" class="th" style="color: #FFFFFF">鏄惁鍚堟牸</uni-th>
- <uni-th align="center" class="th" style="color: #FFFFFF">璁板綍(鐐瑰嚮)</uni-th>
- </uni-tr>
- <uni-tr v-for="(item, index) in tableData" :key="index">
- <uni-td align="center">
- <input class="form-input" disabled="true" type="text" v-model="item.projName"/>
- </uni-td>
- <uni-td align="center">
- <input class="form-input" disabled="true" type="text" v-model="item.result"/>
- </uni-td>
- <uni-td>
- <view class="uni-group">
- <button v-if="item.isCheck >=item.levelNum" type="default" @click="toDetail(item)">
- {{ item.levelNum + '/' + item.isCheck }}
- </button>
- <button v-else type="warn" @click="toDetail(item)">
- {{ item.levelNum + '/' + item.isCheck }}
- </button>
- </view>
- </uni-td>
- </uni-tr>
- </uni-table>
- </view>
-
- <view class="plus-button">
- <button type="warn" v-if="isUpdate && !isShowTable" @click="getItem">鐢熸垚妫�楠屽崟</button>
- </view>
-
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !isShowTable" @click="toImage">涓婁紶/鏌ョ湅鍥剧墖</button>
- </view>
-
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !isShowTable" @click="saveRemarks">娣诲姞涓嶅悎鏍兼弿杩�</button>
- </view>
-
- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !isShowTable && this.formData.fsubmit != 1" @click="cleanResult">娓呴櫎妫�楠岀粨鏋�</button>
- </view>
-
- <!-- <view class="plus-button">
- <button type="warn" v-if="!isUpdate && !formData.fcheckResu && !isShowTable" @click="removeXJ">鍒犻櫎鍗曟嵁</button>
- </view> -->
-
- <view class="plus-button">
- <button type="warn" v-if="isShowTable" @click="getTable">鑾峰彇妫�楠岄」鐩�</button>
- </view>
-
- <view class="plus-button">
- <button type="warn" v-if="isShowTable && isUpdate" @click="saveTable">鐢熸垚妫�楠岄」鐩�</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"/>
- </view>
- <button type="warn" @click="edit">淇敼</button>
- <button @click="showPopup = !showPopup">鍙栨秷</button>
- </form>
- </view>
- </view>
-
- </view>
- </template>
-
- <script>
- export default {
- data() {
- return {
- formData: {
- id: "",
- releaseNo: "",
- createBy: "",
- createDate: "",
- daa020: "",
- itemNo: "",
- billNo: "",
- catQty: "",
- detailMem: "",
- taskNo: "",
- fcheckResu: "",
+ <!-- 鏂板缓琛ㄥ崟 - 浼樺寲鍚庣殑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"> 鎻愪氦鐘舵�侊細</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: "",
+ itemId: "", // 鐗╂枡ID
+ billNo: "",
+ lineNo: "", // 鐢熶骇绾跨紪鍙�
+ catQty: "",
+ detailMem: "",
+ taskNo: "",
+ fcheckResu: "",
+ fsubmit: "", // 鎻愪氦鐘舵��
+ remarks: "",
+ rbillNo: "",
+ workShop: "", // 宸ヤ綔杞﹂棿
+ lineName: "", // 绾夸綋鍚嶇О
+ quantity: "", // 閫佹鏁伴噺
+ planQty: "", // 宸ュ崟璁″垝鏁伴噺
+ fngDesc: "" // 涓嶈壇鎻忚堪
+ },
+
+ DAA020List: [],
+
+ DAA001List: [],
+
+ BillNoList: [],
+
+ lineList: [],
+
+ lineNo: "",
+
+ tableData: [],
+
+ isSubmit: true,
+
+ isUpdate: true,
+
+ isShowTable: false,
+
remarks: "",
- rbillNo: ""
- },
-
- DAA020List: [],
-
- DAA001List: [],
-
- BillNoList: [],
-
- lineList: [],
-
- lineNo: "",
-
- tableData: [],
-
- isSubmit: true,
-
- isUpdate: true,
-
- isShowTable: false,
-
- remarks: "",
-
- showPopup: false,
- };
- },
- onLoad(options) {
- //options涓寘鍚簡url闄勫甫鐨勫弬鏁�
-
- let params = options;
-
- if (params["id"]) {
- this.isUpdate = false;
- this.formData.id = params["id"];
- this.formData.releaseNo = params["releaseNo"];
- //getQaItemXj02
- this.init();
- } else {
- //鍒濆鍖栨楠屽崟鍙�
- this.$post({
- url: "/RKJ/getMaxReleaseNo"
- }).then(res => {
- this.formData.releaseNo = res.data.tbBillList;
- this.formData.createBy = this.$loginInfo.account;
- this.formData.createDate = this.$getDate("yyyy-mm-dd");
- });
-
- //杞﹂棿涓嬫媺妗嗙殑鍒濆鍖�
- this.$post({
- url: "/XJ/getLineAll"
- }).then(res => {
- this.lineList = res.data.tbBillList;
- this.DAA020List = res.data.tbBillList.map(item => item.lineName);
- })
- }
- },
- methods: {
- removeXJ() {
- if (this.formData.id) {
- this.$post({
- url: "/RKJ/removeXJ",
- data: {
- id: this.formData.id
- }
- }).then(res => {
- if (res.data.tbBillList > 0) {
- this.$showMessage("鍒犻櫎鎴愬姛");
- //鍏抽棴褰撳墠椤甸潰锛岃繑鍥炰笂涓�椤甸潰鎴栧绾ч〉闈�
- uni.navigateBack();
- } else {
- this.$showMessage("鍒犻櫎澶辫触");
- }
- });
- } else {
- this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�");
- }
+
+ showPopup: false,
+ 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,
+ };
},
- getItem() {
-
- if (!this.formData.billNo) {
- 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 => {
- this.formData.id = res.data.tbBillList;
- this.$showMessage("鐢熸垚妫�楠岄」鐩垚鍔�");
- this.init();
+ onLoad(options) {
+ //options涓寘鍚簡url闄勫甫鐨勫弬鏁�
+
+ let params = options;
+
+ if (params["id"]) {
this.isUpdate = false;
- });
- },
- //鐢熶骇绾垮埆閫夋嫨骞跺垵濮嬭瘽宸ュ崟鍙�
- onDaa020Change(event) {
- //鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧�
- this.formData.lineName = event;
-
- this.lineNo = this.lineList[this.DAA020List.indexOf(event)].lineNo;
-
- this.formData.line = this.lineNo;
-
- this.$post({
- url: "/RKJ/getDaa001",
- data: {
- lineNo: this.formData.lineName
- }
- }).then(res => {
- this.BillNoList = res.data.tbBillList;
- this.DAA001List = res.data.tbBillList.map(s => s.billNo);
-
- this.formData.billNo = "";
- this.formData.mocode = "";
- this.formData.boardModel = "";
- this.formData.taskNo = "";
- this.formData.itemNo = "";
- this.formData.boardName = "";
- this.formData.quantity = "";
- this.tableData = [];
- })
- },
- //閫夊彇宸ュ崟濉厖鐗╂枡鍙峰拰鍏朵粬淇℃伅
- onDaa001Change(e) {
-
- this.formData.billNo = e;
-
- let data = this.BillNoList[this.DAA001List.indexOf(e)];
-
- //褰撹繑鍥炵殑缁撴灉闆嗕负绌烘椂缃┖鍘熸湁鐨勫��
- if (!data) {
- this.formData.billNo = "";
- this.formData.mocode = "";
- this.formData.boardModel = "";
- this.formData.taskNo = "";
- this.formData.itemNo = "";
- this.formData.boardName = "";
- this.formData.quantity = "";
- this.tableData = [];
- return;
+ this.formData.id = params["id"];
+ this.formData.releaseNo = params["releaseNo"];
+ //getQaItemXj02
+ this.init();
+ } else {
+ //鍒濆鍖栨楠屽崟鍙�
+ this.$post({
+ url: "/RKJ/getMaxReleaseNo"
+ }).then(res => {
+ this.formData.releaseNo = res.data.tbBillList;
+ this.formData.createBy = this.$loginInfo.account;
+ this.formData.createDate = this.$getDate("yyyy-mm-dd");
+ });
+
+ // 鍒濆鍖栬溅闂翠笅鎷夋
+ this.$post({
+ url: "/RKJ/GetDepartmentsWithLines"
+ }).then(res => {
+ this.departmentList = res.data.tbBillList.map(item => item.departmentname);
+ })
}
- //涓嶄负绌烘椂璧嬪��
- this.formData.billNo = data.billNo;
- this.formData.mocode = data.mocode;
- this.formData.boardModel = data.boardModel;
- this.formData.taskNo = data.taskNo;
- this.formData.itemNo = data.itemNo;
- this.formData.boardName = data.boardName;
- this.formData.quantity = data.quantity;
-
-
- this.$post({
- url: "/RKJ/setJYItem",
- data: {
- itemNo: this.formData.itemNo,
- quantity:this.formData.quantity
- }
- }).then(res => {
- this.tableData = res.data.tbBillList;
- if (this.tableData.length === 0) {
- this.$showMessage("璇ョ墿鏂欐潯鐮佹病鏈夋楠岄」鐩�");
- this.isSubmit = true;
- this.tableData = [];
- } else {
- this.isSubmit = false;
- }
- });
},
- init() {
- this.$post({
- url: "/RKJ/getPage",
- data: {
- id: this.formData.id,
- createUser: this.$loginInfo.account,
- pageIndex: 1,
- limit: 1,
+ methods: {
+ getStatusClass(result) {
+ if (result === '鍚堟牸') return 'status-pass';
+ if (result === '涓嶅悎鏍�') return 'status-fail';
+ return 'status-pending';
+ },
+
+ getStatusText(status) {
+ const statusMap = {
+ approved: '鍚堟牸',
+ rejected: '涓嶅悎鏍�',
+ pending: '寰呯‘璁�'
}
- }).then(res => {
- let data = res.data.tbBillList[0];
- if (data) {
- this.formData = data;
-
+ if (status == null || status == '鏈畬鎴�') {
+ return statusMap['pending'] || '寰呯‘璁�';
+ } else if (status == '鍚堟牸') {
+ return statusMap['approved'] || '鍚堟牸';
+ } else {
+ return statusMap['rejected'] || '涓嶅悎鏍�';
+ }
+ },
+
+ removeXJ() {
+ if (this.formData.id) {
this.$post({
- url: "/RKJ/getItems",
+ url: "/RKJ/removeXJ",
data: {
- pid: this.formData.id
+ id: 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;
+ }).then(res => {
+ if (res.data.tbBillList > 0) {
+ this.$showMessage("鍒犻櫎鎴愬姛");
+ //鍏抽棴褰撳墠椤甸潰锛岃繑鍥炰笂涓�椤甸潰鎴栧绾ч〉闈�
+ uni.navigateBack();
+ } else {
+ this.$showMessage("鍒犻櫎澶辫触");
+ }
+ });
+ } else {
+ this.$showMessage("璇峰厛閫夋嫨妫�楠屽崟鍙�");
+ }
+ },
+ 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("宸ュ崟鍙疯幏鍙栧け璐ワ紝璇烽噸鏂伴�夋嫨宸ュ崟");
+ return;
+ }
+
+ // 璁剧疆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;
+
+ // 淇濆瓨杞﹂棿閫夋嫨淇℃伅
+ if (this.formData.workShop && this.selectedDepartmentId) {
+ this.$post({
+ url: "/RKJ/SaveDepartmentSelection",
+ data: {
+ id: this.formData.id,
+ departmentId: this.selectedDepartmentId,
+ departmentName: this.formData.workShop
}
});
- this.tableData = tableData;
-
- if (this.tableData.length === 0) {
- this.isShowTable = true;
+ }
+
+ this.$showMessage("妫�楠屽崟鍒涘缓鎴愬姛锛佽妫�楠屽崟鏈淮鎶ゆ楠岄」鐩紝璇峰厛缁存姢妫�楠岄」鐩紒");
+ // 涓嶈皟鐢╥nit鏂规硶锛岄伩鍏嶆楠屽崟鍙峰彂鐢熷彉鍖�
+ this.isUpdate = false;
+ });
+ },
+ //鐢熶骇绾垮埆閫夋嫨骞跺垵濮嬭瘽宸ュ崟鍙�
+ onDaa020Change(event) {
+ //鑾峰彇鐢熶骇绾垮埆鐨勪笅鏍囧湴鍧�
+ this.formData.lineName = event;
+
+ const selectedLine = this.lineList[this.DAA020List.indexOf(event)];
+ this.lineNo = selectedLine.lineno;
+
+ // 璁剧疆鐢熶骇绾跨紪鍙峰埌formData
+ this.formData.lineNo = this.lineNo;
+
+ this.$post({
+ url: "/RKJ/getDaa001",
+ data: {
+ lineNo: this.lineNo
+ }
+ }).then(res => {
+ this.BillNoList = res.data.tbBillList;
+ // 宸ュ崟鍙峰幓閲嶏紝鍙樉绀哄敮涓�
+ this.DAA001List = Array.from(new Set(res.data.tbBillList.map(s => s.daa001)));
+ this.formData.rBillNo = "";
+ // 涓嶆竻绌洪�佹鏁伴噺锛屼繚鎸佺敤鎴峰凡杈撳叆鐨勫��
+ this.formData.itemName = "";
+ this.formData.itemNo = "";
+ 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;
+
+ // 鎵惧埌褰撳墠宸ュ崟鍙风殑瀹屾暣鏁版嵁
+ 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.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({
+ url: "/RKJ/getPage",
+ data: {
+ id: this.formData.id,
+ createUser: this.$loginInfo.account,
+ pageIndex: 1,
+ limit: 1,
+ }
+ }).then(res => {
+ let data = res.data.tbBillList[0];
+ if (data) {
+ // 淇濆瓨鍘熸湁鐨勬楠屽崟鍙�
+ 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();
+ }
+ });
+ },
+
+ // 鍔犺浇杞﹂棿鍜岀嚎浣撲俊鎭�
+ 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() {
+ if (this.formData.fsubmit == 1) {
+ this.$showMessage("璇ユ楠屽崟宸叉彁浜わ紝涓嶈兘淇敼涓嶅悎鏍兼弿杩�");
+ return;
+ }
+ this.showPopup = !this.showPopup;
+ this.remarks = this.formData.remarks;
+ },
+ edit() {
+ if (this.remarks) {
+ //saveRemarksGid
+ this.$post({
+ url: "/RKJ/saveRemarksGid",
+ data: {
+ gid: this.formData.id,
+ remarks: this.remarks
+ }
+ }).then(res => {
+ if(res.data.tbBillList > 0){
+ this.formData.remarks = this.remarks;
+ this.showPopup = !this.showPopup;
+ this.$showMessage("淇濆瓨鎴愬姛");
}
})
}
- });
- },
- 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
- });
- }
- },
- toImage() {
- uni.navigateTo({
- url: 'ImageItem?id=' + this.formData.id
- });
- },
- saveRemarks() {
- this.showPopup = !this.showPopup;
- this.remarks = this.formData.remarks;
- },
- edit() {
- if (this.remarks) {
- //saveRemarksGid
+ },getInspectionItems() {
+ // 鑾峰彇妫�楠岄」鐩殑閫昏緫 - 璋冪敤瀛樺偍杩囩▼
this.$post({
- url: "/RKJ/saveRemarksGid",
+ url: "/RKJ/genUpdate",
data: {
- gid: this.formData.id,
- remarks: this.remarks
+ id: this.formData.id,
+ no: this.formData.releaseNo,
+ user: this.$loginInfo.account
}
}).then(res => {
- if(res.data.tbBillList > 0){
- this.formData.remarks = this.remarks;
- this.showPopup = !this.showPopup;
- this.$showMessage("淇濆瓨鎴愬姛");
+ 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
+ });
}
- })
- }
- },getTable() {
- this.$post({
- url: "/RKJ/setJYItem",
- data: {
- itemNo: this.formData.itemNo,
- quantity:this.formData.quantity
+ }).catch(error => {
+ console.error("鑾峰彇妫�楠岄」鐩け璐�:", error);
+ this.$showMessage("鑾峰彇妫�楠岄」鐩け璐ワ紝璇烽噸璇�");
+ });
+ },
+ getTable() {
+ // 纭繚quantity鏈夊��
+ if (!this.formData.quantity || parseFloat(this.formData.quantity) <= 0) {
+ this.$showMessage("璇峰厛杈撳叆鏈夋晥鐨勯�佹鏁伴噺");
+ return;
}
- }).then(res => {
-
- this.tableData = res.data.tbBillList;
- if (this.tableData.length === 0) {
- this.$showMessage("璇ョ墿鏂欐潯鐮佹病鏈夋楠岄」鐩�");
- this.isSubmit = true;
- this.tableData = [];
- this.isShowTable = true;
- this.isUpdate = false;
- } else {
- this.isSubmit = false;
- this.isShowTable = true;
- this.isUpdate = true;
- }
- });
- },
- saveTable() {
- if (this.tableData.length === 0) {
- return;
- }
-
- this.$post({
- url: "/RKJ/saveItem",
- data: {
- gid: this.formData.id,
- items: this.tableData,
- userNo: this.$loginInfo.account
- }
- }).then(res => {
- this.formData.id = res.data.tbBillList;
- this.isShowTable = false;
- this.isUpdate = false;
- this.init();
- })
- },
- cleanResult(){
+
this.$post({
- url: "/RKJ/cleanReqResult",
+ url: "/RKJ/setJYItem",
+ data: {
+ itemNo: this.formData.itemNo,
+ quantity: this.formData.quantity
+ }
+ }).then(res => {
+
+ this.tableData = res.data.tbBillList;
+ if (this.tableData.length === 0) {
+ this.$showMessage("璇ョ墿鏂欐湭缁存姢妫�楠岄」鐩紝璇峰厛缁存姢妫�楠岄」鐩紒");
+ this.isSubmit = true;
+ this.tableData = [];
+ this.isShowTable = true;
+ // 淇濇寔鏂板缓妯″紡锛屼笉鍒囨崲鍒版煡鐪嬫ā寮�
+ this.isUpdate = true;
+ } else {
+ this.isSubmit = false;
+ this.isShowTable = true;
+ this.isUpdate = true;
+ }
+ });
+ },
+ saveTable() {
+ if (this.tableData.length === 0) {
+ return;
+ }
+
+ this.$post({
+ url: "/RKJ/saveItem",
data: {
gid: this.formData.id,
+ items: this.tableData,
userNo: this.$loginInfo.account
}
}).then(res => {
- console.log(res);
- if(res.status == 0){
- this.init();
- }else{
- this.$showMessage(res.message);
- }
-
+ this.formData.id = res.data.tbBillList;
+ this.isShowTable = false;
+ this.isUpdate = false;
+ this.init();
})
+ },
+ 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/getAttachments",
+ data: { itemNo: this.formData.itemNo }
+ }).then(res => {
+ this.attachmentsLoading = false;
+ if (res.status === 0) {
+ this.attachments = res.data.tbBillList;
+ // 涓烘瘡涓檮浠惰缃粯璁ゅ彲鐢ㄧ姸鎬�
+ this.attachments.forEach((item, index) => {
+ this.$set(item, 'ftpAvailable', true); // 榛樿璁や负鏂囦欢鍙敤
+ this.$set(item, 'checking', false);
+ });
+ } else if (res.status === 1 && res.message === "璇ユ楠屽崟鏈笂浼犻檮浠朵俊鎭紒") {
+ uni.showToast({ title: res.message, icon: "none" });
+ } else {
+ uni.showToast({ title: "鑾峰彇闄勪欢澶辫触", icon: "none" });
+ }
+ });
+ },
+ 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() {
+ //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
+ if (this.formData.id) {
+ 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("淇濆瓨涓嶈壇鎻忚堪澶辫触锛岃閲嶈瘯");
+ });
+ }
}
- },
- onShow() {
- //姣忔杩涘叆椤甸潰閮戒細鎵ц鐨勬柟娉�
- if (this.formData.id) {
- this.init();
- }
- },
- };
- </script>
-
- <style>
- .form-group {
- display: flex;
- align-items: center;
- border-bottom: 1px solid #c9c9c9;
- }
-
- .form-label {
- margin-bottom: 0;
- padding: 5px;
- }
-
- .form-input {
- flex: 1;
- margin-bottom: 0;
- padding: 5px;
- }
-
-
- .picker {
- flex: 1;
- margin-bottom: 0;
- padding: 5px;
- font-size: 12px;
- }
-
- .uni-form-item {
- display: flex;
- border-bottom: 1px solid #c9c9c9;
- }
-
- .edit {
- background-color: white;
- }
-
- /* 榛樿鏍峰紡 */
- .list-container {
- height: 60vh;
- /* 璁剧疆鍒楄〃瀹瑰櫒鐨勯珮搴︿负鍓╀綑绌洪棿锛屽苟鍑忓幓琛ㄥ崟瀹瑰櫒鐨勯珮搴� */
- overflow-y: auto;
- /* 鍏佽鍒楄〃瀹瑰櫒鍨傜洿婊氬姩 */
- padding: 10px;
- /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇鍒楄〃鍐呭鏇寸編瑙� */
- }
-
- /* 鍦ㄥ皬灞忓箷璁惧涓婏紝閲嶇疆楂樺害涓洪�傚簲灞忓箷 */
- @media (max-width: 768px) {
- .list-container {
- height: calc(100vh - 500px);
- /* 閫傚綋璋冩暣楂樺害 */
- }
- }
-
-
- .form-container {
- padding: 10px;
- /* 鍙�夛細娣诲姞涓�浜涘唴杈硅窛锛屼娇琛ㄥ崟鍐呭鏇寸編瑙� */
- }
-
- .th {
- background-color: lightskyblue;
- color: #FFFFFF;
- }
-
-
- .plus-button {
- line-height: 59px;
- font-size: 24px;
- cursor: pointer;
- z-index: 1000;
- margin-bottom: 10px;
- }
-
- .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;
- }
-
- .popup {
- background-color: #fff;
- padding: 20px;
- border: 1px solid #ccc;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
- width: 68vw;
- /* 璁剧疆瀹藉害涓鸿鍙e搴︾殑80% */
- height: 25vh;
- /* 璁剧疆楂樺害涓鸿鍙i珮搴︾殑80% */
- }
- </style>
\ No newline at end of file
+ };
+ </script>
+
+ <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