Commit 7d7342b1 by zhangquan

交互优化

1 parent a70b5861
......@@ -46,7 +46,7 @@
</el-popover>
</div>
</div>
<div class="file_name" v-if="errorFileInfo.fileName">{{errorFileInfo.fileName}}</div>
<div class="file_name" v-if="fileData && fileData.name">{{fileData.name}}</div>
</div>
<div class="file_info">
<div class="file_num">
......@@ -82,6 +82,7 @@
return {
size: 'small',
exampleImg,
uploaded: false,
isVisible: false,
requestTip: false,
contractNoStr: '',
......@@ -89,6 +90,7 @@
contractNoList: [],
errorNoList: [],
errorFileInfo:{},
fileData: {},
getListApi: this.$apis.addCode.getcodeList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageCount', totalCount: 'total' },
pageSizes: [5, 10, 20, 30, 40],
......@@ -216,6 +218,30 @@
this.$refs.file.value = ''
return false
}
this.uploaded = false
this.fileData = file
},
handleUploadFile(){
if(!this.fileData.size) return this.$message({
message:'请上传文件',
type: 'error',
customClass: 'msgHierarchy'
});
if(this.uploaded){
if(this.errorFileInfo.effectiveSize<=0){
this.$message({
message:'有效合同号为0',
type: 'error',
customClass: 'msgHierarchy'
})
this.fileData = {}
}else{
this.clearData()
}
this.uploaded = false
return false
}
const file = this.fileData
const reader = new FileReader()
reader.readAsDataURL(file)
reader.onload = event => {
......@@ -233,15 +259,15 @@
this.$apis.addCode.uploadCodeFile({ file: fileUrl }).then(res => {
loading.close()
if(res?.batchNo) {
res.fileName = file?.name
this.errorFileInfo = res
this.uploaded = true
}
this.$refs.file.value = ''
}).catch(err =>{
loading.close()
})
}
},
},
// 下载错误的合同号
handleExport() {
const params = {
......@@ -262,6 +288,7 @@
})
},
createCode() {
this.uploaded = false
this.isVisible = true
},
onOk(){
......@@ -309,14 +336,7 @@
loading.close()
})
}else{
if(this.errorFileInfo.effectiveSize<=0){
return this.$message({
message:'有效合同号为0',
type: 'error',
customClass: 'msgHierarchy'
})
}
this.clearData()
this.handleUploadFile()
}
},
clearData(){
......@@ -327,6 +347,7 @@
this.contractNoList = [],
this.errorNoList = []
this.errorFileInfo = {}
this.fileData = {}
this.handleRest()
},
handleClose() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!