From 12c6f51d841e80bab7089725e63a034dbe6a294f Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 11 一月 2026 21:57:45 +0800
Subject: [PATCH] 修改了代码
---
src/views/archiveManager/archiveMaterial/index.vue | 151 ++++++++++++++++++++++++++++---------------------
1 files changed, 86 insertions(+), 65 deletions(-)
diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index a6c252d..fa1d883 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -2,7 +2,7 @@
<div class="app-container">
<div v-if="sho">
- <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍</h2>
+ <h2 class="title-border">娣诲姞妗堝嵎璇︾粏璁板綍 {褰撳墠褰曞叆浜唟{total}}鏉</h2>
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-row>
@@ -18,6 +18,10 @@
<el-form-item label="璐d换鑰�" prop="creator">
<div class="title-search-wrapper">
<el-input
+ type="textarea"
+ rows="2"
+ v-auto-height="{ minRows: 2, maxRows: 10 }"
+
v-model="form.creator"
placeholder="璇疯緭鍏ヨ矗浠昏��"
@input="handleCreatorInput"
@@ -48,6 +52,8 @@
<el-form-item label="鏂囦欢棰樺悕" prop="title">
<div class="title-search-wrapper">
<el-input
+ type="textarea"
+ rows="2"
v-model="form.title"
placeholder="璇疯緭鍏ユ枃浠堕鍚�"
@input="handleTitleInput"
@@ -350,7 +356,7 @@
>瀵煎叆妯℃澘涓嬭浇</el-button>
</el-col>
- <el-col :span="1.5">
+ <el-col v-if="sho" :span="1.5">
<el-upload
action=""
@@ -361,7 +367,7 @@
accept=".xlsx,.xls"
>
- <el-button size="mini" v-if="sho" type="primary"
+ <el-button size="mini" type="primary"
plain
icon="el-icon-top">瀵煎叆</el-button>
@@ -455,13 +461,13 @@
<el-row>
<el-col :span="16">
<el-form-item label="璐d换鑰�" prop="creator">
- <el-input v-model="forms.creator" placeholder="璇疯緭鍏ヨ矗浠昏��" />
+ <el-input type="textarea" rows="1" v-model="forms.creator" placeholder="璇疯緭鍏ヨ矗浠昏��" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="鏂囦欢棰樺悕" prop="title">
- <el-input v-model="forms.title" placeholder="璇疯緭鍏ユ枃浠堕鍚�" />
+ <el-input type="textarea" rows="1" v-model="forms.title" placeholder="璇疯緭鍏ユ枃浠堕鍚�" />
</el-form-item>
<el-form-item label="鏃ユ湡" prop="date">
<el-input v-model="forms.date" placeholder="璇疯緭鍏ユ棩鏈� (鏍煎紡锛歽yyy-mm-dd)" style="width: 200px;" />
@@ -824,13 +830,17 @@
importDialogVisible: false,
fileList: [],
- uploadUrl: process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId, // 鏇挎崲涓哄疄闄呯殑涓婁紶鎺ュ彛
+ uploadUrl: process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId, // 鏇挎崲涓哄疄闄呯殑涓婁紶鎺ュ彛
headers: {
Authorization: 'Bearer ' + getToken()
},
uploadParams: {
type: 'material' // 鑷畾涔変笂浼犵被鍨�
},
+ // 涓婁紶鐘舵�佽窡韪�
+ uploadSuccessCount: 0,
+ uploadFailCount: 0,
+ totalUploadFiles: 0,
// 娣诲姞鏉愭枡绫诲瀷閫夐」
fileStyleOptions: [
{ value: '鏂囧瓧鏉愭枡', label: '鏂囧瓧鏉愭枡' },
@@ -959,6 +969,14 @@
{ required: true, message: "椤靛彿涓嶈兘涓虹┖", trigger: "blur" },
{ type: 'number', message: '椤靛彿蹇呴』涓烘暟瀛楃被鍨�', trigger: ['blur', 'change'] },
{ pattern: /^[1-9]\d*$/, message: '璇疯緭鍏ュぇ浜�0鐨勬鏁存暟', trigger: 'blur' },
+ { validator: (rule, value, callback) => {
+ if (this.totalPageCount > 0 && value > this.totalPageCount) {
+ callback(new Error(`椤靛彿涓嶈兘瓒呰繃鎬婚〉鏁�${this.totalPageCount}`));
+ } else {
+ callback();
+ }
+ }, trigger: ['blur', 'change']
+ },
// { max: 85, message: "鏈�澶ч暱搴︿负85涓瓧绗�", trigger: "blur" }
],
stage: [
@@ -1021,7 +1039,7 @@
//alert(this.totalPageCount)
//alert(recordId)
this.recordId = recordId;
- this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId
+ this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId
// alert('Bearer ' + getToken())
this.reset()
this.form.securityLevel = '鏅��' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
@@ -1039,35 +1057,49 @@
methods: {
// 涓婁紶澶辫触鍥炶皟
handleError(err, file, fileList) {
- this.$modal.msgError("涓婁紶澶辫触: " + err.message)
- // 娓呴櫎涓婁紶鍒楄〃
- this.$refs.upload.clearFiles();
+ // 澶辫触璁℃暟+1
+ this.uploadFailCount++;
+ // 妫�鏌ユ槸鍚︽墍鏈夋枃浠堕兘涓婁紶瀹屾垚
+ this.checkUploadComplete();
},
// 涓婁紶鎴愬姛鍥炶皟
handleSuccess(response, file, fileList) {
if (response.code === 200) {
- this.$modal.msgSuccess("涓婁紶鎴愬姛")
- // 娓呴櫎涓婁紶鍒楄〃
- this.$refs.upload.clearFiles();
- // 鍏抽棴涓婁紶瀵硅瘽妗�
- this.importDialogVisible = false;
- // 鍒锋柊鍒楄〃鏁版嵁
- this.getList(); // 杩欓噷鍙互璋冪敤鎺ュ彛鍏宠仈涓婁紶鐨勬枃浠跺拰褰撳墠璁板綍
- //鏇存柊妗f鐨勭姸鎬�
-
+ // 鎴愬姛璁℃暟+1
+ this.uploadSuccessCount++;
} else {
- // alert(234)
- console.log(response)
- this.$modal.msgError(response.msg)
+ // 澶辫触璁℃暟+1
+ this.uploadFailCount++;
+ }
+ // 妫�鏌ユ槸鍚︽墍鏈夋枃浠堕兘涓婁紶瀹屾垚
+ this.checkUploadComplete();
+ },
+ // 妫�鏌ユ墍鏈夋枃浠舵槸鍚︿笂浼犲畬鎴�
+ checkUploadComplete() {
+ // 褰撴墍鏈夋枃浠堕兘涓婁紶瀹屾垚鏃�
+ if (this.uploadSuccessCount + this.uploadFailCount === this.totalUploadFiles) {
+ if (this.uploadFailCount === 0) {
+ // 鎵�鏈夋枃浠朵笂浼犳垚鍔�
+ this.$modal.msgSuccess("鎵�鏈夋枃浠朵笂浼犳垚鍔�");
+ } else {
+ // 閮ㄥ垎鏂囦欢涓婁紶澶辫触
+ this.$modal.msgError(`涓婁紶瀹屾垚锛屼絾鏈� ${this.uploadFailCount} 涓枃浠朵笂浼犲け璐);
+ }
+ // 娓呴櫎涓婁紶鍒楄〃
+ this.$refs.upload.clearFiles();
+ // 鍏抽棴涓婁紶瀵硅瘽妗�
+ this.importDialogVisible = false;
+ // 鍒锋柊鍒楄〃鏁版嵁
+ this.getList();
}
},
- // 鎵撳紑瀵煎叆瀵硅瘽妗�
+ // 鎵撳紑瀵煎叆瀵硅瘽妗�
handleImport() {
//鐢熸垚鏂扮殑璁板綍
- insertFile(this.recordId, this.totalPageCount).then(response => {
- console.log(response)
- // alert(3245)
- })
+ // insertFile(this.recordId, this.totalPageCount).then(response => {
+ // console.log(response)
+ // // alert(3245)
+ // })
this.importDialogVisible = true
},
// 鏂囦欢绉婚櫎
@@ -1099,16 +1131,20 @@
// var res = response.data.res
// console.log(res)
//alert(response.data.total)
- if(fileCount!=this.totalPageCount)
+ // if(fileCount!=this.totalPageCount)
+ // {
+ // this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢')
+ // return
+ // }
+ // else
{
- this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢')
- return
- }
- else
- {
+ // 鍒濆鍖栦笂浼犵姸鎬佽鏁�
+ this.uploadSuccessCount = 0;
+ this.uploadFailCount = 0;
+ this.totalUploadFiles = fileCount;
// 鎵ц涓婁紶
this.$refs.upload.submit()
- this.getList()
+ // this.getList()
}
// else
// {
@@ -1146,22 +1182,7 @@
/** 鏌ヨ銆愯濉啓鍔熻兘鍚嶇О銆戝垪琛� */
getList() {
this.loading = true
-
- // 澶勭悊妗f鍙锋悳绱㈤�昏緫锛屽寘鎷寖鍥存悳绱�
- const queryParams = { ...this.queryParams }
-
- // 妫�鏌ユ槸鍚﹀寘鍚寖鍥存悳绱㈢鍙�
- if (queryParams.fileNumber && queryParams.fileNumber.includes('~')) {
- const rangeParts = queryParams.fileNumber.split('~')
- if (rangeParts.length === 2) {
- // 瑙f瀽鑼冨洿鎼滅储鍙傛暟
- // 淇濈暀鍘熷fileNumber鐢ㄤ簬鍏朵粬澶勭悊
- queryParams.fileNumberStart = rangeParts[0].trim()
- queryParams.fileNumberEnd = rangeParts[1].trim()
- }
- }
-
- listMaterials(queryParams).then(response => {
+ listMaterials(this.queryParams).then(response => {
console.log(response)
// 杩囨护鎺塿isible涓�0鐨勮褰�
this.materialsList = response.data.data.filter(item => item.visible !== 0)
@@ -1313,11 +1334,11 @@
this.showCreatorSuggestions = false;
},
- // 澶勭悊鏉愭枡绫诲瀷鍙樺寲锛堟柊澧炶〃鍗曪級
+ // 澶勭悊鏉愭枡绫诲瀷鍙樺寲
handleFileStyleChange(value) {
- // 褰撻�夋嫨'鍏朵粬鏉愭枡'鏃讹紝灏嗛〉鍙疯缃负0
+ // 褰撻�夋嫨'鍏朵粬鏉愭枡'鏃讹紝娓呯┖椤电爜瀛楁
if (value === '鍏朵粬鏉愭枡') {
- this.forms.pageNumber = null;
+ this.form.pageNumber = null;
}
},
// 澶勭悊鏉愭枡绫诲瀷鍙樺寲锛堜慨鏀硅〃鍗曪級
@@ -1484,30 +1505,26 @@
// 淇濆瓨鎴愬姛鍚庯紝鍏夋爣璺冲洖鏂囦欢缂栧彿杈撳叆妗�
this.$nextTick(() => {
- this.$refs.documentNumberInput.focus();
+ this.$refs.documentNumberInput.select();
});
this.getList()
- })
- }
- else
- {
- this.$message.error('璇峰~鍐欐墍鏈夊繀濉瓧娈�');
+ })
+ }
+ else
+ {
+ this.$message.error('璇峰~鍐欐墍鏈夊繀濉瓧娈�');
}
})
},
/** 鎻愪氦鎸夐挳 */
submitForms() {
- console.log(this.forms)
this.$refs["forms"].validate(valid => {
if (valid) {
if (this.forms.materialId != null) {
updateMaterials(this.forms).then(response => {
this.$modal.msgSuccess("淇敼鎴愬姛")
- // 淇敼鎴愬姛鍚庯紝鍏夋爣璺冲洖鏂囦欢缂栧彿杈撳叆妗�
- this.$nextTick(() => {
- this.$refs.documentNumberInput.focus();
- });
+
this.open = false
this.getList()
})
@@ -1626,7 +1643,7 @@
//淇敼妗堝嵎鐨勭姸鎬�
// var id = row.id
var status = '鏈笂浼犻檮浠�'
- updateStatusById(status, recordId).then(response=>{
+ updateStatusById(status, recordId, '閫�鍥炵鐞嗗憳').then(response=>{
// this.$modal.msgSuccess("鎻愪氦鎴愬姛")
// this.getList()
_this.$store.dispatch('tagsView/delView', this.$route);
@@ -1750,3 +1767,7 @@
background-color: #fff;
}
</style>
+
+
+
+
--
Gitblit v1.9.1