From c50a874feed1ceceb18e0d42f95e4094eef98128 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期四, 27 十一月 2025 23:32:56 +0800
Subject: [PATCH] 修改了代码

---
 src/views/archiveManager/index.vue |  266 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 238 insertions(+), 28 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 5513c20..dcb1fb4 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -17,6 +17,64 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="绫诲埆鍙�" prop="categoryNumber">
+        <el-row :gutter="8">
+          <el-col :span="6">
+            <el-select
+              v-model="queryParams.categoryType"
+              placeholder="閫夋嫨绫诲埆绫诲瀷"
+              clearable
+              @change="handleQuery"
+            >
+              <el-option
+                v-for="item in recordTypeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-col>
+          <el-col :span="6">
+            <el-select
+              v-model="queryParams.categoryZone"
+              placeholder="閫夋嫨鍦板尯"
+              clearable
+              @change="handleQuery"
+            >
+              <el-option
+                v-for="item in zoneTypeOptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              />
+            </el-select>
+          </el-col>
+          <el-col :span="4">
+            <el-input
+              v-model="queryParams.categoryYear"
+              placeholder="骞翠唤"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-col>
+          <el-col :span="4">
+            <el-input
+              v-model="queryParams.categorySeq"
+              placeholder="寮�濮嬪簭鍙�"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-col>
+          <el-col :span="4">
+            <el-input
+              v-model="queryParams.categorySeqEnd"
+              placeholder="缁撴潫搴忓彿"
+              clearable
+              @keyup.enter.native="handleQuery"
+            />
+          </el-col>
+        </el-row>
+      </el-form-item>
       <el-form-item label="妗堝嵎棰樺悕" prop="caseTitle">
         <el-input
           v-model="queryParams.caseTitle"
@@ -150,12 +208,19 @@
         />
       </el-form-item>
       <el-form-item label="鎵弿鍔犲伐鍏徃" prop="scanningCompany">
-        <el-input
+        <el-select
           v-model="queryParams.scanningCompany"
-          placeholder="璇疯緭鍏ユ壂鎻忓姞宸ュ叕鍙�"
+          placeholder="璇烽�夋嫨鎵弿鍔犲伐鍏徃"
           clearable
-          @keyup.enter.native="handleQuery"
-        />
+          @change="handleQuery"
+        >
+          <el-option
+            v-for="item in projectCompanyOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item label="妗f绠�(瀹�)鍙�" prop="archiveRoomNumber">
         <el-input
@@ -300,7 +365,7 @@
                   icon="el-icon-edit"
                   @click="handleInfo(scope.row)"
                   v-hasPermi="['system:records:edit']"
-                >妗堝嵎璇︾粏淇℃伅</el-button>
+                >缂栬緫鍗峰唴鐩綍</el-button>
 
                 <el-button
                   size="mini"
@@ -411,7 +476,7 @@
             <div class="option-group">
               <label class="option-label">
                 <input type="checkbox" v-model="excelOptions.includeQrCode">
-                <span>鍖呭惈浜岀淮鐮�</span>
+                <span>鍖呭惈鏉″舰鐮�</span>
               </label>
             </div>
 
@@ -419,10 +484,11 @@
             <div class="option-group">
               <div class="option-label">閫夋嫨娉ㄨВ:</div>
               <div class="annotation-options">
-                <label v-for="i in 5" :key="i" class="annotation-checkbox">
-                  <input type="checkbox" v-model="excelOptions.selectedAnnotations" :value="i">
-                  <span>娉ㄨВ{{ i }}</span>
-                </label>
+              <label v-for="(annotation, index) in excelOptions.selectedAnnotations" :key="index" class="signature-checkbox">
+                              <input type="checkbox" v-model="excelOptions.subselectedAnnotations" :value="index">
+                              <span>{{ annotation }}
+                              </span>
+              </label>
               </div>
             </div>
 
@@ -431,10 +497,13 @@
               <div class="option-label">绛惧悕鏍忚缃�:</div>
               <div class="signature-options">
                 <div class="signature-checkboxes">
-                  <label v-for="i in 3" :key="i" class="signature-checkbox">
-                    <input type="checkbox" v-model="excelOptions.selectedSignatures" :value="i">
-                    <span>绛惧悕鏍弡{ i }}</span>
+                 <label v-for="(signature, index) in excelOptions.selectedSignatures" :key="index" class="signature-checkbox">
+                                 <input type="checkbox" v-model="excelOptions.subselectedSignatures" :value="index">
+                                 <span>{{ signature }}</span>
                   </label>
+
+
+
                 </div>
 <!--                <p v-if="excelOptions.selectedSignatures.length === 0" class="option-tip">璇烽�夋嫨鑷冲皯涓�涓鍚嶆爮</p> -->
               </div>
