From 0c6b2eb953f5ed4df00a77a5f7b14b9ff6c563fe Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 04 一月 2026 23:59:06 +0800
Subject: [PATCH] 修改代码

---
 src/views/archiveManager/index.vue |  783 ++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 619 insertions(+), 164 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index f19eec4..6f319d2 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
@@ -241,7 +306,16 @@
           v-hasPermi="['system:records:export']"
         >鎵归噺鎻愪氦</el-button>
       </el-col>
-
+   <el-col v-if="userId==1" :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          @click="handleGivePermission"
+          v-hasPermi="['system:materials:edit']"
+        >鎵归噺鎺堟潈</el-button>
+      </el-col>
         <el-col v-if="userId==1" :span="1.5">
         <el-button
           type="warning"
@@ -285,7 +359,7 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange">
+    <el-table v-loading="loading" :data="recordsList" @selection-change="handleSelectionChange" @sort-change="handleSortChange">
       <el-table-column type="selection" width="55" align="center" />
 
 
@@ -300,8 +374,46 @@
                   icon="el-icon-edit"
                   @click="handleInfo(scope.row)"
                   v-hasPermi="['system:records:edit']"
-                >妗堝嵎璇︾粏淇℃伅</el-button>
+                >缂栬緫鍗峰唴鐩綍</el-button>
+          <el-button
+                v-if="userId===1"
 
+                  size="mini"
+                  type="text"
+                  icon="el-icon-edit"
+                  @click="CheckInfo(scope.row)"
+                  v-hasPermi="['system:records:edit']"
+                >鏌ョ湅鍗峰唴鐩綍</el-button>
+                <el-button
+                      v-if="userId===1"
+
+                        size="mini"
+                        type="text"
+                        icon="el-icon-edit"
+                        @click="backInfo(scope.row)"
+                        v-hasPermi="['system:records:edit']"
+                      >瀵煎嚭澶囪�冭〃</el-button>
+
+                <el-button
+                      v-if="userId===1"
+
+                        size="mini"
+                        type="text"
+                        icon="el-icon-edit"
+                        @click="JuanInfo(scope.row)"
+                        v-hasPermi="['system:records:edit']"
+                      >瀵煎嚭鍗峰唴鐩綍</el-button>
+
+
+                      <el-button
+                            v-if="userId===1"
+
+                              size="mini"
+                              type="text"
+                              icon="el-icon-edit"
+                              @click="pageInfo(scope.row)"
+                              v-hasPermi="['system:records:edit']"
+                            >瀵煎嚭妗堝嵎灏侀潰</el-button>
                 <el-button
                   size="mini"
                   type="text"
@@ -324,6 +436,7 @@
                   @click="handleSubmit(scope.row)"
                   v-hasPermi="['system:records:edit']"
                 >鎻愪氦妗堝嵎</el-button>
+
                 <el-button
                 v-if="scope.row.ownData||userId===1"
 
@@ -351,7 +464,7 @@
               </template>
             </el-table-column>
 
-            <el-table-column label="鐘舵��" align="center" prop="recordStatus" width="120">
+            <el-table-column label="鐘舵��" align="center"  sortable="custom" prop="recordStatus" width="120">
               <template slot-scope="scope">
                 <el-button :type="scope.row.recordStatus === '鏈綍鍏�' ? 'danger' : 'success'" size="mini">
                   {{ scope.row.recordStatus }}
@@ -360,7 +473,7 @@
             </el-table-column>
 
 <!--      <el-table-column label="${comment}" align="center" prop="id" /> -->
-      <el-table-column label="妗f鍙�" align="center" prop="recordId" />
+      <el-table-column label="妗f鍙�" align="center" sortable="custom" prop="recordId" width="120"/>
       <el-table-column label="鍙戞枃鍙�" align="center" prop="inquiryNumber" />
 
 
@@ -411,7 +524,7 @@
             <div class="option-group">
               <label class="option-label">
                 <input type="checkbox" v-model="excelOptions.includeQrCode">
-                <span>鍖呭惈浜岀淮鐮�</span>
+                <span>鍖呭惈鏉″舰鐮�</span>
               </label>
             </div>
 
@@ -446,9 +559,8 @@
           </div>
         </div>
     <!-- 浼樺寲鐨凟xcel棰勮缁勪欢 -->
-     <el-dialog class="excel-preview-wrapper" :visible.sync="showExcelPreview" :modal="false" width="80%">
-
-    <div  >
+     <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"
@@ -767,7 +879,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="璇疯緭鍏ユ。妗堢(瀹�)鍙�" />
@@ -788,6 +907,45 @@
         <el-button @click="cancel">鍙� 娑�</el-button>
       </div>
     </el-dialog>
