From a6fdbed4f31530c080b591d78c141e561db78967 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期一, 28 九月 2026 09:35:01 +0800
Subject: [PATCH] feat(inspection): 更新检测类型选项并移除湿度字段 - 将"委托试验"改为"委托检验",增加委托检测、实验室间比对、能力验证等检测类型 - 移除所有表单中的湿度相关字段及验证逻辑 - 在报告准备界面添加印章选择功能,支持MA章、报告章、骑缝章的位置选择 - 优化报告结果流程界面,增加报告下载功能和领报告相关信息字段 - 新增印章管理系统,支持印章的增删改查和图片上传功能

---
 src/views/business/reportPreparation/index.vue |  173 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 168 insertions(+), 5 deletions(-)

diff --git a/src/views/business/reportPreparation/index.vue b/src/views/business/reportPreparation/index.vue
index ccce7c9..d7b3314 100644
--- a/src/views/business/reportPreparation/index.vue
+++ b/src/views/business/reportPreparation/index.vue
@@ -130,8 +130,42 @@
            @click="fullscreen = true;"></i>
         <img v-else alt="" src="@/assets/images/no-full.svg" style="cursor: pointer;" @click="fullscreen = false;">
       </div>
-      <div v-if="approveVisible" style="height: 70vh;">
+      <div v-if="approveVisible" class="approve-preview">
         <onlyoffice ref="onlyoffice" :options="option" style="width: 100%;height: 100%;"/>
+      </div>
+      <div class="seal-select-block" v-loading="sealLoading">
+        <div class="seal-select-title">
+          <span>鎸変綅缃�夋嫨鍗扮珷</span>
+          <span class="seal-select-tip">鑷姩鍖归厤 MA绔� / 1鍙风珷 / 楠戠紳绔狅紝姣忛」鍙崟鐙皟鏁存垨娓呯┖</span>
+        </div>
+        <div v-if="sealOptions.length" class="seal-position-grid">
+          <div v-for="position in sealPositions" :key="position.key" class="seal-position-card">
+            <div class="seal-position-name">{{ position.label }}</div>
+            <div class="seal-position-desc">{{ position.description }}</div>
+            <el-select
+              v-model="selectedSealPositions[position.key]"
+              clearable
+              placeholder="涓嶇洊绔�"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="seal in sealOptions"
+                :key="seal.id"
+                :label="seal.name"
+                :value="Number(seal.id)"
+              />
+            </el-select>
+            <div v-if="getSelectedSeal(position.key)" class="seal-position-preview">
+              <img
+                :src="javaApi + '/img/' + getSelectedSeal(position.key).address"
+                :alt="getSelectedSeal(position.key).name"
+              >
+              <span>{{ getSelectedSeal(position.key).name }}</span>
+            </div>
+            <div v-else class="seal-position-empty">璇ヤ綅缃笉鐩栫珷</div>
+          </div>
+        </div>
+        <el-empty v-if="!sealLoading && sealOptions.length === 0" description="鏆傛棤鍚敤鍗扮珷锛岃鍏堝湪鍗扮珷绠$悊涓淮鎶�" :image-size="54" />
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button :disabled="loadingApprove" @click="approveReasonVisible = true">涓嶆壒鍑�</el-button>
@@ -249,6 +283,7 @@
 import {selectUserCondition} from "@/api/business/inspectionTask";
 import limsTable from "@/components/Table/lims-table.vue";
 import {delFile, downFile, getFileList} from "@/api/business/rawMaterialOrder";
