<%@ 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">
        $(document).ready(function() {
            //搜索框收放
            $('#moresee').click(function(){
                if($('#moresees').is(':visible'))
                {
                    $('#moresees').slideUp(0,resizeListWindow2);
                    $('#moresee i').removeClass("glyphicon glyphicon-menu-up").addClass("glyphicon glyphicon-menu-down");
                }else{
                    $('#moresees').slideDown(0,resizeListWindow2);
                    $('#moresee i').removeClass("glyphicon glyphicon-menu-down").addClass("glyphicon glyphicon-menu-up");
                }
            });

            laydate.render({
                elem: '#beginContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
            laydate.render({
                elem: '#endContractDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus', //响应事件。如果没有传入event，则按照默认的click
                type : 'date'
            });
        });
	</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>
	<style>
		.widthClass{
			display: inline-block;
		}
		.shows .input-group{
			width: 48%!important;
		}
	</style>
</head>
<body>
<div class="wrapper wrapper-content">
	<sys:message content="${message}"/>
	<div class="layui-row">
		<div class="full-width fl">

		</div>
		<div class="full-width fl">
			<div class="contentShadow layui-row" id="queryDiv">
				<form:form id="searchForm" modelAttribute="workContractListInfo" action="${ctx}/workcontractinfo/workContractInfo/workContractList" 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 lw7">
					<div class="layui-item query athird">
						<label class="layui-form-label">合同名称：</label>
						<div class="layui-input-block with-icon">
							<form:input path="name" 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">
							<input id="beginContractDate" name="beginContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
								   value="<fmt:formatDate value="${workContractListInfo.beginContractDate}" pattern="yyyy-MM-dd"/>"/>
							</input>
							<span class="group-sep">-</span>
							<input id="endContractDate" name="endContractDate" type="text" readonly="readonly" maxlength="20" class="laydate-icondate form-control layer-date layui-input laydate-icon query-group"
								   value="<fmt:formatDate value="${workContractListInfo.endContractDate}" pattern="yyyy-MM-dd"/>"/>
							</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" class="lw7" style="clear:both;display:none;">
                    <div class="layui-item query athird">
                        <label class="layui-form-label">合同编号：</label>
                        <div class="layui-input-block with-icon">
                            <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 with-icon">
							<form:input path="contractPrice" 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">
							<form:select path="contractState"  class="form-control simple-select">
								<form:option value="" label=""/>
								<form:options items="${fns:getDictList('audit_contract_state')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
							</form:select>
						</div>
					</div>
				</div>
				</form:form>
			</div>
		</div>
		<div class="full-width fl">
			<div class="layui-form contentDetails contentShadow shadowLBR">
				<div class="nav-btns">
					<table:exportExcel url="${ctx}/workcontractinfo/workContractInfo/exportListFile"></table:exportExcel><!-- 导出按钮 -->
					<%--<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i> 刷新</button>--%>
					<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:'contractNum',align:'center',fixed: true, sort:true,title: '合同编号',minWidth:200,templet:function(d){
                        return "<span title='"+ d.contractNum +"'>" + d.contractNum + "</span>";
                    }}
                ,{field:'name',align:'center', title: '合同名称',minWidth:200,templet:function(d){
                        return "<a class=\"attention-info\" title=\""+d.name+"\" href=\"javascript:void(0);\" onclick=\"openDialogView('查看合同管理', '${ctx}/workcontractinfo/workContractInfo/lookForm?id=" + d.id + "','95%', '95%')\">" + d.name + "</a>";
                    }}
                ,{field:'ext',align:'center', title: '合同来源',minWidth:160,templet:function(d){
                        return "<span title='"+ d.ext +"'>" + d.ext + "</span>";
                    }}
                ,{field:'projectName',align:'center', title: '投标名称',minWidth:160,templet:function(d){
                        return "<span title='"+ d.projectName +"'>" + d.projectName + "</span>";
                    }}
                ,{field:'projectNum',align:'center', title: '投标编号',minWidth:160,templet:function(d){
                        return "<span title='"+ d.projectNum +"'>" + d.projectNum + "</span>";
                    }}
                ,{field:'totalContractName',align:'center', title: '总合同名称',minWidth:160,templet:function(d){
                        return "<span title='"+ d.totalContractName +"'>" + d.totalContractName + "</span>";
                    }}
                ,{field:'officeName',align:'center', title: '所属部门',minWidth:160,templet:function(d){
                        return "<span title='"+ d.officeName +"'>" + d.officeName + "</span>";
                    }}
                ,{field:'contractPrice',align:'center', title: '合同金额（元）',minWidth:160,templet:function(d){
                        return "<span title='"+ d.contractPrice +"'>" + d.contractPrice + "</span>";
                    }}
                ,{field:'contractState',align:'center', title: '合同状态',minWidth:160,templet:function(d){
                        return "<span title='"+ d.contractState +"'>" + d.contractState + "</span>";
                    }}
                ,{field:'clientName',align:'center', title: '委托方',minWidth:160,templet:function(d){
                        return "<span title='"+ d.clientName +"'>" + d.clientName + "</span>";
                    }}
                ,{field:'contractDate',align:'center', title: '签订日期',minWidth:160,templet:function(d){
                        return "<span title='"+ d.contractDate +"'>" + d.contractDate + "</span>";
                    }}
                ,{field:'effectiveDate',align:'center', title: '合同生效日期',minWidth:160,templet:function(d){
                        return "<span title='"+ d.effectiveDate +"'>" + d.effectiveDate + "</span>";
                    }}
                ,{field:'closingDate',align:'center', title: '合同终止日期',minWidth:160,templet:function(d){
                        return "<span title='"+ d.closingDate +"'>" + d.closingDate + "</span>";
                    }}
                ,{field:'anotherContractNum',align:'center', title: '对方合同编号',minWidth:160,templet:function(d){
                        return "<span title='"+ d.anotherContractNum +"'>" + d.anotherContractNum + "</span>";
                    }}
                ,{field:'investmentAmount',align:'center', title: '投资额（万元）',minWidth:160,templet:function(d){
                        return "<span title='"+ d.investmentAmount +"'>" + d.investmentAmount + "</span>";
                    }}
                ,{field:'contractType', align:'center',title: '工程分类', width:120,templet:function(d){
                        return "<span title='"+ d.contractType +"'>" + d.contractType + "</span>";
                    }}
                ,{field:'recordState', align:'center',sort:true,title: '归档状态',width:100,templet:function(d){
                        return "<span title='"+ d.recordState +"'>" + d.recordState + "</span>";
                    }}
                ,{field:'summaryPayment',align:'center', title: '付款摘要',  width:180,templet:function(d){
                        return "<span title='"+ d.summaryPayment +"'>" + d.summaryPayment + "</span>";
                    }}
                ,{field:'contractSpecial',align:'center', title: '合同特别条款',  width:180,templet:function(d){
                        return "<span title='"+ d.contractSpecial +"'>" + d.contractSpecial + "</span>";
                    }}
                ,{field:'contractTypeDoc',align:'center', title: '合同类型说明',  width:180,templet:function(d){
                        return "<span title='"+ d.contractTypeDoc +"'>" + d.contractTypeDoc + "</span>";
                    }}
                ,{field:'remarks',align:'center', title: '备注信息',  width:180,templet:function(d){
                        return "<span title='"+ d.remarks +"'>" + d.remarks + "</span>";
                    }}
            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="workContractListInfo" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "index":"${index.index+1}"
                    ,"id":"${workContractListInfo.id}"
                    ,"contractNum":"${workContractListInfo.contractNum}"
                    ,"name":"${workContractListInfo.name}"
                    ,"ext":"${workContractListInfo.ext}"
                    ,"projectName":"${workContractListInfo.projectName}"
                    ,"projectNum":"${workContractListInfo.projectNum}"
					,"totalContractName":"${workContractListInfo.totalContractName}"
                    ,"officeName":"${workContractListInfo.officeName}"
                    ,"contractPrice":"<fmt:formatNumber value="${workContractListInfo.contractPrice}" pattern="#,#00.00"/>"
                    ,"contractState":"${fns:getDictLabel(workContractListInfo.contractState, 'audit_completion_state', '')}"
                    ,"clientName":"${workContractListInfo.clientName}"
                    ,"contractDate":"<fmt:formatDate value="${workContractListInfo.contractDate}" pattern="yyyy-MM-dd"/>"
                    ,"effectiveDate":"<fmt:formatDate value="${workContractListInfo.effectiveDate}" pattern="yyyy-MM-dd"/>"
                    ,"closingDate":"<fmt:formatDate value="${workContractListInfo.closingDate}" pattern="yyyy-MM-dd"/>"
                    ,"anotherContractNum":"${workContractListInfo.anotherContractNum}"
                    ,"investmentAmount":"${workContractListInfo.investmentAmount}"
                    ,"contractType":"${fns:getMainDictLabel(workContractListInfo.contractType, 'contract_type', '')}"
                    ,"recordState":"${fns:getDictLabel(workContractListInfo.recordState, 'record_state', '')}"
                    ,"summaryPayment":"${workContractListInfo.summaryPayment}"
                    ,"contractSpecial":"${workContractListInfo.contractSpecial}"
					,"contractTypeDoc":"${fns:getMainDictLabel(workContractListInfo.contractTypeDoc, 'contract_info_type', '')}"
                    ,"remarks":"${workContractListInfo.remarks}"
                }
                </c:forEach>
                </c:if>
            ]
        });

    })

    resizeListTable();
</script>
<script>
    resizeListWindow2();
    $(window).resize(function(){
        resizeListWindow2();
    });

</script>
</body>
</html>