From e3686634452289d43e750a44f30f72b0e7754866 Mon Sep 17 00:00:00 2001
From: 吴羡 <16976746+Xian-TT3@user.noreply.gitee.com>
Date: 星期六, 07 十一月 2026 00:26:56 +0800
Subject: [PATCH] 修复人员管理模块各标签页问题并完善设备、文件受控页面
---
src/views/CNAS/personnel/personnelInfo/components/ViewRecord.vue | 48 +++++++++++++++++++++++++++++-------------------
1 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/src/views/CNAS/personnel/personnelInfo/components/ViewRecord.vue b/src/views/CNAS/personnel/personnelInfo/components/ViewRecord.vue
index 80af54d..c09b517 100644
--- a/src/views/CNAS/personnel/personnelInfo/components/ViewRecord.vue
+++ b/src/views/CNAS/personnel/personnelInfo/components/ViewRecord.vue
@@ -99,13 +99,17 @@
},
// 鏌ヨ闄勪欢鍒楄〃
searchTableList () {
+ if (!this.info || !this.info.id) {
+ this.tableData = []
+ return
+ }
this.tableLoading = true
getTrainingDetailedFileList({trainingDetailedId: this.info.id}).then(res => {
+ this.tableData = res.data || []
+ }).catch(() => {
+ this.tableData = []
+ }).finally(() => {
this.tableLoading = false
- this.tableData = res.data
- }).catch(err => {
- this.tableLoading = false
- console.log('err---', err);
})
},
closeFilesLook () {
@@ -124,37 +128,43 @@
}).then(() => {
this.tableLoading = true
delTrainingDetailedFileList({detailedFileId: row.detailedFileId}).then(res => {
+ if (res.code == 200) {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.searchTableList()
+ } else {
+ this.$message.error(res.msg || '鍒犻櫎澶辫触')
+ }
+ }).catch(() => {
+ this.$message.error('鍒犻櫎澶辫触')
+ }).finally(() => {
this.tableLoading = false
- this.$message.success('鍒犻櫎鎴愬姛')
- this.searchTableList()
- }).catch(err => {
- this.tableLoading = false
- console.log('err---', err);
})
}).catch(() => {})
},
// 涓婁紶楠岃瘉
fileBeforeUpload(file) {
- let flag = true
if (file.size > 1024 * 1024 * 10) {
this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
this.$refs.upload.clearFiles()
- flag = false
+ return Promise.reject()
}
- if (!flag) {
- return Promise.reject(flag); //姝g‘鐨勭粓姝�
+ if (!/\.(jpg|jpeg|png|gif|doc|docx|xls|xlsx|ppt|pptx|pdf|zip|rar)$/i.test(file.name || '')) {
+ this.$message.error('涓嶆敮鎸佺殑鏂囦欢鏍煎紡')
+ this.$refs.upload.clearFiles()
+ return Promise.reject()
}
},
onError(err, file, fileList,type) {
this.$message.error('涓婁紶澶辫触')
- this.$refs.upload.clearFiles()
+ this.$refs.upload && this.$refs.upload.clearFiles()
},
- handleSuccessUp(response, ) {
- this.upLoading = false;
- if (response.code == 200) {
- this.$message.success('涓婁紶鎴愬姛');
- this.searchTableList()
+ handleSuccessUp(response) {
+ if (!response || response.code != 200) {
+ this.$message.error((response && (response.msg || response.message)) || '涓婁紶澶辫触')
+ return
}
+ this.$message.success('涓婁紶鎴愬姛');
+ this.searchTableList()
},
// 鏌ョ湅鏂囦欢
handleLook(row){
--
Gitblit v1.9.3