+
+
+
+
+    <!-- 鎺堟潈鐢ㄦ埛 -->
+     <el-dialog title="閫夋嫨鐢ㄦ埛" :visible.sync="visibleUser" width="800px" top="5vh" append-to-body>
+
+       <el-row>
+         <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSingleSelection"
+    height="260px">
+           <el-table-column type="selection" width="55"></el-table-column>
+           <el-table-column label="鐢ㄦ埛鍚嶇О" prop="userName" :show-overflow-tooltip="true" />
+           <el-table-column label="鐢ㄦ埛鏄电О" prop="nickName" :show-overflow-tooltip="true" />
+           <el-table-column label="閭" prop="email" :show-overflow-tooltip="true" />
+           <el-table-column label="鎵嬫満" prop="phonenumber" :show-overflow-tooltip="true" />
+      <!--     <el-table-column label="鐘舵��" align="center" prop="status">
+             <template slot-scope="scope">
+               <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
+             </template>
+           </el-table-column> -->
+           <el-table-column label="鍒涘缓鏃堕棿" align="center" prop="createTime" width="180">
+             <template slot-scope="scope">
+               <span>{{ parseTime(scope.row.createTime) }}</span>
+             </template>
+           </el-table-column>
+         </el-table>
+         <pagination
+           v-show="totalUser>0"
+           :total="totalUser"
+           :page.sync="queryParamsUser.pageNum"
+           :limit.sync="queryParamsUser.pageSize"
+           @pagination="getUserList"
+         />
+       </el-row>
+       <div slot="footer" class="dialog-footer">
+         <el-button type="primary" @click="handleSelectUser">纭� 瀹�</el-button>
+         <el-button @click="visibleUser = false">鍙� 娑�</el-button>
+       </div>
+     </el-dialog>
   </div>
 </template>
 
@@ -801,6 +959,10 @@
 import { listAllCategory } from "@/api/system/category"
 import { listAllProjectName } from "@/api/system/projectName"
 import { listPlaceName, listAllPlaceName } from "@/api/system/placeName"
+import { judge } from "@/api/system/materials"
+import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role"
+import {authManyRecordsToUsers}  from "@/api/system/archiverecordstouser"
+
 export default {
      components: {
         VueOfficeExcel
@@ -808,6 +970,19 @@
   name: "Records",
   data() {
     return {
+      totalUser: 0,
+      visibleUser:false,
+      userList:[],
+      // 閫変腑鏁扮粍鍊�
+      userIds: [],
+      queryParamsUser: {
+        pageNum: 1,
+        pageSize: 10,
+        roleId: undefined,
+        archiveRecordsId: undefined,
+
+      },
+      showExcelPreview: false,
                   excel: 'http://localhost:8080/profile/upload/12.xls', //璁剧疆鏂囨。缃戠粶鍦板潃锛屽彲浠ユ槸鐩稿鍦板潃
 
       open_check: false,
@@ -818,6 +993,8 @@
       maxId: 0,
       // 椤圭洰鍚嶇О閫夐」
       projectOptions: [],
+      // 椤圭洰绠$悊鍏徃閫夐」
+      projectCompanyOptions: [],
       // 妗f绫诲瀷閫夐」
       recordTypeOptions: [],
       //鍦板尯绫诲瀷
@@ -861,6 +1038,11 @@
         pageSize: 10,
         recordId: null,
         inquiryNumber: null,
+        categoryType: null, // 绫诲埆绫诲瀷
+        categoryZone: null, // 绫诲埆鍦板尯
+        categoryYear: null, // 绫诲埆骞翠唤
+        categorySeq: null, // 寮�濮嬪簭鍙�
+        categorySeqEnd: null, // 缁撴潫搴忓彿
         everyProjectName: null,
         caseTitle: null,
         publicAttribute: null,
@@ -878,7 +1060,10 @@
         archiveRoomNumber: null,
         microfilmNumber: null,
         remarks: null,
-        historicalReferenceNumber: null
+        historicalReferenceNumber: null,
+
+                orderByColumn: null,
+                isAsc: null
       },
     // Excel寮圭獥鐩稿叧鏁版嵁
     excelDialogVisible: false,
@@ -925,6 +1110,9 @@
         ],
         projectName: [
           { required: true, message: "寤鸿椤圭洰鍚嶇О涓嶈兘涓虹┖", trigger: "blur" }
+        ],
+        pageCount: [
+          { required: true, message: "妗堝嵎椤垫暟涓嶈兘涓虹┖", trigger: "blur" }
         ]
       }
     }
@@ -939,7 +1127,9 @@
     this.getRecordTypes()
     this.getZoneOptions()
     this.fetchProjectOptions()
