From d529e4e9f3b00ce5ff0d9d65670e37e422ec660c Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期一, 22 十二月 2025 20:19:56 +0800
Subject: [PATCH] 修改了代码

---
 src/views/archiveManager/archiveMaterial/index.vue |   64 ++++++++++++++++++---
 src/views/archiveManager/arMAutoUser.vue           |    1 
 src/views/system/user/index.vue                    |    4 
 src/views/archiveProjectName/index.vue             |    4 
 src/views/archiveExport/index.vue                  |    4 
 src/views/archivePlaceName/index.vue               |    4 
 src/views/archiveToUserStatistic/index.vue         |    2 
 src/api/system/materials.js                        |    9 +++
 src/views/archiveCategory/index.vue                |    4 
 src/views/archiveManager/index.vue                 |   67 +++++++++++++++++----
 src/views/archiveStatics/index.vue                 |    2 
 src/router/index.js                                |    2 
 12 files changed, 129 insertions(+), 38 deletions(-)

diff --git a/src/api/system/materials.js b/src/api/system/materials.js
index af5b1d6..041cbb2 100644
--- a/src/api/system/materials.js
+++ b/src/api/system/materials.js
@@ -69,7 +69,16 @@
     // }
   })
 }
+export function judge(recordId)
+{
+  return request({
+    url:'/system/materials/judge/'+recordId,
+    method:'get',
+    // headers:{
 
+    // }
+  })
+}
 export function getFileCount(recordId)
 {
   return request({
diff --git a/src/router/index.js b/src/router/index.js
index 8728364..aa846e7 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -123,7 +123,7 @@
       },
       //妗堝嵎璇︾粏淇℃伅绠$悊
       {
-        path: 'archiveMaterialManager/:recordId/:pageCount',
+        path: 'archiveMaterialManager/:recordId/:pageCount/:sho',
         component: () => import('@/views/archiveManager/archiveMaterial/index'),
         name: 'ArchiveMaterialManager',
         meta: { title: '璇︾粏淇℃伅', activeMenu: '/archiveManager/infoManager' }
diff --git a/src/views/archiveCategory/index.vue b/src/views/archiveCategory/index.vue
index 08e91ef..0ceea41 100644
--- a/src/views/archiveCategory/index.vue
+++ b/src/views/archiveCategory/index.vue
@@ -287,14 +287,14 @@
     handleExport() {
       this.download('system/category/export', {
         ...this.queryParams
-      }, `category_${new Date().getTime()}.xlsx`)
+      }, `category_${new Date().getTime()}.xls`)
     },
             /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/
     handleExportTemplate()
     {
      this.download('/system/category/model', {
 
-      }, `category_${new Date().getTime()}.xlsx`)
+      }, `category_${new Date().getTime()}.xls`)
     },
      /** 瀵煎叆鎿嶄綔*/
     async handleImport({file}){
diff --git a/src/views/archiveExport/index.vue b/src/views/archiveExport/index.vue
index 5ba5733..0c5f979 100644
--- a/src/views/archiveExport/index.vue
+++ b/src/views/archiveExport/index.vue
@@ -128,7 +128,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
+      <!-- <el-col :span="1.5">
         <el-button
           type="primary"
           plain
@@ -159,7 +159,7 @@
           @click="handleDelete"
           v-hasPermi="['system:records:remove']"
         >鍒犻櫎</el-button>
-      </el-col>
+      </el-col> -->
       <el-col :span="1.5">
         <el-button
           type="warning"
diff --git a/src/views/archiveManager/arMAutoUser.vue b/src/views/archiveManager/arMAutoUser.vue
index d7eb9ef..fc0a599 100644
--- a/src/views/archiveManager/arMAutoUser.vue
+++ b/src/views/archiveManager/arMAutoUser.vue
@@ -148,7 +148,6 @@
   created() {
     const roleId = this.$route.params && this.$route.params.roleId
     const recordId = this.$route.params && this.$route.params.archiveRecordsId
-
     if (roleId && recordId) {
       this.queryParams.roleId = roleId
       // 杩涜绫诲瀷杞崲
diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index 57442dd..a6c252d 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -1,5 +1,7 @@
 <template>
     <div class="app-container">
+
+      <div v-if="sho">
          <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍</h2>
  <el-form ref="form" :model="form" :rules="rules" label-width="100px">
 
@@ -234,7 +236,7 @@
 
         </div>
 
-
+</div>
 
 <div class="title-border"></div>
 
@@ -255,6 +257,7 @@
         </el-col>
         <el-col :span="1.5">
           <el-button
+          v-if="sho"
             type="success"
             plain
             icon="el-icon-edit"
@@ -263,6 +266,17 @@
             @click="handleUpdate"
             v-hasPermi="['system:materials:edit']"
           >淇敼</el-button>
+        </el-col>
+           <el-col :span="1.5">
+          <el-button
+            type="warning"
+            plain
+            icon="el-icon-download"
+            size="mini"
+            @click="handleExportDir"
+            v-hasPermi="['system:materials:list']"
+
+          >瀵煎嚭鍗峰唴鐩綍</el-button>
         </el-col>
         <el-col :span="1.5">
           <el-button
@@ -273,10 +287,11 @@
             @click="handleExport"
             v-hasPermi="['system:materials:list']"
 
-          >瀵煎嚭</el-button>
+          >瀵煎嚭鐢靛瓙鏂囦欢鐩綍</el-button>
         </el-col>
         <el-col :span="1.5">
           <el-button
+          v-if="sho"
             type="danger"
             plain
             icon="el-icon-delete"
@@ -289,6 +304,7 @@
 
           <el-col :span="1.5">
           <el-button
+          v-if="sho"
             type="success"
             plain
             icon="el-icon-edit"
@@ -345,7 +361,7 @@
               accept=".xlsx,.xls"
 
         >
-          <el-button size="mini"   type="primary"
+          <el-button size="mini"  v-if="sho" type="primary"
                      plain
                      icon="el-icon-top">瀵煎叆</el-button>
 
@@ -356,7 +372,7 @@
 
       <el-table v-loading="loading" :data="materialsList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="鎿嶄綔" align="center" width="160" class-name="small-padding ">
+        <el-table-column v-if="sho" label="鎿嶄綔" align="center" width="160" class-name="small-padding ">
               <template slot-scope="scope">
                 <el-button
                   size="mini"
@@ -393,8 +409,8 @@
         </el-table-column>
         <el-table-column label="椤靛彿" sortable align="center" prop="pageNumber"  />
         <el-table-column label="澶囨敞" align="center" prop="remarks" />
-                <el-table-column label="椤垫" sortable align="center" prop="pageOrder"  />
-
+            <!--          <el-table-column label="椤垫" sortable align="center" prop="pageOrder"  />
+--->
         <el-table-column label="鎵�澶勯樁娈�" sortable align="center" width="180" prop="stage" />
         <el-table-column label="鍏紑灞炴��" sortable align="center" width="180" prop="publicity" />
         <el-table-column label="鏄惁涓洪檮鍥惧強闄勪欢" align="center" prop="isAttachment" />
@@ -798,6 +814,8 @@
     name: "Materials",
     data() {
       return {
+        //鏄惁鏄剧ず鐩稿叧鍐呭
+        sho: true,
         totalPageCount: 0,
         // 璁板綍鍏冪礌鍒濆浣嶇疆鍜岀姸鎬�
   originalOffsetLeft: 0,
@@ -995,6 +1013,11 @@
       const recordId = this.$route.params && this.$route.params.recordId
 
       this.totalPageCount = this.$route.params && this.$route.params.pageCount
+
+      this.sho = this.$route.params && this.$route.params.sho
+      // 灏嗗瓧绗︿覆杞崲涓哄竷灏斿��
+      this.sho = this.sho === true || this.sho === "true"
+
       //alert(this.totalPageCount)
       //alert(recordId)
       this.recordId = recordId;
@@ -1294,7 +1317,7 @@
       handleFileStyleChange(value) {
         // 褰撻�夋嫨'鍏朵粬鏉愭枡'鏃讹紝灏嗛〉鍙疯缃负0
         if (value === '鍏朵粬鏉愭枡') {
-          this.form.pageNumber = null;
+          this.forms.pageNumber = null;
         }
       },
       // 澶勭悊鏉愭枡绫诲瀷鍙樺寲锛堜慨鏀硅〃鍗曪級
@@ -1475,6 +1498,7 @@
       },
       /** 鎻愪氦鎸夐挳 */
       submitForms() {
+        console.log(this.forms)
         this.$refs["forms"].validate(valid => {
           if (valid) {
             if (this.forms.materialId != null) {
@@ -1503,6 +1527,26 @@
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛")
         }).catch(() => {})
       },
+           /** 瀵煎嚭鎸夐挳鎿嶄綔 - 鏀寔瀵煎嚭閫変腑琛屾垨鍏ㄩ儴鏁版嵁 */
+      handleExportDir() {
+        // 鍒ゆ柇鏄惁鏈夐�変腑鐨勮
+        if (this.ids && this.ids.length > 0) {
+          // 鏄剧ず瀵煎嚭閫変腑琛岀殑鎻愮ず
+          this.$message.info(`姝e湪瀵煎嚭${this.ids.length}鏉¢�変腑鐨勬暟鎹�...`);
+          // 瀵煎嚭閫変腑鐨勮鏁版嵁
+          this.download('system/materials/exportDir', {
+            ids: this.ids.join(','),
+         //   exportType: 'selected'
+          }, `materiaDir_selected_${new Date().getTime()}.xls`)
+        } else {
+          // 鏄剧ず瀵煎嚭鍏ㄩ儴鏁版嵁鐨勬彁绀�
+          this.$message.info('姝e湪瀵煎嚭绗﹀悎褰撳墠鏌ヨ鏉′欢鐨勬墍鏈夋暟鎹�...');
+          // 娌℃湁閫変腑琛屾椂锛屽鍑哄綋鍓嶆煡璇㈡潯浠剁殑鏁版嵁
+          this.download('system/materials/exportDir', {
+            ...this.queryParams
+          }, `materiaDir_${new Date().getTime()}.xls`)
+        }
+      },
       /** 瀵煎嚭鎸夐挳鎿嶄綔 - 鏀寔瀵煎嚭閫変腑琛屾垨鍏ㄩ儴鏁版嵁 */
       handleExport() {
         // 鍒ゆ柇鏄惁鏈夐�変腑鐨勮
@@ -1513,14 +1557,14 @@
           this.download('system/materials/export', {
             ids: this.ids.join(','),
          //   exportType: 'selected'
-          }, `materials_selected_${new Date().getTime()}.xlsx`)
+          }, `materials_selected_${new Date().getTime()}.xls`)
         } else {
           // 鏄剧ず瀵煎嚭鍏ㄩ儴鏁版嵁鐨勬彁绀�
           this.$message.info('姝e湪瀵煎嚭绗﹀悎褰撳墠鏌ヨ鏉′欢鐨勬墍鏈夋暟鎹�...');
           // 娌℃湁閫変腑琛屾椂锛屽鍑哄綋鍓嶆煡璇㈡潯浠剁殑鏁版嵁
           this.download('system/materials/export', {
             ...this.queryParams
-          }, `materials_${new Date().getTime()}.xlsx`)
+          }, `materials_${new Date().getTime()}.xls`)
         }
       },
 
@@ -1529,7 +1573,7 @@
     {
       this.download('/system/materials/model', {
 
-      }, `materials_${new Date().getTime()}.xlsx`)
+      }, `materials_${new Date().getTime()}.xls`)
     },
        /** 瀵煎叆鎿嶄綔*/
     async handleImportData({file}){
diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 2e54b22..ca8568a 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -366,7 +366,15 @@
                   @click="handleInfo(scope.row)"
                   v-hasPermi="['system:records:edit']"
                 >缂栬緫鍗峰唴鐩綍</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
                   size="mini"
                   type="text"
@@ -389,6 +397,7 @@
                   @click="handleSubmit(scope.row)"
                   v-hasPermi="['system:records:edit']"
                 >鎻愪氦妗堝嵎</el-button>
+                
                 <el-button
                 v-if="scope.row.ownData||userId===1"
 
@@ -872,6 +881,7 @@
 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"
 export default {
      components: {
         VueOfficeExcel
@@ -1295,7 +1305,22 @@
       this.vis = false;
       this.title = "娣诲姞妗f璁板綍"
     },
+
     /*鏌ョ湅璇︽儏*/
+    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+"/"+pageCount+"/"+sho)
+
+    },
     handleInfo(row)
     {
 
@@ -1305,8 +1330,9 @@
 
       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)
