<%@ 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() {
            laydate.render({
                elem: '#trialDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
            laydate.render({
                elem: '#bidDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
                event: 'focus' //响应事件。如果没有传入event，则按照默认的click
            });
            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'
            });
            //搜索框收放
            $('#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: '#bidDate', //目标元素。由于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>
</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="workBidProjectList" action="${ctx}/workbidprojectlist/workBidProjectList/" 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">
					<div class="layui-item query athird">
						<label class="layui-form-label">投标名称：</label>
						<div class="layui-input-block">
							<form:input path="projectName" 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">
							<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="${workBidProjectList.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="${workBidProjectList.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" 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="projectNumber" 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:select path="projectType"  class="form-control simple-select">
								<form:option value="" label=""/>
								<form:options items="${fns:getMainDictList('contract_type')}" 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="projectSource" class="form-control simple-select">
								<form:option value="" label=""/>
								<form:options items="${fns:getMainDictList('bidProjectSource')}" 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 style="clear:both;"></div>
					</div>
					<%--<div class="layui-item query athird lw9">
						<label class="layui-form-label double-line">工程投资额(万元)：</label>
						<div class="layui-input-block with-icon">
							<form:input path="min" htmlEscape="false" maxlength="64"  class=" form-control number layui-input"/>
						</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 with-icon">
							<form:input path="max" htmlEscape="false" maxlength="64"  class=" form-control number layui-input"/>
						</div>
					</div>--%>
					</form:form>
				</div>
			</div>
			<div class="full-width fl">
				<div class="contentShadow layui-form contentDetails">
					<div class="nav-btns">
						<shiro:hasPermission name="workbidproject:workBidProject:export">
							<table:exportExcel url="${ctx}/workbidprojectlist/workBidProjectList/export"></table:exportExcel><!-- 导出按钮 -->
						</shiro:hasPermission>

						<button class="nav-btn nav-btn-refresh" data-toggle="tooltip" data-placement="left" onclick="sortOrRefresh()" title="刷新"><i class="glyphicon glyphicon-repeat"></i>&nbsp;刷新</button>
						<div style="clear: both;"></div>
					</div>
					<table class="oa-table layui-table" id="contentTable"></table>

					<!-- 分页代码 -->
					<table:page page="${page}"></table:page>
					<div style="clear: both;"></div>
				</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: '#contentTable'
            ,page: false
            ,cols: [[
                {field:'index',align:'center',fixed: 'left', title: '序号',width:40}
                ,{field:'number',align:'center',fixed: true, title: '投标编号', minWidth:200,templet:function(d){
                        var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看投标项目', '${ctx}/workbidproject/workBidProject/form?id=" + d.id + "&tabId=1','95%','95%')\">" +
                            "<span title=" + d.number + ">" + d.number + "</span></a>";
                        return xml;
                    }}
                ,{field:'name',align:'center', title: '投标名称', minWidth:200,templet:function(d){
                        var xml = "<a class=\"attention-info\" href=\"javascript:void(0)\" onclick=\"openDialogView('查看投标项目', '${ctx}/workbidproject/workBidProject/form?id=" + d.id + "&tabId=1','95%','95%')\">" +
                            "<span title=" + d.name + ">" + d.name + "</span></a>";
                        return xml;
                    }}
                ,{field:'type',align:'center', title: '工程分类', width:160,templet:function(d){
                        return "<span title='"+ d.type +"'>" + d.type + "</span>";
                    }}
                ,{field:'typeExplain',align:'center', title: '类型说明', minWidth:200,templet:function(d){
                    return "<span title='"+ d.typeExplain +"'>" + d.typeExplain + "</span>";
                }}
                ,{field:'source', align:'center',title: '项目来源', width:120,templet:function(d){
                        return "<span title='"+ d.source +"'>" + d.source + "</span>";
                    }}
                ,{field:'sourceExplain',align:'center', title: '来源说明', minWidth:200,templet:function(d){
                    return "<span title='"+ d.sourceExplain +"'>" + d.sourceExplain + "</span>";
                }}
                ,{field:'projectScale',align:'center', title: '项目规模', minWidth:200,templet:function(d){
                    return "<span title='"+ d.projectScale +"'>" + d.projectScale + "</span>";
                }}
                ,{field:'scaleType',align:'center', title: '规模类型', minWidth:200,templet:function(d){
                    return "<span title='"+ d.scaleType +"'>" + d.scaleType + "</span>";
                }}
                ,{field:'scaleUnit',align:'center', title: '规模单位', minWidth:200,templet:function(d){
                    return "<span title='"+ d.scaleUnit +"'>" + d.scaleUnit + "</span>";
                }}
                ,{field:'money', align:'center',title: '投资额（万元）', width:100,templet:function(d){
                        return "<span title='"+ d.money +"'>" + d.money + "</span>";
                    }}
                ,{field:'bidCompany',align:'center', title: '招标单位', minWidth:200,templet:function(d){
                    return "<span title='"+ d.bidCompany +"'>" + d.bidCompany + "</span>";
                }}
                ,{field:'registrationDate',align:'center', title: '报名日期', minWidth:200,templet:function(d){
                    return "<span title='"+ d.registrationDate +"'>" + d.registrationDate + "</span>";
                }}
                ,{field:'date', align:'center',title: '投标日期',width:80}
                ,{field:'trialDate',align:'center', title: '资审日期', minWidth:200,templet:function(d){
                    return "<span title='"+ d.trialDate +"'>" + d.trialDate + "</span>";
                }}
                ,{field:'trialType',align:'center', title: '资格审查', minWidth:200,templet:function(d){
                    return "<span title='"+ d.trialType +"'>" + d.trialType + "</span>";
                }}
                ,{field:'documentCost',align:'center', title: '文件费用（元）', minWidth:200,templet:function(d){
                    return "<span title='"+ d.documentCost +"'>" + d.documentCost + "</span>";
                }}
                ,{field:'bidBond',align:'center', title: '投标保证金（元）', minWidth:200,templet:function(d){
                    return "<span title='"+ d.bidBond +"'>" + d.bidBond + "</span>";
                }}
                ,{field:'bondStyle',align:'center', title: '投标保证金形式', minWidth:200,templet:function(d){
                    return "<span title='"+ d.bondStyle +"'>" + d.bondStyle + "</span>";
                }}
                ,{field:'giveDate',align:'center', title: '投标保证金交付日期', minWidth:200,templet:function(d){
                    return "<span title='"+ d.giveDate +"'>" + d.giveDate + "</span>";
                }}
                ,{field:'refundDate',align:'center', title: '保证金退还日期', minWidth:200,templet:function(d){
                    return "<span title='"+ d.refundDate +"'>" + d.refundDate + "</span>";
                }}
                ,{field:'office',align:'center', title: '项目协作部门', minWidth:200,templet:function(d){
                    return "<span title='"+ d.office +"'>" + d.office + "</span>";
                }}
                ,{field:'isBid',align:'center', title: '是否联合体投标', minWidth:200,templet:function(d){
                    return "<span title='"+ d.isBid +"'>" + d.isBid + "</span>";
                }}
                ,{field:'subcontractCompany',align:'center', title: '对外协作单位', minWidth:200,templet:function(d){
                    return "<span title='"+ d.subcontractCompany +"'>" + d.subcontractCompany + "</span>";
                }}
                ,{field:'businessType',align:'center', title: '业务类型', minWidth:200,templet:function(d){
                    return "<span title='"+ d.businessType +"'>" + d.businessType + "</span>";
                }}
                ,{field:'projectSituation',align:'center', title: '项目概况', minWidth:200,templet:function(d){
                    return "<span title='"+ d.projectSituation +"'>" + d.projectSituation + "</span>";
                }}
                ,{field:'serviceContent',align:'center', title: '服务内容', minWidth:200,templet:function(d){
                    return "<span title='"+ d.serviceContent +"'>" + d.serviceContent + "</span>";
                }}
                ,{field:'remarks',align:'center', title: '备注信息', minWidth:200,templet:function(d){
                    return "<span title='"+ d.remarks +"'>" + d.remarks + "</span>";
                }}
                ,{field:'createBy',align:'center', title: '创建人', minWidth:200,templet:function(d){
                    return "<span title='"+ d.createBy +"'>" + d.createBy + "</span>";
                }}
                ,{field:'createDate',align:'center', title: '创建日期', minWidth:200,templet:function(d){
                    return "<span title='"+ d.createDate +"'>" + d.createDate + "</span>";
                }}
                ,{ title: '状态', align:'center', width:70,templet:function(d){
                        <%--var st = getAuditState(d.status)--%>
                        <%--var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/workbidproject/workBidProject/getProcessOne?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";--%>
                        <%--return xml;--%>
                        var st = getAuditState(d.status);
                        if(st.action)
                            var xml = "<span onclick=\"openDialogView('流程追踪', '${ctx}/workbidproject/workBidProject/getProcessOne?id=" + d.id + "','95%','95%')\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
                        else
                            var xml = "<span style=\"cursor:default;\" class=\"status-label status-label-" + st.label + "\" >" + st.status + "</span>";
                        return xml;
                    }}
            ]]
            ,data: [
                <c:if test="${ not empty page.list}">
                <c:forEach items="${page.list}" var="workBidProjectList" varStatus="index">
                <c:if test="${index.index != 0}">,</c:if>
                {
                    "index":"${index.index+1}"
                    ,"id":"${workBidProjectList.id}"
                    ,"number":"${workBidProjectList.projectNumber}"
                    ,"name":"${workBidProjectList.projectName}"
                    ,"documentCost":"${workBidProjectList.documentCost}"
                    ,"office":"${workBidProjectList.coopName}"
                    ,"subcontractCompany":"${workBidProjectList.subcontractCompany}"
                    ,"projectSituation":"${workBidProjectList.projectSituation}"
                    ,"serviceContent":"${workBidProjectList.serviceContent}"
                    ,"remarks":"${workBidProjectList.remark}"
                    ,"createBy":"${workBidProjectList.createByName}"
                    ,"type":"${fns:getMainDictLabel(workBidProjectList.projectType, 'contract_type', '')}"
                    ,"source":"${fns:getMainDictLabel(workBidProjectList.projectSource, 'bidProjectSource', '')}"
                    ,"date":"<fmt:formatDate value="${workBidProjectList.bidDate}" pattern="yyyy-MM-dd"/>"
                    ,"registrationDate":"<fmt:formatDate value="${workBidProjectList.registrationDate}" pattern="yyyy-MM-dd"/>"
                    ,"trialDate":"<fmt:formatDate value="${workBidProjectList.trialDate}" pattern="yyyy-MM-dd"/>"
                    ,"giveDate":"<fmt:formatDate value="${workBidProjectList.giveDate}" pattern="yyyy-MM-dd"/>"
                    ,"refundDate":"<fmt:formatDate value="${workBidProjectList.refundDate}" pattern="yyyy-MM-dd"/>"
                    ,"createDate":"<fmt:formatDate value="${workBidProjectList.creaDates}" pattern="yyyy-MM-dd"/>"
                    ,"isBid":"${fns:getDictLabel(workBidProjectList.isBid, 'is_bid', '')}"
                    ,"bidBond":"<fmt:formatNumber value="${workBidProjectList.bidBond}" pattern="#,#00.00"/>"
                    ,"money":"<fmt:formatNumber value="${workBidProjectList.investMoney}" pattern="#,#00.00"/>"
					,"scaleType":"${fns:getMainDictLabel(workBidProjectList.scaleType, 'scale_type', '')}"
                    ,"scaleUnit":"${fns:getMainDictLabel(workBidProjectList.scaleUnit, 'scale_unit', '')}"
                    ,"trialType":"${fns:getDictLabel(workBidProjectList.trialType, 'trial_type', '')}"
                    ,"bondStyle":"${fns:getMainDictLabel(workBidProjectList.bondStyle, 'bond_style', '')}"
                    ,"businessType":"${fns:getMainDictLabel(workBidProjectList.businessType, 'business_type', '')}"
                    ,"typeExplain":"${workBidProjectList.typeExplain}"
                    ,"sourceExplain":"${workBidProjectList.sourceExplain}"
                    ,"projectScale":"${workBidProjectList.projectScale}"
                    <c:choose>
						<c:when test="${workBidProjectList.isExt == '0' }">,"bidCompany":"${workBidProjectList.bidCompanyName}"</c:when>
                    	<c:when test="${workBidProjectList.isExt == '1' }">,"bidCompany":"${workBidProjectList.extCompany}"</c:when>
                    </c:choose>
                    ,"status":"${workBidProjectList.status}"
                }
                </c:forEach>
                </c:if>
            ]
            // ,even: true
            // ,height: 315
        });

    })

    resizeListTable();
</script>
<script>
    resizeListWindow1();
    $(window).resize(function(){
        resizeListWindow1();
    });
  /*  var navg = window.navigator.userAgent;
    if(navg.indexOf('Chrome')!==-1&& navg.indexOf('Edge')==-1){
        $('.layui-table').children().eq(0).children().children().eq(1).css({"background":"transparent","position":"sticky","border-right":"1px solid #ccc","left":"0","background":"#F5F5F5","z-index":"999"});
        var tableft = $('.layui-table').children().eq(0).children().children().eq(1).width();
        $('.layui-table').children().eq(0).children().children().eq(2).css({"background":"transparent","position":"sticky","left":tableft,"background":"#F5F5F5","z-index":"999"});
        var trone = $('.layui-table').children().eq(1).children();
        var newArr = []
        for(var i=0;i<trone.length;i++){
            newArr.push(trone[i]);
            $(newArr[i]).children().eq(1).css({"background":"transparent","position":"sticky","left":"0","background":"#fff","z-index":"999"});
            $(newArr[i]).children().eq(2).css({"background":"transparent","position":"sticky","left":tableft,"background":"#fff","z-index":"999"});
        }
    }*/
</script>
</body>
</html>