|
@@ -236,7 +236,7 @@
|
|
|
$("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
|
|
$("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
|
|
|
"<td class='hide'>" +
|
|
"<td class='hide'>" +
|
|
|
"<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
|
|
"<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
|
|
|
- "<input id='workAccountList" + index + "_file' type='file' multiple='multiple' style='display: none;' onChange='newInsertTitleInvoiceReimbursement(workAccountList" + index + "_id,workAccountList" + index + "_file);'/>" +
|
|
|
|
|
|
|
+ "<input id='workAccountList" + index + "_file' type='file' multiple='multiple' style='display: none;' onclick='this.value = null' onChange='newInsertTitleInvoiceReimbursement(workAccountList" + index + "_id,workAccountList" + index + "_file);'/>" +
|
|
|
"<input id='workAccountList" + index + "_projectRadio' name='workAccountList[" + index + "].projectRadio' type='hidden' value='" + (obj.projectRadio ?? "") + "'/>" +
|
|
"<input id='workAccountList" + index + "_projectRadio' name='workAccountList[" + index + "].projectRadio' type='hidden' value='" + (obj.projectRadio ?? "") + "'/>" +
|
|
|
"<input id='workAccountList" + index + "_delFlag' name='workAccountList[" + index + "].delFlag' type='hidden' value='0'/>" +
|
|
"<input id='workAccountList" + index + "_delFlag' name='workAccountList[" + index + "].delFlag' type='hidden' value='0'/>" +
|
|
|
"</td>" +
|
|
"</td>" +
|
|
@@ -1209,6 +1209,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
async function newInsertTitleInvoiceReimbursement(idValue,fileValue) {
|
|
async function newInsertTitleInvoiceReimbursement(idValue,fileValue) {
|
|
|
|
|
+ console.log(8888888888)
|
|
|
// 将原生DOM元素转换为jQuery对象(关键修复)
|
|
// 将原生DOM元素转换为jQuery对象(关键修复)
|
|
|
var $idElement = $(idValue);
|
|
var $idElement = $(idValue);
|
|
|
// 再调用attr()方法获取name属性
|
|
// 再调用attr()方法获取name属性
|
|
@@ -1283,7 +1284,6 @@
|
|
|
}
|
|
}
|
|
|
//reimbursementElectronicInvoiceVATTaxesRowIdx++;
|
|
//reimbursementElectronicInvoiceVATTaxesRowIdx++;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('文件上传失败', error);
|
|
console.error('文件上传失败', error);
|
|
@@ -1295,6 +1295,7 @@
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ files.value=""
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 处理文件上传
|
|
// 处理文件上传
|
|
@@ -1309,23 +1310,33 @@
|
|
|
for (var i = 0; i < attachmentFileLength; i++) {
|
|
for (var i = 0; i < attachmentFileLength; i++) {
|
|
|
var fileName = ""; // 每次循环初始化,避免残留上一次的值
|
|
var fileName = ""; // 每次循环初始化,避免残留上一次的值
|
|
|
var previewA = null;
|
|
var previewA = null;
|
|
|
|
|
+ var invoiceNumber = null;
|
|
|
|
|
|
|
|
// 安全获取a标签:先判断attachmentFile[i]是否存在,再查找a标签
|
|
// 安全获取a标签:先判断attachmentFile[i]是否存在,再查找a标签
|
|
|
if (attachmentFile && attachmentFile[i]) {
|
|
if (attachmentFile && attachmentFile[i]) {
|
|
|
previewA = attachmentFile[i].querySelector("a.attention-info");
|
|
previewA = attachmentFile[i].querySelector("a.attention-info");
|
|
|
|
|
+ invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes"+i+"_invoiceNumber").val();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 只有在找到a标签时才获取文件名
|
|
// 只有在找到a标签时才获取文件名
|
|
|
if (previewA) {
|
|
if (previewA) {
|
|
|
fileName = (previewA.textContent || "").trim() || (previewA.innerText || "").trim();
|
|
fileName = (previewA.textContent || "").trim() || (previewA.innerText || "").trim();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 对比文件名(同时确保file和file.name存在)
|
|
// 对比文件名(同时确保file和file.name存在)
|
|
|
if (file && file.name ) {
|
|
if (file && file.name ) {
|
|
|
var disposeFileName = await fileNameDispose(file);
|
|
var disposeFileName = await fileNameDispose(file);
|
|
|
if(fileName === disposeFileName.trim()){
|
|
if(fileName === disposeFileName.trim()){
|
|
|
fileNameFlag = false; // 存在重复文件
|
|
fileNameFlag = false; // 存在重复文件
|
|
|
|
|
+ }
|
|
|
|
|
+ var formdata = new FormData();
|
|
|
|
|
+ formdata.append("multipartFile", file);
|
|
|
|
|
+ formdata.append("id", id);
|
|
|
|
|
+ const fileData = await uploadXmlFile(formdata);
|
|
|
|
|
+ if(invoiceNumber == fileData.InvoiceNumber){
|
|
|
|
|
+ fileNameFlag = false; // 存在重复文件
|
|
|
break; // 跳出循环,无需继续检查
|
|
break; // 跳出循环,无需继续检查
|
|
|
|
|
+ }else{
|
|
|
|
|
+ fileNameFlag = true; // 无重复文件
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2541,7 +2552,7 @@
|
|
|
<tr id="workAccountList{{idx}}">
|
|
<tr id="workAccountList{{idx}}">
|
|
|
<td class="hide">
|
|
<td class="hide">
|
|
|
<input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}" />
|
|
<input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}" />
|
|
|
- <input id="workAccountList{{idx}}_file" type="file" multiple="multiple" style="display: none;" onChange="newInsertTitleInvoiceReimbursement(workAccountList{{idx}}_id,workAccountList{{idx}}_file);"/>
|
|
|
|
|
|
|
+ <input id="workAccountList{{idx}}_file" type="file" multiple="multiple" style="display: none;" onclick='this.value = null' onChange="newInsertTitleInvoiceReimbursement(workAccountList{{idx}}_id,workAccountList{{idx}}_file);"/>
|
|
|
|
|
|
|
|
<input id="workAccountList{{idx}}_projectRadio" name="workAccountList[{{idx}}].projectRadio" type="hidden" value="{{row.projectRadio}}"/>
|
|
<input id="workAccountList{{idx}}_projectRadio" name="workAccountList[{{idx}}].projectRadio" type="hidden" value="{{row.projectRadio}}"/>
|
|
|
<input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
|
|
<input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
|