+import {selectEnabledSeals} from "@/api/structural/sealConfig";
 
 export default {
   name: 'ReportPreparation',
@@ -276,6 +311,18 @@
       issuedReasonVisible: false,
       approveVisible: false,
       approveReasonVisible: false,
+      sealOptions: [],
+      sealPositions: [
+        { key: 'maSealId', label: 'MA鏍囧織绔�', description: 'PDF 绗�1椤靛乏涓婅' },
+        { key: 'reportSealId', label: '鎶ュ憡绔�', description: 'Word 妯℃澘鍚勯〉 seal1 / seal2 棰勭暀浣嶇疆' },
+        { key: 'seamSealId', label: '楠戠紳绔�', description: 'PDF 姣忛〉鍙充晶涓棿浣嶇疆' }
+      ],
+      selectedSealPositions: {
+        maSealId: null,
+        reportSealId: null,
+        seamSealId: null
+      },
+      sealLoading: false,
       fullscreen: false,
       loadingApproveReason: false,
       loadingApprove: false,
@@ -307,7 +354,10 @@
         {label: '鍘熸潗鏂欎笅鍗�', value: 1},
       ],
       orderTypeList: [
-        {label: '濮旀墭璇曢獙', value: 'Customer-ordered test'},
+        {label: '濮旀墭妫�娴�', value: 'Commissioned testing'},
+        {label: '瀹為獙瀹ら棿姣斿', value: 'Inter-laboratory comparison'},
+        {label: '鑳藉姏楠岃瘉', value: 'Proficiency testing'},
+        {label: '濮旀墭妫�楠�', value: 'Customer-ordered test'},
         {label: '鎶芥', value: '鎶芥'},
         // { label: '杩涘巶妫�楠�', value: '杩涘巶妫�楠�' },
         // { label: '瀛e害妫�楠�', value: 'Quarterly inspection' },
@@ -986,6 +1036,7 @@
     // 鎵瑰噯鎸夐挳
     handleApprove(row) {
       this.currentInfo = row;
+      this.loadEnabledSeals(row);
       let fileName = (row.urlS === null || row.urlS === '') ? row.url : row.urlS
       let fileType = "docx"
       if (row.tempUrlPdf != null || row.tempUrlPdf === '') {
@@ -1009,10 +1060,16 @@
     },
     // 鎵瑰噯閫氳繃
     subApprove() {
+      const selectedIds = Object.values(this.selectedSealPositions).filter(id => id != null)
+      if (!selectedIds.length) {
+        return this.$message.error('璇疯嚦灏戜负涓�涓綅缃�夋嫨鍗扮珷')
+      }
       this.loadingApprove = true;
       ratifyReport({
         id: this.currentInfo.id,
-        isRatify: 1
+        isRatify: 1,
+        ...this.selectedSealPositions,
+        sealIds: [...new Set(selectedIds)].join(',')
       }).then(res => {
         this.loadingApprove = false;
         this.$message.success('宸叉壒鍑�')
@@ -1022,6 +1079,39 @@
       }).catch(() => {
         this.loadingApprove = false;
       })
+    },
+    loadEnabledSeals(row) {
+      this.sealLoading = true
+      this.sealOptions = []
+      this.selectedSealPositions = { maSealId: null, reportSealId: null, seamSealId: null }
+      selectEnabledSeals().then(res => {
+        this.sealOptions = res.data || []
+        const availableIds = this.sealOptions.map(item => Number(item.id))
+        const legacyIds = String((row && row.sealIds) || '')
+          .split(',')
+          .map(item => Number(item.trim()))
+          .filter(id => availableIds.includes(id))
+        const legacyId = legacyIds[0] || null
+        const maSeal = this.sealOptions.find(item => String(item.name).toUpperCase().includes('MA'))
+        const reportSeal = this.sealOptions.find(item => item.name === '1鍙风珷')
+          || this.sealOptions.find(item => !String(item.name).toUpperCase().includes('MA') && !String(item.name).includes('楠戠紳'))
+          || this.sealOptions[0]
+        const seamSeal = this.sealOptions.find(item => String(item.name).includes('楠戠紳'))
+        this.selectedSealPositions = {
+          maSealId: availableIds.includes(Number(row && row.maSealId))
+            ? Number(row.maSealId) : (maSeal ? Number(maSeal.id) : null),
+          reportSealId: availableIds.includes(Number(row && row.reportSealId))
+            ? Number(row.reportSealId) : (legacyId || (reportSeal ? Number(reportSeal.id) : null)),
+          seamSealId: availableIds.includes(Number(row && row.seamSealId))
+            ? Number(row.seamSealId) : (seamSeal ? Number(seamSeal.id) : legacyId)
+        }
+      }).finally(() => {
+        this.sealLoading = false
+      })
+    },
+    getSelectedSeal(positionKey) {
+      const sealId = this.selectedSealPositions[positionKey]
+      return this.sealOptions.find(item => Number(item.id) === Number(sealId))
     },
     handle(row) {
       this.getAuthorizedPerson()
@@ -1080,7 +1170,7 @@
       ratifyReport({
         id: this.currentInfo.id,
         isRatify: 0,
-        examineTell: this.reason
+        ratifyTell: this.reason
       }).then(res => {
         this.loadingApproveReason = false
         this.$message.success('鎿嶄綔鎴愬姛')
@@ -1091,7 +1181,7 @@
         this.approveReasonVisible = false;
       }).catch(e => {
         this.$message.error('鎿嶄綔澶辫触')
-        this.loadingIssuedReason = false;
+        this.loadingApproveReason = false;
       })
     }
   }
@@ -1156,4 +1246,77 @@
 .fullscreen {
   height: 82vh
 }
+
+.approve-preview {
+  height: 52vh;
+}
+
+.seal-select-block {
+  margin-top: 16px;
+  padding: 14px 16px;
+  border: 1px solid #ebeef5;
+  border-radius: 6px;
+  background: #fafafa;
+}
+
+.seal-select-title {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 12px;
+  color: #303133;
+  font-weight: 600;
+}
+
+.seal-select-tip {
+  color: #909399;
+  font-size: 12px;
+  font-weight: normal;
+}
+
+.seal-position-grid {
+  display: grid;
+  grid-template-columns: repeat(3, minmax(0, 1fr));
+  gap: 14px;
+}
+
+.seal-position-card {
+  padding: 14px;
+  border: 1px solid #dcdfe6;
+  border-radius: 6px;
+}
+
+.seal-position-name {
+  color: #303133;
+  font-weight: 600;
+}
+
+.seal-position-desc {
+  margin: 4px 0 10px;
+  color: #909399;
+  font-size: 12px;
+}
+
+.seal-position-preview {
+  display: flex;
+  align-items: center;
+  margin-top: 12px;
+  color: #606266;
+}
+
+.seal-position-preview img {
+  width: 70px;
+  height: 70px;
+  margin-right: 10px;
+  object-fit: contain;
+}
+
+.seal-position-empty {
+  height: 70px;
+  margin-top: 12px;
+  color: #c0c4cc;
+  font-size: 12px;
+  line-height: 70px;
+  text-align: center;
+}
 </style>

--
Gitblit v1.9.3