+      this.$router.push("/archiveManager/infoManagerAu/archiveMaterialManager/" + recordId+"/"+pageCount+"/"+sho)
 
     },
     //
@@ -1314,10 +1340,24 @@
     {
      //alert(row.id)
       var id = row.id
-      var status = '褰曞叆瀹屾垚'
-      updateStatusById(status, 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('妫�鏌ラ檮浠舵暟閲忓け璐ワ紝璇风◢鍚庨噸璇�')
       })
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
@@ -1457,8 +1497,7 @@
     /** 鍒嗛厤鐢ㄦ埛鎿嶄綔 */
     handleAuthUser: function(row) {
       const roleId = 2
-      var archiveRecordsId = row.recordId
-
+      var archiveRecordsId = row.id
       this.$router.push("/archiveManager/infoManagerAu/user/" + roleId+"/"+archiveRecordsId)
     },
     /** 鍒犻櫎鎸夐挳鎿嶄綔 */
@@ -1480,12 +1519,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`)
       }
     },
 
@@ -1731,7 +1770,7 @@
         // if (selectedAnnotations.length > 0) {
         //   filename += `_anno${selectedAnnotations.join('')}`;
         // }
-        filename += `_${new Date().getTime()}.xlsx`;
+        filename += `_${new Date().getTime()}.xls`;
 
         link.download = filename;
 
@@ -2011,7 +2050,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);
@@ -2030,7 +2069,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);
@@ -2049,13 +2088,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}){
diff --git a/src/views/archivePlaceName/index.vue b/src/views/archivePlaceName/index.vue
index cd7e858..b32f348 100644
--- a/src/views/archivePlaceName/index.vue
+++ b/src/views/archivePlaceName/index.vue
@@ -288,7 +288,7 @@
 
       this.download('/system/placeName/export', {
         ...this.queryParams
-      }, `name_${new Date().getTime()}.xlsx`)
+      }, `name_${new Date().getTime()}.xls`)
     },
              /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/
     handleExportTemplate()
@@ -296,7 +296,7 @@
     
      this.download('/system/placeName/model', {
 
-      }, `placeName_${new Date().getTime()}.xlsx`)
+      }, `placeName_${new Date().getTime()}.xls`)
     },
       /** 瀵煎叆鎿嶄綔*/
     async handleImport({file}){
diff --git a/src/views/archiveProjectName/index.vue b/src/views/archiveProjectName/index.vue
index f4647af..7b66c49 100644
--- a/src/views/archiveProjectName/index.vue
+++ b/src/views/archiveProjectName/index.vue
@@ -308,14 +308,14 @@
     handleExport() {
       this.download('system/projectName/export', {
         ...this.queryParams
-      }, `name_${new Date().getTime()}.xlsx`)
+      }, `name_${new Date().getTime()}.xls`)
     },
     /** 瀵煎叆妯℃澘涓嬭浇鎿嶄綔*/
     handleExportTemplate()
     {
       this.download('/system/projectName/model', {
 
-      }, `projectName_${new Date().getTime()}.xlsx`)
+      }, `projectName_${new Date().getTime()}.xls`)
     },
     
       /** 瀵煎叆鎿嶄綔*/
diff --git a/src/views/archiveStatics/index.vue b/src/views/archiveStatics/index.vue
index f12700f..fa7dc06 100644
--- a/src/views/archiveStatics/index.vue
+++ b/src/views/archiveStatics/index.vue
@@ -547,7 +547,7 @@
      // alert(98)
       this.download('system/records/exportAllStatis', {
        // ...this.queryParams
-      }, `records_${new Date().getTime()}.xlsx`)
+      }, `records_${new Date().getTime()}.xls`)
     }
   }
 }
diff --git a/src/views/archiveToUserStatistic/index.vue b/src/views/archiveToUserStatistic/index.vue
index c9d9e41..563ed64 100644
--- a/src/views/archiveToUserStatistic/index.vue
+++ b/src/views/archiveToUserStatistic/index.vue
@@ -357,7 +357,7 @@
     handleExport() {
       this.download('system/archiverecordstouser/exportArToUser', {
         // ...this.queryParams
-      }, `records_${new Date().getTime()}.xlsx`)
+      }, `records_${new Date().getTime()}.xls`)
     }
   }
 }
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index 7b4e627..6082c9f 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -524,7 +524,7 @@
     handleExport() {
       this.download('system/user/export', {
         ...this.queryParams
-      }, `user_${new Date().getTime()}.xlsx`)
+      }, `user_${new Date().getTime()}.xls`)
     },
     /** 瀵煎叆鎸夐挳鎿嶄綔 */
     handleImport() {
@@ -534,7 +534,7 @@
     /** 涓嬭浇妯℃澘鎿嶄綔 */
     importTemplate() {
       this.download('system/user/importTemplate', {
-      }, `user_template_${new Date().getTime()}.xlsx`)
+      }, `user_template_${new Date().getTime()}.xls`)
     },
     // 鏂囦欢涓婁紶涓鐞�
     handleFileUploadProgress(event, file, fileList) {

--
Gitblit v1.9.1