|
@@ -0,0 +1,305 @@
|
|
|
+<%@ page contentType="text/html;charset=UTF-8" %>
|
|
|
+<%@ include file="/webpage/include/taglib.jsp"%>
|
|
|
+<form id="subForm" action="#" onsubmit="return false;" method="post" class="form-horizontal">
|
|
|
+ <c:forEach items="${signList}" var="sign">
|
|
|
+ <c:if test="${sign =='workConcealProject'}">
|
|
|
+ <div class="layui-item nav-btns" style="padding-left:0px;">
|
|
|
+ <a class="nav-btn nav-btn-add" onclick="addRowCost('#workConcealProject',preliminaryIdx,preliminaryTpl)" title="新增"><i class="fa fa-plus"></i> 新增</a>
|
|
|
+ <%--<table:importExcelCost url="${ctx}/workConcealProject/workConcealProject/import"></table:importExcelCost>--%><!-- 导入按钮 -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table id="contentTable" class="table table-bordered table-condensed can-edit">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th colspan="6" style="font-size: 20px">屏蔽工程量确认单</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>工程部位</th>
|
|
|
+ <th>工程量</th>
|
|
|
+ <th>隐蔽工程验收记录编号</th>
|
|
|
+ <th>备注</th>
|
|
|
+ <th width="60">操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="workConcealProject">
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </c:if>
|
|
|
+ <c:if test="${sign =='workSiteLevel'}">
|
|
|
+ <div class="layui-item nav-btns" style="padding-left:0px;">
|
|
|
+ <a class="nav-btn nav-btn-add" onclick="addWorkSiteLevelRowCost('#workSiteLevel',workSiteLevelIdx,workSiteLevelTpl)" title="新增"><i class="fa fa-plus"></i> 新增</a>
|
|
|
+ <%--<table:importExcelCost url="${ctx}/workConcealProject/workConcealProject/import"></table:importExcelCost>--%> <!-- 导入按钮 -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <table id="contentTable" class="table table-bordered table-condensed can-edit">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th colspan="6" style="font-size: 20px">场平工程量确认单</th>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>工程部位</th>
|
|
|
+ <th>申报工程量</th>
|
|
|
+ <th>审定工程量</th>
|
|
|
+ <th>备注</th>
|
|
|
+ <th width="60">操作</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody id="workSiteLevel">
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </c:if>
|
|
|
+ </c:forEach>
|
|
|
+ <script type="text/template" id="workSiteLevelTpl">
|
|
|
+ //<!--
|
|
|
+ <tr id="workSiteLevel{{idx}}">
|
|
|
+ <td class="hide">
|
|
|
+ <input id="workSiteLevel{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
|
|
|
+ <input id="workSiteLevel{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
|
|
|
+ <input id="workSiteLevel{{idx}}_type" subName="type" class="contentDetail" type="hidden" value="workSiteLevel"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workSiteLevel{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center" value="{{idx}}" type="text" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workSiteLevel{{idx}}_costPart" subName="costPart" value="{{row.costPart}}" type="text" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workSiteLevel{{idx}}_workAmount" subName="workAmount" type="text" value="{{row.workAmount}}" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workSiteLevel{{idx}}_workConcealProjectSerialNum" subName="workConcealProjectSerialNum" type="text" value="{{row.workConcealProjectSerialNum}}" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workSiteLevel{{idx}}_remarks" subName="remarks" type="text" value="{{row.remarks}}" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td class="text-center op-td">
|
|
|
+ <a href="#" onclick="delWorkSiteLevelRow(this, '#workSiteLevel{{idx}}')" class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
|
|
|
+ </td>
|
|
|
+ </tr>//-->
|
|
|
+ </script>
|
|
|
+ <script type="text/javascript">
|
|
|
+ var workSiteLevelIdx = 0, workSiteLevelTpl = $("#workSiteLevelTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+ var validateForm2;
|
|
|
+ $(function(){
|
|
|
+ validateForm2 = $("#subForm").validate({
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var data = ${fns:toJson(workConcealProject)};
|
|
|
+ for (var i=0; i<data.length; i++){
|
|
|
+ if(data[i].type == 'workSiteLevel') {
|
|
|
+ addWorkSiteLevelRowCost('#workSiteLevel', workSiteLevelIdx, workSiteLevelTpl, data[i]);
|
|
|
+ $("#workSiteLevel" + i + "_nodeTypes").val(data[i].nodeTypes);
|
|
|
+ $("#workSiteLevel" + i + "_expenseType").val(data[i].expenseType);
|
|
|
+ $("#workSiteLevel" + i + "_unit").val(data[i].unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(":input.money").change();
|
|
|
+ })
|
|
|
+
|
|
|
+ function addWorkSiteLevelRowCost(list, idx, tpl, row){
|
|
|
+ idx = idx+1;
|
|
|
+ bornTempleteWorkSiteLevel(list, idx, tpl, row, idx);
|
|
|
+ workSiteLevelIdx +=1;
|
|
|
+ }
|
|
|
+ function bornTempleteWorkSiteLevel(list, idx, tpl, row, idx1){
|
|
|
+ var idx1 = $("#workSiteLevel tr").length +1;
|
|
|
+ $(list).append(Mustache.render(tpl, {
|
|
|
+ idx: idx, delBtn: true, row: row,
|
|
|
+ order:idx1 + 1, idx1:idx1
|
|
|
+ }));
|
|
|
+ $(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 delWorkSiteLevelRow(obj, prefix,idx){
|
|
|
+ var id = $(prefix+"_id");
|
|
|
+ var delFlag = $(prefix+"_delFlag");
|
|
|
+ if(id.val()==null||id.val()==''){
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ }else {
|
|
|
+ delFlag.val("1");
|
|
|
+ $(obj).parent().parent().hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function genWorkSiteLevelRow(data) {
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ addWorkSiteLevelRowCost('#workSiteLevel',workSiteLevelIdx,workSiteLevelTpl,data[i]);
|
|
|
+ }
|
|
|
+ $(":input.money").change();
|
|
|
+ }
|
|
|
+
|
|
|
+ function genSecondDetailStr(){
|
|
|
+ var costList = $("#workSiteLevel tr");
|
|
|
+ var contentStr = "[";
|
|
|
+ for(var j=0; j<costList.length;j++){
|
|
|
+ contentStr+="{"
|
|
|
+ var idstr = $(costList[j]).attr("id");
|
|
|
+ var detail = $("tr[id="+idstr+"] .contentDetail");
|
|
|
+ for(var i=0; i<detail.length;i++){
|
|
|
+ contentStr+="'"
|
|
|
+ contentStr+=$(detail[i]).attr("subName");
|
|
|
+ contentStr+="'"
|
|
|
+ contentStr+=":";
|
|
|
+ contentStr+="'"
|
|
|
+ contentStr+=$(detail[i]).val();
|
|
|
+ contentStr+="'"
|
|
|
+ if(i!=detail.length-1){
|
|
|
+ contentStr+=","
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contentStr+="}"
|
|
|
+ if(j!=costList.length-1){
|
|
|
+ contentStr+=","
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contentStr += "]";
|
|
|
+ return contentStr;
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+ <script type="text/template" id="preliminaryTpl">//<!--
|
|
|
+ <tr id="workConcealProject{{idx}}">
|
|
|
+ <td class="hide">
|
|
|
+ <input id="workConcealProject{{idx}}_id" subName="id" class="contentDetail" type="hidden" value="{{row.id}}"/>
|
|
|
+ <input id="workConcealProject{{idx}}_delFlag" subName="delFlag" class="contentDetail" type="hidden" value="0"/>
|
|
|
+ <input id="workConcealProject{{idx}}_type" subName="type" class="contentDetail" type="hidden" value="workConcealProject"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workConcealProject{{idx}}_costNum" subName="costNum" readonly="readonly" style="text-align: center" value="{{idx}}" type="text" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workConcealProject{{idx}}_costPart" subName="costPart" value="{{row.costPart}}" type="text" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workConcealProject{{idx}}_workAmount" subName="workAmount" type="text" value="{{row.workAmount}}" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workConcealProject{{idx}}_workConcealProjectSerialNum" subName="workConcealProjectSerialNum" type="text" value="{{row.workConcealProjectSerialNum}}" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <input id="workConcealProject{{idx}}_remarks" subName="remarks" type="text" value="{{row.remarks}}" class="form-control contentDetail"/>
|
|
|
+ </td>
|
|
|
+ <td class="text-center op-td">
|
|
|
+ <a href="#" onclick="delRow(this, '#workConcealProject{{idx}}')" class="op-btn op-btn-delete"><i class="fa fa-trash"></i> 取消</a>
|
|
|
+ </td>
|
|
|
+ </tr>//-->
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <script type="text/javascript">
|
|
|
+ var preliminaryIdx = 0, preliminaryTpl = $("#preliminaryTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
+ var validateForm2;
|
|
|
+ $(function(){
|
|
|
+ validateForm2 = $("#subForm").validate({
|
|
|
+ errorContainer: "#messageBox",
|
|
|
+ errorPlacement: function(error, element) {
|
|
|
+ $("#messageBox").text("输入有误,请先更正。");
|
|
|
+ if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
|
|
|
+ error.appendTo(element.parent().parent());
|
|
|
+ } else {
|
|
|
+ error.insertAfter(element);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ var data = ${fns:toJson(workConcealProject)};
|
|
|
+ for (var i=0; i<data.length; i++){
|
|
|
+ if(data[i].type == 'workConcealProject') {
|
|
|
+ addRowCost('#workConcealProject', preliminaryIdx, preliminaryTpl, data[i]);
|
|
|
+ $("#workConcealProject" + i + "_nodeTypes").val(data[i].nodeTypes);
|
|
|
+ $("#workConcealProject" + i + "_expenseType").val(data[i].expenseType);
|
|
|
+ $("#workConcealProject" + i + "_unit").val(data[i].unit);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $(":input.money").change();
|
|
|
+ })
|
|
|
+
|
|
|
+ function addRowCost(list, idx, tpl, row){
|
|
|
+ idx = idx+1;
|
|
|
+ bornTemplete(list, idx, tpl, row, idx);
|
|
|
+ preliminaryIdx +=1;
|
|
|
+ }
|
|
|
+
|
|
|
+ function bornTemplete(list, idx, tpl, row, idx1){
|
|
|
+ var idx1 = $("#workConcealProject tr").length +1;
|
|
|
+ $(list).append(Mustache.render(tpl, {
|
|
|
+ idx: idx, delBtn: true, row: row,
|
|
|
+ order:idx1 + 1, idx1:idx1
|
|
|
+ }));
|
|
|
+ $(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 delRow(obj, prefix,idx){
|
|
|
+ var id = $(prefix+"_id");
|
|
|
+ var delFlag = $(prefix+"_delFlag");
|
|
|
+ if(id.val()==null||id.val()==''){
|
|
|
+ $(obj).parent().parent().remove();
|
|
|
+ }else {
|
|
|
+ delFlag.val("1");
|
|
|
+ $(obj).parent().parent().hide();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function genRow(data) {
|
|
|
+ for (var i = 0; i < data.length; i++) {
|
|
|
+ addRowCost('#workConcealProject',preliminaryIdx,preliminaryTpl,data[i]);
|
|
|
+ }
|
|
|
+ $(":input.money").change();
|
|
|
+ }
|
|
|
+
|
|
|
+ function genDetailStr(){
|
|
|
+ var costList = $("#workConcealProject tr");
|
|
|
+ var contentStr = "[";
|
|
|
+ for(var j=0; j<costList.length;j++){
|
|
|
+ contentStr+="{"
|
|
|
+ var idstr = $(costList[j]).attr("id");
|
|
|
+ var detail = $("tr[id="+idstr+"] .contentDetail");
|
|
|
+ for(var i=0; i<detail.length;i++){
|
|
|
+ contentStr+="'"
|
|
|
+ contentStr+=$(detail[i]).attr("subName");
|
|
|
+ contentStr+="'"
|
|
|
+ contentStr+=":";
|
|
|
+ contentStr+="'"
|
|
|
+ contentStr+=$(detail[i]).val();
|
|
|
+ contentStr+="'"
|
|
|
+ if(i!=detail.length-1){
|
|
|
+ contentStr+=","
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contentStr+="}"
|
|
|
+ if(j!=costList.length-1){
|
|
|
+ contentStr+=","
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contentStr += "]";
|
|
|
+ return contentStr;
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</form>
|