From 6429b95aa66bfbb214bcadb248b8b7ca5e754368 Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 18 一月 2026 23:17:41 +0800
Subject: [PATCH] 修改相关代码

---
 src/views/archiveManager/index.vue |  648 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 482 insertions(+), 166 deletions(-)

diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 7ee8e76..b04ef15 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -1,5 +1,6 @@
 <template>
   <div class="app-container">
+    <el-dialog title="鎼滅储" :visible.sync="openSearch" width="1200px" top="5vh" append-to-body>
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="妗f鍙�" prop="recordId">
         <el-input
@@ -251,8 +252,18 @@
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button>
       </el-form-item>
     </el-form>
-
+</el-dialog>
     <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleSearch"
+
+        >鎼滅储</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -296,7 +307,7 @@
         >瀵煎嚭</el-button>
       </el-col>
 
-          <el-col :span="1.5">
+          <el-col  v-if="userId!=1" :span="1.5">
         <el-button
           type="warning"
           plain
@@ -306,7 +317,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"
@@ -350,7 +370,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" />
 
 
@@ -358,7 +378,7 @@
             <el-table-column label="鎿嶄綔" align="center" width="190" class-name="small-padding fixed-width">
               <template slot-scope="scope">
                 <el-button
-                v-if="scope.row.ownData"
+                v-if="scope.row.ownData && scope.row.recordStatus!='褰曞叆瀹屾垚'"
 
                   size="mini"
                   type="text"
@@ -376,7 +396,7 @@
                   v-hasPermi="['system:records:edit']"
                 >鏌ョ湅鍗峰唴鐩綍</el-button>
                 <el-button
-                      v-if="userId===1"
+
 
                         size="mini"
                         type="text"
@@ -386,7 +406,7 @@
                       >瀵煎嚭澶囪�冭〃</el-button>
 
                 <el-button
-                      v-if="userId===1"
+
 
                         size="mini"
                         type="text"
@@ -397,7 +417,7 @@
 
 
                       <el-button
-                            v-if="userId===1"
+
 
                               size="mini"
                               type="text"
@@ -455,7 +475,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 }}
@@ -464,7 +484,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" />
 
 
@@ -703,6 +723,9 @@
         <el-form-item label="澶囨敞" prop="remarks">
           <el-input v-model="form.remarks" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" disabled/>
         </el-form-item>
+        <el-form-item label="澶囪�冭〃澶囨敞" prop="noteRemark">
+          <el-input v-model="form.noteRemark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
+        </el-form-item>
         <el-form-item label="鍘嗗彶鐩稿叧鍙戞枃鍙�" prop="historicalReferenceNumber">
           <el-input v-model="form.historicalReferenceNumber" placeholder="璇疯緭鍏ュ巻鍙茬浉鍏冲彂鏂囧彿" disabled/>
         </el-form-item>
@@ -888,6 +911,9 @@
         <el-form-item label="澶囨敞" prop="remarks">
           <el-input v-model="form.remarks" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
         </el-form-item>
+        <el-form-item label="澶囪�冭〃澶囨敞" prop="noteRemark">
+          <el-input v-model="form.noteRemark" type="textarea" placeholder="璇疯緭鍏ュ唴瀹�" />
+        </el-form-item>
         <el-form-item label="鍘嗗彶鐩稿叧鍙戞枃鍙�" prop="historicalReferenceNumber">
           <el-input v-model="form.historicalReferenceNumber" placeholder="璇疯緭鍏ュ巻鍙茬浉鍏冲彂鏂囧彿" />
         </el-form-item>
@@ -898,6 +924,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>
 
@@ -907,11 +972,14 @@
 
 import axios from 'axios'
 import { getToken } from '@/utils/auth'
