<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>过程控制表管理</title>
	<meta name="decorator" content="default"/>
    <link href="${ctxStatic}/summernotenew/summernote.css" rel="stylesheet">
    <link href="${ctxStatic}/summernotenew/summernote-bs3.css" rel="stylesheet">
    <script src="${ctxStatic}/summernotenew/summernote.min.js"></script>
    <script src="${ctxStatic}/summernotenew/lang/summernote-zh-CN.js"></script>
    <%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
	<script type="text/javascript">
		$(document).ready(function() {
            checkContentKeyUp('takanre',512);
            if($("#createDate").val()==null || $("#createDate").val()==''){
                $("#createDate").val(getNowFormatDate());
            }
            switchType("#tType");
            //富文本初始化
            $('.summernote').summernote({
                lang: 'zh-CN',
                height:'300px',
                minHeight:'300px'
            });
            $("#attachment_btn").click(function () {
                $("#attachment_file").click();
            });
            laydate.render({
                elem: '#billHandTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
            laydate.render({
                elem: '#askTime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
		});
        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 switchType(othis){
            if(!$(othis).find("option:selected").val()){
                return
            }
            clearVal();
            if($(othis).find("option:selected").text() == "设备询价记录"){
                $("#d1").show();
                $("#d1").siblings().hide();
                $("#workDeviceRecords").empty()
                $("#askTime").val('');
                $("#askUserId").val('');
                $("#askTimeName").val('');
            }else if($(othis).find("option:selected").text() == "补充资料清单"){
                $("#d2").show();
                $("#d2").siblings().hide();
                $("#content").val('')
            }else if($(othis).find("option:selected").text() == "现场踏勘记录"){
                $("#d3").show();
                $("#d3").siblings().hide();
                $("#takanre").val('')
            }else if($(othis).find("option:selected").text() == "沟通记录表"){
                $("#d4").show();
                $("#d4").siblings().hide();
                $("#workCommunicateRecords").empty()
                $("#comUserId").val('')
                $("#comUserName").val('')
            }else if($(othis).find("option:selected").text() == "工程量计算底稿"){
                $("#d5").show();
                $("#d5").siblings().hide();
                $("#workProjectCalcBuilds").empty()
                $("#workProjectCalcDecors").empty()
            }else if($(othis).find("option:selected").text() == "交接单"){
                $("#d6").show();
                $("#d6").siblings().hide();
                $("#workHandBills").empty()
                $("#billRecUserId").val('')
                $("#billRecUserName").val('')
                $("#billSendUserId").val('')
                $("#billSendUserName").val('')
                $("#billHandTime").val('')
            }

        }
        function clearVal(){
            $("#workProjectCalcBuilds").empty()
            $("#workProjectCalcDecors").empty()
            $("#workCommunicateRecords").empty()
            $("#comUserId").val('')
            $("#comUserName").val('')
            $("#takanre").val('')
            $(".note-editable").html('');
            $("#workDeviceRecords").empty()
            $("#askTime").val('');
            $("#askUserId").val('');
            $("#askTimeName").val('');
        }
        /**
         * 初始化控制数据

        function initControlData(){
            $.ajax({
                type:'post',
                url:'${ctx}/projectcontroltable/projectControlTable/delControlData',
                data:{
                    "projectId":"${projectControlTable.pfId}"
                },
                success:function(data){
                    console.log(data);
                }
            })
        }*/
        function insertTitle(tValue){
            var files = $("#attachment_file")[0].files;            for(var i = 0;i<files.length;i++) {                var file = files[i];
            var attachmentId = $("#id").val();
            var attachmentFlag = "82";
            /*console.log(file);*/
            var timestamp=new Date().getTime();

            var storeAs = "attachment-file/projectRecords/"+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 deleteFileFromAliyun(obj,deleteUrl,addFile){
            $.ajax({
                type:"post",
                url:deleteUrl,
                success:function(data){
                    if(data.str){
                        parent.layer.msg('删除成功',{icon:1});
                        $(obj).parent().parent().parent().remove();
                        if(addFile!=null && typeof(addFile)!= undefined && addFile != ''){
                            $(addFile).hide();
                        }else {
                            $("#addFile_attachment").hide();
                        }
                    }else {
                        parent.layer.msg('删除失败',{icon:2});
                    }
                }
            });
        }

        function addRow(list, idx, tpl, row){
            var idx1 = $("#workDeviceRecords tr").length;
            if(list == '#workDeviceRecords'){
                bornTemplete(list, idx, tpl, row, idx1);
            }
            var idx4 = $("#workCommunicateRecords tr").length;
            if(list == '#workCommunicateRecords'){
                bornTemplete(list, idx, tpl, row, idx4);
            }
            var idx51 = $("#workProjectCalcDecors tr").length;
            if(list == '#workProjectCalcDecors'){
                bornTemplete(list, idx, tpl, row, idx51);
            }
            var idx52 = $("#workProjectCalcBuilds tr").length;
            if(list == '#workProjectCalcBuilds'){
                bornTemplete(list, idx, tpl, row, idx52);
            }
            var idx6 = $("#workHandBills tr").length;
            if(list == '#workHandBills'){
                bornTemplete(list, idx, tpl, row, idx6);
            }
            laydate.render({
                elem: '#workCommunicateContentList'+idx+'_contentDate',
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
        }
        function bornTemplete(list, idx, tpl, row, idx1){
            $(list).append(Mustache.render(tpl, {
                idx: idx, delBtn: true, row: row,
                order:idx1 + 1
            }));
        }
        function delRow(obj, prefix){
            var id = $(prefix+"_id");
            var delFlag = $(prefix+"_delFlag");
            if (id.val() == ""){
                delFlag.val("1");
                $(obj).parent().parent().remove();
            }else if(delFlag.val() == "0"){
                delFlag.val("1");
                $(obj).html("&divide;").attr("title", "撤回删除");
                $(obj).parent().parent().addClass("error");
                $(obj).parent().parent().addClass("hide");
            }else if(delFlag.val() == "1"){
                delFlag.val("0");
                $(obj).parent().parent().removeClass("error");
            }
        }
	</script>

</head>
<body>
<div class="single-form">
    <div class="container">
		<form:form id="inputForm" modelAttribute="projectControlTable" action="${ctx}/projectcontroltable/projectControlTable/save" method="post" class="form-horizontal">
            <form:hidden path="id"/>
            <sys:message content="${message}"/>
            <input type="hidden" name="pfId" id="pfId" value="${projectControlTable.pfId}">
            <div class="form-group layui-row first">
                <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">
                        <form:input path="tName" htmlEscape="false"    class="form-control required layui-input"/>
                    </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">
                        <form:select path="tType" class="form-control layui-input required" onchange="switchType(this)" id="tType">
                            <form:options items="${fns:getContentList()}" itemValue="processNumber" itemLabel="processName"></form:options>
                        </form:select>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6">
                    <label class="layui-form-label">创建时间：</label>
                    <div class="layui-input-block">
                        <input id="createDate" name="createDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date required layui-input"
                               value="<fmt:formatDate value="${projectControlTable.createDate}" pattern="yyyy-MM-dd"/>"/>
                    </div>
                </div>
                <div class="layui-item layui-col-sm6">
                    <label class="layui-form-label">负责人：</label>
                    <div class="layui-input-block">
                        <c:choose>
                            <c:when test="${not empty projectControlTable.tUser}">
                                <input type="text" class="form-control layui-input" style="background:#eee;" disabled="disabled" value="${projectControlTable.tUser.name}" name="tUser.name"/>
                                <input type="hidden" value="${projectControlTable.tUser.id}" name="tUser.id"/>
                            </c:when>
                            <c:otherwise>
                                <input type="text" class="form-control layui-input" style="background:#eee;" disabled="disabled" value="${fns:getUser().name}" name="tUser.name"/>
                                <input type="hidden" value="${fns:getUser().id}" name="tUser.id"/>
                            </c:otherwise>
                        </c:choose>
                    </div>
                </div>
            </div>
            <%-- 不同类型间切换--%>
        <%--<iframe id="controltype" name="controltype" src="" width="100%" scrolling="no" frameborder="0">--%>

        <%--</iframe>--%>
        <div>
            <div id="d1">
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>设备询价记录</h2></div>
                    <div class="layui-item nav-btns">
                        <a class="nav-btn nav-btn-add addBtn" onclick="addRow('#workDeviceRecords', workDeviceRecordsRowIdx, workDeviceRecordsTpl);workDeviceRecordsRowIdx = workDeviceRecordsRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
                    </div>
                    <div class="layui-item layui-col-xs12 form-table-container" >
                        <table class="table table-bordered table-condensed can-edit no-bottom-margin">
                            <thead>
                            <tr>
                                <th><font color="red">*</font>设备名称</th>
                                <th><font color="red">*</font>设备型号</th>
                                <th><font color="red">*</font>单位</th>
                                <th><font color="red">*</font>生产厂家</th>
                                <th><font color="red">*</font>联系电话</th>
                                <th><font color="red">*</font>单价（元）</th>
                                <th>备注</th>
                                <th width="150px">操作</th>
                            </tr>
                            </thead>
                            <tbody id="workDeviceRecords">
                            <c:if test="${not empty projectControlTable.workDeviceXjRecord.workDeviceRecordList}">
                                <c:forEach items="${projectControlTable.workDeviceXjRecord.workDeviceRecordList}" var="workDeviceRecord" varStatus="index">
                                    <tr id="workDeviceRecordList${index.index}">
                                        <td class="hide">
                                            <input id="workDeviceRecordList${index.index}_id" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].id" type="hidden" value="${workDeviceRecord.id}"/>
                                            <input id="workDeviceRecordList${index.index}_delFlag" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].delFlag" type="hidden" value="0"/>
                                        </td>
                                        <td>
                                            <input id="workDeviceRecordList${index.index}_deviceName"  name="workDeviceXjRecord.workDeviceRecordList[${index.index}].deviceName" type="text" value="${workDeviceRecord.deviceName}"    class="form-control required"/>
                                        </td>

                                        <td>
                                            <input id="workDeviceRecordList${index.index}_deviceKind" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].deviceKind" type="text" value="${workDeviceRecord.deviceKind}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workDeviceRecordList${index.index}_deviceUnit" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].deviceUnit" type="text" value="${workDeviceRecord.deviceUnit}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workDeviceRecordList${index.index}_deviceCreator" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].deviceCreator" type="text" value="${workDeviceRecord.deviceCreator}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workDeviceRecordList${index.index}_devicePhone" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].devicePhone" type="text" value="${workDeviceRecord.devicePhone}"    class="form-control isTel required"/>
                                        </td>
                                        <td>
                                            <input id="workDeviceRecordList${index.index}_devicePrice" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].devicePrice" type="text" value="${workDeviceRecord.devicePrice}"    class="form-control number required"/>
                                        </td>
                                        <td>
                                            <input id="workDeviceRecordList${index.index}_remarks" name="workDeviceXjRecord.workDeviceRecordList[${index.index}].remarks" type="text" value="${workDeviceRecord.remarks}"    class="form-control"/>
                                        </td>
                                        <td class="text-center op-td" style="width:80px;">
                                            <span class="op-btn op-btn-delete" onclick="delRow(this, '#workDeviceRecordList${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            </tbody>
                        </table>
                        <script type="text/template" id="workDeviceRecordsTpl">//<!--
                                <tr id="workDeviceRecordList{{idx}}">
                                    <td class="hide">
                                        <input id="workDeviceRecordList{{idx}}_id" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                        <input id="workDeviceRecordList{{idx}}_delFlag" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].delFlag" type="hidden" value="0"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_deviceName"  name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].deviceName" type="text" value="{{row.deviceName}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_deviceKind"  name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].deviceKind" type="text" value="{{row.deviceKind}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_deviceUnit" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].deviceUnit" type="text" value="{{row.deviceUnit}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_deviceCreator" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].deviceCreator" type="text" value="{{row.deviceCreator}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_devicePhone" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].devicePhone" type="text" value="{{row.devicePhone}}"    class="form-control isTel required"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_devicePrice" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].devicePrice" type="text" value="{{row.devicePrice}}"    class="form-control number required"/>
                                    </td>
                                    <td>
                                        <input id="workDeviceRecordList{{idx}}_remarks" name="workDeviceXjRecord.workDeviceRecordList[{{idx}}].remarks" type="text" value="{{row.remarks}}"    class="form-control"/>
                                    </td>

                                    <td class="text-center op-td" style="width:80px;">
                                        {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workDeviceRecordList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
                                    </td>
                                </tr>//-->
                        </script>
                        <script type="text/javascript">
                            var workDeviceRecordsRowIdx = 0, workDeviceRecordsTpl = $("#workDeviceRecordsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        </script>
                        <div class="form-group layui-row first">
                            <div class="layui-item layui-col-sm6">
                                <label class="layui-form-label"><span class="require-item">*</span>询价时间：</label>
                                <div class="layui-input-block">
                                    <input id="askTime" name="workDeviceXjRecord.askTime"  readonly="true" maxlength="20" class="laydate-icondate form-control layer-date required layui-input laydate-icon"
                                           value="<fmt:formatDate value="${projectControlTable.workDeviceXjRecord.askTime}" pattern="yyyy-MM-dd" />"/>
                                </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 with-icon">
                                    <sys:treeselect id="askUser" name="workDeviceXjRecord.askUser.id" value="${projectControlTable.workDeviceXjRecord.askUser.id}" labelName="workDeviceXjRecord.askUser.name" labelValue="${projectControlTable.workDeviceXjRecord.askUser.name}"
                                                    title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>


            <div id="d2">
                <style>
                    .note-editor .panel-heading{
                        padding:3px 5px;
                    }
                </style>
                <input type="hidden" name="projectId" id="projectId">
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>补充资料清单</h2></div>
                    <div class="form-group layui-row first">
                        <div class="layui-item layui-col-sm12">
                            <label class="layui-form-label"  style="width:105px;">内容：</label>
                            <div class="layui-input-block" style="margin-left:131px">
                                <textarea id="content" name="workInfoList.content"  class="form-control summernote required" placeholder="内容" required>${projectControlTable.workInfoList.content}</textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div id="d3">
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>现场踏勘记录</h2></div>
                    <div class="form-group layui-row first">
                        <div class="layui-item layui-col-sm12">
                            <label class="layui-form-label"  style="width:105px;"><span class="require-item">*</span>现场踏勘记录：</label>
                            <div class="layui-input-block" style="margin-left:131px">
                                <form:textarea path="workExplore.remarks" id="takanre" htmlEscape="false" rows="16" onkeyup="checkContentKeyUp('takanre',512);"   maxlength="512"    class="form-control required"/>
                            </div>
                            <span id="contentMsg" style="float: right"></span>
                        </div>
                    </div>
                </div>
            </div>
            <div id="d4">
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>沟通记录表</h2></div>
                    <div class="layui-item nav-btns">
                        <a class="nav-btn nav-btn-add addBtn" onclick="addRow('#workCommunicateRecords', workCommunicateRecordsRowIdx, workCommunicateRecordsTpl);workCommunicateRecordsRowIdx = workCommunicateRecordsRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
                    </div>
                    <div class="layui-item layui-col-xs12 form-table-container" >
                        <table id="contentTable" class="table table-bordered table-condensed can-edit no-bottom-margin">
                            <thead>
                            <tr>
                                <th><font color="red">*</font>序号</th>
                                <th><font color="red">*</font>日期</th>
                                <th><font color="red">*</font>沟通内容</th>
                                <th><font color="red">*</font>沟通方式</th>
                                <th><font color="red">*</font>反馈意见</th>
                                <th>备注</th>
                                <th width="150px">操作</th>
                            </tr>
                            </thead>
                            <tbody id="workCommunicateRecords">
                            <c:if test="${not empty projectControlTable.workCommunicateRecord.workCommunicateContentList}">
                                <c:forEach items="${projectControlTable.workCommunicateRecord.workCommunicateContentList}" var="workCommunicateRecord" varStatus="index">
                                    <tr id="workCommunicateContentList${index.index}">
                                        <td class="hide">
                                            <input id="workCommunicateContentList${index.index}_id" name="workCommunicateRecord.workCommunicateContentList[${index.index}].id" type="hidden" value="${workCommunicateRecord.id}"/>
                                            <input id="workCommunicateContentList${index.index}_delFlag" name="workCommunicateRecord.workCommunicateContentList[${index.index}].delFlag" type="hidden" value="0"/>
                                        </td>
                                        <td>
                                            <input id="workCommunicateContentList${index.index}_contentNumber"  name="workCommunicateRecord.workCommunicateContentList[${index.index}].contentNumber" type="text" value="${workCommunicateRecord.contentNumber}"    class="form-control required"/>
                                        </td>

                                        <td>
                                            <input id="workCommunicateContentList${index.index}_contentDate" name="workCommunicateRecord.workCommunicateContentList[${index.index}].contentDate"  value="<fmt:formatDate value="${workCommunicateRecord.contentDate}" pattern="yyyy-MM-dd"/>"    readonly="true" maxlength="20" class="laydate-icondate form-control layer-date required layui-input laydate-icon cdTimes" />
                                        </td>
                                        <td>
                                            <input id="workCommunicateContentList${index.index}_contentDetail" name="workCommunicateRecord.workCommunicateContentList[${index.index}].contentDetail" type="text" value="${workCommunicateRecord.contentDetail}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workCommunicateContentList${index.index}_contentWay" name="workCommunicateRecord.workCommunicateContentList[${index.index}].contentWay" type="text" value="${workCommunicateRecord.contentWay}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workCommunicateContentList${index.index}_contentFeedback" name="workCommunicateRecord.workCommunicateContentList[${index.index}].contentFeedback" type="text" value="${workCommunicateRecord.contentFeedback}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workCommunicateContentList${index.index}_remarks" name="workCommunicateRecord.workCommunicateContentList[${index.index}].remarks" type="text" value="${workCommunicateRecord.remarks}"    class="form-control"/>
                                        </td>
                                        <td class="text-center op-td" style="width:80px;">
                                            <span class="op-btn op-btn-delete" onclick="delRow(this, '#workCommunicateContentList${index.index}','#workCommunicateRecords')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            </tbody>
                        </table>
                        <div class="form-group layui-row first">
                            <div class="layui-item layui-col-sm12">
                                <label class="layui-form-label" style="width:105px;"><span class="require-item">*</span>沟通记录人员：</label>
                                <div class="layui-input-block with-icon" style="margin-left:131px;">
                                    <sys:treeselect id="comUser" name="workCommunicateRecord.comUser.id" value="${projectControlTable.workCommunicateRecord.comUser.id}" labelName="workCommunicateRecord.comUser.name" labelValue="${projectControlTable.workCommunicateRecord.comUser.name}"
                                                    title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                                </div>
                            </div>
                        </div>
                        <script type="text/template" id="workCommunicateRecordsTpl">//<!--
                            <tr id="workCommunicateContentList{{idx}}">
                                <td class="hide">
                                    <input id="workCommunicateContentList{{idx}}_id" name="workCommunicateRecord.workCommunicateContentList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                    <input id="workCommunicateContentList{{idx}}_delFlag" name="workCommunicateRecord.workCommunicateContentList[{{idx}}].delFlag" type="hidden" value="0"/>
                                </td>
                                <td>
                                    <input id="workCommunicateContentList{{idx}}_contentNumber"  name="workCommunicateRecord.workCommunicateContentList[{{idx}}].contentNumber" type="text" value="{{row.contentNumber}}"    class="form-control required"/>
                                </td>
                                <td>
                                    <input id="workCommunicateContentList{{idx}}_contentDate"  name="workCommunicateRecord.workCommunicateContentList[{{idx}}].contentDate" value="{{row.contentDate}}"    readonly="true" maxlength="20" class="laydate-icondate form-control layer-date required layui-input laydate-icon cdTimes" />
                                </td>
                                <td>
                                    <input id="workCommunicateContentList{{idx}}_contentDetail" name="workCommunicateRecord.workCommunicateContentList[{{idx}}].contentDetail" type="text" value="{{row.contentDetail}}"    class="form-control required"/>
                                </td>
                                <td>
                                    <input id="workCommunicateContentList{{idx}}_contentWay" name="workCommunicateRecord.workCommunicateContentList[{{idx}}].contentWay" type="text" value="{{row.contentWay}}"    class="form-control required"/>
                                </td>
                                <td>
                                    <input id="workCommunicateContentList{{idx}}_contentFeedback" name="workCommunicateRecord.workCommunicateContentList[{{idx}}].contentFeedback" type="text" value="{{row.contentFeedback}}"    class="form-control required"/>
                                </td>
                                <td>
                                    <input id="workCommunicateContentList{{idx}}_remarks" name="workCommunicateRecord.workCommunicateContentList[{{idx}}].remarks" type="text" value="{{row.remarks}}"    class="form-control"/>
                                </td>

                                <td class="text-center op-td" style="width:80px;">
                                    {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workCommunicateContentList{{idx}}','#workCommunicateRecords')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
                                </td>
                            </tr>//-->
                        </script>
                        <script type="text/javascript">
                            var workCommunicateRecordsRowIdx = 0, workCommunicateRecordsTpl = $("#workCommunicateRecordsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        </script>
                    </div>
                </div>
            </div>
            <div id="d5">
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>装饰部分</h2></div>
                    <div class="layui-item nav-btns">
                        <a class="nav-btn nav-btn-add addBtn" onclick="addRow('#workProjectCalcDecors', workProjectCalcDecorsRowIdx, workProjectCalcDecorsTpl);workProjectCalcDecorsRowIdx = workProjectCalcDecorsRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
                    </div>
                    <div class="layui-item layui-col-xs12 form-table-container" >
                        <table class="table table-bordered table-condensed can-edit no-bottom-margin">
                            <thead>
                            <tr>
                                <th><font color="red">*</font>序号</th>
                                <th><font color="red">*</font>清单编号/定额编号</th>
                                <th><font color="red">*</font>项目名称</th>
                                <th><font color="red">*</font>计量单位</th>
                                <th><font color="red">*</font>计算式</th>
                                <th><font color="red">*</font>工程量</th>
                                <th>其他</th>
                                <th><font color="red">*</font>工程来源</th>
                                <th width="150px">操作</th>
                            </tr>
                            </thead>
                            <tbody id="workProjectCalcDecors">
                            <c:if test="${not empty projectControlTable.workProjectCalcDecorList}">
                                <c:forEach items="${projectControlTable.workProjectCalcDecorList}" var="workProjectCalcDecor" varStatus="index">
                                    <tr id="workHandBillDetailList${index.index}">
                                        <td class="hide">
                                            <input id="workProjectCalcDecorList${index.index}_id" name="workProjectCalcDecorList[${index.index}].id" type="hidden" value="${workProjectCalcDecor.id}"/>
                                            <input id="workProjectCalcDecorList${index.index}_delFlag" name="workProjectCalcDecorList[${index.index}].delFlag" type="hidden" value="0"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}decorNumber"  name="workProjectCalcDecorList[${index.index}].decorNumber" type="text" value="${workProjectCalcDecor.decorNumber}"    class="form-control required"/>
                                        </td>

                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_decorCode" name="workProjectCalcDecorList[${index.index}].decorCode" type="text" value="${workProjectCalcDecor.decorCode}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_projectName" name="workProjectCalcDecorList[${index.index}].projectName" type="text" value="${workProjectCalcDecor.projectName}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_decorUnit" name="workProjectCalcDecorList[${index.index}].decorUnit" type="text" value="${workProjectCalcDecor.decorUnit}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_decorMode" name="workProjectCalcDecorList[${index.index}].decorMode" type="text" value="${workProjectCalcDecor.decorMode}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_decorSize" name="workProjectCalcDecorList[${index.index}].decorSize" type="text" value="${workProjectCalcDecor.decorSize}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_decorOther" name="workProjectCalcDecorList[${index.index}].decorOther" type="text" value="${workProjectCalcDecor.decorOther}"    class="form-control"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcDecorList${index.index}_decorOrigin" name="workProjectCalcDecorList[${index.index}].decorOrigin" type="text" value="${workProjectCalcDecor.decorOrigin}"    class="form-control required"/>
                                        </td>
                                        <td class="text-center op-td" style="width:80px;">
                                            <span class="op-btn op-btn-delete" onclick="delRow(this, '#workProjectCalcDecorList${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            </tbody>
                        </table>
                        <script type="text/template" id="workProjectCalcDecorsTpl">//<!--
						<tr id="workProjectCalcDecorList{{idx}}">
							<td class="hide">
								<input id="workProjectCalcDecorList{{idx}}_id" name="workProjectCalcDecorList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="workProjectCalcDecorList{{idx}}_delFlag" name="workProjectCalcDecorList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorNumber"  name="workProjectCalcDecorList[{{idx}}].decorNumber" type="text" value="{{row.decorNumber}}"    class="form-control required"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorCode"  name="workProjectCalcDecorList[{{idx}}].decorCode" type="text" value="{{row.decorCode}}"    class="form-control required"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_projectName" name="workProjectCalcDecorList[{{idx}}].projectName" type="text" value="{{row.projectName}}"    class="form-control required"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorUnit" name="workProjectCalcDecorList[{{idx}}].decorUnit" type="text" value="{{row.decorUnit}}"    class="form-control required"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorMode" name="workProjectCalcDecorList[{{idx}}].decorMode" type="text" value="{{row.decorMode}}"    class="form-control required"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorSize" name="workProjectCalcDecorList[{{idx}}].decorSize" type="text" value="{{row.decorMode}}"    class="form-control required"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorOther" name="workProjectCalcDecorList[{{idx}}].decorOther" type="text" value="{{row.decorMode}}"    class="form-control"/>
							</td>
							<td>
								<input id="workProjectCalcDecorList{{idx}}_decorOrigin" name="workProjectCalcDecorList[{{idx}}].decorOrigin" type="text" value="{{row.decorOrigin}}"    class="form-control required"/>
							</td>
							<td class="text-center op-td" style="width:80px;">
								{{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workProjectCalcDecorList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
							</td>
						</tr>//-->
                        </script>
                        <script type="text/javascript">
                            var workProjectCalcDecorsRowIdx = 0, workProjectCalcDecorsTpl = $("#workProjectCalcDecorsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        </script>
                    </div>
                </div>
                <div class="form-group layui-row">
                    <div class="form-group-label"><h2>建筑部分</h2></div>
                    <div class="layui-item nav-btns">
                        <a class="nav-btn nav-btn-add addBtn" onclick="addRow('#workProjectCalcBuilds', workProjectCalcBuildsRowIdx, workProjectCalcBuildsTpl);workProjectCalcBuildsRowIdx = workProjectCalcBuildsRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
                    </div>
                    <div class="layui-item layui-col-xs12 form-table-container" >
                        <table class="table table-bordered table-condensed can-edit no-bottom-margin">
                            <thead>
                            <tr>
                                <th><font color="red">*</font>序号</th>
                                <th><font color="red">*</font>清单编号/定额编号</th>
                                <th><font color="red">*</font>项目名称</th>
                                <th><font color="red">*</font>计量单位</th>
                                <th><font color="red">*</font>计算式/索引</th>
                                <th><font color="red">*</font>工程量</th>
                                <th>其他</th>
                                <th><font color="red">*</font>分项数据索引</th>
                                <th width="150px">操作</th>
                            </tr>
                            </thead>
                            <tbody id="workProjectCalcBuilds">
                            <c:if test="${not empty projectControlTable.workProjectCalcBuildList}">
                                <c:forEach items="${projectControlTable.workProjectCalcBuildList}" var="workProjectCalcBuild" varStatus="index">
                                    <tr id="workHandBillDetailList${index.index}">
                                        <td class="hide">
                                            <input id="workProjectCalcBuildList${index.index}_id" name="workProjectCalcBuildList[${index.index}].id" type="hidden" value="${workProjectCalcBuild.id}"/>
                                            <input id="workProjectCalcBuildList${index.index}_delFlag" name="workProjectCalcBuildList[${index.index}].delFlag" type="hidden" value="0"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}buildNumber"  name="workProjectCalcBuildList[${index.index}].buildNumber" type="text" value="${workProjectCalcBuild.buildNumber}"    class="form-control required"/>
                                        </td>

                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_buildCode" name="workProjectCalcBuildList[${index.index}].buildCode" type="text" value="${workProjectCalcBuild.buildCode}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_projectName" name="workProjectCalcBuildList[${index.index}].projectName" type="text" value="${workProjectCalcBuild.projectName}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_buildUnit" name="workProjectCalcBuildList[${index.index}].buildUnit" type="text" value="${workProjectCalcBuild.buildUnit}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_buildMode" name="workProjectCalcBuildList[${index.index}].buildMode" type="text" value="${workProjectCalcBuild.buildMode}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_buildSize" name="workProjectCalcBuildList[${index.index}].buildSize" type="text" value="${workProjectCalcBuild.buildSize}"    class="form-control required"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_buildOther" name="workProjectCalcBuildList[${index.index}].buildOther" type="text" value="${workProjectCalcBuild.buildOther}"    class="form-control"/>
                                        </td>
                                        <td>
                                            <input id="workProjectCalcBuildList${index.index}_buildIndex" name="workProjectCalcBuildList[${index.index}].buildIndex" type="text" value="${workProjectCalcBuild.buildIndex}"    class="form-control required"/>
                                        </td>
                                        <td class="text-center op-td" style="width:80px;">
                                            <span class="op-btn op-btn-delete" onclick="delRow(this, '#workProjectCalcBuildList${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            </tbody>
                        </table>
                        <script type="text/template" id="workProjectCalcBuildsTpl">//<!--
                                <tr id="workProjectCalcBuildList{{idx}}">
                                    <td class="hide">
                                        <input id="workProjectCalcBuildList{{idx}}_id" name="workProjectCalcBuildList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                        <input id="workProjectCalcBuildList{{idx}}_delFlag" name="workProjectCalcBuildList[{{idx}}].delFlag" type="hidden" value="0"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildNumber"  name="workProjectCalcBuildList[{{idx}}].buildNumber" type="text" value="{{row.buildNumber}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildCode"  name="workProjectCalcBuildList[{{idx}}].buildCode" type="text" value="{{row.buildCode}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_projectName" name="workProjectCalcBuildList[{{idx}}].projectName" type="text" value="{{row.projectName}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildUnit" name="workProjectCalcBuildList[{{idx}}].buildUnit" type="text" value="{{row.buildUnit}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildMode" name="workProjectCalcBuildList[{{idx}}].buildMode" type="text" value="{{row.buildMode}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildSize" name="workProjectCalcBuildList[{{idx}}].buildSize" type="text" value="{{row.buildSize}}"    class="form-control required"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildOther" name="workProjectCalcBuildList[{{idx}}].buildOther" type="text" value="{{row.buildOther}}"    class="form-control"/>
                                    </td>
                                    <td>
                                        <input id="workProjectCalcBuildList{{idx}}_buildIndex" name="workProjectCalcBuildList[{{idx}}].buildIndex" type="text" value="{{row.buildIndex}}"    class="form-control required"/>
                                    </td>
                                    <td class="text-center op-td" style="width:80px;">
                                        {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workProjectCalcBuildList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
                                    </td>
                                </tr>//-->
                        </script>
                        <script type="text/javascript">
                            var workProjectCalcBuildsRowIdx = 0, workProjectCalcBuildsTpl = $("#workProjectCalcBuildsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                        </script>
                    </div>
                </div>
            </div>
            <%-- 交接单 start --%>
            <div id="d6">
                <div class="form-group layui-row first">
                    <div class="form-group-label"><h2>交接单</h2></div>
                    <div class="layui-item layui-col-sm6">
                        <label class="layui-form-label"><span class="require-item">*</span>接收人：</label>
                        <div class="layui-input-block with-icon">
                            <sys:treeselect id="billRecUser" name="workHandBill.billRecUser.id" value="${projectControlTable.workHandBill.billRecUser.id}" labelName="workHandBill.billRecUser.name" labelValue="${projectControlTable.workHandBill.billRecUser.name}"
                                            title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                        </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 with-icon">
                            <sys:treeselect id="billSendUser" name="workHandBill.billSendUser.id" value="${projectControlTable.workHandBill.billSendUser.id}" labelName="workHandBill.billSendUser.name" labelValue="${projectControlTable.workHandBill.billSendUser.name}"
                                            title="用户" url="/sys/office/treeDataAll?type=3" cssClass="form-control required layui-input" allowClear="true" notAllowSelectParent="true"/>
                        </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 with-icon">
                            <input id="billHandTime" name="workHandBill.billHandTime" readonly="true" maxlength="20" class="laydate-icondate form-control layer-date required layui-input laydate-icon"
                                   value="<fmt:formatDate value="${projectControlTable.workHandBill.billHandTime}" pattern="yyyy-MM-dd HH:mm:ss"/>"/>
                        </div>
                    </div>
                </div>
                <div class="layui-item nav-btns">
                    <a class="nav-btn nav-btn-add addBtn" onclick="addRow('#workHandBills', workHandBillsRowIdx, workHandBillsTpl);workHandBillsRowIdx = workHandBillsRowIdx + 1;" title="新增"><i class="fa fa-plus"></i> 新增</a>
                </div>
                <table class="table table-bordered table-condensed can-edit no-bottom-margin">
                    <thead>
                    <tr>
                        <th><font color="red">*</font>序号</th>
                        <th><font color="red">*</font>资料名称</th>
                        <th><font color="red">*</font>有无</th>
                        <th><font color="red">*</font>份数或页数</th>
                        <th>备注</th>
                        <th width="150px">操作</th>
                    </tr>
                    </thead>
                    <tbody id="workHandBills">
                    <c:if test="${not empty projectControlTable.workHandBill.workHandBillDetailList}">
                        <c:forEach items="${projectControlTable.workHandBill.workHandBillDetailList}" var="workHandBill" varStatus="index">
                            <tr id="workHandBillDetailList${index.index}">
                                <td class="hide">
                                    <input id="workHandBillDetailList${index.index}_id" name="workHandBill.workHandBillDetailList[${index.index}].id" type="hidden" value="${workHandBill.id}"/>
                                    <input id="workHandBillDetailList${index.index}_delFlag" name="workHandBill.workHandBillDetailList[${index.index}].delFlag" type="hidden" value="0"/>
                                </td>
                                <td>
                                    <input id="workHandBillDetailList${index.index}_materialNumber"  name="workHandBill.workHandBillDetailList[${index.index}].materialNumber" type="text" value="${workHandBill.materialNumber}"    class="form-control required"/>
                                </td>

                                <td>
                                    <input id="workHandBillDetailList${index.index}_materialName" name="workHandBill.workHandBillDetailList[${index.index}].materialName" type="text" value="${workHandBill.materialName}"    class="form-control required"/>
                                </td>
                                <td>
                                    <input id="workHandBillDetailList${index.index}_materialFlag" name="workHandBill.workHandBillDetailList[${index.index}].materialFlag" type="text" value="${workHandBill.materialFlag}"    class="form-control required"/>
                                </td>
                                <td>
                                    <input id="workHandBillDetailList${index.index}_materialPages" name="workHandBill.workHandBillDetailList[${index.index}].materialPages" type="text" value="${workHandBill.materialPages}"    class="form-control number required"/>
                                </td>
                                <td>
                                    <input id="workHandBillDetailList${index.index}_remarks" name="workHandBill.workHandBillDetailList[${index.index}].remarks" type="text" value="${workHandBill.remarks}"    class="form-control"/>
                                </td>
                                <td class="text-center op-td" style="width:80px;">
                                    <span class="op-btn op-btn-delete" onclick="delRow(this, '#workHandBillDetailList${index.index}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>
                                </td>
                            </tr>
                        </c:forEach>
                    </c:if>
                    </tbody>
                </table>
                <script type="text/template" id="workHandBillsTpl">//<!--
                        <tr id="workHandBillDetailList{{idx}}">
                            <td class="hide">
                                <input id="workHandBillDetailList{{idx}}_id" name="workHandBill.workHandBillDetailList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
                                <input id="workHandBillDetailList{{idx}}_delFlag" name="workHandBill.workHandBillDetailList[{{idx}}].delFlag" type="hidden" value="0"/>
                            </td>
                            <td>
                                <input id="workHandBillDetailList{{idx}}_materialNumber"  name="workHandBill.workHandBillDetailList[{{idx}}].materialNumber" type="text" value="{{row.materialNumber}}"    class="form-control required"/>
                            </td>
                            <td>
                                <input id="workHandBillDetailList{{idx}}_materialName"  name="workHandBill.workHandBillDetailList[{{idx}}].materialName" type="text" value="{{row.materialName}}"    class="form-control required"/>
                            </td>
                            <td>
                                <input id="workHandBillDetailList{{idx}}_materialFlag" name="workHandBill.workHandBillDetailList[{{idx}}].materialFlag" type="text" value="{{row.materialFlag}}"    class="form-control required"/>
                            </td>
                            <td>
                                <input id="workHandBillDetailList{{idx}}_materialPages" name="workHandBill.workHandBillDetailList[{{idx}}].materialPages" type="text" value="{{row.materialPages}}"    class="form-control number required"/>
                            </td>
                            <td>
                                <input id="workHandBillDetailList{{idx}}_remarks" name="workHandBill.workHandBillDetailList[{{idx}}].remarks" type="text" value="{{row.remarks}}"    class="form-control"/>
                            </td>

                            <td class="text-center op-td" style="width:80px;">
                                {{#delBtn}}<span class="op-btn op-btn-delete" onclick="delRow(this, '#workHandBillDetailList{{idx}}')" title="删除"><i class="glyphicon glyphicon-remove"></i> 删除</span>{{/delBtn}}
                            </td>
                        </tr>//-->
                </script>
                <script type="text/javascript">
                    var workHandBillsRowIdx = 0, workHandBillsTpl = $("#workHandBillsTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
                    if($("#id").val()){
                        workHandBillsRowIdx = ${fn:length(workHandBill.workHandBillDetailList)};
                    }
                </script>
            </div>
         </div>
        <%-- 交接单 end --%>
        <div class="form-group layui-row">
            <div class="form-group-label"><h2>附件信息</h2></div>
            <div class="layui-item nav-btns">
                <a id="attachment_btn" class="nav-btn nav-btn-add" title="添加附件"><i class="fa fa-plus"></i>&nbsp;添加附件</a>
            </div>
            <div id="addFile_attachment" style="display: none" class="upload-progress">
                <span id="fileName_attachment" ></span>
                <b><span id="baifenbi_attachment" ></span></b>
                <div class="progress">
                    <div id="jindutiao_attachment" class="progress-bar" style="width: 0%" aria-valuenow="0">
                    </div>
                </div>
            </div>
            <input id="attachment_file" type="file" name="attachment_file" multiple="multiple" style="display: none;" onChange="if(this.value)insertTitle(this.value);"/>
            <span id="attachment_title"></span>
            <div class="layui-item layui-col-xs12" style="padding:0 16px;">
                <table id="upTable" class="table table-bordered table-condensed details">
                    <thead>
                    <tr>
                            <%-- <th>序号</th>--%>
                        <th>文件预览</th>
                        <th>上传人</th>
                        <th>上传时间</th>
                        <th width="150px">操作</th>
                    </tr>
                    </thead>
                    <tbody id="file_attachment">
                    <c:forEach items="${projectControlTable.workAttachments}" var = "workAttachment" varStatus="status">
                        <tr>
                                <%-- <td>${status.index + 1}</td>--%>
                            <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" onclick="openDialogView('预览','${ctx}/sys/picturepreview/picturePreview?url=${workAttachment.url}','90%','90%')" alt="${workAttachment.attachmentName}">
                                </c:when>
                                <c:otherwise>
                                    <c:choose>
                                        <c:when test="${fn:containsIgnoreCase(workAttachment.attachmentName,'pdf')}">
                                            <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%','1')">${workAttachment.attachmentName}</a></td>
                                        </c:when>
                                        <c:otherwise>
                                            <td><a class="attention-info" href="javascript:void(0)" onclick="preview('预览','${workAttachment.url}','90%','90%')">${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>

                                <c:if test="${workAttachment.createBy.id eq fns:getUser().id}">
                                    <a href="javascript:void(0)" onclick="deleteFileFromAliyun(this,'${ctx}/sys/workattachment/deleteFileFromAliyun?url=${workAttachment.url}&id=${workAttachment.id}&type=2','addFile')" class="op-btn op-btn-delete" ><i class="fa fa-trash"></i>&nbsp;删除</a>
                                </c:if>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
	</form:form>
</body>
</html>