<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>案例管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
        var validateForm;
        var count = 0;
        var count2 = 0;
        var count3 = 0;
        var count4 = 0;
        function doSubmit(obj){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                if(obj == 2){
                    $("#inputForm").attr("action","${ctx}/workexample/workExample/store");
                }else{
                    $("#inputForm").attr("action","${ctx}/workexample/workExample/save");
                }
                $("#inputForm").submit();
                return true;
            }else {
                parent.layer.msg("信息未填写完整!", {icon: 5});
            }
            return false;
        }
        /*  function reset(){
              $('#inputForm').reset();
          }*/
        function tijiao(){
            //submit(reset);
            var _name = $("#name").val();
            var _type = $("#type").val();
            var _buildScale = $("#buildScale").val();
            if(_name ==null || _name =='' || _name == undefined){
                parent.layer.msg("请填写工程名称!!!",{icon:5});
                return false;
            }else if(_type ==null || _type =='' || _type == undefined){
                parent.layer.msg("请填写工程类型!!!",{icon:5});
                return false;
            }else if(_buildScale ==null || _buildScale =='' || _buildScale == undefined){
                parent.layer.msg("请填写建设规模!!!",{icon:5});
                return false;
            }else if(!isNumber(_buildScale)){
                parent.layer.msg("建设规模请填写有效数字!!!",{icon:5});
                return false;
            }
            $.ajax({
                type:'post',
                url:'${ctx}/workexample/workExample/checkSame',
                data:$("#inputForm").serialize(),
                success:function(result){
                    if(result.body.data.id == null || result.body.data.id == undefined || result.body.data.id == ''){
                        parent.layer.msg("暂存失败",{icon:5});
                    }else{
                        parent.layer.msg("暂存成功",{icon:1});
                        $("#id").val(result.body.data.id);
                        parent.$("#exampleId").val(result.body.data.id);
                        parent.refreshTree(result.body.data.id);
                    }
                }
            })
        }
        function submit(callback){
            if(validateForm.form()){
                var _name = $("#name").val();
                var _type = $("#type").val();
                var _buildScale = $("#buildScale").val();
                if(_name!=null && _name !='' && _type !=null && _type !=''){
                    $("#inputForm").submit();
                    callback();
                    return true;
                }else if(_name ==null || _name =='' || _name == undefined){
                    parent.layer.msg("请填写工程名称!!!",{icon:5});
                    return false;
                }else if(_type ==null || _type =='' || _type == undefined){
                    parent.layer.msg("请填写工程类型!!!",{icon:5});
                    return false;
                }else if(_buildScale ==null || _buildScale =='' || _buildScale == undefined){
                    parent.layer.msg("请填写建设规模!!!",{icon:5});
                    return false;
                }
            }
            return false;
        }
        $(document).ready(function() {
            validateForm = $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                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);
                    }
                }
            });

            laydate.render({
                elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
            laydate.render({
                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
            /*$("#reviseType").change(function(){
                if($(this). val()== 1 || $(this). val()== 2 || $(this). val()== 3 || $(this). val()== 4){
                    console.log($(this). val()+"----------2");
                    $("#workContractInfoName").attr("class","form-control layui-input required");
                    document.getElementById("workContractInfoName").disabled=false;
                    document.getElementById("workContractInfoId").disabled=false;
                    $("#inreviseOfficeName").attr("class","form-control layui-input");
                    $("#td1").removeClass("hide");
                    $("#td2").addClass("hide");
                    if($(this). val()== 1){
                        $("#td3").removeClass("hide");
                        $("#td4").addClass("hide");
                        $("#inreviseOfficeName").attr("class","form-control layui-input required");
                    }
                }else{
                    console.log($(this). val()+"----------1");
                    $("#workContractInfoName").attr("class","form-control layui-input");
                    $("#inreviseOfficeName").attr("class","form-control layui-input");
                    document.getElementById("workContractInfoName").disabled=true;
                    document.getElementById("workContractInfoId").disabled=true;
                    $("#td1").addClass("hide");
                    $("#td2").removeClass("hide");
                    $("#td3").addClass("hide");
                    $("#td4").removeClass("hide");
                }
            });*/
        });
        function changeInfo(id,pid,_type) {
            //alert(id+"-233-"+pid+"----"+_type);
            count ==0;
            count2 ==0;
            count3 ==0;
            count4 ==0;
            exampleSingleRowIdx = 0;
            exampleProjectRowIdx = 0;
            exampleExpendRowIdx = 0;
            exampleEconomicsRowIdx = 0;
            if(_type == '1'){
                //单项工程造价指标
                $("#_single").show();
                $("#_example").hide();
                $("#_project").hide();
                $("#_expend").hide();
                $("#_economics").hide();
                $('#exampleSingleList').html("");
                var eId = $("#id").val();
                $.get("${ctx}/workexample/workExample/selectSingle", { indexId: id,eId:eId},
                    function(data){
                        data = data.body.list;
                        if(data !=null){
                            for (var i=0; i<data.length; i++){
                                addRow('#exampleSingleList', exampleSingleRowIdx, exampleSingleTpl, data[i]);
                                exampleSingleRowIdx = exampleSingleRowIdx + 1;
                            }
                        }
                    });
            }else if(_type == '4'){
                //经济指标
                $("#_single").hide();
                $("#_example").hide();
                $("#_project").hide();
                $("#_expend").hide();
                $("#_economics").show();
                $('#exampleEconomicsList').html("");
                var eId = $("#id").val();
                $.get("${ctx}/workexample/workExample/selectEconomics", { indexId: id,eId:eId},
                    function(data){
                        data = data.body.list;
                        if(data !=null){
                            for (var i=0; i<data.length; i++){
                                addRow('#exampleEconomicsList', exampleEconomicsRowIdx, exampleEconomicsTpl, data[i]);
                                exampleEconomicsRowIdx = exampleEconomicsRowIdx + 1;
                            }
                        }
                    });
            }else if(_type == '5'){
                //主要工程量指标
                $("#_single").hide();
                $("#_example").hide();
                $("#_project").show();
                $("#_expend").hide();
                $("#_economics").hide();
                $('#exampleProjectList').html("");
                var eId = $("#id").val();
                $.get("${ctx}/workexample/workExample/selectProject", { indexId: id,eId:eId},
                    function(data){
                        data = data.body.list;
                        if(data !=null){
                            for (var i=0; i<data.length; i++){
                                addRow('#exampleProjectList', exampleProjectRowIdx, exampleProjectTpl, data[i]);
                                exampleProjectRowIdx = exampleProjectRowIdx + 1;
                            }
                        }
                    });
            }else if(_type == '6'){
                //主要工料价格及消耗量指标
                $("#_single").hide();
                $("#_example").hide();
                $("#_project").hide();
                $("#_expend").show();
                $("#_economics").hide();
                $('#exampleExpendList').html("");
                var eId = $("#id").val();
                $.get("${ctx}/workexample/workExample/selectExpend", { indexId: id,eId:eId},
                    function(data){
                        data = data.body.list;
                        if(data !=null){
                            for (var i=0; i<data.length; i++){
                                addRow('#exampleExpendList', exampleExpendRowIdx, exampleExpendTpl, data[i]);
                                exampleExpendRowIdx = exampleExpendRowIdx + 1;
                            }
                        }
                    });
            }else if(_type == '0'){
                $("#_single").hide();
                $("#_example").show();
                $("#_project").hide();
                $("#_expend").hide();
                $("#_economics").hide();
            }
        }
        function _singleqr(){
            $.ajax({
                type:'post',
                url:'${ctx}/workexample/workExample/checkSame',
                data:$("#inputForm").serialize(),
                success:function(result){
                    parent.layer.msg("暂存成功",{icon:1});
                }
            })
        }
        function _projectqr(){
            $.ajax({
                type:'post',
                url:'${ctx}/workexample/workExample/checkSame',
                data:$("#inputForm").serialize(),
                success:function(result){
                    parent.layer.msg("暂存成功",{icon:1});
                }
            })
        }
        function _expendqr(){
            $.ajax({
                type:'post',
                url:'${ctx}/workexample/workExample/checkSame',
                data:$("#inputForm").serialize(),
                success:function(result){
                    parent.layer.msg("暂存成功",{icon:1});
                }
            })
        }
        function _economicsqr(){
            $.ajax({
                type:'post',
                url:'${ctx}/workexample/workExample/checkSame',
                data:$("#inputForm").serialize(),
                success:function(result){
                    parent.layer.msg("暂存成功",{icon:1});
                }
            })
        }
        function addRow(list, idx, workClientLinkmanTpl, row) {
            $(list).append(Mustache.render(workClientLinkmanTpl, {
                idx: idx, delBtn: true, row: row
            }));
            $(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){
            count++;
            count2 ++;
            count3 ++;
            count4 ++;
            var id = $(prefix+"_id");
            var delFlag = $(prefix+"_delFlag");
            if (id.val() == ""){
                $(obj).parent().parent().remove();
            }else if(delFlag.val() == "0"){
                delFlag.val("1");
                $(obj).parent().parent().hide();
                $(obj).html("&divide;").attr("title", "撤回删除");
                $(obj).parent().parent().addClass("error");
            }else if(delFlag.val() == "1"){
                delFlag.val("0");
                $(obj).html("&times;").attr("title", "删除");
                $(obj).parent().parent().removeClass("error");
            }
        }
        function setCost(obj){
            var buildScale = $("#buildScale").val();//建设规模
            var a = $(obj).attr("id");
            var c = a.replace('money','cost');//单位造价
            //var p = a.replace('money','proportion');//占造价比例
            var value = obj.value || 0;
            console.log("value----"+value);

            var money = "0.00";
            //自动计算出结果并填充在相应的输入框中
            var size = $("#exampleSingleList tr").length+count;
            for (var i = 0;i<size;i++){
                var _totalMoney = $("#exampleSingleList"+i+"_money").val();
                var delFlag = $("#exampleSingleList"+i+"_delFlag").val();
                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
                    if(money==""){
                        money = parseFloat(_totalMoney).toFixed(2);
                    }else {
                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
                    }
                }
            }
            if(!/^\d+(\.\d{1,2})?$/.test( value )){
                parent.layer.msg("金额必须输入数字",{icon:5});
            }else{
                var num = value/buildScale || 0;
                console.log("num-----"+num);
                $("#" +  c ).val(parseFloat(num.toFixed(2)));
                console.log("size-----"+size);
                for (var i = 0;i<size;i++){
                    var delFlag = $("#exampleSingleList"+i+"_delFlag").val();
                    if (delFlag==0){
                        var _money = $("#exampleSingleList"+i+"_money").val();
                        var pp = (_money/money)*100 || 0;
                        console.log("pp-----"+pp);
                        $("#exampleSingleList"+i+"_proportion").val(parseFloat(pp.toFixed(2)))
                    }
                }
            }
        }
        /*-------------------------*/
        function setCostEconomics(obj){
            var buildScale = $("#buildScale").val();//建设规模
            var a = $(obj).attr("id");
            var c = a.replace('money','cost');//单位造价
            //var p = a.replace('money','proportion');//占造价比例
            var value = obj.value || 0;
            console.log("value----"+value);

            var money = "0.00";
            //自动计算出结果并填充在相应的输入框中
            var size = $("#exampleEconomicsList tr").length+count;
            for (var i = 0;i<size;i++){
                var _totalMoney = $("#exampleEconomicsList"+i+"_money").val();
                var delFlag = $("#exampleEconomicsList"+i+"_delFlag").val();
                if (_totalMoney!=undefined && isNumber(_totalMoney) && delFlag==0){
                    if(money==""){
                        money = parseFloat(_totalMoney).toFixed(2);
                    }else {
                        money = (parseFloat(money) + parseFloat(_totalMoney)).toFixed(2);
                    }
                }
            }
            if(!/^\d+(\.\d{1,2})?$/.test( value )){
                parent.layer.msg("金额必须输入数字",{icon:5});
            }else{
                var num = value/buildScale || 0;
                console.log("num-----"+num);
                $("#" +  c ).val(parseFloat(num.toFixed(2)));
                console.log("size-----"+size);
                for (var i = 0;i<size;i++){
                    var delFlag = $("#exampleEconomicsList"+i+"_delFlag").val();
                    if (delFlag==0){
                        var _money = $("#exampleEconomicsList"+i+"_money").val();
                        var pp = (_money/money)*100 || 0;
                        console.log("pp-----"+pp);
                        $("#exampleEconomicsList"+i+"_proportion").val(parseFloat(pp.toFixed(2)))
                    }
                }
            }
        }
        function setCostProject(obj){
            var buildScale = $("#buildScale").val();//建设规模
            var a = $(obj).attr("id");
            var c = a.replace('count','quota');//单位指标
            var value = obj.value || 0;
            console.log("value----"+value);
            if(!/^\d+(\.\d{1,2})?$/.test( value )){
                parent.layer.msg("数量必须输入数字",{icon:5});
            }else{
                var num = value/buildScale || 0;
                console.log("num-----"+num);
                $("#" +  c ).val(parseFloat(num.toFixed(2)));
            }
        }
        function isNumber(val){
            if(val === "" || val ==null){
                return false;
            }
            var regPos = /^\d+(\.\d+)?$/; //非负浮点数
            var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
            if(regPos.test(val) || regNeg.test(val)){
                return true;
            }else{
                return false;
            }

        }

        function openDialogreSingle(title,url,width,height,target){
            var indexId = null;
            for (var a = 0;a<100;a++){
                indexId = $("#exampleSingleList"+a+"_indexId").val();
                if(indexId != undefined && indexId !=null && indexId !=''){
                    break;
                }
            }
            console.log("-----indexId------"+indexId);
            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: ['90%','90%'],
                title:title,
                skin:"two-btns",
                name:'friend',
                content: encodeURI("${ctx}/workexample/workExampleIndices/gridSelectIndices?url=${ctx}/workexample/workExampleIndices/gridSelectIndices&indexId="+indexId) ,
                btn: ['确定', '关闭'],
                yes: function(index, layero){
                    var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var item = iframeWin.getSelectedItem();
                    if(item == "-1"){
                        return;
                    }
                    var userIds; ;
                    if(false){//单选
                        userIds = item.id;
                        //selectUserInfo(item.userId);
                    }else{//多选
                        var ids = [], names = [];
                        for (var i=0;i<item.length;i++){
                            ids.push(item[i].id);
                        }
                        var arr=ids.join(",").replace(/u_/ig,"");
                        userIds = arr;
                        //setUserInfo(arr);
                    }
                    console.log(userIds);
                    //console.log($("#id").val());
                    var exampleId = $("#id").val();
                    $.ajax({
                        type:"post",
                        url:'${ctx}/workexample/workExampleIndices/saveIndices',
                        data:{"ids":userIds,"indexId":indexId,"exampleId":exampleId},
                        dataType:"json",
                        success:function(data){
                            data = data.body.list;
                            console.log("--------data--------"+data);
                            console.log("--------data.length--------"+data.length);
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    var exampleIndicesId = data[i].exampleIndicesId;
                                    console.log("--------exampleIndicesId--------"+exampleIndicesId);
                                    var size = $("#exampleSingleList tr").length+count;
                                    console.log("--------size--------"+size);
                                    if(size == 0){
                                        console.log("--------_size0--------");
                                        addRow('#exampleSingleList', exampleSingleRowIdx, exampleSingleTpl, data[i]);
                                        exampleSingleRowIdx = exampleSingleRowIdx + 1;
                                    }else{
                                        console.log("--------_else--------");
                                        var sign = true;
                                        for (var j = 0;j<size;j++){
                                            var delFlag = $("#exampleSingleList"+j+"_delFlag").val();
                                            var _exampleIndicesId = $("#exampleSingleList"+j+"_exampleIndicesId").val();
                                            console.log(sign);
                                            console.log("--------_exampleIndicesId--------"+_exampleIndicesId+"---exampleIndicesId---"+exampleIndicesId);
                                            if(delFlag == 0 && _exampleIndicesId == exampleIndicesId){
                                                sign = false;
                                            }
                                        }
                                        if(sign){
                                            addRow('#exampleSingleList', exampleSingleRowIdx, exampleSingleTpl, data[i]);
                                            exampleSingleRowIdx = exampleSingleRowIdx + 1;
                                        }
                                    }

                                }
                            }
                        }
                    })
                    top.layer.close(index);//关闭对话框。

                },
                cancel: function(index){
                }
            });
        }


        function openDialogreProject(title,url,width,height,target){
            var indexId = null;
            for (var a = 0;a<100;a++){
                indexId = $("#exampleProjectList"+a+"_indexId").val();
                if(indexId != undefined && indexId !=null && indexId !=''){
                    break;
                }
            }
            console.log("-----indexId------"+indexId);
            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: ['90%','90%'],
                title:title,
                skin:"two-btns",
                name:'friend',
                content: encodeURI("${ctx}/workexample/workExampleIndices/gridSelectIndices?url=${ctx}/workexample/workExampleIndices/gridSelectIndices&indexId="+indexId) ,
                btn: ['确定', '关闭'],
                yes: function(index, layero){
                    var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var item = iframeWin.getSelectedItem();
                    if(item == "-1"){
                        return;
                    }
                    var userIds; ;
                    if(false){//单选
                        userIds = item.id;
                        //selectUserInfo(item.userId);
                    }else{//多选
                        var ids = [], names = [];
                        for (var i=0;i<item.length;i++){
                            ids.push(item[i].id);
                        }
                        var arr=ids.join(",").replace(/u_/ig,"");
                        userIds = arr;
                        //setUserInfo(arr);
                    }
                    console.log(userIds);
                    //console.log($("#id").val());
                    var exampleId = $("#id").val();
                    $.ajax({
                        type:"post",
                        url:'${ctx}/workexample/workExampleIndices/saveIndices',
                        data:{"ids":userIds,"indexId":indexId,"exampleId":exampleId},
                        dataType:"json",
                        success:function(data){
                            data = data.body.list;
                            console.log("--------data--------"+data);
                            console.log("--------data.length--------"+data.length);
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    var exampleindicesId = data[i].exampleindicesId;
                                    console.log("--------exampleindicesId--------"+exampleindicesId);
                                    var size = $("#exampleProjectList tr").length+count2;
                                    console.log("--------size--------"+size);
                                    if(size == 0){
                                        console.log("--------_size0--------");
                                        addRow('#exampleProjectList', exampleProjectRowIdx, exampleProjectTpl, data[i]);
                                        exampleProjectRowIdx = exampleProjectRowIdx + 1;
                                    }else{
                                        console.log("--------_else--------");
                                        var sign = true;
                                        for (var j = 0;j<size;j++){
                                            var delFlag = $("#exampleProjectList"+j+"_delFlag").val();
                                            var _exampleindicesId = $("#exampleProjectList"+j+"_exampleindicesId").val();
                                            console.log(sign);
                                            console.log("--------_exampleindicesId--------"+_exampleindicesId+"---exampleindicesId---"+exampleindicesId);
                                            if(delFlag == 0 && _exampleindicesId == exampleindicesId){
                                                sign = false;
                                            }
                                        }
                                        if(sign){
                                            addRow('#exampleProjectList', exampleProjectRowIdx, exampleProjectTpl, data[i]);
                                            exampleProjectRowIdx = exampleProjectRowIdx + 1;
                                        }
                                    }

                                }
                            }
                        }
                    })
                    top.layer.close(index);//关闭对话框。

                },
                cancel: function(index){
                }
            });
        }


        function openDialogreExpend(title,url,width,height,target){
            var indexId = null;
            for (var a = 0;a<100;a++){
                indexId = $("#exampleExpendList"+a+"_indexId").val();
                if(indexId != undefined && indexId !=null && indexId !=''){
                    break;
                }
            }
            console.log("-----indexId------"+indexId);
            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: ['90%','90%'],
                title:title,
                skin:"two-btns",
                name:'friend',
                content: encodeURI("${ctx}/workexample/workExampleIndices/gridSelectIndices?url=${ctx}/workexample/workExampleIndices/gridSelectIndices&indexId="+indexId) ,
                btn: ['确定', '关闭'],
                yes: function(index, layero){
                    var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var item = iframeWin.getSelectedItem();
                    if(item == "-1"){
                        return;
                    }
                    var userIds; ;
                    if(false){//单选
                        userIds = item.id;
                        //selectUserInfo(item.userId);
                    }else{//多选
                        var ids = [], names = [];
                        for (var i=0;i<item.length;i++){
                            ids.push(item[i].id);
                        }
                        var arr=ids.join(",").replace(/u_/ig,"");
                        userIds = arr;
                        //setUserInfo(arr);
                    }
                    console.log(userIds);
                    //console.log($("#id").val());
                    var exampleId = $("#id").val();
                    $.ajax({
                        type:"post",
                        url:'${ctx}/workexample/workExampleIndices/saveIndices',
                        data:{"ids":userIds,"indexId":indexId,"exampleId":exampleId},
                        dataType:"json",
                        success:function(data){
                            data = data.body.list;
                            console.log("--------data--------"+data);
                            console.log("--------data.length--------"+data.length);
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    var exampleindicesId = data[i].exampleindicesId;
                                    console.log("--------exampleindicesId--------"+exampleindicesId);
                                    var size = $("#exampleExpendList tr").length+count3;
                                    console.log("--------size--------"+size);
                                    if(size == 0){
                                        console.log("--------_size0--------");
                                        addRow('#exampleExpendList', exampleExpendRowIdx, exampleExpendTpl, data[i]);
                                        exampleExpendRowIdx = exampleExpendRowIdx + 1;
                                    }else{
                                        console.log("--------_else--------");
                                        var sign = true;
                                        for (var j = 0;j<size;j++){
                                            var delFlag = $("#exampleExpendList"+j+"_delFlag").val();
                                            var _exampleindicesId = $("#exampleExpendList"+j+"_exampleindicesId").val();
                                            console.log(sign);
                                            console.log("--------_exampleindicesId--------"+_exampleindicesId+"---exampleindicesId---"+exampleindicesId);
                                            if(delFlag == 0 && _exampleindicesId == exampleindicesId){
                                                sign = false;
                                            }
                                        }
                                        if(sign){
                                            addRow('#exampleExpendList', exampleExpendRowIdx, exampleExpendTpl, data[i]);
                                            exampleExpendRowIdx = exampleExpendRowIdx + 1;
                                        }
                                    }

                                }
                            }
                        }
                    })
                    top.layer.close(index);//关闭对话框。

                },
                cancel: function(index){
                }
            });
        }


        function openDialogreEconomics(title,url,width,height,target){
            var indexId = null;
            for (var a = 0;a<100;a++){
                indexId = $("#exampleEconomicsList"+a+"_indexId").val();
                if(indexId != undefined && indexId !=null && indexId !=''){
                    break;
                }
            }
            console.log("-----indexId------"+indexId);
            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: ['90%','90%'],
                title:title,
                skin:"two-btns",
                name:'friend',
                content: encodeURI("${ctx}/workexample/workExampleIndices/gridSelectIndices?url=${ctx}/workexample/workExampleIndices/gridSelectIndices&indexId="+indexId) ,
                btn: ['确定', '关闭'],
                yes: function(index, layero){
                    var iframeWin = layero.find('iframe')[0].contentWindow; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var item = iframeWin.getSelectedItem();
                    if(item == "-1"){
                        return;
                    }
                    var userIds; ;
                    if(false){//单选
                        userIds = item.id;
                        //selectUserInfo(item.userId);
                    }else{//多选
                        var ids = [], names = [];
                        for (var i=0;i<item.length;i++){
                            ids.push(item[i].id);
                        }
                        var arr=ids.join(",").replace(/u_/ig,"");
                        userIds = arr;
                        //setUserInfo(arr);
                    }
                    console.log(userIds);
                    //console.log($("#id").val());
                    var exampleId = $("#id").val();
                    $.ajax({
                        type:"post",
                        url:'${ctx}/workexample/workExampleIndices/saveIndices',
                        data:{"ids":userIds,"indexId":indexId,"exampleId":exampleId},
                        dataType:"json",
                        success:function(data){
                            data = data.body.list;
                            console.log("--------data--------"+data);
                            console.log("--------data.length--------"+data.length);
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    var exampleindicesId = data[i].exampleindicesId;
                                    console.log("--------exampleindicesId--------"+exampleindicesId);
                                    var size = $("#exampleEconomicsList tr").length+count4;
                                    console.log("--------size--------"+size);
                                    if(size == 0){
                                        console.log("--------_size0--------");
                                        addRow('#exampleEconomicsList', exampleEconomicsRowIdx, exampleEconomicsTpl, data[i]);
                                        exampleEconomicsRowIdx = exampleEconomicsRowIdx + 1;
                                    }else{
                                        console.log("--------_else--------");
                                        var sign = true;
                                        for (var j = 0;j<size;j++){
                                            var delFlag = $("#exampleEconomicsList"+j+"_delFlag").val();
                                            var _exampleindicesId = $("#exampleEconomicsList"+j+"_exampleindicesId").val();
                                            console.log(sign);
                                            console.log("--------_exampleindicesId--------"+_exampleindicesId+"---exampleindicesId---"+exampleindicesId);
                                            if(delFlag == 0 && _exampleindicesId == exampleindicesId){
                                                sign = false;
                                            }
                                        }
                                        if(sign){
                                            addRow('#exampleEconomicsList', exampleEconomicsRowIdx, exampleEconomicsTpl, data[i]);
                                            exampleEconomicsRowIdx = exampleEconomicsRowIdx + 1;
                                        }
                                    }

                                }
                            }
                        }
                    })
                    top.layer.close(index);//关闭对话框。

                },
                cancel: function(index){
                }
            });
        }
	</script>
