|
@@ -164,7 +164,7 @@
|
|
|
totalCount: 0, // 记录总的文件数量
|
|
|
duplicateFileNames: [], // 存储重复文件名
|
|
|
noXmlFiles: [], // 存储非当前公司的文件名
|
|
|
- reNumFiles: [], // 存储重复发票号
|
|
|
+ // reNumFiles: [], // 存储重复发票号
|
|
|
toCompany:'', //用于区分属于哪个公司的数电发票,
|
|
|
}
|
|
|
},
|
|
@@ -475,7 +475,14 @@
|
|
|
// 检查该文件标识是否已存在
|
|
|
if (uploadedFileIdentifiers.has(fileIdentifier)) {
|
|
|
// 记录重复文件名
|
|
|
- this.duplicateFileNames.push(fileName);
|
|
|
+ const formBody = new FormData();
|
|
|
+ formBody.append('file', item.raw);
|
|
|
+ const data = await this.ossService.disposeXmlFile(formBody);
|
|
|
+ if (this.commonJS.isNotEmpty(data.InvoiceNumber)){
|
|
|
+ this.duplicateFileNames.push(fileName+"-"+data.InvoiceNumber);
|
|
|
+ console.log('222',data.InvoiceNumber)
|
|
|
+ console.log('this.duplicateFileNames',this.duplicateFileNames)
|
|
|
+ }
|
|
|
} else {
|
|
|
// 文件没有重复,加入上传列表
|
|
|
filesToUpload.push(item);
|
|
@@ -560,16 +567,18 @@
|
|
|
// this.$message.warning("仅可上传江苏兴光项目管理有限公司的报销数电发票");
|
|
|
continue;
|
|
|
}
|
|
|
- var flag = this.invoiceReimbursementDispose(data)
|
|
|
- if (flag){
|
|
|
- this.reNumFiles.push(data.InvoiceNumber)
|
|
|
- continue;
|
|
|
- }
|
|
|
- //查询当前发票号是否已经被报销
|
|
|
- let isUsed = await this.ossService.isUsedByInvoiceNumber(data.InvoiceNumber);
|
|
|
- if (isUsed){
|
|
|
- isUsedFiles.push(data.InvoiceNumber)
|
|
|
- continue;
|
|
|
+ if (this.commonJS.isNotEmpty(data.InvoiceNumber)){
|
|
|
+ var flag = this.invoiceReimbursementDispose(data)
|
|
|
+ if (flag){
|
|
|
+ this.duplicateFileNames.push(item.raw.name +"-"+data.InvoiceNumber)
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //查询当前发票号是否已经被报销
|
|
|
+ let isUsed = await this.ossService.isUsedByInvoiceNumber(data.InvoiceNumber);
|
|
|
+ if (isUsed){
|
|
|
+ isUsedFiles.push(item.raw.name +"-"+data.InvoiceNumber)
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
let inDate = this.formatDate(data.IssueTime)
|
|
|
if (inDate.indexOf("NaN") != -1 && this.commonJS.isNotEmpty(inDate)){
|
|
@@ -596,38 +605,38 @@
|
|
|
if (this.uploadingCount === this.totalCount) {
|
|
|
this.duplicateFileNames = [...new Set(this.duplicateFileNames)];
|
|
|
this.noXmlFiles = [...new Set(this.noXmlFiles)];
|
|
|
- this.reNumFiles = [...new Set(this.reNumFiles)];
|
|
|
+ // this.reNumFiles = [...new Set(this.reNumFiles)];
|
|
|
errorFiles = [...new Set(errorFiles)];
|
|
|
invalidFiles = [...new Set(invalidFiles)];
|
|
|
errorDateFiles = [...new Set(errorDateFiles)];
|
|
|
isUsedFiles = [...new Set(isUsedFiles)];
|
|
|
// 提示重复文件
|
|
|
if (this.duplicateFileNames.length > 0) {
|
|
|
- this.$message.warning(`以下文件已经上传,跳过了这些文件:\n${this.duplicateFileNames.join('\n')}`);
|
|
|
+ this.$message.warning({message:`以下文件已经上传,跳过了这些文件:<br>${this.duplicateFileNames.join('<br>')}`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
// 提示xml文件不是当前公司报销的文件
|
|
|
if (this.noXmlFiles.length > 0) {
|
|
|
- this.$message.warning(`仅可上传${this.toCompany}的报销数电发票:\n${this.noXmlFiles.join('\n')}`);
|
|
|
+ this.$message.warning({message:`仅可上传${this.toCompany}的报销数电发票:<br>${this.noXmlFiles.join('<br>')}`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
// 提示发票号重复文件
|
|
|
- if (this.reNumFiles.length > 0) {
|
|
|
- this.$message.error(`发票号:\n${this.reNumFiles.join('\n')}已上传,请勿重复上传`);
|
|
|
- }
|
|
|
+ // if (this.reNumFiles.length > 0) {
|
|
|
+ // this.$message.error(`发票号:\n${this.reNumFiles.join('\n')}已上传,请勿重复上传`);
|
|
|
+ // }
|
|
|
//数电发票格式错误的文件
|
|
|
if (errorFiles.length > 0){
|
|
|
- this.$message.warning(`上传的数电发票格式错误:\n${errorFiles.join('\n')}`);
|
|
|
+ this.$message.warning({message:`上传的数电发票格式错误:<br>${errorFiles.join('<br>')}`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
//临时路径错误的文件
|
|
|
if (invalidFiles.length > 0){
|
|
|
- this.$message.warning(`文件: "\n${invalidFiles.join('\n')}" 获取失败,已从上传列表中删除。`);
|
|
|
+ this.$message.warning({message:`文件: "<br>${invalidFiles.join('<br>')}" 获取失败,已从上传列表中删除。`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
//临时路径错误的文件
|
|
|
if (errorDateFiles.length > 0){
|
|
|
- this.$message.warning(`文件: "\n${errorDateFiles.join('\n')}" 日期格式错误,已从上传列表中删除。`);
|
|
|
+ this.$message.warning({message:`文件: "<br>${errorDateFiles.join('<br>')}" 日期格式错误,已从上传列表中删除。`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
//已经被报销的文件
|
|
|
if (isUsedFiles.length > 0){
|
|
|
- this.$message.warning(`数电发票编号为: "\n${isUsedFiles.join('\n')}" 已经发起或已完成报销,无法重复报销`);
|
|
|
+ this.$message.warning({message:`数电发票编号为: "<br>${isUsedFiles.join('<br>')}" 已经发起或已完成报销,无法重复报销`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
// 重置计数器
|
|
|
this.uploadingCount = 0;
|