@@ -442,7 +511,8 @@
           </div>
         </div>
     <!-- 浼樺寲鐨凟xcel棰勮缁勪欢 -->
-    <div class="excel-preview-wrapper" v-if="excelDialogVisible">
+     <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%" :show-close="true" @click="closeExcelPreviewDialog">
+    <div  @click.stop>
       <!-- 涓昏棰勮缁勪欢 -->
       <vue-office-excel
         v-if="currentExcelUrl"
@@ -464,7 +534,7 @@
         <button class="excel-dialog-btn download-btn" @click="handleDownloadClick">涓嬭浇Excel鏂囦欢</button>
       </div>
     </div>
-
+</el-dialog>
         <div class="excel-dialog-footer">
           <button class="excel-dialog-btn preview-btn" @click="handlePreviewClick">棰勮</button>
           <button class="excel-dialog-btn print-btn" @click="handlePrintClick">鎵撳嵃</button>
@@ -761,7 +831,14 @@
           <el-input v-model="form.projectNumber" placeholder="璇疯緭鍏ラ」鐩紪鍙�" />
         </el-form-item>
         <el-form-item label="鎵弿鍔犲伐鍏徃" prop="scanningCompany">
-          <el-input v-model="form.scanningCompany" placeholder="璇疯緭鍏ユ壂鎻忓姞宸ュ叕鍙�" />
+          <el-select v-model="form.scanningCompany" placeholder="璇烽�夋嫨鎵弿鍔犲伐鍏徃">
+            <el-option
+              v-for="item in projectCompanyOptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            />
+          </el-select>
         </el-form-item>
         <el-form-item label="妗f绠�(瀹�)鍙�" prop="archiveRoomNumber">
           <el-input v-model="form.archiveRoomNumber" placeholder="璇疯緭鍏ユ。妗堢(瀹�)鍙�" />
@@ -802,6 +879,7 @@
   name: "Records",
   data() {
     return {
+      showExcelPreview: false,
                   excel: 'http://localhost:8080/profile/upload/12.xls', //璁剧疆鏂囨。缃戠粶鍦板潃锛屽彲浠ユ槸鐩稿鍦板潃
 
       open_check: false,
@@ -812,6 +890,8 @@
       maxId: 0,
       // 椤圭洰鍚嶇О閫夐」
       projectOptions: [],
+      // 椤圭洰绠$悊鍏徃閫夐」
+      projectCompanyOptions: [],
       // 妗f绫诲瀷閫夐」
       recordTypeOptions: [],
       //鍦板尯绫诲瀷
@@ -855,6 +935,11 @@
         pageSize: 10,
         recordId: null,
         inquiryNumber: null,
+        categoryType: null, // 绫诲埆绫诲瀷
+        categoryZone: null, // 绫诲埆鍦板尯
+        categoryYear: null, // 绫诲埆骞翠唤
+        categorySeq: null, // 寮�濮嬪簭鍙�
+        categorySeqEnd: null, // 缁撴潫搴忓彿
         everyProjectName: null,
         caseTitle: null,
         publicAttribute: null,
@@ -885,8 +970,15 @@
     // Excel閫夐」閰嶇疆
     excelOptions: {
       includeQrCode: false, // 鏄惁鍖呭惈浜岀淮鐮�
-      selectedAnnotations: [], // 閫変腑鐨勬敞瑙e垪琛�
+      selectedAnnotations: ["鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+           "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+            "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+             "淇濈鏈熼檺:30骞存垨姘镐箙",
+            "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"], // 閫変腑鐨勬敞瑙e垪琛�
       includeSignature: false, // 鏄惁鍖呭惈绛惧悕鏍�
+            selectedSignatures: ['涓氬姟绉戝绉讳氦浜�:', '瀹℃壒绉戠Щ浜や汉:', '妗f鏁寸悊鍏徃:'], // 閫変腑鐨勭鍚嶆爮鍒楄〃
+            subselectedSignatures: [],
+            subselectedAnnotations: [],
       signaturePosition: 'bottom' // 绛惧悕鏍忎綅缃細top/bottom
     },
       // 琛ㄥ崟鍙傛暟
@@ -926,6 +1018,7 @@
     this.getRecordTypes()
     this.getZoneOptions()
     this.fetchProjectOptions()
+    this.fetchProjectCompanyOptions()
 this.getList()
   },
   watch: {
@@ -1040,6 +1133,23 @@
         console.error('鑾峰彇椤圭洰鍚嶇О鍒楄〃澶辫触:', error)
       }
     },