</head>
<body>
<div class="single-form">
	<div class="container view-form">
		<form:form id="inputForm" modelAttribute="workExample" action="${ctx}/workexample/workExample/store" method="post" class="form-horizontal">
			<form:hidden path="id"/>
			<%--<sys:message content="${message}"/>--%>
			<div id="_example" class="form-group layui-row first lw8">
				<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">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.name}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label"><span class="require-item">*</span>工程类型：</label>
					<div class="layui-input-block">
						<div class="input-group">
							<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.mainDictDetail.detailName}"/>
							<span class="input-group-btn">
							<label class="form-status"><c:choose><c:when test="${ empty workExample.status}">新添</c:when><c:otherwise>${fns:getDictLabel(workExample.status, '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">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.area.name}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">建设规模(㎡)：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.buildScale}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">结构形式：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.modus}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">基础类型：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.basicType}"/>
					</div>
				</div><div class="layui-item layui-col-sm6">
				<label class="layui-form-label">规   模：</label>
				<div class="layui-input-block">
					<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.scale}"/>
				</div>
			</div><div class="layui-item layui-col-sm6">
				<label class="layui-form-label">结构安全等级：</label>
				<div class="layui-input-block">
					<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.safeLevel}"/>
				</div>
			</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">编制阶段：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.stage}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">投资类型：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.investmentType}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">计价类型：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.valuationType}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">计价依据：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.valuationAccording}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label double-line">招标基准信息价：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.biddingPrice}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">计税模式：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.taxModel}"/>
					</div>
				</div>

				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">开工日期：</label>
					<div class="layui-input-block">
						<input name="startDate" type="text" maxlength="20" readonly="true" class="laydate-icondate form-control layer-date layui-input laydate-icon"
							   value="<fmt:formatDate value="${workExample.startDate}" pattern="yyyy-MM-dd"/>"/>
						</input>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">竣工日期：</label>
					<div class="layui-input-block">
						<input name="endDate" type="text" maxlength="20" readonly="true" class="laydate-icondate form-control layer-date layui-input laydate-icon"
							   value="<fmt:formatDate value="${workExample.endDate}" pattern="yyyy-MM-dd"/>"/>
						</input>
					</div>
				</div>

				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">地上建筑面积：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.abovegroundArea}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">地下建筑面积：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.undergroundArea}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">人防建筑面积：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.civilArea}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">车库建筑面积：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.garageArea}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">地上层数：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.abovegroundLayer}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">地下层数：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.undergroundLayer}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">地上层高：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.abovegroundHeight}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">地下层高：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.undergroundHeight}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">总 层 数：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.totalHeight}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">檐    高：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.eavesHeight}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">内墙面装修：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.insideDecoration}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">外墙面装修：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.outsideDecoration}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">天棚装修：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.skylightDecoration}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">楼地面装修：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.floorDecoration}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">门：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.door}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm6">
					<label class="layui-form-label">窗：</label>
					<div class="layui-input-block">
						<input htmlEscape="false" readonly="true" class="form-control layui-input" value="${workExample.window}"/>
					</div>
				</div>
				<div class="layui-item layui-col-sm12  with-textarea">
					<label class="layui-form-label">其他说明：</label>
					<div class="layui-input-block">
						<textarea  htmlEscape="false" rows="4" readonly="true"    class="form-control ">${workExample.instruction}</textarea>
					</div>
				</div>
				<script>
                    resizeFormWindow();
                    $(window).resize(function(){
                        resizeFormWindow();
                    });
				</script>
			</div>

			<div id="_single" style="display: none" class="form-group layui-row first lw7">
				<div class="form-group-label"><h2>单项工程造价指标</h2></div>
				<div class="layui-input-block">
					<table id="info" class="table table-bordered table-condensed can-edit">
						<thead>
						<tr>
							<th width="30%">费用名称</th>
							<th width="18%">金额（元）</th>
							<th width="18%">单位造价（元/㎡）</th>
							<th width="18%">占造价比例（%）</th>
						</tr>
						</thead>
						<tbody id="exampleSingleList">

						</tbody>
					</table>
					<script type="text/template" id="exampleSingleTpl">//<!--
                                <tr id="exampleSingleList{{idx}}">
                                    <td class="hide">
                                        <input id="exampleSingleList{{idx}}_id" name="exampleSingleList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                        <input id="exampleSingleList{{idx}}_delFlag" name="exampleSingleList[{{idx}}].delFlag" type="hidden" value="0"/>
                                    </td>
                                    <td>
                                    	<input id="exampleSingleList{{idx}}_exampleId" name="exampleSingleList[{{idx}}].exampleId" type="hidden" value="{{row.exampleId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleSingleList{{idx}}_exampleIndicesId" name="exampleSingleList[{{idx}}].exampleIndicesId" type="hidden" value="{{row.exampleIndicesId}}" class="form-control"/>
                                    	<input id="exampleSingleList{{idx}}_indexId" name="exampleSingleList[{{idx}}].indexId" type="hidden" value="{{row.indexId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleSingleList{{idx}}_digits" name="exampleSingleList[{{idx}}].digits" type="hidden" value="{{row.digits}}" readonly="true" class="form-control"/>
                                    	<input id="exampleSingleList{{idx}}_unit" name="exampleSingleList[{{idx}}].unit" type="hidden" value="{{row.unit}}" readonly="true" class="form-control"/>
                                        <input id="exampleSingleList{{idx}}_name" name="exampleSingleList[{{idx}}].name" type="text" value="{{row.name}}" readonly="true" class="form-control layui-input required"/>
                                    </td>
									<td width="100">
                                        <input id="exampleSingleList{{idx}}_money" name="exampleSingleList[{{idx}}].money" style="text-align:right" onchange="setCost(this)" type="text" value="{{row.money}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                    <td width="150">
                                        <input id="exampleSingleList{{idx}}_cost" name="exampleSingleList[{{idx}}].cost" style="text-align:right" type="text" value="{{row.cost}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                    <td width="150">
                                        <input id="exampleSingleList{{idx}}_proportion" name="exampleSingleList[{{idx}}].proportion" style="text-align:right" type="text" value="{{row.proportion}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                </tr>//-->
					</script>
				</div>
				<script>
                    resizeFormWindow();
                    $(window).resize(function(){
                        resizeFormWindow();
                    });
				</script>
			</div>

			<div id="_economics" style="display: none" class="form-group layui-row first lw7">
				<div class="form-group-label"><h2>经济指标</h2></div>
				<div class="layui-input-block">
					<table id="info_Economics" class="table table-bordered table-condensed can-edit">
						<thead>
						<tr>
							<th width="30%">主要分项工程</th>
							<th width="18%">工程造价（元）</th>
							<th width="18%">单位造价（元/㎡）</th>
							<th width="18%">占造价比例（%）</th>
						</tr>
						</thead>
						<tbody id="exampleEconomicsList">

						</tbody>
					</table>
					<script type="text/template" id="exampleEconomicsTpl">//<!--
                                <tr id="exampleEconomicsList{{idx}}">
                                    <td class="hide">
                                        <input id="exampleEconomicsList{{idx}}_id" name="exampleEconomicsList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                        <input id="exampleEconomicsList{{idx}}_delFlag" name="exampleEconomicsList[{{idx}}].delFlag" type="hidden" value="0"/>
                                    </td>
                                    <td>
                                    	<input id="exampleEconomicsList{{idx}}_exampleId" name="exampleEconomicsList[{{idx}}].exampleId" type="hidden" value="{{row.exampleId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleEconomicsList{{idx}}_exampleindicesId" name="exampleEconomicsList[{{idx}}].exampleindicesId" type="hidden" value="{{row.exampleindicesId}}" class="form-control"/>
                                    	<input id="exampleEconomicsList{{idx}}_indexId" name="exampleEconomicsList[{{idx}}].indexId" type="hidden" value="{{row.indexId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleEconomicsList{{idx}}_digits" name="exampleEconomicsList[{{idx}}].digits" type="hidden" value="{{row.digits}}" readonly="true" class="form-control"/>
                                    	<input id="exampleEconomicsList{{idx}}_unit" name="exampleEconomicsList[{{idx}}].unit" type="hidden" value="{{row.unit}}" readonly="true" class="form-control"/>
                                        <input id="exampleEconomicsList{{idx}}_name" name="exampleEconomicsList[{{idx}}].name" type="text" value="{{row.name}}" readonly="true" class="form-control layui-input required"/>
                                    </td>
									<td width="100">
                                        <input id="exampleEconomicsList{{idx}}_money" name="exampleEconomicsList[{{idx}}].money" style="text-align:right" onchange="setCostEconomics(this)" type="text" value="{{row.money}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                    <td width="150">
                                        <input id="exampleEconomicsList{{idx}}_cost" name="exampleEconomicsList[{{idx}}].cost" style="text-align:right" type="text" value="{{row.cost}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                    <td width="150">
                                        <input id="exampleEconomicsList{{idx}}_proportion" name="exampleEconomicsList[{{idx}}].proportion" style="text-align:right" type="text" value="{{row.proportion}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                </tr>//-->
					</script>
				</div>
				<script>
                    resizeFormWindow();
                    $(window).resize(function(){
                        resizeFormWindow();
                    });
				</script>
			</div>

			<div id="_project" style="display: none" class="form-group layui-row first lw7">
				<div class="form-group-label"><h2>主要工程量指标</h2></div>
				<div class="layui-input-block">
					<table id="info_Project" class="table table-bordered table-condensed can-edit">
						<thead>
						<tr>
							<th width="30%">工料名称</th>
							<th width="15%">单位</th>
							<th width="15%">数量</th>
							<th width="15%">单位指标(每100㎡)</th>
						</tr>
						</thead>
						<tbody id="exampleProjectList">

						</tbody>
					</table>
					<script type="text/template" id="exampleProjectTpl">//<!--
                                <tr id="exampleProjectList{{idx}}">
                                    <td class="hide">
                                        <input id="exampleProjectList{{idx}}_id" name="exampleProjectList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                        <input id="exampleProjectList{{idx}}_delFlag" name="exampleProjectList[{{idx}}].delFlag" type="hidden" value="0"/>
                                    </td>
                                    <td>
                                    	<input id="exampleProjectList{{idx}}_exampleId" name="exampleProjectList[{{idx}}].exampleId" type="hidden" value="{{row.exampleId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleProjectList{{idx}}_exampleindicesId" name="exampleProjectList[{{idx}}].exampleindicesId" type="hidden" value="{{row.exampleindicesId}}" class="form-control"/>
                                    	<input id="exampleProjectList{{idx}}_indexId" name="exampleProjectList[{{idx}}].indexId" type="hidden" value="{{row.indexId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleProjectList{{idx}}_digits" name="exampleProjectList[{{idx}}].digits" type="hidden" value="{{row.digits}}" readonly="true" class="form-control"/>
                                        <input id="exampleProjectList{{idx}}_name" name="exampleProjectList[{{idx}}].name" type="text" value="{{row.name}}" readonly="true" class="form-control layui-input required"/>
                                    </td>
                                     <td width="150">
                                        <input id="exampleProjectList{{idx}}_unit" name="exampleProjectList[{{idx}}].unit" type="text" value="{{row.unit}}"  readonly="true"  class="form-control layui-input "/>
                                    </td>
									<td width="100">
                                        <input id="exampleProjectList{{idx}}_count" name="exampleProjectList[{{idx}}].count" style="text-align:right" onchange="setCostProject(this)" type="text" value="{{row.count}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>

                                    <td width="150">
                                        <input id="exampleProjectList{{idx}}_quota" name="exampleProjectList[{{idx}}].quota" style="text-align:right" type="text" value="{{row.quota}}" readonly="true"   class="form-control layui-input number"/>
                                    </td>
                                </tr>//-->
					</script>
				</div>
				<script>
                    resizeFormWindow();
                    $(window).resize(function(){
                        resizeFormWindow();
                    });
				</script>
			</div>

			<div id="_expend" style="display: none" class="form-group layui-row first lw7">
				<div class="form-group-label"><h2>主要工料价格及消耗量指标</h2></div>
				<div class="layui-input-block">
					<table id="info_Expend" class="table table-bordered table-condensed can-edit">
						<thead>
						<tr>
							<th width="25%">工料名称</th>
							<th width="10%">单位</th>
							<th width="10%">数量</th>
							<th width="10%">单价(元)</th>
							<th width="15%">单位指标(每100㎡)</th>
							<th width="20%">备注</th>
						</tr>
						</thead>
						<tbody id="exampleExpendList">

						</tbody>
					</table>
					<script type="text/template" id="exampleExpendTpl">//<!--
                                <tr id="exampleExpendList{{idx}}">
                                    <td class="hide">
                                        <input id="exampleExpendList{{idx}}_id" name="exampleExpendList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                        <input id="exampleExpendList{{idx}}_delFlag" name="exampleExpendList[{{idx}}].delFlag" type="hidden" value="0"/>
                                    </td>
                                    <td>
                                    	<input id="exampleExpendList{{idx}}_exampleId" name="exampleExpendList[{{idx}}].exampleId" type="hidden" value="{{row.exampleId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleExpendList{{idx}}_exampleindicesId" name="exampleExpendList[{{idx}}].exampleindicesId" type="hidden" value="{{row.exampleindicesId}}" class="form-control"/>
                                    	<input id="exampleExpendList{{idx}}_indexId" name="exampleExpendList[{{idx}}].indexId" type="hidden" value="{{row.indexId}}" readonly="true" class="form-control"/>
                                    	<input id="exampleExpendList{{idx}}_digits" name="exampleExpendList[{{idx}}].digits" type="hidden" value="{{row.digits}}" readonly="true" class="form-control"/>
                                        <input id="exampleExpendList{{idx}}_name" name="exampleExpendList[{{idx}}].name" type="text" value="{{row.name}}" readonly="true" class="form-control layui-input required"/>
                                    </td>
                                     <td width="150">
                                        <input id="exampleExpendList{{idx}}_unit" name="exampleExpendList[{{idx}}].unit" type="text" value="{{row.unit}}"  readonly="true"  class="form-control layui-input "/>
                                    </td>
									<td width="100">
                                        <input id="exampleExpendList{{idx}}_count" name="exampleExpendList[{{idx}}].count" style="text-align:right" onchange="setCostProject(this)" type="text" value="{{row.count}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
									<td width="100">
                                        <input id="exampleExpendList{{idx}}_price" name="exampleExpendList[{{idx}}].price" style="text-align:right" type="text" value="{{row.price}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                    <td width="150">
                                        <input id="exampleExpendList{{idx}}_quota" name="exampleExpendList[{{idx}}].quota" style="text-align:right" type="text" value="{{row.quota}}"  readonly="true"  class="form-control layui-input number"/>
                                    </td>
                                    <td width="150">
                                        <input id="exampleExpendList{{idx}}_remarks" name="exampleExpendList[{{idx}}].remarks" type="text" value="{{row.remarks}}"  maxlength="100" readonly="true" class="form-control layui-input"/>
                                    </td>
                                </tr>//-->
					</script>
					<script type="text/javascript">
                        var exampleExpendRowIdx = 0, exampleExpendTpl = $("#exampleExpendTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        $(document).ready(function() {
                            var data = ${fns:toJson(workExample.exampleExpendList)};
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    addRow('#exampleExpendList', exampleExpendRowIdx, exampleExpendTpl, data[i]);
                                    exampleExpendRowIdx = exampleExpendRowIdx + 1;
                                }
                            }
                        });
                        var exampleProjectRowIdx = 0, exampleProjectTpl = $("#exampleProjectTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        $(document).ready(function() {
                            var data = ${fns:toJson(workExample.exampleProjectList)};
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    addRow('#exampleProjectList', exampleProjectRowIdx, exampleProjectTpl, data[i]);
                                    exampleProjectRowIdx = exampleProjectRowIdx + 1;
                                }
                            }
                        });
                        var exampleEconomicsRowIdx = 0, exampleEconomicsTpl = $("#exampleEconomicsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        $(document).ready(function() {
                            var data = ${fns:toJson(workExample.exampleEconomicsList)};
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    addRow('#exampleEconomicsList', exampleEconomicsRowIdx, exampleEconomicsTpl, data[i]);
                                    exampleEconomicsRowIdx = exampleEconomicsRowIdx + 1;
                                }
                            }
                        });
                        var exampleSingleRowIdx = 0, exampleSingleTpl = $("#exampleSingleTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        $(document).ready(function() {
                            var data = ${fns:toJson(workExample.exampleSingleList)};
                            if(data !=null){
                                for (var i=0; i<data.length; i++){
                                    addRow('#exampleSingleList', exampleSingleRowIdx, exampleSingleTpl, data[i]);
                                    exampleSingleRowIdx = exampleSingleRowIdx + 1;
                                }
                            }
                        });
					</script>
				</div>
				<script>
                    resizeFormWindow();
                    $(window).resize(function(){
                        resizeFormWindow();
                    });
				</script>
			</div>

			<div class="form-group layui-row page-end"></div>
		</form:form>
	</div>
</div>
</body>
</html>