|
@@ -496,18 +496,7 @@
|
|
|
function insertTitle(tValue){
|
|
|
var list = "${workReimbursement.workAttachments}";
|
|
|
var size = (list.split('url')).length-1;
|
|
|
- var files = $("#attachment_file")[0].files; for(var i = 0;i<files.length;i++) { var file = files[i];
|
|
|
- var attachmentId = "";
|
|
|
- var attachmentFlag = "6";
|
|
|
- console.log(file);
|
|
|
- var timestamp=new Date().getTime();
|
|
|
-
|
|
|
- var storeAs = "wrkReimbursement";
|
|
|
- var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
|
|
|
- var divId = "_attachment";
|
|
|
- $("#addFile"+divId).show();
|
|
|
- multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
|
|
|
-
|
|
|
+ var files = $("#attachment_file")[0].files;
|
|
|
|
|
|
//判断报销类型是否为电子报销
|
|
|
var reimbursementType=$('input:radio[name="reimbursementType"]:checked').val();
|
|
@@ -527,61 +516,87 @@
|
|
|
contentType: false,
|
|
|
processData: false,
|
|
|
success:function (data) {
|
|
|
- console.log(data)
|
|
|
- //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
|
|
|
- var includeFlag = false;
|
|
|
- //xml文件处理
|
|
|
- //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
|
|
|
- //获取专用发票信息 行数
|
|
|
- var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
|
|
|
- for(var i = 0;i < trlen;i++){
|
|
|
- var id = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(0).val();
|
|
|
- var delFlag = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
|
|
|
- var invoiceType = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val();
|
|
|
- var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val();
|
|
|
- var invoiceDate = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
|
|
|
- var invoiceUnit = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val();
|
|
|
- var money = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val();
|
|
|
- var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
|
|
|
- var sumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
|
|
|
- var remarks = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
|
|
|
+ if(data.flag){
|
|
|
+ top.layer.msg(data.message,{icon:2});
|
|
|
+ }else{
|
|
|
+ //创建判断值,若行信息存在相同的发票号,则进行数据检查调整,若不存在发票号,则新增行,并将信息写入
|
|
|
+ var includeFlag = false;
|
|
|
+ //xml文件处理
|
|
|
+ //首先查询专用发票信息中对应发票号是否存在,并对应其数据是否正确
|
|
|
+ //获取专用发票信息 行数
|
|
|
+ var trlen = $("#reimbursementElectronicInvoiceVATTaxes tr").length;
|
|
|
+ for(var i = 0;i < trlen;i++){
|
|
|
+ var id = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(0).val();
|
|
|
+ var delFlag = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(0).find("input").eq(1).val();
|
|
|
+ var invoiceType = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val();
|
|
|
+ var invoiceNumber = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val();
|
|
|
+ var invoiceDate = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val();
|
|
|
+ var invoiceUnit = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val();
|
|
|
+ var money = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val();
|
|
|
+ var taxAmount = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val();
|
|
|
+ var sumMoney = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val();
|
|
|
+ var remarks = $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val();
|
|
|
|
|
|
- if(invoiceNumber === data.InvoiceNumber){
|
|
|
- includeFlag = true
|
|
|
- //数据处理
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val("");
|
|
|
+ if(invoiceNumber === data.InvoiceNumber){
|
|
|
+ includeFlag = true
|
|
|
+ //数据处理
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(4).find("input").eq(0).val(data.BasicInformationRequestTime);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(5).find("input").eq(0).val(data.BuyerInformationBuyerName);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationAmount);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(8).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(i).find("td").eq(9).find("input").eq(0).val("");
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- //若发票号不存在。则新增行将对应信息添加进去
|
|
|
- if(!includeFlag){
|
|
|
- addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
|
|
|
+ //若发票号不存在。则新增行将对应信息添加进去
|
|
|
+ if(!includeFlag){
|
|
|
+ addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);
|
|
|
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(0).val("");
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(1).val(0);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(2).find("input").eq(0).val(data.InvoiceNumber);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(3).find("input").eq(0).val(data.BasicInformationRequestTime);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(4).find("input").eq(0).val(data.BuyerInformationBuyerName);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(5).find("input").eq(0).val(data.IssuItemInformationAmount);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
|
|
|
- $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(8).find("input").eq(0).val("");
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(0).val("");
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(0).find("input").eq(1).val(0);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(1).find("select").eq(0).val(data.InherentLabelGeneralOrSpecialVATLabelCode);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(2).find("input").eq(0).val(data.IssuItemInformationItemName);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(3).find("input").eq(0).val(data.InvoiceNumber);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(4).find("input").eq(0).val(data.BasicInformationRequestTime);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(5).find("input").eq(0).val(data.BuyerInformationBuyerName);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(6).find("input").eq(0).val(data.IssuItemInformationAmount);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(7).find("input").eq(0).val(data.IssuItemInformationComTaxAm);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(8).find("input").eq(0).val(data.IssuItemInformationTotaltaxIncludedAmount);
|
|
|
+ $("#reimbursementElectronicInvoiceVATTaxes tr").eq(reimbursementElectronicInvoiceVATTaxesRowIdx).find("td").eq(9).find("input").eq(0).val("");
|
|
|
|
|
|
- reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
|
|
|
+ reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;
|
|
|
+ }
|
|
|
+ var attachmentId = "";
|
|
|
+ var attachmentFlag = "6";
|
|
|
+ var timestamp=new Date().getTime();
|
|
|
+
|
|
|
+ var storeAs = "wrkReimbursement";
|
|
|
+ var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
|
|
|
+ var divId = "_attachment";
|
|
|
+ $("#addFile"+divId).show();
|
|
|
+ multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
+ }else{
|
|
|
+ for(var i = 0;i<files.length;i++) { var file = files[i];
|
|
|
+ var attachmentId = "";
|
|
|
+ var attachmentFlag = "6";
|
|
|
+ console.log(file);
|
|
|
+ var timestamp=new Date().getTime();
|
|
|
|
|
|
+ var storeAs = "wrkReimbursement";
|
|
|
+ var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
|
|
|
+ var divId = "_attachment";
|
|
|
+ $("#addFile"+divId).show();
|
|
|
+ multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,size);}
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
function insertTitleCollection(tValue){
|
|
@@ -1073,7 +1088,7 @@
|
|
|
|
|
|
|
|
|
<div class="form-group layui-row count2">
|
|
|
- <div class="form-group-label"><h2>电子发票信息</h2></div>
|
|
|
+ <div class="form-group-label"><h2>电子发票信息<span style="color: red;font-size: 14px"> (可通过上传电子发票xml文件自动填写电子发票信息)</span></h2></div>
|
|
|
<div class="layui-item nav-btns">
|
|
|
<a class="nav-btn nav-btn-add" onclick="addRow('#reimbursementElectronicInvoiceVATTaxes', reimbursementElectronicInvoiceVATTaxesRowIdx, reimbursementElectronicInvoiceVATTaxesTpl);reimbursementElectronicInvoiceVATTaxesRowIdx = reimbursementElectronicInvoiceVATTaxesRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
|
|
|
</div>
|
|
@@ -1081,13 +1096,14 @@
|
|
|
<table id="contentTable3" class="table table-bordered table-condensed can-edit">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th width="200px"><font color="red">*</font>发票类型</th>
|
|
|
+ <th width="150px"><font color="red">*</font>发票类型</th>
|
|
|
+ <th width="200px"><font color="red">*</font>发票项目名</th>
|
|
|
<th width="200px"><font color="red">*</font>发票号</th>
|
|
|
<th width="200px"><font color="red">*</font>开票日期</th>
|
|
|
<th width="200px"><font color="red">*</font>开票单位</th>
|
|
|
- <th width="200px"><font color="red">*</font>金额</th>
|
|
|
- <th width="200px"><font color="red">*</font>税额</th>
|
|
|
- <th width="200px"><font color="red">*</font>价税合计</th>
|
|
|
+ <th width="150px"><font color="red">*</font>金额</th>
|
|
|
+ <th width="150px"><font color="red">*</font>税额</th>
|
|
|
+ <th width="150px"><font color="red">*</font>价税合计</th>
|
|
|
<th width="200px">备注</th>
|
|
|
<th width="150px">操作</th>
|
|
|
</tr>
|
|
@@ -1109,6 +1125,10 @@
|
|
|
</c:forEach>
|
|
|
</select>
|
|
|
</td>
|
|
|
+ <%--发票项目名--%>
|
|
|
+ <td>
|
|
|
+ <input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceProjectName" onmouseover="this.title=this.value" maxlength="50" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceProjectName" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceProjectName}" onmouseover="this.title=this.value" placeholder="请输入发票项目名" class="form-control judgment "/>
|
|
|
+ </td>
|
|
|
<%--发票号--%>
|
|
|
<td>
|
|
|
<input id="reimbursementElectronicInvoiceVATTaxes${index.index}_invoiceNumber" onmouseover="this.title=this.value" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[${index.index}].invoiceNumber" type="text" value="${reimbursementElectronicInvoiceVATTaxes.invoiceNumber}" onmouseover="this.title=this.value" placeholder="请输入发票号" class="form-control judgment number "/>
|
|
@@ -1160,6 +1180,10 @@
|
|
|
</c:forEach>
|
|
|
</select>
|
|
|
</td>
|
|
|
+ <%--发票项目名--%>
|
|
|
+ <td>
|
|
|
+ <input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceProjectName" onmouseover="this.title=this.value" maxlength="50" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceProjectName" type="text" value="{{row.invoiceNumber}}" onmouseover="this.title=this.value" placeholder="请输入发票项目名" class="form-control judgment "/>
|
|
|
+ </td>
|
|
|
<%--发票号--%>
|
|
|
<td>
|
|
|
<input id="reimbursementElectronicInvoiceVATTaxes{{idx}}_invoiceNumber" maxlength="30" name="reimbursementElectronicInvoiceVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" onmouseover="this.title=this.value" maxlength="32" placeholder="请输入发票号" class="form-control judgment number "/>
|