+    this.fetchProjectCompanyOptions()
 this.getList()
+
   },
   watch: {
     'form.constructionUnit': {
@@ -964,14 +1154,70 @@
   beforeDestroy() {
     // 娓呯悊浜嬩欢鐩戝惉鍣ㄥ拰瀹氭椂鍣�
     document.removeEventListener('keydown', this.handleKeyDown);
-    if (this.excelPreviewTimeout) {
-      clearTimeout(this.excelPreviewTimeout);
-    }
+    // if (this.excelPreviewTimeout) {
+    //   clearTimeout(this.excelPreviewTimeout);
+    // }
     if (this.currentExcelUrl) {
       URL.revokeObjectURL(this.currentExcelUrl);
     }
   },
   methods: {
+    /** 閫夋嫨鎺堟潈鐢ㄦ埛鎿嶄綔 */
+    handleSelectUser() {
+    //  const archiveRecordsId = this.queryParams.archiveRecordsId
+      const userIds = this.userIds.join(",")
+     // const aids = this.ids.join(",")
+    //  alert(aids)
+      if (userIds == "") {
+        this.$modal.msgError("璇烽�夋嫨瑕佸垎閰嶇殑鐢ㄦ埛")
+        return
+      }
+
+      // 鍒涘缓杞崲鍚庣殑鍙傛暟锛岀‘淇漴ecordId鏄暟瀛楃被鍨�
+     // const convertedRecordId = !isNaN(Number(archiveRecordsId)) ? Number(archiveRecordsId) : 0
+    const convertedRecordId = this.ids.join(",")
+    if (convertedRecordId == "") {
+      this.$modal.msgError("璇烽�夋嫨鐩稿簲鐨勬鍗�")
+      return
+    }
+      authManyRecordsToUsers({ recordIds: convertedRecordId, userIds: userIds }).then(res => {
+        if(res.code === 200) {
+          this.$modal.msgSuccess(res.msg)
+          this.visibleUser = false
+        //  this.$emit("ok")
+        } else {
+          this.$modal.msgError(res.msg || "鎺堟潈澶辫触锛屽凡缁忔巿鏉冭繃浜�")
+        }
+      })
+    },
+    clickRow(row) {
+      this.$refs.table.clearSelection();
+    this.$refs.table.toggleRowSelection(row);
+    },
+    // 鏇挎崲鍘熸湁鐨刪andleSelectionChange鏂规硶
+    handleSingleSelection(selection) {
+      if (selection.length > 1) {
+        this.$refs.table.clearSelection();
+        this.$refs.table.toggleRowSelection(selection[selection.length - 1]);
+      }
+      else
+      this.userIds = selection.map(item => item.userId);
+    },
+    // 澶氶�夋閫変腑鏁版嵁
+    handleSelectionChange(selection) {
+      this.userIds = selection.map(item => item.userId)
+    },
+    // 鏌ヨ琛ㄦ暟鎹�
+    getUserList() {
+      this.queryParamsUser.roleId = 2
+      UserRoleIdList(this.queryParamsUser).then(res => {
+        console.log("=------00000000009")
+        console.log(res)
+
+        this.userList = res.rows
+        this.totalUser = res.total
+      })
+    },
       /** Excel娓叉煋瀹屾垚澶勭悊 */
         renderedHandler() {
             console.log("Excel娓叉煋瀹屾垚");
@@ -1053,6 +1299,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) => {
@@ -1090,7 +1353,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
@@ -1098,6 +1395,24 @@
         this.loading = false
       })
     },
+    // 鎺掑簭澶勭悊鏂规硶
+
+      // 娣诲姞handleSortChange鏂规硶
+          handleSortChange({ column, prop, order }) {
+           // alert(23)
+
+            if (order === 'ascending') {
+              this.queryParams.orderByColumn = prop;
+              this.queryParams.isAsc = 'asc';
+            } else if (order === 'descending') {
+              this.queryParams.orderByColumn = prop;
+              this.queryParams.isAsc = 'desc';
+            } else {
+              this.queryParams.orderByColumn = null;
+              this.queryParams.isAsc = null;
+            }
+            this.getList();
+          },
     // 鍙栨秷鎸夐挳
     cancel() {
       this.open = false
@@ -1139,6 +1454,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()
     },
     // 澶氶�夋閫変腑鏁版嵁
@@ -1155,26 +1476,107 @@
       this.vis = false;
       this.title = "娣诲姞妗f璁板綍"
     },
+
     /*鏌ョ湅璇︽儏*/
