|
@@ -325,7 +325,7 @@
|
|
|
formBody.append('file', file)
|
|
|
await this.ossService.disposeXmlFile(formBody).then((data) => {
|
|
|
if(JSON.stringify(data) === "{}"){
|
|
|
- this.$message.warning('文件:'+file.name+'数电发票格式错误');
|
|
|
+ this.$message.warning('数电发票:'+file.name+'格式错误');
|
|
|
this.loading = false;
|
|
|
// 在验证失败时删除已经添加的行
|
|
|
const index = this.fileList.findIndex(item => item.name === file.name);
|
|
@@ -479,7 +479,7 @@
|
|
|
formBody.append('file', item.raw);
|
|
|
const data = await this.ossService.disposeXmlFile(formBody);
|
|
|
if (this.commonJS.isNotEmpty(data.InvoiceNumber)){
|
|
|
- this.duplicateFileNames.push(fileName+"-"+data.InvoiceNumber);
|
|
|
+ this.duplicateFileNames.push("文件名: "+fileName +"—— 发票号:"+data.InvoiceNumber);
|
|
|
console.log('222',data.InvoiceNumber)
|
|
|
console.log('this.duplicateFileNames',this.duplicateFileNames)
|
|
|
}
|
|
@@ -563,7 +563,7 @@
|
|
|
}
|
|
|
|
|
|
if (this.toCompany !== data.BuyerInformationBuyerName) {
|
|
|
- this.noXmlFiles.push(item.raw.name)
|
|
|
+ this.noXmlFiles.push("文件名: "+item.raw.name +"—— 发票号:"+data.InvoiceNumber)
|
|
|
// this.$message.warning("仅可上传江苏兴光项目管理有限公司的报销数电发票");
|
|
|
continue;
|
|
|
}
|
|
@@ -576,16 +576,17 @@
|
|
|
//查询当前发票号是否已经被报销
|
|
|
let isUsed = await this.ossService.isUsedByInvoiceNumber(data.InvoiceNumber);
|
|
|
if (isUsed){
|
|
|
- isUsedFiles.push(item.raw.name +"-"+data.InvoiceNumber)
|
|
|
+ isUsedFiles.push("文件名: "+item.raw.name +"—— 发票号:"+data.InvoiceNumber)
|
|
|
continue;
|
|
|
}
|
|
|
+ let inDate = this.formatDate(data.IssueTime)
|
|
|
+ if (inDate.indexOf("NaN") != -1 && this.commonJS.isNotEmpty(inDate)){
|
|
|
+ errorDateFiles.push("文件名: "+item.raw.name +"—— 发票号:"+data.InvoiceNumber);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ validCompanyFiles.push(item); // 符合条件的文件
|
|
|
}
|
|
|
- let inDate = this.formatDate(data.IssueTime)
|
|
|
- if (inDate.indexOf("NaN") != -1 && this.commonJS.isNotEmpty(inDate)){
|
|
|
- errorDateFiles.push(item.raw.name);
|
|
|
- continue;
|
|
|
- }
|
|
|
- validCompanyFiles.push(item); // 符合条件的文件
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -612,11 +613,11 @@
|
|
|
isUsedFiles = [...new Set(isUsedFiles)];
|
|
|
// 提示重复文件
|
|
|
if (this.duplicateFileNames.length > 0) {
|
|
|
- this.$message.warning({message:`以下文件已经上传,跳过了这些文件:<br>${this.duplicateFileNames.join('<br>')}`,dangerouslyUseHTMLString: true});
|
|
|
+ this.$message.warning({message:`以下文件已经上传,请勿重复上传:<br>${this.duplicateFileNames.join('<br>')} `,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
// 提示xml文件不是当前公司报销的文件
|
|
|
if (this.noXmlFiles.length > 0) {
|
|
|
- this.$message.warning({message:`仅可上传${this.toCompany}的报销数电发票:<br>${this.noXmlFiles.join('<br>')}`,dangerouslyUseHTMLString: true});
|
|
|
+ this.$message.warning({message:`仅可上传${this.toCompany}的报销数电发票:<br>${this.noXmlFiles.join('<br>')}<br>上传失败 `,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
// 提示发票号重复文件
|
|
|
// if (this.reNumFiles.length > 0) {
|
|
@@ -628,15 +629,15 @@
|
|
|
}
|
|
|
//临时路径错误的文件
|
|
|
if (invalidFiles.length > 0){
|
|
|
- this.$message.warning({message:`文件: "<br>${invalidFiles.join('<br>')}" 获取失败,已从上传列表中删除。`,dangerouslyUseHTMLString: true});
|
|
|
+ this.$message.warning({message:`数电发票: <br>${invalidFiles.join('<br>')}<br>获取失败,上传失败。`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
//临时路径错误的文件
|
|
|
if (errorDateFiles.length > 0){
|
|
|
- this.$message.warning({message:`文件: "<br>${errorDateFiles.join('<br>')}" 日期格式错误,已从上传列表中删除。`,dangerouslyUseHTMLString: true});
|
|
|
+ this.$message.warning({message:`数电发票: <br>${errorDateFiles.join('<br>')}<br>日期格式错误,上传失败。`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
//已经被报销的文件
|
|
|
if (isUsedFiles.length > 0){
|
|
|
- this.$message.warning({message:`数电发票编号为: "<br>${isUsedFiles.join('<br>')}" 已经发起或已完成报销,无法重复报销`,dangerouslyUseHTMLString: true});
|
|
|
+ this.$message.warning({message:`数电发票: <br>${isUsedFiles.join('<br>')}<br>已经发起或已完成报销,无法重复报销`,dangerouslyUseHTMLString: true});
|
|
|
}
|
|
|
// 重置计数器
|
|
|
this.uploadingCount = 0;
|