|
@@ -6,6 +6,12 @@
|
|
|
<meta name="decorator" content="default"/>
|
|
|
<script type="text/javascript" src="${ctxStatic}/layui/layui.js"></script>
|
|
|
<link rel='stylesheet' type="text/css" href="${ctxStatic}/layui/css/layui.css"/>
|
|
|
+ <style>
|
|
|
+ #workInvoiceProjectRelationList td{
|
|
|
+ padding-left: 0px;
|
|
|
+ padding-right: 0px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
<script type="text/javascript">
|
|
|
var validateForm;
|
|
|
function doSubmit(obj){//回调函数,在编辑和保存动作时,供openDialog调用提交表单。
|
|
@@ -153,24 +159,27 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- function setPNumber(obj){
|
|
|
- $.ajax({
|
|
|
- type:'post',
|
|
|
- url:'${ctx}/workinvoice/workInvoice/getPNumber',
|
|
|
- data:{
|
|
|
- "obj":obj
|
|
|
- },
|
|
|
- success:function(data){
|
|
|
- var d = JSON.parse(data);
|
|
|
- $("#pNumber").val(d.pNumber);
|
|
|
- $("#cInfoName").val(d.cInfoName);
|
|
|
- $("#cName").val(d.cName);
|
|
|
- $("#officeName").val(d.officeName);
|
|
|
- $("#officeId").val(d.officeId);
|
|
|
- $("#prdNumber").val(d.prdNumber);
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ function setPNumber(obj,ids){
|
|
|
+ var idx=ids.split("_")[0]
|
|
|
+ $.ajax({
|
|
|
+ type:'post',
|
|
|
+ url:'${ctx}/workinvoice/workInvoice/getPNumber',
|
|
|
+ data:{
|
|
|
+ "obj":obj
|
|
|
+ },
|
|
|
+ success:function(data){
|
|
|
+ var d = JSON.parse(data);
|
|
|
+ var workContractName="#"+idx+"_workContractName";
|
|
|
+ var projectNum="#"+idx+"_projectNum";
|
|
|
+ var clientName="#"+idx+"_clientName";
|
|
|
+ var reportDataNum="#"+idx+"_reportDataNum";
|
|
|
+ $(workContractName).val(d.workContractName);
|
|
|
+ $(projectNum).val(d.projectNum);
|
|
|
+ $(clientName).val(d.clientName);
|
|
|
+ $(reportDataNum).val(d.reportDataNum);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
function addRow(list, idx, tpl, row){
|
|
|
var idx1 = $("#workAccountList tr").length;
|
|
@@ -195,6 +204,62 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ function addRow1(list, idx, tpl, row){
|
|
|
+ var idx1 = $("#workInvoiceProjectRelationList tr").length;
|
|
|
+ if(list == '#workInvoiceProjectRelationList'){
|
|
|
+ // 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();
|
|
|
+ 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");
|
|
|
+ bornTemplete1(list, idx, tpl, row, idx1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function bornTemplete1(list, idx, tpl, row, idx1){
|
|
|
+ $(list).append(Mustache.render(tpl, {
|
|
|
+ idx: idx, delBtn: true, row: row,
|
|
|
+ order:idx1 + 1
|
|
|
+ }));
|
|
|
+ $(list+idx).find("select").each(function(){
|
|
|
+ $(this).val($(this).attr("data-value"));
|
|
|
+ });
|
|
|
+ $(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
|
|
|
+ var ss = $(this).attr("data-value").split(',');
|
|
|
+ for (var i=0; i<ss.length; i++){
|
|
|
+ if($(this).val() == ss[i]){
|
|
|
+ $(this).attr("checked","checked");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function delRow1(obj, prefix) {
|
|
|
+ var id = $(prefix + "_invoiceId");
|
|
|
+ var delFlag = $(prefix + "_delFlag");
|
|
|
+ if (id.val() == "") {
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ } else if (delFlag.val() == "0") {
|
|
|
+ delFlag.val("1");
|
|
|
+ $(obj).html("÷").attr("title", "撤回删除");
|
|
|
+ $(obj).parent().parent().addClass("error");
|
|
|
+ $(obj).parent().parent().addClass("hide");
|
|
|
+ } else if (delFlag.val() == "1") {
|
|
|
+ delFlag.val("0");
|
|
|
+ $(obj).html("×").attr("title", "删除");
|
|
|
+ $(obj).parent().parent().removeClass("error");
|
|
|
+ }
|
|
|
+ // var idx1 = $("#workAccountList tr").length; //tr 总数
|
|
|
+ // for (var i = 0; i < idx1; i++) {
|
|
|
+ // $("#workAccountList tr").eq(i).find("td").eq(1).html(i + 1);
|
|
|
+ // }
|
|
|
+ }
|
|
|
/*function delRow(obj, prefix) {
|
|
|
var id = $(prefix + "_id");
|
|
|
var delFlag = $(prefix + "_delFlag");
|
|
@@ -373,56 +438,62 @@
|
|
|
|
|
|
<div class="form-group layui-row first lw14">
|
|
|
<div class="form-group-label"><h2>基本信息</h2></div>
|
|
|
- <div class="layui-item layui-col-sm6">
|
|
|
- <label class="layui-form-label"><span class="require-item">*</span>项目名称:</label>
|
|
|
- <div class="layui-input-block with-icon">
|
|
|
- <input type="hidden" value="" id ="ids">
|
|
|
- <sys:gridselectcallprojectt url="${ctx}/workinvoice/workInvoice/selectproject" id="project" name="project.id" value="${workInvoice.project.id}" title="选择所属项目" labelName="workInvoice.project.projectName"
|
|
|
- labelValue="${workInvoice.project.projectName}" cssClass="form-control required layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallprojectt>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-item layui-col-sm6">
|
|
|
- <label class="layui-form-label">发票申请编号:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <div class="input-group">
|
|
|
- <form:input path="number" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
- <span class="input-group-btn">
|
|
|
- <label class="form-status"><c:choose><c:when test="${ empty workInvoice.invoiceState}">新添</c:when><c:otherwise>${fns:getDictLabel(workInvoice.invoiceState, 'audit_state','')}</c:otherwise> </c:choose></label>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-item layui-col-sm6">
|
|
|
- <label class="layui-form-label">合同名称:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <form:input id ="cInfoName" path="project.workContractInfo.name" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-item layui-col-sm6">
|
|
|
- <label class="layui-form-label">项目编号:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <form:input id ="pNumber" path="project.projectId" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="layui-item layui-col-sm6">
|
|
|
- <label class="layui-form-label">委托方:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <form:input id ="cName" path="project.workContractInfo.client.name" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
- </div>
|
|
|
+ <div class="layui-item nav-btns">
|
|
|
+ <a class="nav-btn nav-btn-add" onclick="addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl);workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
|
|
|
</div>
|
|
|
- <div class="layui-item layui-col-sm6">
|
|
|
- <label class="layui-form-label">报告号:</label>
|
|
|
- <div class="layui-input-block">
|
|
|
- <form:input id ="prdNumber" path="project.reportData.number" htmlEscape="false" readonly="true" class="form-control layui-input"/>
|
|
|
- </div>
|
|
|
+ <div class="layui-table-body layui-item layui-col-xs12 form-table-container" style="padding:0px">
|
|
|
+ <table id="contentTables" class="table table-bordered table-condensed can-edit no-bottom-margin details">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th width="200px"><font color="red">*</font>项目名称</th>
|
|
|
+ <th width="200px">合同名称</th>
|
|
|
+ <th width="200px">项目编号</th>
|
|
|
+ <th width="200px">委托方</th>
|
|
|
+ <th width="200px">报告号</th>
|
|
|
+ <th width="100px">操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="workInvoiceProjectRelationList">
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ <script type="text/template" id="workInvoiceProjectRelationListTpl">//<!--
|
|
|
+ <tr id="workInvoiceProjectRelationList{{idx}}">
|
|
|
+ <td class="hide">
|
|
|
+ <input id="workInvoiceProjectRelationList{{idx}}_invoiceId" name="workInvoiceProjectRelationList[{{idx}}].invoiceId" type="hidden" value="{{row.invoiceId}}"/>
|
|
|
+ <input id="workInvoiceProjectRelationList{{idx}}_delFlag" name="workInvoiceProjectRelationList[{{idx}}].delFlag" type="hidden" value="0"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <sys:gridselectcallprojecttss url="${ctx}/workinvoice/workInvoice/selectproject" id="workInvoiceProjectRelationList{{idx}}_projectId" name="workInvoiceProjectRelationList[{{idx}}].projectId" value="{{row.projectId}}" title="选择所属项目" labelName="workInvoiceProjectRelationList[{{idx}}].projectName" cssStyle="background-color: #fff"
|
|
|
+ labelValue="{{row.projectName}}" cssClass="form-control required layui-input" fieldLabels="项目" fieldKeys="projectName" searchLabel="项目名称" searchKey="projectName" ></sys:gridselectcallprojecttss>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workInvoiceProjectRelationList{{idx}}_workContractName" type="text" value="{{row.workContractName}}" maxlength="32" readonly="readonly" class="form-control"/>
|
|
|
+ </td>
|
|
|
+ <td style="text-align:center;">
|
|
|
+ <input id="workInvoiceProjectRelationList{{idx}}_projectNum" type="text" value="{{row.projectNum}}" maxlength="32" readonly="readonly" class="form-control"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workInvoiceProjectRelationList{{idx}}_clientName" type="text" value="{{row.clientName}}" maxlength="32" readonly="readonly" class="form-control"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workInvoiceProjectRelationList{{idx}}_reportDataNum" type="text" value="{{row.reportDataNum}}" maxlength="32" readonly="readonly" class="form-control"/>
|
|
|
+ </td>
|
|
|
+ <td class="text-center op-td" >
|
|
|
+ {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow1(this, '#workInvoiceProjectRelationList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
|
|
|
+ </td>
|
|
|
+ </tr>//-->
|
|
|
+ </script>
|
|
|
+ <script type="text/javascript">
|
|
|
+ var workInvoiceProjectRelationListRowIdx = 0, workInvoiceProjectRelationListTpl = $("#workInvoiceProjectRelationListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+ $(document).ready(function() {
|
|
|
+ var data = ${fns:toJson(workInvoice.workInvoiceProjectRelationList)};
|
|
|
+ for (var i=0; i<data.length; i++){
|
|
|
+ addRow1('#workInvoiceProjectRelationList', workInvoiceProjectRelationListRowIdx, workInvoiceProjectRelationListTpl, data[i])
|
|
|
+ workInvoiceProjectRelationListRowIdx = workInvoiceProjectRelationListRowIdx + 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ </script>
|
|
|
</div>
|
|
|
- <%--<div class="layui-item layui-col-sm6">--%>
|
|
|
- <%--<label class="layui-form-label"><span class="require-item">*</span>所属部门:</label>--%>
|
|
|
- <%--<div class="layui-input-block">--%>
|
|
|
- <%--<form:input id ="officeName" path="office.name" htmlEscape="false" readonly="true" class="form-control layui-input"/>--%>
|
|
|
- <%--<form:hidden path="office.id" id ="officeId" />--%>
|
|
|
- <%--</div>--%>
|
|
|
- <%--</div>--%>
|
|
|
</div>
|
|
|
<div class="form-group layui-row first lw14">
|
|
|
<div class="form-group-label"><h2>发票详情</h2></div>
|