diff --git a/src/api/archivesManagement/fileManager/fileManager.js b/src/api/archivesManagement/fileManager/fileManager.js
index 86d9954..a0bff6c 100644
--- a/src/api/archivesManagement/fileManager/fileManager.js
+++ b/src/api/archivesManagement/fileManager/fileManager.js
@@ -114,4 +114,22 @@ export function getFileManageByIdApi(params) {
method: 'get',
params
})
+}
+
+// 档案移交确认
+export function updateIntegrityStatusApi(params) {
+ return request({
+ url: '/smartArchives/fileManage/updateIntegrityStatus',
+ method: 'get',
+ params
+ })
+}
+
+// 档案抽取
+export function fileExtractApi(data) {
+ return request({
+ url: '/smartArchives/fileManage/fileExtract',
+ method: 'post',
+ data
+ })
}
\ No newline at end of file
diff --git a/src/views/archivesManagement/fileManager/components/addTableData.vue b/src/views/archivesManagement/fileManager/components/addTableData.vue
index cf95a3b..135eba2 100644
--- a/src/views/archivesManagement/fileManager/components/addTableData.vue
+++ b/src/views/archivesManagement/fileManager/components/addTableData.vue
@@ -47,8 +47,7 @@
:before-upload="beforeUpload"
:auto-upload="false"
:limit="1"
- accept=".pdf,.jpg,.jpeg,.png"
- :http-request="customUpload">
+ accept=".pdf,.jpg,.jpeg,.png">
选择文件
@@ -182,7 +181,7 @@ export default {
const res2 = await getFileManageByIdApi({id:this.rowData.id});
const obj =res2.data;
- console.error(obj);
+
// 编辑模式:填充表单数据
this.form = {
id: obj.id,
@@ -196,6 +195,8 @@ export default {
level: 5,
proId:this.projectId
};
+ const fileList = [{name:obj.fileName,businessId:obj.businessId}];
+ this.fileList = fileList;
} else {
const res = await getFileManageByIdApi({id:this.rowData.id});
const obj =res.data;
@@ -255,6 +256,9 @@ export default {
},
// 上传前对文件进行验证
beforeUpload(file) {
+ if(!(file instanceof File)){
+ return true;
+ }
const isValidType = this.checkFileType(file)
const isValidSize = this.checkFileSize(file)
@@ -305,6 +309,9 @@ export default {
},
// 移除文件
handleRemove(file, fileList) {
+ if(!(file instanceof File)){
+ this.form.businessId = file.businessId;
+ }
this.fileList = fileList
},
// 文件状态改变
@@ -316,49 +323,7 @@ export default {
}
console.log('文件列表更新:', fileList.length, '个文件')
},
- // 自定义上传方法
- customUpload(options) {
- // 这里可以处理文件上传,但由于您已经移除了上传功能,这里只是占位
- console.log('自定义上传:', options)
- return Promise.resolve()
- },
- // 上传文件
- uploadFiles() {
- return new Promise((resolve, reject) => {
- if (this.fileList.length === 0) {
- resolve();
- return;
- }
-
- let uploadPromises = this.fileList.map(file => {
- return new Promise((fileResolve, fileReject) => {
- const formData = new FormData();
- formData.append('file', file.raw);
- formData.append('projectId', this.projectId);
- formData.append('categoryId', this.form.parentId || 0);
- formData.append('description', this.form.contentName || '');
-
- this.$http.post(this.uploadUrl, formData, {
- headers: this.uploadHeaders
- }).then(response => {
- if (response.data.code === 200) {
- fileResolve(response.data);
- } else {
- fileReject(new Error(response.data.msg || '上传失败'));
- }
- }).catch(error => {
- fileReject(error);
- });
- });
- });
-
- Promise.all(uploadPromises).then(() => {
- resolve();
- }).catch(error => {
- reject(error);
- });
- });
- },
+
/**验证 */
submitForm(formName) {
this.$refs[formName].validate(valid => {
@@ -385,7 +350,9 @@ export default {
let params = _.cloneDeep(this.form);
if(this.fileList.length > 0){
this.fileList.map(file => {
- formData.append('file', file.raw);
+ if(file instanceof File){
+ formData.append('file', file.raw);
+ }
})
}
if (this.isAdd === 'add') {
@@ -403,6 +370,8 @@ export default {
// this.$modal.msgError('提交失败,请重试');
});
} else {
+ formData.append('params', JSON.stringify(params));
+ console.log(params);
updateFileManageRightApi(formData).then(res => {
this.loading.close();
if (res.code === 200) {
diff --git a/src/views/archivesManagement/fileManager/file-data.vue b/src/views/archivesManagement/fileManager/file-data.vue
index e1d0adc..ecc0a94 100644
--- a/src/views/archivesManagement/fileManager/file-data.vue
+++ b/src/views/archivesManagement/fileManager/file-data.vue
@@ -3,11 +3,13 @@
@@ -15,7 +17,7 @@
-
+
@@ -24,6 +26,7 @@
@@ -70,7 +106,7 @@ export default {
justify-content: space-between;
}
-.toolbar-left :deep(.el-button) + :deep(.el-button) {
+.toolbar-left :deep(.el-button)+ :deep(.el-button) {
margin-left: 8px;
}
@@ -82,11 +118,12 @@ export default {
min-height: calc(100vh - 200px);
}
-.pane-left, .pane-right {
+.pane-left,
+.pane-right {
background: #fff;
border-radius: 6px;
height: 100%;
- box-shadow: 0 1px 3px rgba(0,0,0,0.05);
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.pane-left {