From 78a3c898908bbb8827d1c2aa6299f92ff03f5847 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期三, 21 十月 2026 15:06:09 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue b/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue
index dae8fc0..9f02bb5 100644
--- a/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue
+++ b/src/views/CNAS/systemManagement/documentControl/components/ControlledFileApplication.vue
@@ -71,7 +71,7 @@
           <div class="search_thing">
             <div class="search_label">涓婁紶闄勪欢锛�</div>
             <div class="search_input"><el-upload style="margin: 8px 0 0px 50px;" action="#" :auto-upload="false"
-                :multiple="false" accept='.pdf' :on-change="handleChangeUpload" v-if="addDialogVisible">
+                :multiple="false" accept='.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.wps,.et,.dps,.txt,.jpg,.jpeg,.png' :on-change="handleChangeUpload" v-if="addDialogVisible">
                 <el-button size="small" type="primary">涓婁紶闄勪欢</el-button>
               </el-upload></div>
           </div>
@@ -437,21 +437,30 @@
     handleCheck0(row) {
       this.checkStampDialogVisible = false
       this.checkDialogVisible = true
-      checkManageDocumentControlledPdf({ id: row.id }).then(res => {
-        const blob = new Blob([res]);
+      checkManageDocumentControlledPdf({ id: row.id }).then(async res => {
+        // 鍚庣杞� PDF 澶辫触鏃朵細杩斿洖 JSON 閿欒锛宐lob 閲屽氨涓嶆槸 PDF
+        if (res.type && res.type.includes('json')) {
+          const data = JSON.parse(await res.text())
+          this.$message.error(data.msg || '闄勪欢杞崲棰勮澶辫触')
+          this.checkDialogVisible = false
+          return
+        }
+        const blob = new Blob([res], { type: 'application/pdf' });
         const file = new File([blob], row.name, { type: 'application/pdf' })
         this.$refs.UpPdfStamp.lookFile(file, this.currentStamp)
       }).catch(err => {
+        this.checkDialogVisible = false
         console.log(err)
       })
     },
     handleDown(row) {
       if (!row.url) return this.$message.warning('鏂囦欢鏈笂浼�')
-      this.$download.saveAs(row.url, row.url);
+      const fileName = row.url.replace(/^[0-9a-fA-F-]{36}_/, '')
+      this.$download.saveAs(this.javaApi + '/word/' + row.url, fileName);
     },
     async uploadPDF(pdfBlob) {
       const formData = new FormData();
-      formData.append('file', pdfBlob, this.fileName + '.pdf'); // 鏂囦欢瀛楁
+      formData.append('file', pdfBlob, (this.currentInfo.name || 'controlled') + '.pdf'); // 鏂囦欢瀛楁
       formData.append('id', this.currentInfo.id); // 鏂囦欢鍚嶅瓧娈�
       formData.append('state', this.type); // 鏂囦欢鍚嶅瓧娈�
       formData.append('writer', this.currentInfo.writer); // 鏂囦欢鍚嶅瓧娈�

--
Gitblit v1.9.3