Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

user5 4 rokov pred
rodič
commit
2e0e190122

+ 2 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -1071,6 +1071,8 @@ public class WorkProjectNotifyController extends BaseController {
 						}
 						return "modules/workreimbursement/workReimbursementAudit";
 					} else if (workProjectNotify.getRemarks().contains("重新申请") && !"1".equals(workProjectNotify.getStatus())) {
+						User user=UserUtils.getUser();
+						model.addAttribute("user", user);
 						return "modules/workreimbursement/workReimbursementModifyApply";
 					} else {
 						return "modules/workreimbursement/workReimbursementFormDetail";

+ 13 - 2
src/main/webapp/webpage/modules/workreimbursement/workReimbursementAllFormAdd.jsp

@@ -265,7 +265,11 @@
             }
         }
 
-        function addRow(list, idx, tpl, row){
+        function addRow(list, idx, tpl, row,flag){
+            var data;
+            if (flag){
+                data = ${fns:toJson(workReimbursement.createBy)};
+            }
             var idx1 = $("#workAccountList tr").length;
             if(list == '#workAccountList'){
                 tpl = tpl.replace("workAccountList[0].financialSubjects","workAccountList["+idx1+"].financialSubjects");
@@ -281,6 +285,13 @@
                 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);
+                //将报销人和部门自动赋值
+                var id="#workAccountList"+idx1+"_reimbursementNameId";
+                var idName="#workAccountList"+idx1+"_reimbursementNameName";
+                var idOffice="#workAccountList"+idx1+"_reimbursementNameofficeId";
+                $(id).val(data.id);
+                $(idName).val(data.name);
+                $(idOffice).val(data.office.name);
             }
             var idx2 = $("#reimbursementVATTaxes tr").length;
             if(list == '#reimbursementVATTaxes'){
@@ -650,7 +661,7 @@
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销详情</h2></div>
             <div class="layui-item nav-btns">
-                <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
             </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">

+ 33 - 17
src/main/webapp/webpage/modules/workreimbursement/workReimbursementFormAdd.jsp

@@ -291,9 +291,14 @@
             }
         }
 