-    handleInfo(row)
+    CheckInfo(row)
     {
 
       var mid = row.id
       const roleId = 2
    //   alert(mid)
+
       var recordId = mid
+      var pageCount = row.pageCount
+      var sho = false
     //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
-      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId)
+      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+
+    },
+    /*瀵煎嚭澶囪�冭〃*/
+    backInfo(row)
+     {
+
+       var id = row.id
+
+             id = Number(id)
+
+       var recordId = row.recordId
+   this.download('/system/materials/exportBack/'+id+'/'+recordId, {
+
+   }, `澶囪�冭〃_${new Date().getTime()}.pdf`)
+     },
+
+     /*瀵煎嚭鍗峰唴鐩綍*/
+     JuanInfo(row)
+     {
+       var id = row.id
+
+                 id = Number(id)
+
+           var recordId = row.recordId
+       this.download('/system/materials/exportJuan/'+id, {
+
+       }, `鍗峰唴鐩綍_${new Date().getTime()}.xls`)
+     },
+     /*瀵煎嚭妗堝嵎灏侀潰*/
+     pageInfo(row)
+     {
+       var id = row.id
+
+                 id = Number(id)
+
+           var recordId = row.recordId
+       this.download('/system/materials/exportPageInfo/'+id+'/'+recordId, {
+
+       }, `妗堝嵎灏侀潰_${new Date().getTime()}.xls`)
+     },
+    handleInfo(row)
+    {
+
+        //鍒ゆ柇蹇呴』淇敼鐨勫瓧娈垫槸鍚﹁ˉ鍏呭畬鏁翠簡
+       var valid = false;
+      var pageCount = row.pageCount
+      if(row.projectName!=null&&row.pageCount!=null&&row.caseTitle!=null&&row.constructionUnit)
+       valid = true;
+        if (valid) {
+      var mid = row.id
+      const roleId = 2
+   //   alert(mid)
+
+      var recordId = mid
+
+      var sho = true
+    //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
+      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+      }else
+      {
+        this.$modal.msgWarning("璇疯ˉ鍏呴〉鍙风瓑鐩稿叧淇℃伅锛屽啀缂栬緫鍗峰唴鐩綍锛�")
+      }
 
     },
     //
     handleSubmit(row)
     {
-   //   alert(row.id)
+     //alert(row.id)
       var id = row.id
-      updateStatusById(id).then(response=>{
-        this.$modal.msgSuccess("鎻愪氦鎴愬姛")
-        this.getList()
+      // 鍦ㄦ彁浜や箣鍓嶏紝璋冪敤鍚庣鎺ュ彛妫�鏌ユ槸鍚﹀凡缁忎笂浼犻檮浠�
+      judge(id).then(response => {
+        // console.log(response)
+        // alert(response.data)
+        if (response.data===undefined||response.data === false) {
+          // 濡傛灉鏂囦欢鏁伴噺涓�0锛屾彁绀虹敤鎴峰厛涓婁紶闄勪欢
+          this.$modal.msgWarning('璇峰厛涓婁紶闄勪欢锛屽啀杩涜鎻愪氦鎿嶄綔')
+        } else {
+          // 濡傛灉宸茬粡涓婁紶浜嗛檮浠讹紝缁х画鎻愪氦鎿嶄綔
+          var status = '褰曞叆瀹屾垚'
+          updateStatusById(status, id).then(response=>{
+            this.$modal.msgSuccess("鎻愪氦鎴愬姛")
+            this.getList()
+          })
+        }
+      }).catch(error => {
+        console.error('妫�鏌ラ檮浠舵暟閲忓け璐�:', error)
+        this.$modal.msgError('妫�鏌ラ檮浠舵暟閲忓け璐ワ紝璇风◢鍚庨噸璇�')
       })
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
@@ -1192,7 +1594,7 @@
   if(this.recordTypeOptions.length > 0) {
       const recordParts = response.data.recordId.split('-')
       this.$set(this.form, 'recordType', recordParts[0])
-      if(this.recordTypeOptions.length==4)
+      if(recordParts.length==4)
       {
         this.$set(this.form, 'recordZone', recordParts[1])
 
@@ -1208,6 +1610,16 @@
         this.open = true
         this.title = "淇敼妗f璁板綍"
       })
+    },
+    /*鎵归噺鎺堟潈*/
+    handleGivePermission()
+    {
+      if (this.ids.length === 0) {
+        this.$modal.msgWarning('璇烽�夋嫨瑕佹巿鏉冪殑妗f璁板綍')
+        return
+      }
+      this.visibleUser = true
+      this.getUserList()
     },
     /** 鎵归噺鎻愪氦 */
     handleBatchSubmit() {
@@ -1248,8 +1660,9 @@
   this.form = response.data
   if(this.recordTypeOptions.length > 0) {
       const recordParts = response.data.recordId.split('-')
+
       this.$set(this.form, 'recordType', recordParts[0])
-      if(this.recordTypeOptions.length==4)
+      if(recordParts.length==4)
       {
             this.$set(this.form, 'recordZone', recordParts[1])
 
@@ -1314,8 +1727,7 @@
     /** 鍒嗛厤鐢ㄦ埛鎿嶄綔 */
     handleAuthUser: function(row) {
       const roleId = 2
-      var archiveRecordsId = row.recordId
-
+      var archiveRecordsId = row.id
       this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+archiveRecordsId)
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -1337,12 +1749,12 @@
         // 鍙鍑洪�変腑鐨勮褰�
         this.download('system/records/export', {
           ids: this.ids.join(',') // 灏嗛�変腑鐨処D鏁扮粍杞崲涓洪�楀彿鍒嗛殧鐨勫瓧绗︿覆
-        }, `records_${new Date().getTime()}.xlsx`)
+        }, `records_${new Date().getTime()}.xls`)
       } else {
         // 娌℃湁閫変腑璁板綍鏃讹紝瀵煎嚭绗﹀悎鏌ヨ鏉′欢鐨勬墍鏈夎褰�
         this.download('system/records/export', {
           ...this.queryParams
-        }, `records_${new Date().getTime()}.xlsx`)
+        }, `records_${new Date().getTime()}.xls`)
       }
     },
 
