|
@@ -518,7 +518,7 @@ export default {
|
|
|
}, 1000) // 一秒后关闭进度条
|
|
}, 1000) // 一秒后关闭进度条
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- invoiceReimbursementDisposeData: function (data, file) {
|
|
|
|
|
|
|
+ async invoiceReimbursementDisposeData(data, file) {
|
|
|
var invoiceReimbursements = this.dataListNew;
|
|
var invoiceReimbursements = this.dataListNew;
|
|
|
//创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
|
|
//创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
|
|
|
var includeFlag = false;
|
|
var includeFlag = false;
|
|
@@ -526,21 +526,23 @@ export default {
|
|
|
invoiceReimbursements = [];
|
|
invoiceReimbursements = [];
|
|
|
}
|
|
}
|
|
|
if (this.toCompany === data.BuyerInformationBuyerName) {
|
|
if (this.toCompany === data.BuyerInformationBuyerName) {
|
|
|
- invoiceReimbursements.forEach(item => {
|
|
|
|
|
- if (file.name === item.name) {
|
|
|
|
|
|
|
+ // 生成个随机数
|
|
|
|
|
|
|
|
- item.invoiceType = data.InherentLabelGeneralOrSpecialVATLabelCode;
|
|
|
|
|
- item.invoiceProjectName = data.IssuItemInformationItemName;
|
|
|
|
|
- item.number = data.InvoiceNumber;
|
|
|
|
|
- item.invoiceDate = this.formatDate(data.IssueTime);
|
|
|
|
|
- item.invoiceUnit = data.SellerInformationSellerName;
|
|
|
|
|
- item.amount = data.BasicInformationTotalAmWithoutTax;
|
|
|
|
|
- item.taxAmount = data.BasicInformationTotalTaxAm;
|
|
|
|
|
- item.count = data.BasicInformationTotalTaxincludedAmount;
|
|
|
|
|
- item.buyerName = data.BuyerInformationBuyerName;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const fileBody = new FormData();
|
|
|
|
|
+ fileBody.append('file', file.raw);
|
|
|
|
|
+ const fileData = await this.ossService.disposeXmlFile(fileBody);
|
|
|
|
|
+ if (data.InvoiceNumber === fileData.InvoiceNumber) {
|
|
|
|
|
+ file.invoiceType = fileData.InherentLabelGeneralOrSpecialVATLabelCode;
|
|
|
|
|
+ file.invoiceProjectName = fileData.IssuItemInformationItemName;
|
|
|
|
|
+ file.number = fileData.InvoiceNumber;
|
|
|
|
|
+ file.invoiceDate = this.formatDate(fileData.IssueTime);
|
|
|
|
|
+ file.invoiceUnit = fileData.SellerInformationSellerName;
|
|
|
|
|
+ file.amount = fileData.BasicInformationTotalAmWithoutTax;
|
|
|
|
|
+ file.taxAmount = fileData.BasicInformationTotalTaxAm;
|
|
|
|
|
+ file.count = fileData.BasicInformationTotalTaxincludedAmount;
|
|
|
|
|
+ file.buyerName = fileData.BuyerInformationBuyerName;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- })
|
|
|
|
|
|
|
|
|
|
this.$emit("handleCount", JSON.parse(JSON.stringify(this.dataListNew)), this.uniqueId)
|
|
this.$emit("handleCount", JSON.parse(JSON.stringify(this.dataListNew)), this.uniqueId)
|
|
|
this.$emit("handleUploadSuccess", JSON.parse(JSON.stringify(this.dataListNew)), this.uniqueId)
|
|
this.$emit("handleUploadSuccess", JSON.parse(JSON.stringify(this.dataListNew)), this.uniqueId)
|
|
@@ -607,9 +609,18 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const fileName = file.raw ? file.raw.name : file.name;
|
|
const fileName = file.raw ? file.raw.name : file.name;
|
|
|
|
|
+ const fileBody = new FormData();
|
|
|
|
|
+ fileBody.append('file', file.raw);
|
|
|
|
|
+ const fileData = await this.ossService.disposeXmlFile(fileBody);
|
|
|
//判断文件是否重复
|
|
//判断文件是否重复
|
|
|
let fileIndex = this.dataList.findIndex(fileItem => {
|
|
let fileIndex = this.dataList.findIndex(fileItem => {
|
|
|
- return fileItem.name == file.name
|
|
|
|
|
|
|
+ console.log(fileItem.number, fileData.InvoiceNumber);
|
|
|
|
|
+ console.log(fileItem.number, fileData.InvoiceNumber);
|
|
|
|
|
+ console.log(fileItem.number, fileData.InvoiceNumber);
|
|
|
|
|
+ console.log(fileItem.number, fileData.InvoiceNumber);
|
|
|
|
|
+ console.log(fileItem.number, fileData.InvoiceNumber);
|
|
|
|
|
+
|
|
|
|
|
+ return fileItem.number == fileData.InvoiceNumber
|
|
|
})
|
|
})
|
|
|
if (fileIndex != -1) {
|
|
if (fileIndex != -1) {
|
|
|
// 记录重复文件名
|
|
// 记录重复文件名
|
|
@@ -747,7 +758,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
// 在 changes 完成后,手动调用 handleUploadSuccess
|
|
// 在 changes 完成后,手动调用 handleUploadSuccess
|
|
|
- await this.handleUploadSuccess(null, null, this.fileList); // 传入空参数或实际参数
|
|
|
|
|
|
|
+ await this.handleUploadSuccess(null, file, this.fileList); // 传入空参数或实际参数
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.$message.error({
|
|
this.$message.error({
|
|
|
message: `上传出错,${error.message}`
|
|
message: `上传出错,${error.message}`
|