导入拆分文件类型修改
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<div class="split-import-upload">
|
||||
<!-- <a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title" class="ocr-upload-modal">-->
|
||||
<a-upload
|
||||
:accept='accept'
|
||||
accept='.zip'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
name="file"
|
||||
@@ -50,31 +50,21 @@
|
||||
},
|
||||
methods:{
|
||||
beforeUpload(file,fileList) {
|
||||
// console.log('file',this.accept,file,fileList,this.myfileList)
|
||||
console.log('file',this.accept,file,fileList,this.myfileList)
|
||||
this.fileTypeSatus=false
|
||||
if(this.myfileList&&this.myfileList.length>=1){
|
||||
// console.log()
|
||||
this.$message.warning(this.$t('onlyOnefileUploaded'))
|
||||
return false
|
||||
}else{
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
// console.log('accetptt',this.accept)
|
||||
let acceptFlag=false
|
||||
let accepts = this.accept.split(',')
|
||||
accepts.forEach((item,index)=>{
|
||||
if(item==file.type){
|
||||
acceptFlag=true
|
||||
return
|
||||
}else{
|
||||
acceptFlag=false
|
||||
}
|
||||
})
|
||||
if(acceptFlag){
|
||||
// console.log('111111')
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
let suffix=file.name.split('.')
|
||||
let acceptSuffix=suffix[suffix.length-1]
|
||||
if(acceptSuffix.toLowerCase()=='zip'){
|
||||
this.fileTypeSatus = true;
|
||||
this.$message.destroy()
|
||||
// 207M.doc文件大小超出100MB限制, 请压缩或降低文件质量!
|
||||
this.errorMessage = file.name + "文件大小超出100MB限制, 请压缩或降低文件质量!";
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
],
|
||||
},
|
||||
spinning:false, //loading标识
|
||||
type:'',
|
||||
type:'doc',
|
||||
url:{
|
||||
tableHeader: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //表格头部字段
|
||||
seachList: 'document/bussDocumentLibraryEO/getHeaderOrConditionForSplitResult', //搜索字段
|
||||
|
||||
@@ -894,6 +894,7 @@
|
||||
|
||||
}
|
||||
eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
this.selectClear()
|
||||
// eventBUs.$emit('searchReset')
|
||||
}else{
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
|
||||
@@ -137,6 +137,7 @@
|
||||
OperationList:[],
|
||||
token:Vue.ls.get(ACCESS_TOKEN),
|
||||
cut:'',
|
||||
submitFlag:false
|
||||
}
|
||||
},
|
||||
props:{
|
||||
@@ -226,31 +227,24 @@
|
||||
fileGroup: this.fileGroup,
|
||||
fileType:file.text_info
|
||||
}
|
||||
if(!this.submitFlag){
|
||||
this.submitFlag=true
|
||||
|
||||
postAction(`split/sarFileSplitInfo/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
eventBUs.$emit('searchReset')
|
||||
this.visible = false;
|
||||
this.$emit('visible', false)
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.submitFlag =true
|
||||
|
||||
// if (file.text_info == '发布稿(必读)') {
|
||||
// params.fileType = '1'
|
||||
// } else if (file.text_info == '增补件(必读)') {
|
||||
// params.fileType = '2'
|
||||
// } else if (file.text_info == '报批稿') {
|
||||
// params.fileType = '3'
|
||||
// } else if (file.text_info == '征求意见稿') {
|
||||
// params.fileType = '4'
|
||||
// } else if (file.text_info == '测试程序') {
|
||||
// params.fileType = '5'
|
||||
// } else if (file.text_info == '相关资料') {
|
||||
// params.fileType = '6'
|
||||
// }
|
||||
postAction(`split/sarFileSplitInfo/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
eventBUs.$emit('searchReset')
|
||||
this.visible = false;
|
||||
this.$emit('visible', false)
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
this.$emit('exportVisible',true)
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(this.$t('OnlyWord'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user