|
|
@@ -196,7 +196,7 @@
|
|
|
|
|
|
// 3. 替换模板中的所有占位符
|
|
|
var accessoryNoParentParsedTagHtml = accessoryNoParentTemplateHtml
|
|
|
- .replace(/__INDEX__/g, index) // 替换索引
|
|
|
+ .replace(/__INDEX__/g, index+1) // 替换索引
|
|
|
.replace(/__TYPE__/g, typeValue) // 替换type值(处理空值后)
|
|
|
.replace(/__TYPE_NAME__/g, typeNameValue); // 替换typeName值(处理空值后)
|
|
|
|
|
|
@@ -211,7 +211,7 @@
|
|
|
|
|
|
// 3. 替换模板中的所有占位符
|
|
|
var reprojectParsedTagHtml = reprojectTemplateHtml
|
|
|
- .replace(/__INDEX__/g, index) // 替换行索引
|
|
|
+ .replace(/__INDEX__/g, index+1) // 替换行索引
|
|
|
.replace(/__PROJECT_ID__/g, projectId) // 替换项目ID(处理空值后)
|
|
|
.replace(/__PROJECT_NAME__/g, projectName) // 替换项目名称(处理空值后)
|
|
|
.replace(/__PROJECT_RADIO__/g, projectRadio); // 替换projectRadio(处理空值后)
|
|
|
@@ -233,7 +233,7 @@
|
|
|
|
|
|
if(flag) {
|
|
|
const trId = 'workAccountList' + index;
|
|
|
-
|
|
|
+ index = index+1
|
|
|
$("#workAccountList").append("<tr id='workAccountList" + index + "' class='rowSize'>" +
|
|
|
"<td class='hide'>" +
|
|
|
"<input id='workAccountList" + index + "_id' name='workAccountList[" + index + "].id' type='hidden' value='" + obj.id + "'/>" +
|
|
|
@@ -365,9 +365,9 @@
|
|
|
|
|
|
// 1. 获取后端渲染的列表字符串(注意:不要加单引号,直接获取模板渲染结果)
|
|
|
var listStr = '${workReimbursement.workAccountListCount}';
|
|
|
- console.log(listStr)
|
|
|
if(listStr<1){
|
|
|
addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true)
|
|
|
+ workAccountListRowIdx = workAccountListRowIdx+1
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -909,6 +909,7 @@
|
|
|
tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
|
|
|
tpl = tpl.replace("not_project_reimbursement_div","not_project_reimbursement_div\" style=\"display:none;\"");
|
|
|
tpl = tpl.replace("project_reimbursement_div\" style=\"display:none;\"","project_reimbursement_div");
|
|
|
+
|
|
|
bornTemplete(list, idx, tpl, row, idx1,number);
|
|
|
//将报销人和部门自动赋值
|
|
|
// if (idx==0 && flag){
|
|
|
@@ -1520,11 +1521,9 @@
|
|
|
top.layer.close(tempIndex);
|
|
|
// 获取所有 td
|
|
|
var tds = $('#workAccountList .op-td');
|
|
|
- for (var i = tds.length - 1; i >= 0; i--) { // 注意 i > 0,从倒数第二个开始
|
|
|
+ for (var i = tds.length - 1; i >= 0; i--) {
|
|
|
var td = tds.eq(i); // 当前 td
|
|
|
- // 找到 td 内 class="op-btn-delete" 的元素
|
|
|
var deleteBtn = td.find('.op-btn-delete');
|
|
|
- // 触发 onclick
|
|
|
deleteBtn.each(function(eleIndex,ele) {
|
|
|
if (i == 0){
|
|
|
delRowParentNew(ele,"#workAccountList1",true)
|
|
|
@@ -2442,9 +2441,9 @@
|
|
|
</div>
|
|
|
<div class="form-group layui-row">
|
|
|
<div class="form-group-label"><h2>报销详情<span style="color: red;font-size: 14px"> (可在报销单后新增数电发票xml格式的附件获取发票信息)</span></h2></div>
|
|
|
- <%--<div class="layui-item nav-btns">
|
|
|
+ <div class="layui-item nav-btns">
|
|
|
<a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增报销单</a>
|
|
|
- </div>--%>
|
|
|
+ </div>
|
|
|
<div class="layui-table-body layui-item layui-col-xs12 form-table-container" style="padding:0px">
|
|
|
<table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin details tree_table">
|
|
|
<thead>
|
|
|
@@ -2646,7 +2645,7 @@
|
|
|
</td>
|
|
|
<td style="vertical-align: middle; text-align:center;" class="op-td" >
|
|
|
<span class="op-btn op-btn-add" onclick="addRowInfoForm(this, '#workAccountList{{idx}}')" title="添加"><i class="fa fa-plus"></i> 新增</span>
|
|
|
- <%--{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}--%>
|
|
|
+ {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowParentNew(this, '#workAccountList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
|
|
|
</td>
|
|
|
</tr>//-->
|
|
|
</script>
|
|
|
@@ -2736,15 +2735,16 @@
|
|
|
reimbursementVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementVATTaxes)};
|
|
|
}
|
|
|
$(document).ready(function() {
|
|
|
- var data = ${fns:toJson(workReimbursement.createBy)};
|
|
|
- addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );
|
|
|
- workAccountListRowIdx = workAccountListRowIdx + 1;
|
|
|
- document.querySelector('.nav-btn-add').style.display = 'none';
|
|
|
- <%-- var data = ${fns:toJson(workReimbursement.reimbursementVATTaxes)};--%>
|
|
|
- <%--for (var i=0; i<data.length; i++){--%>
|
|
|
- <%-- addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl, data[i]);--%>
|
|
|
- <%-- reimbursementVATTaxesRowIdx = reimbursementVATTaxesRowIdx + 1;--%>
|
|
|
- <%--}--%>
|
|
|
+ <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
|
|
|
+ <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
|
|
|
+ <%--workAccountListRowIdx = workAccountListRowIdx + 1;--%>
|
|
|
+ var tempData = ${fns:toJson(workReimbursement.workAccountList)};
|
|
|
+ if(tempData.length > 0 &&tempData[0].typeName == '业务差旅费' ){
|
|
|
+ document.querySelector('.nav-btn-add').style.display = 'block';
|
|
|
+ }else{
|
|
|
+ document.querySelector('.nav-btn-add').style.display = 'none';
|
|
|
+ }
|
|
|
+
|
|
|
});
|
|
|
</script>
|
|
|
</div>
|