From fc98e676332302c4b835f8fa4ed42d72e177801f Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期二, 14 十月 2025 16:57:02 +0800
Subject: [PATCH] 增加了对应的代码
---
src/views/archiveManager/archiveMaterial/index.vue | 91 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 78 insertions(+), 13 deletions(-)
diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index 4ed97fc..83b9619 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -162,6 +162,10 @@
<el-button type="primary" @click="resetForms">閲嶇疆</el-button>
<el-button @click="cancel">鍙� 娑�</el-button>
+
+
+ <el-button type="warning" @click="cancelAuthUser">閫�鍥炵鐞嗗憳</el-button>
+
</div>
@@ -239,12 +243,14 @@
:on-preview="handlePreview"
:on-remove="handleRemove"
:file-list="fileList"
+ :on-change="handleFileChange"
:auto-upload="false"
multiple
accept=".jpg,.png"
>
<el-button slot="trigger" size="small" type="primary">閫夋嫨鏂囦欢</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">涓婁紶鍒版湇鍔″櫒</el-button>
+ <el-button style="margin-left: 10px;" size="small" type="danger" @click="clearFileList">娓呯┖鍒楄〃</el-button>
<div slot="tip" class="el-upload__tip">鍙笂浼燡PG绛夋牸寮忔枃浠讹紝鍗曚釜鏂囦欢涓嶈秴杩�50MB</div>
</el-upload>
</el-dialog>
@@ -687,7 +693,10 @@
<script>
import { listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials"
import { getToken } from '@/utils/auth'
+import store from '@/store'
+import { updateStatusById } from "@/api/system/records"
+import {delArchiverecordstouserByReIdAndUid} from "@/api/system/archiverecordstouser"
export default {
name: "Materials",
data() {
@@ -863,8 +872,10 @@
this.$refs.upload.clearFiles();
// 鍏抽棴涓婁紶瀵硅瘽妗�
this.importDialogVisible = false;
- // 鍒锋柊鍒楄〃鏁版嵁
- this.getList(); // 杩欓噷鍙互璋冪敤鎺ュ彛鍏宠仈涓婁紶鐨勬枃浠跺拰褰撳墠璁板綍
+ // 鍒锋柊鍒楄〃鏁版嵁
+ this.getList(); // 杩欓噷鍙互璋冪敤鎺ュ彛鍏宠仈涓婁紶鐨勬枃浠跺拰褰撳墠璁板綍
+ //鏇存柊妗f鐨勭姸鎬�
+
} else {
// alert(234)
console.log(response)
@@ -883,9 +894,29 @@
handlePreview(file) {
console.log(file)
},
+ handleFileChange(file, fileList) {
+ console.log('褰撳墠鏂囦欢鍒楄〃:', fileList);
+ this.fileList = fileList;
+ },
// 鎻愪氦涓婁紶
submitUpload() {
+ // 鑾峰彇褰撳墠閫夋嫨鐨勬枃浠舵暟閲�
+ const fileCount = this.fileList.length
+ if (fileCount === 0) {
+ this.$modal.msgWarning('璇峰厛閫夋嫨鏂囦欢鍐嶄笂浼�')
+ return
+ }
+ if(fileCount!==this.total)
+ {
+ this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢')
+ return
+ }
+ // 鎵ц涓婁紶
this.$refs.upload.submit()
+ },
+ clearFileList() {
+ this.fileList = [];
+ this.$modal.msgSuccess('宸叉竻绌轰笂浼犲垪琛�');
},
handleKeyDown(e) {
// 鍦╧eydown浜嬩欢涓洿鏃╁湴闃绘榛樿琛屼负
@@ -903,6 +934,10 @@
if ((e.ctrlKey || e.metaKey) && e.key === 'd') {
e.preventDefault();
this.resetForms();
+ }
+ if ((e.ctrlKey || e.metaKey) && e.key === 'w') {
+ e.preventDefault();
+ this.closeCurrentTab();
}
},
/** 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� */
@@ -1016,15 +1051,19 @@
})
},
resetForms()
- {
+ {
this.reset()
- this.form.securityLevel = '鏅��' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
- this.form.isSensitive = '鍚�' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
- this.form.isCanceled = '鍚�' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
- this.form.isAttachment = '鍚�' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
- this.form.isDiagram = '鍚�' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
- this.form.retentionPeriod = '姘镐箙' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
- },
+ this.form.securityLevel = '鏅��'
+ this.form.isSensitive = '鍚�'
+ this.form.isCanceled = '鍚�'
+ this.form.isAttachment = '鍚�'
+ this.form.isDiagram = '鍚�'
+ this.form.retentionPeriod = '姘镐箙'
+ },
+ closeCurrentTab() {
+ this.$store.dispatch('tagsView/delView', this.$route)
+ this.$router.push('/archiveManager/infoManager')
+ },
submitForm()
{
console.log(this.form)
@@ -1086,8 +1125,8 @@
// }
const formData = new FormData();
formData.append('file', file);
- formData.append('recordId', this.recordId)
- alert(this.recordId)
+ // formData.append('recordId', this.recordId)
+ // alert(this.recordId)
console.log(file)
// 鏄剧ず鍔犺浇涓姸鎬�
@@ -1111,7 +1150,33 @@
this.$message.error('瀵煎叆澶辫触: ' + (error.message || '鏈煡閿欒'));
});
- }
+ },
+ /** 鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */
+ cancelAuthUser(row) {
+ const recordId = this.recordId
+ var userId = store.state.user.id
+ var _this = this
+ // alert(userId)
+ // alert(userId)
+ // alert(this.queryParams.archiveRecordsId)
+ // alert(row.sysUser.userName)
+ this.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛鐨�"' + '' + '"鎺堟潈鍚楋紵').then(function() {
+ return delArchiverecordstouserByReIdAndUid({ recordId: recordId, userId: userId })
+ }).then(() => {
+ // this.getList()
+ //淇敼妗堝嵎鐨勭姸鎬�
+ // var id = row.id
+ var status = '鏈笂浼犻檮浠�'
+ updateStatusById(status, recordId).then(response=>{
+ // this.$modal.msgSuccess("鎻愪氦鎴愬姛")
+ // this.getList()
+ _this.$store.dispatch('tagsView/delView', this.$route);
+ _this.$router.push('/archiveManager/infoManager')
+ _this.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛")
+ })
+
+ }).catch(() => {})
+ },
}
}
</script>
--
Gitblit v1.9.1