<%@ 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">
        $.fn.serializeJson=function(){
            var serializeObj={};
            var array=this.serializeArray();
            var str=this.serialize();
            $(array).each(function(){
                if(serializeObj[this.name]){
                    if($.isArray(serializeObj[this.name])){
                        serializeObj[this.name].push(this.value);
                    }else{
                        serializeObj[this.name]=[serializeObj[this.name],this.value];
                    }
                }else{
                    serializeObj[this.name]=this.value;
                }
            });
            return serializeObj;
        };

        var validateForm;
        var detailFlag =0;
        function doSubmit(){//回调函数，在编辑和保存动作时，供openDialog调用提交表单。
            if(validateForm.form()){
                if(detailFlag==1){
                    $("#contentDeta").val(encodeURIComponent(genDetailStr()));
                }
                $(document.getElementById("projectContentData.type")).removeAttr("disabled");
                $("#inputForm").submit();
                return true;
            }

            return false;
        }
        $(function() {
            var editVal = '${projectcontentinfo.edit}';
            if('edit'==editVal){
                parent.parent.refreshTrees();
            }

            if($("#createDate").val()==null || $("#createDate").val()==''){
                $("#createDate").val(getNowFormatDate());
            }
            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: '#createDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });*/
            changeContentDetail("${projectcontentinfo.projectContentData.type}");
            var tp = "${projectcontentinfo.dictType}";
            var tp2 = "${projectcontentinfo.projectContentData.id}"
            if((tp!=null && tp!='')||(tp2!=null && tp2!='')){
                $(document.getElementById("projectContentData.type")).attr("disabled","disabled");
            }
            initControlData("1");
        });

        function openDialogre(title,url,width,height,formId){

            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: [width, height],
                title: title,
                skin: 'three-btns',
                maxmin: true, //开启最大化最小化按钮
                content: url ,
                btn: ['提交','关闭'],
                btn1: function(index, layero){
                    var body = top.layer.getChildFrame('body', index);
                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var inputForm = body.find('#inputForm');
                    var top_iframe;
                    inputForm.attr("action","${ctx}/projectcontentinfo/projectcontentinfo/ajaxsaveBaseData");//表单提交成功后，从服务器返回的url在当前tab中展示
                    var $document = iframeWin.contentWindow.document;
                    formSubmitAjax($document,formId,index);
                },
                btn2: function(index){
                }
            });
        }

        function formSubmitAjax($document,inputForm,index){
            var validateForm = $($document.getElementById(inputForm)).validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $($document.getElementById("#messageBox")).text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
            if(validateForm.form()){
                $($document.getElementById(inputForm)).ajaxSubmit({
                    success:function(data) {
                        if(!data.success){
                            top.layer.msg("保存依据资料信息异常!",{icon:2});
                            return false;
                        }
                        var idx = $("#workBaseDataList tr").length;
                        addRowBaseData("#workBaseDataList",idx,workBaseDataTpl,data.body.workBasedData);
                        parent.layer.msg(data.msg,{icon:1});
                        top.layer.close(index)
                    }
                });
            }
        }

        function getNowFormatDate() {
            var date = new Date();
            var seperator1 = "-";
            var month = date.getMonth() + 1;
            var strDate = date.getDate();
            month = (month < 10)?"0"+month:month;
            strDate = (strDate < 10)?"0"+strDate:strDate;
            var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
            return currentdate;
        }
        
        function changeContentDetail(val) {
            var param2 = {'contentId':"${projectcontentinfo.projectContentData.id}",'projectId':"${projectcontentinfo.project.id}","view":"view"};
            detailFlag=1;
            switch (val){
                case '13':
                case '22':
                case '25':
                    $("#contentDetail").load("${ctx}/workcontentinvestmentcost/workContentInvestmentCost/list",param2);
                    break;
                case '31':
                    $("#contentDetail").load("${ctx}/workcontent/workContentContprogram/form",param2);
                    break;
                case '32':
                    $("#contentDetail").load("${ctx}/workcontent/workContentBiddingplan/form",param2);
                    break;
                case '34':
                    $("#contentDetail").load("${ctx}/workcontent/workContentCtrlprice/form",param2);
                    break;
                case '41':
                    $("#contentDetail").load("${ctx}/workcontent/workContentContractinfo/form",param2);
                    break;
                case '42':
                    $("#contentDetail").load("${ctx}/workcontent/workContentPricemanage/form",param2);
                    break;
                case '43':
                    $("#contentDetail").load("${ctx}/workcontent/workContentAltermanage/form",param2);
                    break;
                case '46':
                    $("#contentDetail").load("${ctx}/workcontent/workContentClaim/form",param2);
                    break;
                case '47':
                    $("#contentDetail").load("${ctx}/workcontent/workContentFundplan/form",param2);
                    break;
                case '48':
                    $("#contentDetail").load("${ctx}/workcontent/workContentProjectprice/form",param2);
                    break;
                case '49':
                    $("#contentDetail").load("${ctx}/workcontent/workContentPriceadjust/form",param2);
                    break;
                case '52':
                    $("#contentDetail").load("${ctx}/workcontent/workContentBudget/form",param2);
                    break;
                case '53':
                    $("#contentDetail").load("${ctx}/workcontent/workContentDocument/form",param2);
                    break;
                default:
                    detailFlag=0;
                    $("#contentDetail").html("");
                    break;
            }

        }

        function addFile() {
            $("#attachment_file").click();
        }

        function insertTitle(tValue){
            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
            var attachmentId = $(document.getElementById('projectContentData.id')).val();
            var attachmentFlag = "94";
            /*console.log(file);*/
            var timestamp=new Date().getTime();

            var storeAs = "attachment-file/projectContentData/"+timestamp+"/"+file['name'];
            var uploadPath="http://gangwan-app.oss-cn-hangzhou.aliyuncs.com/"+storeAs;/*将这段字符串存到数据库即可*/
            var divId = "_attachment";
            $("#addFile"+divId).show();
            multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,divId,0);}
        }

        function openDialogreControl(title,url,width,height,target){
            if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){//如果是移动端，就使用自适应大小弹窗
                width='auto';
                height='auto';
            }else{//如果是PC端，根据用户设置的width和height显示。

            }
            top.layer.open({
                type: 2,
                area: [width, height],
                title: title,
                skin: 'three-btns',
                maxmin: true, //开启最大化最小化按钮
                content: url ,
                btn: ['提交','关闭'],
                btn1: function(index, layero){
                    var body = top.layer.getChildFrame('body', index);
                    var iframeWin = layero.find('iframe')[0]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
                    var inputForm = body.find('#inputForm');
                    var top_iframe;
                    if(target){
                        top_iframe = target;//如果指定了iframe，则在改frame中跳转
                    }else{
                        top_iframe = top.getActiveTab().attr("name");//获取当前active的tab的iframe
                    }
                    inputForm.attr("target",top_iframe);//表单提交成功后，从服务器返回的url在当前tab中展示
                    var $document = iframeWin.contentWindow.document;
                    var index1 = parent.layer.load(0, {shade: [0.1, 'tranparent']});
                    formSubmit($document,"inputForm",index,index1);
                },
                btn2: function(index){
                    parent.layer.close(index)
                },
                end:function(index){
                    parent.layer.close(index)
                }
            });
        }
        function formSubmit($document,inputForm,index,index1){
            var validateForm = $($document.getElementById(inputForm)).validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $($document.getElementById("#messageBox")).text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
            if(validateForm.form()){
                $($document.getElementById(inputForm)).ajaxSubmit({
                    success:function(data) {
                        parent.parent.layer.msg("操作成功",{icon:1})
                        parent.parent.layer.close(index1)
                        parent.layer.close(index1)
                        parent.parent.layer.close(index)
                        parent.layer.close(index)
                        initGetControlData();
                    },error:function(){
                        parent.parent.layer.msg("操作失败",{icon:2})
                        parent.parent.layer.close(index1)
                        parent.layer.close(index1)
                        parent.parent.layer.close(index)
                        parent.layer.close(index)
                        initControlData("1");
                    }
                });
            }else {
                parent.parent.layer.msg("信息未填写完整!", {icon: 2});
                parent.layer.close(index1)
                parent.parent.layer.close(index1)
            }
        }
        /**
         * 删除临时数据
         */
        function initControlData(obj,othis,del,tableId){
            if(del == "del"){
                proId = tableId;
			}else{
                proId = "";
			}
            $.ajax({
                type:'post',
                url:'${ctx}/projectcontroltable/projectControlTable/delControlData',
                data:{
                    "projectId":"${projectcontentinfo.project.id}",
					"projectContentId":proId,
					"flag":del
                },
                success:function(data){
                    if(obj != "1"){
                        if(data.flag){
                            //$(othis).parent().parent().parent().remove();
                            parent.layer.msg("数据删除成功",{icon:1})
                            $(othis).remove()
                        }else{
                            parent.layer.msg("数据删除失败",{icon:2})
                        }
                    }
                }
            })
        }

        function getMatchDate(str){
//            var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1])) (?:(?:[0-2][0-3])|(?:[0-1][0-9])):[0-5][0-9]:[0-5][0-9]$/;
            var reDateTime = /^(?:19|20)[0-9][0-9]-(?:(?:0[1-9])|(?:1[0-2]))-(?:(?:[0-2][1-9])|(?:[1-3][0-1]))/
            var date = (""+str).match(reDateTime);
            if(date){
                return date[0]
            }else{
                return "";
            }
        }

        /**
         * 获取临时数据
         * @param obj
         * @param othis
         */
        function initGetControlData(){
            $.ajax({
                type:'post',
                url:'${ctx}/projectcontroltable/projectControlTable/getControlData',
                data:{
                    "projectId":"${projectcontentinfo.project.id}",
                    "proId":"${projectcontentinfo.projectContentData.id}"
                },
                success:function(data){
                    if(data){
                        var htmlStr = '';
                        data = data.list.projectControlTableList;
                        for(var i=0;i<data.length;i++){
                            htmlStr += "<tr id='tr"+i+"'>"+
                                "   <td style='text-align:center;'>"+
                                "	   "+data[i].tName+
                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].id' value='"+data[i].id+"'>"+
                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].tName' value='"+data[i].tName+"'>"+
                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].processName' value='"+data[i].processName+"'>"+
                                "	   <input type='hidden' name='projectContentData.projectControlTableList["+i+"].pfId' value='"+data[i].pfId+"'>"+
                                "   </td>"+
                                "   <td style='text-align:center;'>" +
                                "  			"+data[i].processName+
                                "	   		<input type='hidden' name='projectContentData.projectControlTableList["+i+"].tType' value='"+data[i].tType+"'>"+
                                "	</td>"+
                                "   <td style='text-align:center;'>"+
                                "  		"+data[i].tUser.name+
                                "   </td>"+
                                "   <td style='text-align:center;'>"+
                                "  "+ getMatchDate(data[i].createDate)+
                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].createDate' value='"+data[i].createDate+"'>"+
                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].updateDate' value='"+data[i].updateDate+"'>"+
                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].delFlag' value='"+data[i].delFlag+"'>"+
                                //										"	    <input type='hidden' name='projectControlTableList["+i+"].createBy.id' value='"+data[i].createBy.id+"'>"+
                                "   </td>"+
                                "   <td style='text-align:center;'>"+
                                "   	<a href='javascript:void(0)' onclick=\"openDialogView('查看过程控制明细', '${ctx}/projectcontroltable/projectControlTable/form?view=view&id="+data[i].id+"','80%', '80%')\" class='btn btn-info btn-xs' ><i class='fa fa-search-plus'></i> 查看</a>"+
                                "  		<a href=\"javascript:initControlData('0','#tr"+i+"','del','"+data[i].id+"')\" onclick=\"return confirmx('确认要删除该过程控制数据吗？', this.href)\"   class='btn btn-danger btn-xs'><i class='fa fa-trash'></i> 删除</a>"+
                                "  </td>"+
                                "</tr>";
                        }
                        if(htmlStr){
                            $("#projectControlTables").html(htmlStr);
                        }
                    }
                }
            })
        }
    </script>