-import { enload, batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records"
+import { enload, getIdFileCounts,batchSubmitRecords,updateStatusById,listRecords,getMaxId, getRecords, delRecords, addRecords, updateRecords } from "@/api/system/records"
 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 { judge,getFileCount } from "@/api/system/materials"
+import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role"
+import {authManyRecordsToUsers}  from "@/api/system/archiverecordstouser"
+
 export default {
      components: {
         VueOfficeExcel
@@ -919,6 +987,19 @@
   name: "Records",
   data() {
     return {
+      openSearch: false,
+      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', //璁剧疆鏂囨。缃戠粶鍦板潃锛屽彲浠ユ槸鐩稿鍦板潃
 
@@ -997,7 +1078,10 @@
         archiveRoomNumber: null,
         microfilmNumber: null,
         remarks: null,
-        historicalReferenceNumber: null
+        historicalReferenceNumber: null,
+
+                orderByColumn: null,
+                isAsc: null
       },
     // Excel寮圭獥鐩稿叧鏁版嵁
     excelDialogVisible: false,
@@ -1015,8 +1099,8 @@
             "鍏紑灞炴�у繀椤诲綍鍏ワ紝涓诲姩鍏紑銆佷緷鐢宠鍏紑銆佸厤浜堝叕寮�",
              "淇濈鏈熼檺:30骞存垨姘镐箙",
             "椤靛彿鎸夌収姝e紡褰曞叆椤电爜涓哄噯"], // 閫変腑鐨勬敞瑙e垪琛�
-      includeSignature: false, // 鏄惁鍖呭惈绛惧悕鏍�
-            selectedSignatures: ['涓氬姟绉戝绉讳氦浜�:', '瀹℃壒绉戠Щ浜や汉:', '妗f鏁寸悊鍏徃:'], // 閫変腑鐨勭鍚嶆爮鍒楄〃
+            includeSignature: false, // 鏄惁鍖呭惈绛惧悕鏍�
+            selectedSignatures: ['涓氬姟绉戝绉讳氦浜�:','瀹℃壒绉�/娉曡绉戠Щ浜や汉:', '瀹℃壒绉戠Щ浜や汉:', '妗f鏁寸悊鍏徃:'], // 閫変腑鐨勭鍚嶆爮鍒楄〃
             subselectedSignatures: [],
             subselectedAnnotations: [],
       signaturePosition: 'bottom' // 绛惧悕鏍忎綅缃細top/bottom
@@ -1063,6 +1147,7 @@
     this.fetchProjectOptions()
     this.fetchProjectCompanyOptions()
 this.getList()
+
   },
   watch: {
     'form.constructionUnit': {
@@ -1087,14 +1172,74 @@
   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: {
+    handleSearch()
+    {
+      this.openSearch = true;
+    },
+    /** 閫夋嫨鎺堟潈鐢ㄦ埛鎿嶄綔 */
+    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娓叉煋瀹屾垚");
@@ -1272,6 +1417,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
@@ -1339,16 +1502,33 @@
     /*鏌ョ湅璇︽儏*/
     CheckInfo(row)
     {
+      var recordStrId = row.recordId
 
+
+      console.log(recordStrId==='')
+      console.log("+---------------------")
+      if(recordStrId===''||recordStrId==null)
+      {
+        this.$modal.msgWarning("璇疯ˉ鍏呮。妗堝彿淇℃伅锛屽啀缂栬緫鍗峰唴鐩綍锛�")
+
+        return
+      }
+         if( row.projectName==null||row.pageCount==null||row.caseTitle==null||row.constructionUnit==null)
+      {
+        this.$modal.msgWarning("璇峰厛琛ュ厖椤电爜绛夌浉鍏充俊鎭紒")
+        return;
+      }
       var mid = row.id
       const roleId = 2
    //   alert(mid)
 
       var recordId = mid
       var pageCount = row.pageCount
+      var recordStrId = row.recordId
+      var inquiryNumber = row.inquiryNumber
       var sho = false
     //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
-      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber)
 
     },
     /*瀵煎嚭澶囪�冭〃*/
@@ -1369,7 +1549,12 @@
      JuanInfo(row)
      {
        var id = row.id
-
+       console.log(row.pageCount)
+      if(row.pageCount==null)
+      {
+        this.$modal.msgWarning("璇峰厛琛ュ厖椤电爜淇℃伅锛�")
+        return;
+      }
                  id = Number(id)
 
            var recordId = row.recordId
@@ -1392,15 +1577,36 @@
     handleInfo(row)
     {
 
+        //鍒ゆ柇蹇呴』淇敼鐨勫瓧娈垫槸鍚﹁ˉ鍏呭畬鏁翠簡
+       var valid = false;
+      var pageCount = row.pageCount
+      var recordStrId = row.recordId
+
+      var inquiryNumber = row.inquiryNumber
+      console.log(recordStrId==='')
+      console.log("+---------------------")
+      if(recordStrId===''||recordStrId==null)
+      {
+        this.$modal.msgWarning("璇疯ˉ鍏呮。妗堝彿淇℃伅锛屽啀缂栬緫鍗峰唴鐩綍锛�")
+
+        return
+      }
+      if( row.projectName!=null&&row.pageCount!=null&&row.caseTitle!=null&&row.constructionUnit!=null)
+       valid = true;
+        if (valid) {
       var mid = row.id
       const roleId = 2
    //   alert(mid)
 
       var recordId = mid
-      var pageCount = row.pageCount
+
       var sho = true
     //  this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+recordId)
-      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
+      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho+"/"+recordStrId+"/"+inquiryNumber)
+      }else
+      {
+        this.$modal.msgWarning("璇疯ˉ鍏呴〉鍙风瓑鐩稿叧淇℃伅锛屽啀缂栬緫鍗峰唴鐩綍锛�")
+      }
 
     },
     //
@@ -1408,20 +1614,31 @@
     {
      //alert(row.id)
       var id = row.id
+         var pageCount = row.pageCount
+      if(pageCount===undefined||pageCount===0)
+        this.$modal.msgWarning('璇峰厛琛ュ厖妗堝嵎椤垫暟锛�')
+
       // 鍦ㄦ彁浜や箣鍓嶏紝璋冪敤鍚庣鎺ュ彛妫�鏌ユ槸鍚﹀凡缁忎笂浼犻檮浠�
-      judge(id).then(response => {
-        // console.log(response)
+      getFileCount(id).then(response => {
+        console.log(response)
         // alert(response.data)
-        if (response.data===undefined||response.data === false) {
+        if (response.length===undefined||response.length === 0) {
           // 濡傛灉鏂囦欢鏁伴噺涓�0锛屾彁绀虹敤鎴峰厛涓婁紶闄勪欢
           this.$modal.msgWarning('璇峰厛涓婁紶闄勪欢锛屽啀杩涜鎻愪氦鎿嶄綔')
-        } else {
+        }
+        else if(response.length===pageCount)
+        {
           // 濡傛灉宸茬粡涓婁紶浜嗛檮浠讹紝缁х画鎻愪氦鎿嶄綔
           var status = '褰曞叆瀹屾垚'
-          updateStatusById(status, id).then(response=>{
+          updateStatusById(status, id, '鎻愪氦妗堝嵎').then(response=>{
             this.$modal.msgSuccess("鎻愪氦鎴愬姛")
             this.getList()
           })
+        }
+        else
+        {
+          this.$modal.msgWarning('闄勪欢鏁伴噺涓婁紶涓嶈冻锛岃缁х画涓婁紶锛�')
+
         }
       }).catch(error => {
         console.error('妫�鏌ラ檮浠舵暟閲忓け璐�:', error)
@@ -1443,7 +1660,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])
 
@@ -1460,25 +1677,86 @@
         this.title = "淇敼妗f璁板綍"
       })
     },
+    /*鎵归噺鎺堟潈*/
+    handleGivePermission()
+    {
+      if (this.ids.length === 0) {
+        this.$modal.msgWarning('璇烽�夋嫨瑕佹巿鏉冪殑妗f璁板綍')
+        return
+      }
+      this.visibleUser = true
+      this.getUserList()
+    },
     /** 鎵归噺鎻愪氦 */
-    handleBatchSubmit() {
+    async handleBatchSubmit() {
      // alert(this.ids)
       if (this.ids.length === 0) {
         this.$modal.msgWarning('璇烽�夋嫨瑕佹彁浜ょ殑妗f璁板綍')
         return
       }
-      const myValidIds = this.recordsList
-  .filter(item => item.ownData === true)
-  .map(item => item.id);
-          // 妫�鏌ラ�変腑鐨処D鏄惁鍏ㄩ儴灞炰簬鑷繁
-    const invalidIds = this.ids.filter(id => !myValidIds.includes(id));
+      const validRecords = this.recordsList
+  // .filter(item => item.ownData === true)
+    // 1. 杞崲recordsList涓簆ageCount鏄犲皠锛堟牳蹇冩楠わ級
+    const recordPageCountMap = this.recordsList.reduce((map, item) => {
+      map[String(item.id)] = item.pageCount || item.totalpageCount || 0;
+      return map;
+    }, {});
 
-    if (invalidIds.length > 0) {
-      this.$message.error(`鍖呭惈鏃犳潈鎿嶄綔鐨処D: ${invalidIds.join(',')}`);
-      return false;
+
+  console.log("-------")
+
+  let recordFileCountMap = {};
+  try {
+    // 璋冪敤鎺ュ彛锛氬叆鍙備负鏈夋潈鎿嶄綔鐨処D鍒楄〃锛岃繑鍥� { recordId: 闄勪欢鏁�, ... }
+    const response = await getIdFileCounts(this.ids)
+    // 鍋囪鎺ュ彛杩斿洖鏍煎紡锛歿 code: 0, data: { "1001": 5, "1002": 8 } }
+    if (response.code === 200) {
+      recordFileCountMap = response.data;
+     // alert(434343)
+    } else {
+      this.$modal.msgError('鑾峰彇闄勪欢鏁伴噺澶辫触锛�' + response.msg);
+      return;
     }
+  } catch (error) {
+    this.$modal.msgError('鎺ュ彛璋冪敤澶辫触锛�' + error.message);
+    return;
+  }
+
+ // 3. 鏍稿績锛氱瓫閫夊嚭銆岄檮浠舵暟绛変簬鑷韩totalpageCount銆嶇殑鏈夋晥ID
+ const submitAbleIds = []; // 瀛樺偍鎵�鏈夌鍚堟潯浠剁殑ID
+ const invalidAttachIds = []; // 瀛樺偍闄勪欢鏁颁笉鍖归厤鐨処D锛堢敤浜庢彁绀猴級
+
+ for (const id of this.ids) {
+   // 鏇挎崲涓洪」鐩疄闄呭瓧娈靛悕
+   const attachmentCount = recordFileCountMap[id] || 0;
+   const recordTotalPage = recordPageCountMap[id] || 0;
+   if (attachmentCount === recordTotalPage) {
+     submitAbleIds.push(id); // 绗﹀悎鏉′欢锛屽姞鍏ユ彁浜ゅ垪琛�
+   } else {
+     invalidAttachIds.push({
+       id: id,
+
+       required: recordTotalPage
+     });
+   }
+ }
+
+ // 4. 鎻愮ず闄勪欢鏁颁笉鍖归厤鐨勮褰�
+ if (invalidAttachIds.length > 0) {
+   const tipMsg = invalidAttachIds.map(item =>
+     `(ID:${item.id}) 锛岃姹�${item.required}涓猔
+   ).join('锛�');
+   this.$modal.msgWarning(`浠ヤ笅璁板綍闄勪欢鏁伴噺涓嶅尮閰嶏紝灏嗚烦杩囨彁浜わ細${tipMsg}`);
+ }
+
+ // 5. 妫�鏌ユ槸鍚︽湁鍙彁浜ょ殑ID
+ if (submitAbleIds.length === 0) {
+   this.$modal.msgWarning('鏆傛棤绗﹀悎鎵�鏈夋潯浠剁殑璁板綍鍙彁浜�');
+   return;
+ }
+
     //濡傛灉id鍏ㄩ儴鏈夋晥鎵嶇户缁彁浜�
-      batchSubmitRecords( this.ids ).then(response => {
+      batchSubmitRecords( submitAbleIds ).then(response => {
         if (response.code === 0) {
           this.$modal.msgSuccess('鎵归噺鎻愪氦鎴愬姛')
           this.getList()
@@ -1499,8 +1777,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])
 
@@ -1607,7 +1886,9 @@
       this.getExcelFile(id).then(blob => {
         this.$modal.closeLoading();
         // 淇濆瓨鏂囦欢淇℃伅骞舵樉绀洪潤鎬佸脊绐�
+
         this.currentExcelUrl = URL.createObjectURL(blob);
+
         this.currentExcelBlob = blob;
         this.currentExcelId = id;
         this.excelDialogVisible = true;
@@ -1656,7 +1937,9 @@
       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;
@@ -1665,113 +1948,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);
+      // }
     },
 
     /** 澶勭悊鎵撳嵃鎸夐挳鐐瑰嚮 */
@@ -1827,28 +2113,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()}.xls`;
-
-        link.download = filename;
-
-        // 瑙﹀彂涓嬭浇
-        document.body.appendChild(link);
-        link.click();
-        document.body.removeChild(link);
-
-        // 鎻愮ず涓嬭浇鎴愬姛
-        this.$modal.msgSuccess('Excel鏂囦欢涓嬭浇鎴愬姛');
       }
     },
 
@@ -1890,20 +2197,25 @@
     /** 浠庡悗绔幏鍙朎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 {
@@ -1913,13 +2225,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 => {

--
Gitblit v1.9.1