|
@@ -194,6 +194,7 @@ export default {
|
|
|
uploadDelFlag: false,
|
|
uploadDelFlag: false,
|
|
|
// reNumFiles: [], // 存储重复发票号
|
|
// reNumFiles: [], // 存储重复发票号
|
|
|
toCompany: '', //用于区分属于哪个公司的数电发票,
|
|
toCompany: '', //用于区分属于哪个公司的数电发票,
|
|
|
|
|
+ socialCreditCode: "", // 统一社会信用代码
|
|
|
motorFileLabel: [
|
|
motorFileLabel: [
|
|
|
"BasicInformationTotalTaxincludedAmount",
|
|
"BasicInformationTotalTaxincludedAmount",
|
|
|
"BasicInformationTotalTaxAm",
|
|
"BasicInformationTotalTaxAm",
|
|
@@ -210,7 +211,7 @@ export default {
|
|
|
"SellerInformationSellerName",//开票单位
|
|
"SellerInformationSellerName",//开票单位
|
|
|
// "IssuItemInformationAmount",
|
|
// "IssuItemInformationAmount",
|
|
|
// "InherentLabelTaxpayerTypeLabelCode",
|
|
// "InherentLabelTaxpayerTypeLabelCode",
|
|
|
- "BuyerInformationBuyerIdNum",//
|
|
|
|
|
|
|
+ "BuyerInformationBuyerIdNum",//统一社会信用代码
|
|
|
"BasicInformationTotalTaxincludedAmount",//合计
|
|
"BasicInformationTotalTaxincludedAmount",//合计
|
|
|
// "Version",
|
|
// "Version",
|
|
|
"InherentLabelGeneralOrSpecialVATLabelName",//发票类型
|
|
"InherentLabelGeneralOrSpecialVATLabelName",//发票类型
|
|
@@ -325,7 +326,7 @@ export default {
|
|
|
*
|
|
*
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
- async newUpload(auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, toCompany, uniqueId) {
|
|
|
|
|
|
|
+ async newUpload(auth, fileList, directory, maxValue, dividerName, uploadFlag, delFlag, showDivider, toCompany, socialCreditCode, uniqueId) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
this.$emit('changeLoading', true)
|
|
this.$emit('changeLoading', true)
|
|
|
this.uploadKey = Math.random()
|
|
this.uploadKey = Math.random()
|
|
@@ -336,7 +337,6 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
const tempFiles = fileList.filter(item => item.remarks == uniqueId);
|
|
const tempFiles = fileList.filter(item => item.remarks == uniqueId);
|
|
|
this.dataListLength = tempFiles.length
|
|
this.dataListLength = tempFiles.length
|
|
|
- // this.allFiles = fileList
|
|
|
|
|
}
|
|
}
|
|
|
if (this.commonJS.isEmpty(dividerName)) {
|
|
if (this.commonJS.isEmpty(dividerName)) {
|
|
|
this.dividerName = '数电发票信息'
|
|
this.dividerName = '数电发票信息'
|
|
@@ -353,6 +353,14 @@ export default {
|
|
|
.replace(/)/g, ')');
|
|
.replace(/)/g, ')');
|
|
|
this.toCompany = toCompany
|
|
this.toCompany = toCompany
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // 添加统一社会信用码校验
|
|
|
|
|
+ if (this.commonJS.isEmpty(socialCreditCode)) {
|
|
|
|
|
+ this.socialCreditCode = '91320000134781877U'
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.socialCreditCode = socialCreditCode
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (directory !== undefined && directory !== null && directory !== '' && directory !== {}) {
|
|
if (directory !== undefined && directory !== null && directory !== '' && directory !== {}) {
|
|
|
this.directory = directory
|
|
this.directory = directory
|
|
|
} else {
|
|
} else {
|
|
@@ -389,6 +397,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.oldDataList = []
|
|
this.oldDataList = []
|
|
|
|
|
|
|
|
|
|
+ this.allFiles = fileList
|
|
|
const filtered = fileList.filter(item => item.remarks === uniqueId)
|
|
const filtered = fileList.filter(item => item.remarks === uniqueId)
|
|
|
|
|
|
|
|
filtered.forEach(item => {
|
|
filtered.forEach(item => {
|
|
@@ -489,6 +498,8 @@ export default {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const formBody = new FormData()
|
|
const formBody = new FormData()
|
|
|
formBody.append('file', file)
|
|
formBody.append('file', file)
|
|
|
let res
|
|
let res
|
|
@@ -544,7 +555,7 @@ export default {
|
|
|
if (!invoiceReimbursements) {
|
|
if (!invoiceReimbursements) {
|
|
|
invoiceReimbursements = [];
|
|
invoiceReimbursements = [];
|
|
|
}
|
|
}
|
|
|
- if (this.toCompany === fileData.BuyerInformationBuyerName) {
|
|
|
|
|
|
|
+ if (this.toCompany === fileData.BuyerInformationBuyerName && this.socialCreditCode === fileData.BuyerInformationBuyerIdNum) {
|
|
|
// 生成个随机数
|
|
// 生成个随机数
|
|
|
|
|
|
|
|
// const fileBody = new FormData();
|
|
// const fileBody = new FormData();
|
|
@@ -645,10 +656,6 @@ export default {
|
|
|
})
|
|
})
|
|
|
if (fileIndex != -1) {
|
|
if (fileIndex != -1) {
|
|
|
// // 记录重复文件名
|
|
// // 记录重复文件名
|
|
|
- // const formBody = new FormData();
|
|
|
|
|
- // formBody.append('file', file.raw);
|
|
|
|
|
- // const data1 = await this.ossService.disposeXmlFile(formBody);
|
|
|
|
|
-
|
|
|
|
|
if (JSON.stringify(fileData) === "{}") {
|
|
if (JSON.stringify(fileData) === "{}") {
|
|
|
// this.$message.warning({ message: `数电发票:${file.raw.name}格式错误` });
|
|
// this.$message.warning({ message: `数电发票:${file.raw.name}格式错误` });
|
|
|
this.messageList.push(`数电发票:${file.raw.name}格式错误`);
|
|
this.messageList.push(`数电发票:${file.raw.name}格式错误`);
|
|
@@ -667,6 +674,19 @@ export default {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ //判断文件在其他报销单是否重复
|
|
|
|
|
+ let allFileIndex = this.allFiles.findIndex(fileItem => {
|
|
|
|
|
+ return fileItem.number == fileData.InvoiceNumber
|
|
|
|
|
+ })
|
|
|
|
|
+ if (allFileIndex != -1) {
|
|
|
|
|
+ if (this.commonJS.isNotEmpty(fileData.InvoiceNumber)) {
|
|
|
|
|
+ this.messageList.push(`数电发票:${fileName + "<br/>发票号:" + fileData.InvoiceNumber}<br/>已经上传,请勿重复上传`);
|
|
|
|
|
+ this.pendingFiles.delete(fileId)
|
|
|
|
|
+ this.processedFiles++
|
|
|
|
|
+ this.checkAndShowMessages()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const fileUrl = file.raw ? file.raw.url : file.url;
|
|
const fileUrl = file.raw ? file.raw.url : file.url;
|
|
|
// 检查临时 URL 是否有效
|
|
// 检查临时 URL 是否有效
|
|
@@ -742,6 +762,15 @@ export default {
|
|
|
this.checkAndShowMessages()
|
|
this.checkAndShowMessages()
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ if (this.socialCreditCode !== fileData.BuyerInformationBuyerIdNum) {
|
|
|
|
|
+ // 统一社会信用代码不正确
|
|
|
|
|
+ this.messageList.push(`统一社会信用代码不正确:<br/>${"文件名: " + file.raw.name + "—— 发票号:" + fileData.InvoiceNumber}<br>上传失败`);
|
|
|
|
|
+ this.pendingFiles.delete(fileId)
|
|
|
|
|
+ this.processedFiles++
|
|
|
|
|
+ this.checkAndShowMessages()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (this.commonJS.isNotEmpty(fileData.InvoiceNumber)) {
|
|
if (this.commonJS.isNotEmpty(fileData.InvoiceNumber)) {
|
|
|
var flag = this.invoiceReimbursementDispose(fileData)
|
|
var flag = this.invoiceReimbursementDispose(fileData)
|
|
|
if (flag) {
|
|
if (flag) {
|