@@ -1357,7 +1769,9 @@
       this.getExcelFile(id).then(blob => {
         this.$modal.closeLoading();
         // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+
         this.currentExcelUrl = URL.createObjectURL(blob);
+
         this.currentExcelBlob = blob;
         this.currentExcelId = id;
         this.excelDialogVisible = true;
@@ -1379,6 +1793,7 @@
     /** 鍏抽棴Excel寮圭獥骞舵竻鐞嗚祫婧� */
     closeExcelDialog() {
       this.excelDialogVisible = false;
+    //  alert(this.excelDialogVisible)
       if (this.excelPreviewTimeout) {
         clearTimeout(this.excelPreviewTimeout);
         this.excelPreviewTimeout = null;
@@ -1389,19 +1804,25 @@
       }
       this.currentExcelBlob = null;
     },
+closeExcelPreviewDialog()
+{
 
+  this.showExcelPreview = false;
+},
     /** 澶勭悊棰勮鎸夐挳鐐瑰嚮 */
     handlePreviewClick() {
       this.showExcelPreview = true;
       this.excelRenderError = '';
       var id = this.recordId ;
       this.$modal.loading('姝e湪鑾峰彇Excel鏂囦欢锛岃绋嶅��...');
-      alert(id)
+
       // 浠庡悗绔幏鍙朎xcel鏂囦欢
       this.getExcelFile(id).then(blob => {
         this.$modal.closeLoading();
         // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+     //   alert(23)
         this.currentExcelUrl = URL.createObjectURL(blob);
+       // alert(this.currentExcelUrl)
         this.currentExcelBlob = blob;
         this.currentExcelId = id;
         this.excelDialogVisible = true;
@@ -1410,113 +1831,116 @@
         this.$modal.closeLoading();
         console.error('鑾峰彇Excel鏂囦欢澶辫触:', error);
         this.$modal.msgError('鑾峰彇Excel鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+
+
+            this.showExcelPreview = false;
       });
-      // 閲嶇疆vue-office-excel缁勪欢
-      if (this.currentExcelUrl) {
-        const tempUrl = this.currentExcelUrl;
-        this.currentExcelUrl = '';
-        this.$nextTick(() => {
-          this.currentExcelUrl = tempUrl;
-        });
-      }
+      // // 閲嶇疆vue-office-excel缁勪欢
+      // if (this.currentExcelUrl) {
+      //   const tempUrl = this.currentExcelUrl;
+      //   this.currentExcelUrl = '';
+      //   this.$nextTick(() => {
+      //     this.currentExcelUrl = tempUrl;
+      //   });
+      // }
 
-      const previewContainer = this.$refs.excelPreviewContainer;
+      // const previewContainer = this.$refs.excelPreviewContainer;
 
-      // 娓呯┖棰勮瀹瑰櫒
-      if (previewContainer) {
-        previewContainer.innerHTML = '';
+      // // 娓呯┖棰勮瀹瑰櫒
+      // if (previewContainer) {
+      //   previewContainer.innerHTML = '';
 
-        // 灏濊瘯浣跨敤寰蒋Office Online棰勮鏈嶅姟浣滀负澶囬��
-        const officeOnlineUrl = `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(this.currentExcelUrl)}`;
+      //   // 灏濊瘯浣跨敤寰蒋Office Online棰勮鏈嶅姟浣滀负澶囬��
+      //   const officeOnlineUrl = `https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(this.currentExcelUrl)}`;
 
-        // 鍒涘缓iframe鐢ㄤ簬棰勮
-        const iframe = document.createElement('iframe');
-        iframe.style.width = '100%';
-        iframe.style.height = '100%';
-        iframe.style.border = 'none';
-        iframe.style.minHeight = '600px';
-        iframe.src = officeOnlineUrl;
-        iframe.title = 'Excel鏂囦欢棰勮';
+      //   // 鍒涘缓iframe鐢ㄤ簬棰勮
+      //   const iframe = document.createElement('iframe');
+      //   iframe.style.width = '100%';
+      //   iframe.style.height = '100%';
+      //   iframe.style.border = 'none';
+      //   iframe.style.minHeight = '600px';
+      //   iframe.src = officeOnlineUrl;
+      //   iframe.title = 'Excel鏂囦欢棰勮';
 
-        // 鍒涘缓鍔犺浇鎸囩ず鍣�
-        const loadingIndicator = document.createElement('div');
-        loadingIndicator.className = 'loading-indicator';
-        loadingIndicator.innerHTML = `
-          <div class="loading-spinner"></div>
-          <p>姝e湪鍔犺浇Excel鏂囦欢锛岃绋嶅��...</p>
-        `;
-        previewContainer.style.position = 'relative';
-        previewContainer.appendChild(iframe);
-        previewContainer.appendChild(loadingIndicator);
+      //   // 鍒涘缓鍔犺浇鎸囩ず鍣�
+      //   const loadingIndicator = document.createElement('div');
+      //   loadingIndicator.className = 'loading-indicator';
+      //   loadingIndicator.innerHTML = `
+      //     <div class="loading-spinner"></div>
+      //     <p>姝e湪鍔犺浇Excel鏂囦欢锛岃绋嶅��...</p>
+      //   `;
+      //   previewContainer.style.position = 'relative';
+      //   previewContainer.appendChild(iframe);
+      //   previewContainer.appendChild(loadingIndicator);
 
-        // 鐩戝惉iframe鍔犺浇瀹屾垚
-        iframe.onload = () => {
-          this.excelLoading = false;
-          if (loadingIndicator && loadingIndicator.parentNode) {
-            loadingIndicator.parentNode.removeChild(loadingIndicator);
-          }
-        };
+      //   // 鐩戝惉iframe鍔犺浇瀹屾垚
+      //   iframe.onload = () => {
+      //     this.excelLoading = false;
+      //     if (loadingIndicator && loadingIndicator.parentNode) {
+      //       loadingIndicator.parentNode.removeChild(loadingIndicator);
+      //     }
+      //   };
 
-        // 璁剧疆瓒呮椂澶勭悊
-        this.excelPreviewTimeout = setTimeout(() => {
-          this.excelLoading = false;
-          if (loadingIndicator && loadingIndicator.parentNode) {
-            loadingIndicator.parentNode.removeChild(loadingIndicator);
-          }
+      //   // 璁剧疆瓒呮椂澶勭悊
+      //   this.excelPreviewTimeout = setTimeout(() => {
+      //     this.excelLoading = false;
+      //     if (loadingIndicator && loadingIndicator.parentNode) {
+      //       loadingIndicator.parentNode.removeChild(loadingIndicator);
+      //     }
 
-          // 灏濊瘯鐩存帴棰勮浣滀负澶囬�夋柟妗�
-          previewContainer.innerHTML = '';
-          const directIframe = document.createElement('iframe');
-          directIframe.style.width = '100%';
-          directIframe.style.height = '100%';
-          directIframe.style.border = 'none';
-          directIframe.style.minHeight = '600px';
-          directIframe.src = this.currentExcelUrl;
+      //     // 灏濊瘯鐩存帴棰勮浣滀负澶囬�夋柟妗�
+      //     previewContainer.innerHTML = '';
+      //     const directIframe = document.createElement('iframe');
+      //     directIframe.style.width = '100%';
+      //     directIframe.style.height = '100%';
+      //     directIframe.style.border = 'none';
+      //     directIframe.style.minHeight = '600px';
+      //     directIframe.src = this.currentExcelUrl;
 
-          const fallbackMessage = document.createElement('div');
-          fallbackMessage.textContent = 'Office棰勮鏈嶅姟鍔犺浇瓒呮椂锛屾鍦ㄥ皾璇曠洿鎺ラ瑙�...';
-          fallbackMessage.style.cssText = `
-            position: absolute;
-            top: 0;
-            left: 0;
-            right: 0;
-            padding: 10px;
-            background-color: #f56c6c;
-            color: white;
-            text-align: center;
-            font-size: 14px;
-            z-index: 10;
-          `;
+      //     const fallbackMessage = document.createElement('div');
+      //     fallbackMessage.textContent = 'Office棰勮鏈嶅姟鍔犺浇瓒呮椂锛屾鍦ㄥ皾璇曠洿鎺ラ瑙�...';
+      //     fallbackMessage.style.cssText = `
+      //       position: absolute;
+      //       top: 0;
+      //       left: 0;
+      //       right: 0;
+      //       padding: 10px;
+      //       background-color: #f56c6c;
+      //       color: white;
+      //       text-align: center;
+      //       font-size: 14px;
+      //       z-index: 10;
+      //     `;
 
-          previewContainer.appendChild(directIframe);
-          previewContainer.appendChild(fallbackMessage);
+      //     previewContainer.appendChild(directIframe);
+      //     previewContainer.appendChild(fallbackMessage);
 
-          directIframe.onload = () => {
-            if (fallbackMessage && fallbackMessage.parentNode) {
-              fallbackMessage.parentNode.removeChild(fallbackMessage);
-            }
-          };
+      //     directIframe.onload = () => {
+      //       if (fallbackMessage && fallbackMessage.parentNode) {
+      //         fallbackMessage.parentNode.removeChild(fallbackMessage);
+      //       }
+      //     };
 
-          // 浜屾瓒呮椂澶勭悊
-          setTimeout(() => {
-            if (directIframe && directIframe.parentNode) {
-              directIframe.parentNode.removeChild(directIframe);
-            }
-            const errorMessage = document.createElement('div');
-            errorMessage.innerHTML = `
-              <div style="text-align: center; padding: 40px;">
-                <h3 style="color: #f56c6c; margin-bottom: 20px;">棰勮澶辫触</h3>
-                <p style="color: #666; margin-bottom: 30px;">鏃犳硶鍦ㄦ祻瑙堝櫒涓瑙圗xcel鏂囦欢锛岃鐐瑰嚮涓嬫柟鎸夐挳涓嬭浇鏂囦欢鍚庢煡鐪嬨��</p>
-                <button onclick="this.parentNode.parentNode.querySelector('.download-btn').click()"
-                        style="padding: 8px 20px; background: #409EFF; color: white; border: none; border-radius: 4px; cursor: pointer;">
-                  涓嬭浇Excel鏂囦欢
-                </button>
-              </div>
-            `;
-            previewContainer.appendChild(errorMessage);
-          }, 20000);
-        }, 25000);
-      }
+      //     // 浜屾瓒呮椂澶勭悊
+      //     setTimeout(() => {
+      //       if (directIframe && directIframe.parentNode) {
+      //         directIframe.parentNode.removeChild(directIframe);
+      //       }
+      //       const errorMessage = document.createElement('div');
+      //       errorMessage.innerHTML = `
+      //         <div style="text-align: center; padding: 40px;">
+      //           <h3 style="color: #f56c6c; margin-bottom: 20px;">棰勮澶辫触</h3>
+      //           <p style="color: #666; margin-bottom: 30px;">鏃犳硶鍦ㄦ祻瑙堝櫒涓瑙圗xcel鏂囦欢锛岃鐐瑰嚮涓嬫柟鎸夐挳涓嬭浇鏂囦欢鍚庢煡鐪嬨��</p>
+      //           <button onclick="this.parentNode.parentNode.querySelector('.download-btn').click()"
+      //                   style="padding: 8px 20px; background: #409EFF; color: white; border: none; border-radius: 4px; cursor: pointer;">
+      //             涓嬭浇Excel鏂囦欢
+      //           </button>
+      //         </div>
+      //       `;
+      //       previewContainer.appendChild(errorMessage);
+      //     }, 20000);
+      //   }, 25000);
+      // }
     },
 
     /** 澶勭悊鎵撳嵃鎸夐挳鐐瑰嚮 */
@@ -1572,28 +1996,49 @@
         // 鑾峰彇鐢ㄦ埛閫夋嫨鐨勯�夐」
         const { includeQrCode, selectedAnnotations } = this.excelOptions;
         console.log('涓嬭浇閫夐」:', { includeQrCode, selectedAnnotations });
+     var id = this.recordId ;
+        this.getExcelFile(id).then(blob => {
+           this.$modal.closeLoading();
+           // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+        //   alert(23)
+           this.currentExcelUrl = URL.createObjectURL(blob);
 
+           const link = document.createElement('a');
+           link.href = this.currentExcelUrl;
+
+           // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
+           let filename = `record_${this.currentExcelId}`;
+           if (includeQrCode) filename += '_qr';
+           // if (selectedAnnotations.length > 0) {
+           //   filename += `_anno${selectedAnnotations.join('')}`;x
+           // }
+           filename += `_${new Date().getTime()}.xls`;
+
+           link.download = filename;
+
+           // 瑙﹀彂涓嬭浇
+           document.body.appendChild(link);
+           link.click();
+           document.body.removeChild(link);
+
+           // 鎻愮ず涓嬭浇鎴愬姛
+           this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
+          // alert(this.currentExcelUrl)
+           // 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鏂囦欢澶辫触锛岃绋嶅悗閲嶈瘯');
+
+
+               this.showExcelPreview = false;
+         });
+       // alert(this.excelOptions.includeQrCode)
         // 鍒涘缓涓嬭浇閾炬帴锛屾枃浠跺悕鍖呭惈閫夐」淇℃伅
-        const link = document.createElement('a');
-        link.href = this.currentExcelUrl;
 
-        // 鏋勫缓鏂囦欢鍚嶏紝鍖呭惈閫夐」淇℃伅
-        let filename = `record_${this.currentExcelId}`;
-        if (includeQrCode) filename += '_qr';
-        if (selectedAnnotations.length > 0) {
-          filename += `_anno${selectedAnnotations.join('')}`;
-        }
-        filename += `_${new Date().getTime()}.xlsx`;
-
-        link.download = filename;
-
-        // 瑙﹀彂涓嬭浇
-        document.body.appendChild(link);
-        link.click();
-        document.body.removeChild(link);
-
-        // 鎻愮ず涓嬭浇鎴愬姛
-        this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
       }
     },
 
@@ -1618,7 +2063,7 @@
       });
     },
 