+    
+    async fetchProjectCompanyOptions() {
+      try {
+        const response = await listAllProjectName()
+        console.log("椤圭洰绠$悊鍏徃鏁版嵁:", response)
+        // 浠庨」鐩暟鎹腑鎻愬彇绠$悊鍏徃淇℃伅
+        const companies = [...new Set(response.data.data.map(item => item.companyName).filter(Boolean))]
+               console.log("椤圭洰绠$悊鍏徃鏁版嵁:", companies)
+
+        this.projectCompanyOptions = companies.map(company => ({
+          value: company,
+          label: company
+        }))
+      } catch (error) {
+        console.error('鑾峰彇椤圭洰绠$悊鍏徃鍒楄〃澶辫触:', error)
+      }
+    },
        /** 鑾峰彇妗f绫诲瀷鍒楄〃 */
        getRecordTypes() {
         return new Promise((resolve) => {
@@ -1077,7 +1187,41 @@
       this.loading = true
       console.log(this.queryParams)
       console.log("--------------")
-      listRecords(this.queryParams).then(response => {
+      // 鍒涘缓queryParams鐨勫壇鏈紝閬垮厤鐩存帴淇敼鍘熷璞�
+      const queryParams = { ...this.queryParams }
+      
+      // 澶勭悊绫诲埆鍙锋悳绱�
+      if ((queryParams.categoryType || queryParams.categoryZone || queryParams.categoryYear) && (queryParams.categorySeq || queryParams.categorySeqEnd)) {
+        // 鏋勫缓鍩虹閮ㄥ垎锛堝墠涓変釜瀛楁淇濇寔涓�鑷达級
+        const baseParts = []
+        if (queryParams.categoryType) baseParts.push(queryParams.categoryType)
+        if (queryParams.categoryZone) baseParts.push(queryParams.categoryZone)
+        if (queryParams.categoryYear) baseParts.push(queryParams.categoryYear)
+        const baseCategory = baseParts.join('-')
+        
+        // 鏋勫缓寮�濮嬬被鍒彿
+        if (queryParams.categorySeq) {
+          queryParams.categoryNumberStart = baseCategory + '-' + queryParams.categorySeq
+        }
+        
+        // 鏋勫缓缁撴潫绫诲埆鍙�
+        if (queryParams.categorySeqEnd) {
+          queryParams.categoryNumberEnd = baseCategory + '-' + queryParams.categorySeqEnd
+        } else if (queryParams.categorySeq) {
+          // 濡傛灉娌℃湁缁撴潫搴忓彿锛屽垯缁撴潫绫诲埆鍙蜂笌寮�濮嬬被鍒彿鐩稿悓
+          queryParams.categoryNumberEnd = queryParams.categoryNumberStart
+        }
+        console.log(queryParams)
+        console.log("9999999999999999999")
+        // 鍒犻櫎鍗曠嫭鐨勫瓧娈碉紝閬垮厤閲嶅鎼滅储
+        delete queryParams.categoryType
+        delete queryParams.categoryZone
+        delete queryParams.categoryYear
+        delete queryParams.categorySeq
+        delete queryParams.categorySeqEnd
+      }
+      
+      listRecords(queryParams).then(response => {
 
         console.log(response)
         this.recordsList = response.data.data
@@ -1126,6 +1270,12 @@
     /** 閲嶇疆鎸夐挳鎿嶄綔 */
     resetQuery() {
       this.resetForm("queryForm")
+      // 纭繚绫诲埆鍙风浉鍏冲瓧娈佃瀹屽叏閲嶇疆
+      this.queryParams.categoryType = null
+      this.queryParams.categoryZone = null
+      this.queryParams.categoryYear = null
+      this.queryParams.categorySeq = null
+      this.queryParams.categorySeqEnd = null
       this.handleQuery()
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -1157,9 +1307,10 @@
     //
     handleSubmit(row)
     {
-   //   alert(row.id)
+     //alert(row.id)
       var id = row.id
-      updateStatusById(id).then(response=>{
+      var status = '褰曞叆瀹屾垚'
+      updateStatusById(status, id).then(response=>{
         this.$modal.msgSuccess("鎻愪氦鎴愬姛")
         this.getList()
       })
@@ -1336,6 +1487,8 @@
     /** 鏌ョ湅骞舵墦鍗癊xcel鏂囦欢 */
     viewAndPrintExcel(row) {
       const id = row.id || this.ids;
+     // alert(id)
+      this.recordId = id;
       this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
 
       // 浠庡悗绔幏鍙朎xcel鏂囦欢
@@ -1364,6 +1517,7 @@
     /** 鍏抽棴Excel寮圭獥骞舵竻鐞嗚祫婧� */
     closeExcelDialog() {
       this.excelDialogVisible = false;
+    //  alert(this.excelDialogVisible)
       if (this.excelPreviewTimeout) {
         clearTimeout(this.excelPreviewTimeout);
         this.excelPreviewTimeout = null;
@@ -1374,12 +1528,32 @@
       }
       this.currentExcelBlob = null;
     },
+closeExcelPreviewDialog()
+{
 
+  this.showExcelPreview = false;
+},
     /** 澶勭悊棰勮鎸夐挳鐐瑰嚮 */
     handlePreviewClick() {
-      this.excelLoading = true;
+      this.showExcelPreview = true;
       this.excelRenderError = '';
+      var id = this.recordId ;
+      this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
 
+      // 浠庡悗绔幏鍙朎xcel鏂囦欢
+      this.getExcelFile(id).then(blob => {
+        this.$modal.closeLoading();
+        // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+        this.currentExcelUrl = URL.createObjectURL(blob);
+        this.currentExcelBlob = blob;
+        this.currentExcelId = id;
+        this.excelDialogVisible = true;
+        this.excelLoading = false;
+      }).catch(error => {
+        this.$modal.closeLoading();
+        console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
+        this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+      });
       // 閲嶇疆vue-office-excel缁勪欢
       if (this.currentExcelUrl) {
         const tempUrl = this.currentExcelUrl;
@@ -1549,9 +1723,9 @@
         // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
         let filename = `record_${this.currentExcelId}`;
         if (includeQrCode) filename += '_qr';
-        if (selectedAnnotations.length > 0) {
-          filename += `_anno${selectedAnnotations.join('')}`;
-        }
+        // if (selectedAnnotations.length > 0) {
+        //   filename += `_anno${selectedAnnotations.join('')}`;
+        // }
         filename += `_${new Date().getTime()}.xlsx`;
 
         link.download = filename;
@@ -1587,7 +1761,7 @@
       });
     },
 
-    /** 娓呯悊Excel棰勮鐩稿叧璧勬簮 */
+    /** 娓呯悊Excel棰勮鐩稿叧璧勬簮骞跺叧闂璇濇 */
     cleanupExcelPreview(iframe, url) {
       setTimeout(() => {
         if (iframe && iframe.parentNode) {
@@ -1597,18 +1771,43 @@
           URL.revokeObjectURL(url);
         }
         this.excelRenderError = '';
+        this.showExcelPreview = false; // 鍏抽棴棰勮瀵硅瘽妗�
       }, 1000);
     },
 
     /** 浠庡悗绔幏鍙朎xcel鏂囦欢 */
     getExcelFile(id) {
+      var includeQrCode = this.excelOptions.includeQrCode;
+      var urls = `${process.env.VUE_APP_BASE_API}/system/records/recordFileList`+"/"+includeQrCode;
+
+
+      if(this.excelOptions.subselectedSignatures.length!=0)
+      {
+        var selectedSignatures = this.excelOptions.subselectedSignatures
+        urls = urls +'/'+ selectedSignatures
+        }
+      if(this.excelOptions.subselectedAnnotations.length!=0)
+      {
+        var selectedAnnotations = this.excelOptions.subselectedAnnotations
+        urls = urls+"/"+selectedAnnotations
+        }
+
       return new Promise((resolve, reject) => {
         // 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
         try {
+          // 鑾峰彇鐢ㄦ埛閫夋嫨鐨勬敞瑙�
+          const { selectedAnnotations } = this.excelOptions;
+
+          // 鏋勫缓鍙傛暟锛屽寘鍚敞瑙e唴瀹�
+          const params = {
+            recordId: id,
+
+          };
+
           axios({
             method: 'Post',
-            url: `${process.env.VUE_APP_BASE_API}/system/records/model`,
-            params: { id: id },
+            url: urls,
+            params: params,
             responseType: 'blob',
             headers: { 'Authorization': 'Bearer ' + getToken() }
           }).then(response => {
@@ -1629,9 +1828,20 @@
     fallbackGetExcelFile(id, resolve, reject) {
       try {
         const xhr = new XMLHttpRequest();
+
+        // 鏋勫缓鏌ヨ鍙傛暟锛屽寘鍚敞瑙e唴瀹�
+        const queryParams = new URLSearchParams({
+          id: id,
+          annotation1: "鏈竻鍗曠敱妗f褰㈡垚閮ㄩ棬瀹屾垚",
+          annotation2: "鏂囦欢绫诲瀷蹇呴』褰曞叆锛屽寘鎷粨璁烘潗鏂欍�佽繃绋嬫潗鏂欍�佺敵璇锋潗鏂欙紝鍏朵粬鏉愭枡",
+          annotation3: "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
+          annotation4: "淇濈鏈熼檺:30骞存垨姘镐箙",
+          annotation5: "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"
+        }).toString();
+
         // 灏濊瘯涓嶅悓鐨凙PI璺緞锛屼互閫傚簲鍙兘鐨勫悗绔疄鐜�
         const apiUrls = [
-          `${process.env.VUE_APP_BASE_API}/system/records/model?id=${id}`,
+          `${process.env.VUE_APP_BASE_API}/system/records/model?${queryParams}`,
           `${process.env.VUE_APP_BASE_API}/system/records/model`
         ];
 

--
Gitblit v1.9.1