</head>
<body>
<div class="single-form">
    <div class="container${container} view-form">
        <form:form id="inputForm" modelAttribute="projectcontentinfo" action="${ctx}/projectcontentinfo/projectcontentinfo/save?view=content" method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <div class="form-group layui-row first lw12">
                <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="${projectcontentinfo.projectContentData.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="${projectcontentinfo.projectContentData.number}"/>
                    </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">
                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${fns:getContentTypeName(projectcontentinfo.projectContentData.type,"")}"/>
                    </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">
                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="${projectcontentinfo.projectContentData.master.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">
                        <input htmlEscape="false" readonly="true" class="form-control layui-input" value="<fmt:formatDate value="${projectcontentinfo.projectContentData.createDate}" pattern="yyyy-MM-dd"/>"/>
                    </div>
                </div>
            </div>
            <div class="form-group layui-row">
                <div class="form-group-label"><h2>内容详情</h2></div>
                <div style="padding: 0 15px;">
                    <div id="contentDetail"></div>
                </div>
            </div>
            <div class="form-group layui-row">
                <div class="form-group-label"><h2>依据性资料明细</h2></div>
                <div class="layui-item layui-col-xs12 form-table-container">
                    <table id="contentTableBase" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                            <th class="hide"></th>
                            <th >资料编号</th>
                            <th >资料名称</th>
                            <th >资料类别</th>
                            <th >上传人</th>
                            <th >上传日期</th>
                        </tr>
                        </thead>
                        <tbody id="workBaseDataList">
                        <c:forEach items="${projectcontentinfo.projectContentData.projectBasedDataList}" var="projectBasedData" varStatus="idx">
                            <tr>
                                <td class="hide">
                                    <input type="hidden" id="workBaseDataList${idx.index}_id" value="${projectBasedData.id}">
                                </td>
                                <td style="text-align:center;">
                                        ${projectBasedData.number}
                                </td>
                                <td style="text-align:center;">
                                        ${projectBasedData.name}
                                </td>
                                <td style="text-align:center;">
                                        ${fns:getDictLabel(projectBasedData.type, 'project_document_type', '')}
                                </td>
                                <td style="text-align:center;">
                                        ${projectBasedData.uploadUser.name}
                                </td>
                                <td style="text-align:center;">
                                    <fmt:formatDate value="${projectBasedData.uploadDate}" pattern="yyyy-MM-dd"/>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <script type="text/template" id="workBaseDataTpl">//<!--
                <tr id="budgetList{{idx}}">
                    <td class="hide">
                        <input id="workBaseDataList{{idx}}_id" name="projectContentData.projectBasedDataList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                        <input id="workBaseDataList{{idx}}_number" name="projectContentData.projectBasedDataList[{{idx}}].number" type="hidden" value="{{row.number}}"/>
                        <input id="workBaseDataList{{idx}}_name" name="projectContentData.projectBasedDataList[{{idx}}].name" type="hidden" value="{{row.name}}"/>
                        <input id="workBaseDataList{{idx}}_type" name="projectContentData.projectBasedDataList[{{idx}}].type" type="hidden" value="{{row.type}}"/>
                    </td>
                    <td style="text-align:center;">
                        {{row.number}}
                    </td>
                    <td style="text-align:center;">
                        {{row.name}}
                    </td>
                    <td style="text-align:center;">
                        {{row.typeLabel}}
                    </td>
                    <td style="text-align:center;">
                        {{row.uploadUser.name}}
                    </td>
                    <td style="text-align:center;">
                        {{row.uploadDate}}
                    </td>
                    <td class="text-center" width="10">
                        <a href="#" onclick="delRowBaseData(this, '#workBaseDataList{{idx}}','{{row.uploadUser.id}}')"   class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> 取消</a>
                    </td>
                </tr>//-->
            </script>
            <script type="text/javascript">
                var workBaseDataTpl = $("#workBaseDataTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                function setValuee(obj){
                    var idx = $("#workBaseDataList tr").length;
                    if(existBaseData(obj.id,idx)) {
                        return;
                    }
                    addRowBaseData("#workBaseDataList",idx,workBaseDataTpl,obj);
                }

                function existBaseData(id,length) {
                    for (var i=0;i<length;i++) {
                        var val = $('#workBaseDataList'+i+'_id').val();
                        if(id==val){
                            return true;
                        }
                    }
                    return false;
                }

                function addRowBaseData(list, idx, tpl, row){
                    bornTemplete(list, idx, tpl, row, idx);
                }

                function bornTemplete(list, idx, tpl, row, idx1){
                    var idx1 = $("#workBaseDataList 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 delRowBaseData(obj, prefix,userId){
                    var id = $(prefix+"_id").val();
                   /* var createBy = $(prefix+"_userId").val();*/
                    var currentUser = '${fns:getUser().id}';
                    var contentId = '${projectcontentinfo.projectContentData.id}';
                    console.log(contentId);
                    if(contentId!=null&&contentId!=''){
                        $.ajax({
                            type:"post",
                            url:'${ctx}/projectcontentinfo/projectContentData/ajaxdelete',
                            data:{"contentId":contentId,"basedId":id},
                            dataType:"json",
                            success:function(data){
                                if(data.success) {
                                    $(obj).parent().parent().remove();
                                    parent.parent.refreshTrees();
                                    if(data.body.inuse){
                                        return;
                                    }
                                    if (currentUser == userId) {
                                        confirmDelete('是否同步删除资料库的文件？','${ctx}/projectcontentinfo/projectcontentinfo/delete?infoId='+id+'&id=${projectcontentinfo.id}&type=1');
                                    }
                                }else {
                                    top.layer.msg("删除依据资料失败！", {icon: 0});
                                }
                            }
                        })
                        return;
                    }
                }

                function confirmDelete(mess, href){
                    top.layer.confirm(mess, {icon: 3, title:'系统提示'}, function(index){
                        //do something
                        if (typeof href == 'function') {
                            href();
                        }else{
                            $.ajax({
                                url:href,
                                type:"post",
                                success:function(data){
                                    if(data.success){
                                        top.layer.msg("删除依据资料成功！", {icon: 0});
                                    }
                                }
                            });
                        }
                        top.layer.close(index);
                    });
                    return false;
                }
            </script>
            <div class="form-group layui-row">
                <div class="form-group-label"><h2>过程控制明细</h2></div>
                <div class="layui-item layui-col-xs12 form-table-container">
                    <table id="contentTable" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                            <th  >表格名称</th>
                            <th  >表格类型</th>
                            <th  >负责人</th>
                            <th  >创建日期</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="projectControlTables">
                        <c:choose>
                            <c:when test="${not empty projectcontentinfo.projectContentData.projectControlTableList}">
                                <c:forEach items="${projectcontentinfo.projectContentData.projectControlTableList}" var="projectControlTable" varStatus="status">
                                    <tr id="tr${status.index}">
                                        <td style="text-align:center;">
                                                ${projectControlTable.tName}
                                            <input type="hidden" name="projectContentData.projectControlTableList[${status.index}].id" value="${projectControlTable.id}">
                                            <input type="hidden" name="projectContentData.projectControlTableList[${status.index}].tName" value="${projectControlTable.tName}">
                                            <input type="hidden" name="projectContentData.projectControlTableList[${status.index}].pfId" value="${projectControlTable.pfId}">
                                        </td>
                                        <td style="text-align:center;">
                                                ${projectControlTable.processName}
                                            <input type="hidden" name="projectContentData.projectControlTableList[${status.index}].tType" value="${projectControlTable.tType}">
                                        </td>
                                        <td style="text-align:center;">
                                                ${projectControlTable.tUser.name}
                                        </td>
                                        <td style="text-align:center;">
                                            <fmt:formatDate value="${projectControlTable.createDate}" pattern="yyyy-MM-dd" />
                                                <%--<input type="hidden" name="projectControlTableList[${status.index}].createDate" value="${projectControlTable.createDate}">--%>
                                                <%--<input type="hidden" name="projectControlTableList[${status.index}].updateDate" value="${projectControlTable.updateDate}">--%>
                                                <%--<input type="hidden" name="projectControlTableList[${status.index}].delFlag" value="${projectControlTable.delFlag}">--%>
                                                <%--<input type="hidden" name="projectControlTableList[${status.index}].createBy.id" value="${projectControlTable.createBy.id}">--%>
                                        </td>
                                        <td class="op-td text-center">
                                                <%--<shiro:hasPermission name="projectcontentinfo:projectBasedData:view">--%>
                                            <a href="#" onclick="openDialogView('查看过程控制明细', '${ctx}/projectcontroltable/projectControlTable/form?id=${projectControlTable.id}&view=view','80%', '80%')" class="op-btn op-btn-view" ><i class="fa fa-search-plus"></i> 查看</a>
                                                <%--</shiro:hasPermission>--%>
                                                <%--<shiro:hasPermission name="projectcontentinfo:projectBasedData:del">--%>
                                                <%--</shiro:hasPermission>--%>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr>
                                    <td colspan="5" align="center">暂无数据</td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="form-group layui-row">
                <div class="form-group-label"><h2>附件信息</h2></div>
                <div class="layui-item layui-col-xs12 form-table-container" >
                    <table id="contentTable1" class="table table-bordered table-condensed details">
                        <thead>
                        <tr>
                            <th>文件名称</th>
                            <th>上传人</th>
                            <th>上传时间</th>
                            <th width="150px">操作</th>
                        </tr>
                        </thead>
                        <tbody id="file_attachment">
                        <c:forEach items="${projectcontentinfo.projectContentData.workAttachments}" var = "workAttachment" varStatus="status">
                            <tr>
                                <c:choose>
                                    <c:when test="${fn:containsIgnoreCase(workAttachment.attachmentName,'jpg')
                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'png')
                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'gif')
                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'bmp')
                                                                           or fn:containsIgnoreCase(workAttachment.attachmentName,'jpeg')}">
                                        <td><img src="${workAttachment.url}" width="50" height="50" alt="${workAttachment.attachmentName}"/></td>
                                    </c:when>
                                    <c:otherwise>
                                        <c:choose>
                                            <c:when test="${fn:containsIgnoreCase(workAttachment.attachmentName,'pdf')}">
                                                <td><a href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','80%','80%','1')">${workAttachment.attachmentName}</a></td>
                                            </c:when>
                                            <c:otherwise>
                                                <td><a href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','80%','80%')">${workAttachment.attachmentName}</a></td>
                                            </c:otherwise>
                                        </c:choose>
                                    </c:otherwise>
                                </c:choose>
                                <td>${workAttachment.createBy.name}</td>
                                <td><fmt:formatDate value="${workAttachment.createDate}" type="both"/></td>
                                <td class="op-td">
                                    <a href="javascript:location.href='${ctx}/workfullmanage/workFullManage/downLoadAttach?file='+encodeURIComponent('${workAttachment.url}');" class="op-btn op-btn-download"><i class="fa fa-download"></i>&nbsp;下载</a>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
        </form:form>
    </div>
</div>
</body>
</html>