-    /** 娓呯悊Excel棰勮鐩稿叧璧勬簮 */
+    /** 娓呯悊Excel棰勮鐩稿叧璧勬簮骞跺叧闂璇濇 */
     cleanupExcelPreview(iframe, url) {
       setTimeout(() => {
         if (iframe && iframe.parentNode) {
@@ -1628,26 +2073,32 @@
           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;
+      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
-        }
-
+//       // if(this.excelOptions.subselectedSignatures.length!=0)
+//       // {
+//       //   var selectedSignatures = this.excelOptions.subselectedSignatures
+//       //   urls = urls +'/'+ selectedSignatures
+//       //  // alert(urls)
+//       //   }
+//       console.log(this.excelOptions.subselectedAnnotations)
+//       alert(234)
+//       if(this.excelOptions.subselectedAnnotations.length!=0)
+//       {
+//         var selectedAnnotations = this.excelOptions.subselectedAnnotations
+//         urls = urls+"/"+selectedAnnotations
+//        // alert(urls)
+//         }
+// alert(urls)
       return new Promise((resolve, reject) => {
         // 棣栧厛灏濊瘯浣跨敤axios锛堥」鐩凡鏈夌殑HTTP瀹㈡埛绔級
         try {
@@ -1657,13 +2108,17 @@
           // 鏋勫缓鍙傛暟锛屽寘鍚敞瑙e唴瀹�
           const params = {
             recordId: id,
-
+            selectedSignatures: this.excelOptions.subselectedSignatures,
+            selectedAnnotations: this.excelOptions.subselectedAnnotations,
+            includeQrCode: this.excelOptions.includeQrCode
           };
+          console.log(params)
+          alert(457)
 
           axios({
             method: 'Post',
             url: urls,
-            params: params,
+            data: params,
             responseType: 'blob',
             headers: { 'Authorization': 'Bearer ' + getToken() }
           }).then(response => {
@@ -1862,7 +2317,7 @@
         // 鐩存帴涓嬭浇
         const link = document.createElement('a');
         link.href = url;
-        link.download = `${prefix}_${new Date().getTime()}.xlsx`;
+        link.download = `${prefix}_${new Date().getTime()}.xls`;
         document.body.appendChild(link);
         link.click();
         document.body.removeChild(link);
@@ -1881,7 +2336,7 @@
             const url = URL.createObjectURL(blob);
             const link = document.createElement('a');
             link.href = url;
-            link.download = `record_${id}_${new Date().getTime()}.xlsx`;
+            link.download = `record_${id}_${new Date().getTime()}.xls`;
             document.body.appendChild(link);
             link.click();
             document.body.removeChild(link);
@@ -1900,13 +2355,13 @@
     {
       this.download('/system/records/model', {
 
-      }, `records_${new Date().getTime()}.xlsx`)
+      }, `records_${new Date().getTime()}.xls`)
     },
     handleExportTemplateOther()
     {
           this.download('/system/records/modelOther', {
 
-      }, `records_${new Date().getTime()}.xlsx`)
+      }, `records_${new Date().getTime()}.xls`)
     },
   /** 瀵煎叆鎿嶄綔*/
     async handleImportData({file}){

--
Gitblit v1.9.1