<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>报告明细一览表</title>
	<meta name="decorator" content="default"/>
	<%--<script src="${ctxStatic}/layer-v2.3/laydate/laydate.js"></script>--%>
	<script type="text/javascript">
        $(document).ready(function() {

            //搜索框收放
            $('#moresee').click(function(){
                if($('#moresees').is(':visible'))
                {
                    $('#moresees').slideUp(0,resizeListWindow1);
                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
                }else{
                    $('#moresees').slideDown(0,resizeListWindow1);
                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
                }
            });
            laydate.render({
                elem: '#startDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
            laydate.render({
                elem: '#endDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
            laydate.render({
                elem: '#createStartDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
            laydate.render({
                elem: '#createEndDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
        });

        function reset() {
            $("#searchForm").resetForm();
        }
	</script>
	<style>
		body{
			background-color:transparent;
			filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#26FFFFFF, endColorstr=#26FFFFFF);
			color:#ffffff;
			background-color:rgba(255,255,255,0);
			height:100%;
		}
	</style>
</head>
<body>
<div class="wrapper wrapper-content">
	<sys:message content="${message}"/>
	<div class="layui-row">
		<div class="full-width fl">
			<div class="contentShadow layui-row" id="queryDiv">
				<form:form id="searchForm" modelAttribute="projectReportData" action="${ctx}/projectcontentinfo/projectReportData/list" method="post" class="form-inline">
					<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
					<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
					<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
					<div class="commonQuery lw9">
						<div class="layui-item query athird">
							<label class="layui-form-label">报告名称：</label>
							<div class="layui-input-block">
								<form:input path="name" htmlEscape="false" maxlength="64"  class=" form-control  layui-input"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">报告编号：</label>
							<div class="layui-input-block">
								<form:input path="number" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
							</div>
						</div>
						<div class="layui-item athird">
							<div class="input-group">
								<a href="#" id="moresee"><i class="glyphicon glyphicon-menu-down"></i></a>
								<button id="searchReset" class="fixed-btn searchReset fr" onclick="resetSearch()">重置</button>
								<button id="searchQuery" class="fixed-btn searchQuery fr" onclick="search()">查询</button>
							</div>
						</div>
						<div style="    clear:both;"></div>
					</div>
					<div id="moresees" style="clear:both;display:none;" class="lw9">
						<div class="layui-item query athird">
							<label class="layui-form-label">工作内容类型：</label>
							<div class="layui-input-block">
								<form:select path="type"  htmlEscape="false"   class="form-control simple-select">
									<form:option value="" label=""/>
									<optgroup label="决策阶段"/>
									<form:options items="${fns:getContentTypeList('1')}" itemLabel="typeName" itemValue="typeId"></form:options>
									<optgroup label="设计阶段"/>
									<form:options items="${fns:getContentTypeList('2')}" itemLabel="typeName" itemValue="typeId"></form:options>
									<optgroup label="发承包阶段"/>
									<form:options items="${fns:getContentTypeList('3')}" itemLabel="typeName" itemValue="typeId"></form:options>
									<optgroup label="实施阶段"/>
									<form:options items="${fns:getContentTypeList('4')}" itemLabel="typeName" itemValue="typeId"></form:options>
									<optgroup label="竣工阶段"/>
									<form:options items="${fns:getContentTypeList('5')}" itemLabel="typeName" itemValue="typeId"></form:options>
									<optgroup label="运营阶段"/>
									<form:options items="${fns:getContentTypeList('6')}" itemLabel="typeName" itemValue="typeId"></form:options>
								</form:select>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">成果类型：</label>
							<div class="layui-input-block">
								<form:select path="achievementType" class="form-control simple-select">
									<form:option value="" label=""/>
									<form:options items="${fns:getMainDictList('achievement_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
						<%--<div class="layui-item query athird">
							<label class="layui-form-label">签字造价师1：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="signCostOne" name="signCostOne.id" value="${projectReportData.signCostOne.id}" labelName="signCostOne.name" labelValue="${projectReportData.signCostOne.name}"
												title="签字造价师1" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">签字造价师2：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="signCostTwo" name="signCostTwo.id" value="${projectReportData.signCostTwo.id}" labelName="signCostTwo.name" labelValue="${projectReportData.signCostTwo.name}"
												title="签字造价师2" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
							</div>
						</div>--%>
						<div class="layui-item query athird">
							<label class="layui-form-label">复核标准：</label>
							<div class="layui-input-block">
								<form:select path="reviewStandard" class="form-control simple-select">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('reviewStandard')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">报告状态：</label>
							<div class="layui-input-block">
								<form:select path="status" class="form-control simple-select">
									<form:option value="" label=""/>
									<form:options items="${fns:getDictList('audit_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
								</form:select>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">报告日期：</label>
							<div class="layui-input-block">
								<input class="form-control layer-date laydate-icon layui-input laydate-icondate" id="startDate" name="startDate" value="<fmt:formatDate value="${projectReportData.startDate}" pattern="yyyy-MM-dd"/>" onclick="laydate({istime: false, format: 'YYYY-MM-DD'})">
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">——&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
							<div class="layui-input-block">
								<input class="form-control layer-date laydate-icon layui-input laydate-icondate" id="endDate" name="endDate" value="<fmt:formatDate value="${projectReportData.endDate}" pattern="yyyy-MM-dd"/>" onclick="laydate({istime: false, format: 'YYYY-MM-DD'})">
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">负责人：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="master" name="master.id" value="${projectReportData.master.id}" labelName="master.name" labelValue="${projectReportData.master.name}"
												title="负责人" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">归属部门：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="office" name="officeId" value="${projectReportData.officeId}" labelName="officeName" labelValue="${projectReportData.officeName}"
												title="归属部门" url="/sys/office/treeData?type=2" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">创建日期：</label>
							<div class="layui-input-block">
								<input class="form-control layer-date laydate-icon layui-input laydate-icondate" id="createStartDate" name="createStartDate" value="<fmt:formatDate value="${projectReportData.createStartDate}" pattern="yyyy-MM-dd"/>" onclick="laydate({istime: false, format: 'YYYY-MM-DD'})">
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">——&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
							<div class="layui-input-block">
								<input class="form-control layer-date laydate-icon layui-input laydate-icondate" id="createEndDate" name="createEndDate" value="<fmt:formatDate value="${projectReportData.createEndDate}" pattern="yyyy-MM-dd"/>" onclick="laydate({istime: false, format: 'YYYY-MM-DD'})">
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">所属项目：</label>
							<div class="layui-input-block">
								<form:input path="project.projectName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">项目负责人：</label>
							<div class="layui-input-block with-icon">
								<sys:treeselect id="projectMaster" name="projectMasterId" value="${projectReportData.projectMasterId}" labelName="projectMaster" labelValue="${projectReportData.projectMaster}"
												title="项目负责人" url="/sys/office/treeDataAll?type=3" cssClass="form-control layui-input" allowClear="true" notAllowSelectParent="true"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">合同编号：</label>
							<div class="layui-input-block">
								<form:input path="contractNum" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
							</div>
						</div>
						<div class="layui-item query athird">
							<label class="layui-form-label">主委托方：</label>
							<div class="layui-input-block">
								<form:input path="clientName" htmlEscape="false" maxlength="255"  class=" form-control layui-input"/>
							</div>
						</div>
						<div style="clear:both;"></div>
					</div>
				</form:form>
			</div>
		</div>
		<div class="full-width fl">
			<div class="contentShadow layui-form contentDetails">
				<div class="nav-btns">
					<shiro:hasPermission name="projectcontentinfo:projectReportData:export">
						<table:exportExcel url="${ctx}/projectcontentinfo/projectReportData/export"></table:exportExcel><!-- 导出按钮 -->
					</shiro:hasPermission>
					<div style="clear: both;"></div>
				</div>
				<table class="oa-table layui-table" id="contentTable1"></table>

				<!-- 分页代码 -->
				<table:page page="${page}"></table:page>
				<div style="clear: both;"></div>
			</div>
		</div>
	</div>
	<div id="changewidth"></div>
</div>

<script src="${ctxStatic}/layer-v2.3/layui/layui.all.js" charset="utf-8"></script>
<script>
    layui.use('table', function(){
        layui.table.render({
            limit:${ page.pageSize }
            ,elem: '#contentTable1'
            ,page: false
            ,cols: [[
                // {checkbox: true, fixed: true},
                {field:'index',align:'center',fixed: 'left', title: '序号',width:40}
                ,{field:'number',align:'center',fixed: true, title: '报告编号',width:200,templet:function(d){
                    return "<a class=\"attention-info\" href=\"#\" onclick=\"openDialogView('查看报告', '${ctx}/projectcontentinfo/projectReportData/form?id=" + d.id + "','95%', '95%')\">" + d.number + "</a>";
                }}
                ,{field:'name',align:'center', title: '报告名称',width:200,templet:function(d){
                    return "<a class=\"attention-info\" href=\"#\" onclick=\"openDialogView('查看报告', '${ctx}/projectcontentinfo/projectReportData/form?id=" + d.id + "','95%', '95%')\">" + d.name + "</a>";
                }}
                ,{field:'type', align:'center',title: '工作类型',width:200}
                ,{field:'achievementType', align:'center',title: '成果类型',width:200}
                /*,{field:'signCostOneName', align:'center',title: '签字造价师1',width:200}
                ,{field:'signCostTwoName', align:'center',title: '签字造价师2',width:200}*/
                ,{field:'reviewStandard', align:'center',title: '复核标准',width:200}
                ,{field:'status', align:'center',title: '报告状态',width:200}
                ,{field:'reportDate', align:'center',title: '报告日期',width:200}
                ,{field:'fileStatus', align:'center',title: '归档状态',width:200}
                ,{field:'master', align:'center',title: '负责人',width:200}
                ,{field:'officeId', align:'center',title: '所属部门',width:200}
                ,{field:'createDate', align:'center',title: '创建日期',width:200}
                ,{field:'projectName', align:'center',title: '所属项目',width:200}
                ,{field:'projectMaster', align:'center',title: '项目负责人',width:200}
                ,{field:'contractNum', align:'center',title: '合同编号',width:200}
                ,{field:'client', align:'center',title: '主委托方',width:200}
            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="projectReportData" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "id":"${projectReportData.id}",
                    "index":"${index.index+1}"
                    ,"number":"${projectReportData.number}"
                    ,"name":"${projectReportData.name}"
                    ,"type":"${fns:getContentTypeName(projectReportData.type,"")}"
                    ,"achievementType":"${fns:getMainDictLabel(projectReportData.achievementType, 'achievement_type', '')}"
                    /*,"signCostOneName":"${projectReportData.signCostOne.name}"
                    ,"signCostTwoName":"${projectReportData.signCostTwo.name}"*/
                    ,"reviewStandard":"${fns:getDictLabel(projectReportData.reviewStandard, 'reviewStandard', '')}"
                    ,"status":"${fns:getDictLabel(projectReportData.status, 'audit_state', '')}"
                    ,"reportDate":"<fmt:formatDate value="${projectReportData.reportDate}" pattern="yyyy-MM-dd"/>"
                    ,"fileStatus":"${fns:getDictLabel(projectReportData.fileStatus, 'record_state', '')}"
                    ,"master":"${projectReportData.master.name}"
                    ,"officeId":"${projectReportData.officeName}"
                    ,"createDate":"<fmt:formatDate value="${projectReportData.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"
                    ,"projectName":"${projectReportData.project.projectName}"
                    ,"projectMaster":"${projectReportData.projectMaster}"
                    ,"contractNum":"${projectReportData.contractNum}"
                    ,"client":"${projectReportData.clientName}"
                }
                </c:forEach>
                </c:if>
            ]
            // ,even: true
            // ,height: 315
        });

    })
    resizeListTable();/*消除由于有竖向滚动条造成table出现横向滚动条*/
    $("a").on("click",addLinkVisied);
</script>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
</script>
</body>
</html>