-        function addRow(list, idx, tpl, row){
+        function addRow(list, idx, tpl, row,flag){
+            var data;
+            if (flag){
+                data = ${fns:toJson(workReimbursement.createBy)};
+            }
             var idx1 = $("#workAccountList tr").length;
             if(list == '#workAccountList'){
+
                 tpl = tpl.replace("workAccountList[0].financialSubjects","workAccountList["+idx1+"].financialSubjects");
                 tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
                 /*var ext = $("input[name='ext']:checked").val();
@@ -307,6 +312,15 @@
                 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);
+                //将报销人和部门自动赋值
+                // if (idx==0 && flag){
+                    var id="#workAccountList"+idx1+"_reimbursementNameId";
+                    var idName="#workAccountList"+idx1+"_reimbursementNameName";
+                    var idOffice="#workAccountList"+idx1+"_reimbursementNameofficeId";
+                    $(id).val(data.id);
+                    $(idName).val(data.name);
+                    $(idOffice).val(data.office.name);
+                // }
             }
             var idx2 = $("#reimbursementVATTaxes tr").length;
             if(list == '#reimbursementVATTaxes'){
@@ -678,7 +692,7 @@
         <div class="form-group layui-row">
             <div class="form-group-label"><h2>报销详情</h2></div>
             <div class="layui-item nav-btns">
-                <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+                <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
             </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">
@@ -846,11 +860,11 @@
                 <table id="contentTable2" class="table table-bordered table-condensed can-edit">
                     <thead>
                     <tr>
-                        <th width="300px"><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="300px">发票代码</th>
+                        <th width="200px">发票号</th>
+                        <th width="200px">金额</th>
+                        <th width="200px">税额</th>
+                        <th width="200px">价税合计</th>
                         <th width="150px">操作</th>
                     </tr>
                     </thead>
@@ -863,20 +877,20 @@
                                     <input id="reimbursementVATTaxes${index.index}_delFlag" name="reimbursementVATTaxes[${index.index}].delFlag" type="hidden" value="0"/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="10" minlength="10" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control judgment number"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceCode" maxlength="10" minlength="10" name="reimbursementVATTaxes[${index.index}].invoiceCode" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceCode}"  placeholder="请输入发票代码"  class="form-control  number"/>
                                 </td>
 
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control number judgment"/>
+                                    <input id="reimbursementVATTaxes${index.index}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[${index.index}].invoiceNumber" type="text" maxlength="32" value="${reimbursementVATTaxes.invoiceNumber}"  placeholder="请输入发票号"  class="form-control number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control number judgment"/>
+                                    <input id="reimbursementVATTaxes${index.index}_money" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].money" type="text" maxlength="32" value="${reimbursementVATTaxes.money}"  placeholder="请输入金额"  class="form-control number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control number judgment"/>
+                                    <input id="reimbursementVATTaxes${index.index}_taxAmount" onchange="getMoneyVATT(${index.index})" name="reimbursementVATTaxes[${index.index}].taxAmount" type="text" maxlength="32" value="${reimbursementVATTaxes.taxAmount}"  placeholder="请输入税额"  class="form-control number "/>
                                 </td>
                                 <td>
-                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number judgment sumMoney"/>
+                                    <input id="reimbursementVATTaxes${index.index}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[${index.index}].sumMoney" type="text" maxlength="32" value="${reimbursementVATTaxes.sumMoney}"    class="form-control number  sumMoney"/>
                                 </td>
                                 <td class="text-center op-td">
                                     <span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>
@@ -893,20 +907,20 @@
                                             <input id="reimbursementVATTaxes{{idx}}_delFlag" name="reimbursementVATTaxes[{{idx}}].delFlag" type="hidden" value="0"/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="10" minlength="10" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control number judgment"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceCode"  maxlength="10" minlength="10" name="reimbursementVATTaxes[{{idx}}].invoiceCode" type="text" value="{{row.invoiceCode}}" maxlength="32" placeholder="请输入发票代码"  class="form-control number "/>
                                         </td>
 
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control number judgment"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_invoiceNumber" maxlength="8" minlength="8" name="reimbursementVATTaxes[{{idx}}].invoiceNumber" type="text" value="{{row.invoiceNumber}}" maxlength="32" placeholder="请输入发票号"  class="form-control number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number judgment"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_money" onchange="getMoneyVATT({{idx}})" name="reimbursementVATTaxes[{{idx}}].money" type="text" value="{{row.money}}" maxlength="32" placeholder="请输入金额"  class="form-control number "/>
                                         </td>
                                         <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number judgment"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_taxAmount"  onchange="getMoneyVATT({{idx}})"name="reimbursementVATTaxes[{{idx}}].taxAmount" type="text" value="{{row.taxAmount}}" maxlength="32" placeholder="请输入税额"  class="form-control number "/>
                                         </td>
                                          <td>
-                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number judgment sumMoney"/>
+                                            <input id="reimbursementVATTaxes{{idx}}_sumMoney" readOnly="true"  name="reimbursementVATTaxes[{{idx}}].sumMoney" type="text" value="{{row.sumMoney}}" maxlength="32"  class="form-control number  sumMoney"/>
                                         </td>
                                         <td class="text-center op-td">
                                             {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRowA(this, '#reimbursementVATTaxes{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i>&nbsp;删除</span>{{/delBtn}}
@@ -921,6 +935,8 @@
                         reimbursementVATTaxesRowIdx = ${fn:length(workReimbursement.reimbursementVATTaxes)};
                     }
                     $(document).ready(function() {
+                        <%--var data = ${fns:toJson(workReimbursement.createBy)};--%>
+                        <%--addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,data,true );--%>
                         /*var data = ${fns:toJson(workReimbursement.reimbursementVATTaxes)};
                     for (var i=0; i<data.length; i++){
                         addRow('#reimbursementVATTaxes', reimbursementVATTaxesRowIdx, reimbursementVATTaxesTpl, data[i]);

+ 25 - 11
src/main/webapp/webpage/modules/workreimbursement/workReimbursementModifyApply.jsp

@@ -274,20 +274,34 @@
             }
         }
 
-        function addRow(list, idx, tpl, row){
+        function addRow(list, idx, tpl, row,flag){
+
             var idx1 = $("#workAccountList tr").length;
             if(list == '#workAccountList'){
                 tpl = tpl.replace("workAccountList[0].financialSubjects","workAccountList["+idx1+"].financialSubjects");
                 tpl = tpl.replace("workAccountList[0].financialSubjectss","workAccountList["+idx1+"].financialSubjectss");
-                var ext = $("input[name='ext']:checked").val();
+                /*var ext = $("input[name='ext']:checked").val();
                 if(ext == 0){
                     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");
                 }else {
                     tpl = tpl.replace("project_reimbursement_div","project_reimbursement_div\" style=\"display:none;\"");
                     tpl = tpl.replace("not_project_reimbursement_div\" style=\"display:none;\"","not_project_reimbursement_div\"");
-                }
+                }*/
+                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);
+                //将报销人和部门自动赋值
+                var data;
+                if (flag){
+                    data = ${fns:toJson(user)};
+                }
+                var id="#workAccountList"+idx1+"_reimbursementNameId";
+                var idName="#workAccountList"+idx1+"_reimbursementNameName";
+                var idOffice="#workAccountList"+idx1+"_reimbursementNameofficeId";
+                $(id).val(data.id);
+                $(idName).val(data.name);
+                $(idOffice).val(data.office.name);
             }
             var idx2 = $("#reimbursementVATTaxes tr").length;
             if(list == '#reimbursementVATTaxes'){
@@ -776,7 +790,7 @@
     <div class="form-group layui-row">
         <div class="form-group-label"><h2>报销详情</h2></div>
         <div class="layui-item nav-btns">
-            <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
+            <a class="nav-btn nav-btn-add" onclick="addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl,'',true);workAccountListRowIdx = workAccountListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i>&nbsp;新增</a>
         </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">
@@ -876,15 +890,15 @@
                             <input id="workAccountList{{idx}}_id" name="workAccountList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                             <input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
                         </td>
-                        <%--<td>
-                            <div style="width: 60px">
-                                <input readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>
-                            </div>
-                        </td>--%>
+<%--                        <td>--%>
+<%--                            <div style="width: 60px">--%>
+<%--                                <input readonly="readonly" style="text-align: center"  value="{{idx}}" type="text" class="form-control contentDetail"/>--%>
+<%--                            </div>--%>
+<%--                        </td>--%>
                         <td>
                             <div class="project_reimbursement_div"  style="width: 200px">
                                 <sys:reimburtreeselectUser id="workAccountList{{idx}}_reimbursementName" name="workAccountList[{{idx}}].reimbursementName" value="${projectRecords.leaderIds}" labelName="workAccountList[{{idx}}].name" labelValue="{{row.reimbursementName}}"
-                                    title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
+                                    title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control judgment layui-input" allowClear="true" notAllowSelectParent="true"/>
                             </div>
                         </td>
                         <td>
@@ -909,7 +923,7 @@
                         </td>
 
                         <td>
-                            <input id="workAccountList{{idx}}_money" onchange="getMoney(this.value)" name="workAccountList[{{idx}}].money" type="text" value="{{row.money}}"  placeholder="请输入费用" maxlength="10" class="form-control number"/>
+                            <input id="workAccountList{{idx}}_money" onchange="getMoney(this.value)" name="workAccountList[{{idx}}].money" type="text" value="{{row.money}}"  placeholder="请输入费用" maxlength="10" class="form-control number required"/>
                         </td>
                         <td style="text-align:center;">
                             <input id="workAccountList{{idx}}_bills"  name="workAccountList[{{idx}}].bills" type="text" value="{{row.bills}}" maxlength="3" placeholder="请输入单据张数"  class="form-control number"/>