<#assign base=request.contextPath />
<#import "../common/defaultLayout.ftl" as defaultLayout>

<@defaultLayout.layout>
    <link rel="stylesheet" href="../assets/css/amazeui.switch.css"/>
    <style type="text/css">
        .huanhang{
        // 表格自动换行
        table-layout:fixed;
            word-break:break-all
        }
        .focus{
        // 表格自动换行
        table-layout:fixed;
            word-break:break-all
        }
        /*固定表头的列表*/
        .fixed-list {
            flex: 1 1 auto;
            overflow: hidden;
        }
        .fixed-list table {
            display: block;
            width: 100%;
            max-height: 100%;
            border-spacing: 0px;
            border-collapse: collapse;
            border: none;
            overflow-y: hidden;
            overflow-x: auto;
            margin: 0;
        }

        .fixed-list.is-vertical-scroll table tbody {
            max-height: calc(100% - 71px);
        }
        .fixed-list table>thead>tr>th {
            height: 40px;
            text-align: center;
            vertical-align: middle;
        }
        .fixed-list table td {
            height: 55px;
            text-align: center;
        }
        .fixed-list table tbody {
            display: block;
            width: 100%;
            max-height: calc(100% - 45px);
            overflow-y: scroll;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
        }

        .fixed-list table tr {
            table-layout: fixed;
            display: table;
        }
        .fixed-list table thead tr {
            width: calc(100% - 18px);
            border-top: 1px solid #ddd;
            border-bottom: none;
        }
        .fixed-list table tbody tr {
            width: 100%;
        }
    </style>
    <div class="admin-content">
        <div class="am-cf am-padding" style="padding:1rem 1.6rem 1.6rem 1rem;margin:0px;">
            <!--  padding:1px 2px 3px 4px;上、右、下,和左   -->
            <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">项目管理</strong> /
                <small>项目管理</small>
            </div>
        </div>
        <div class="am-g">
            <div class="am-u-sm-12">
                <form class="am-form" id="listForm" action="${base}/project/listApprove" method="POST">
                    <input type="hidden" id="keywords" name="keywords" value='${keywords!""}'/>
                    <style>
                        .flex-row {
                            display: -webkit-box;
                            display: -webkit-flex;
                            display: flex;
                            display: -ms-flex;
                        }
                        .search-table {
                            position: relative;
                            width: 100%;
                            padding: 6px 0 0;
                            border: 1px solid #d8d8d8;
                            border-radius: 4px;
                        }
                        .search-table input {
                            border-color: #e6e6e6!important;
                        }
                        .search-table .st-row {
                            position: relative;
                            width: 100%;
                            justify-content: flex-start;
                            /*align-items: center;*/
                            padding: 0 6px 6px;
                            margin-bottom: 6px;
                            border-bottom: 1px solid #d8d8d8;
                        }
                        .search-table .tools-row {
                            position: relative;
                            width: 100%;
                            justify-content: flex-end;
                            padding-right: 6px;
                            margin-bottom: 6px;
                        }
                        .tools-row button {
                            margin-left: 12px;
                        }
                        /* 默认5等分，一行5个 */
                        .st-row .st-col {
                            position: relative;
                            flex: 0 0 18%;
                            margin-right: 2%;
                        }
                        /* 4等分，一行4个 */
                        .st-col.st-col-4 {
                            flex: 0 0 22%;
                            margin-right: 3%;
                        }
                        /* 3等分，一行3个 */
                        .st-col.st-col-3 {
                            flex: 0 0 31%;
                            margin-right: 2.3%;
                        }
                        /* 2等分，一行2个 */
                        .st-col.st-col-2 {
                            flex: 0 0 48%;
                            margin-right: 2%;
                        }
                        .st-col.hidden {
                            display: none;
                        }
                        .st-col .st-col-title {
                            font-size: 14px;
                            color: #333;
                            margin-bottom: 6px;
                            white-space: nowrap;
                            font-weight: bold;
                        }
                        .st-col .st-col-field {
                            align-items: center;
                        }
                        .st-col .mid-connect {
                            margin: 0 4px;
                        }
                        .expand-section {
                            display: block;
                        }
                        .expand-section.fold {
                            display: none;
                        }
                    </style>
                    <div class="search-table">
                        <#--第一行默认展示-->
                        <div class="flex-row st-row">
                            <div class="st-col">
                                <div class="st-col-title">项目编号</div>
                                <div class="st-col-field">
                                    <input type="text" id="projectNo" class="am-form-field am-input-sm" value="${projectNo!}"/>
                                </div>
                            </div>
                            <div class="st-col">
                                <div class="st-col-title">项目名称</div>
                                <div class="st-col-field">
                                    <input type="text" id="name" class="am-form-field am-input-sm" value="${name!}"/>
                                </div>
                            </div>
                            <div class="st-col">
                                <div class="st-col-title">项目当前状态</div>
                                <div class="st-col-field">
                                    <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="status" name="status">
                                        <option value="-1">全部</option>
                                        <option value="1" <#if status?? && status='1'>selected</#if>>概算</option>
                                        <option value="5" <#if status?? && status='5'>selected</#if>>预算</option>
                                        <option value="10" <#if status?? && status='10'>selected</#if>>结算</option>
                                        <option value="15" <#if status?? && status='15'>selected</#if>>决算</option>
                                    </select>
                                </div>
                            </div>
                            <div class="st-col">
                                <div class="st-col-title">项目创建者</div>
                                <div class="st-col-field">
                                    <input type="text" id="creatorName" class="am-form-field am-input-sm" value="${creatorName!}"/>
                                </div>
                            </div>
                            <div class="st-col">
                                <div class="st-col-title">部门名称</div>
                                <div class="st-col-field">
                                    <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="deptId" name="deptId">
                                        <option value="-1">全部</option>
                                        <#list  deptList as dept>
                                            <option value=${dept.id!} <#if deptId! =="${dept.id}" >
                                                    selected
                                                    </#if>>${dept.name!}</option>
                                        </#list>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <!-- 扩展区域 -->
                        <div class="expand-section <#if extend='1'> fold</#if>">
                            <!-- 第二行 -->
                            <div class="flex-row st-row">
                                <div class="st-col">
                                    <div class="st-col-title">项目类型</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="type" name="type">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if type?? && type='1'>selected</#if>>工程集成类</option>
                                            <option value="2" <#if type?? && type='2'>selected</#if>>设备集成类</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">合作类型</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="cooperateType" name="cooperateType">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if cooperateType?? && cooperateType='1'>selected</#if>>战略合作类</option>
                                            <option value="2" <#if cooperateType?? && cooperateType='2'>selected</#if>>非战略合作类</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">垫资模式</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="underwrittenMode" name="underwrittenMode">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if underwrittenMode?? && underwrittenMode='1'>selected</#if>>A类-不垫资（战略合作）</option>
                                            <#--                                        <option value="2" <#if underwrittenMode?? && underwrittenMode='2'>selected</#if>>B类-不垫资（背靠背）</option>-->
                                            <option value="3" <#if underwrittenMode?? && underwrittenMode='3'>selected</#if>>B类-垫资（账期覆盖）</option>
                                            <option value="4" <#if underwrittenMode?? && underwrittenMode='4'>selected</#if>>C类-垫资（账期不覆盖）</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">项目把握度</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="certainty" name="certainty">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if certainty?? && certainty='1'>selected</#if>>A：项目成功率80%-100%</option>
                                            <option value="2" <#if certainty?? && certainty='2'>selected</#if>>B：项目成功率60%-80%</option>
                                            <option value="3" <#if certainty?? && certainty='3'>selected</#if>>C：项目成功率40%-60%</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">客户名称</div>
                                    <div class="st-col-field">
                                        <input type="text" id="customer" class="am-form-field am-input-sm" value="${customer!}"/>
                                    </div>
                                </div>
                            </div>
                            <!-- 第三行 -->
                            <div class="flex-row st-row">
                                <div class="st-col">
                                    <div class="st-col-title">最终用户名称</div>
                                    <div class="st-col-field">
                                        <input type="text" id="terminalCustomer" class="am-form-field am-input-sm" value="${terminalCustomer!}"/>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">项目负责人</div>
                                    <div class="st-col-field">
                                        <input type="text" id="principal" class="am-form-field am-input-sm" value="${principal!}"/>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">审核状态</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500,searchBox: 1}" id="approveStatus" name="approveStatus">
                                            <option value="-1">全部</option>
                                            <option value="0" <#if approveStatus?? && approveStatus='0'>selected</#if>>草稿</option>
                                            <option value="1" <#if approveStatus?? && approveStatus='1'>selected</#if>>待审核</option>
                                            <option value="2" <#if approveStatus?? && approveStatus='2'>selected</#if>>审核通过</option>
                                            <option value="3" <#if approveStatus?? && approveStatus='3'>selected</#if>>审核不通过</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col expand-section <#if extend='1'> fold</#if>">
                                    <div class="st-col-title">是否二次合作</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500}" id="isSecond" name="isSecond">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if isSecond?? && isSecond='1'>selected</#if>>是</option>
                                            <option value="2" <#if isSecond?? && isSecond='2'>selected</#if>>否</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col expand-section <#if extend='1'> fold</#if>">
                                    <div class="st-col-title">直签</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500}" id="signType" name="signType">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if signType?? && signType='1'>selected</#if>>是</option>
                                            <option value="2" <#if signType?? && signType='2'>selected</#if>>否</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <!-- 第四行 -->
                            <div class="flex-row st-row">
                                <div class="st-col expand-section <#if extend='1'> fold</#if>">
                                    <div class="st-col-title">行业场景</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 130}" id="industryScene" name="industryScene">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if industryScene?? && industryScene='1'>selected</#if>>信息安全</option>
                                            <option value="2" <#if industryScene?? && industryScene='2'>selected</#if>>政府</option>
                                            <option value="3" <#if industryScene?? && industryScene='3'>selected</#if>>公安</option>
                                            <option value="4" <#if industryScene?? && industryScene='4'>selected</#if>>企业</option>
                                            <option value="5" <#if industryScene?? && industryScene='5'>selected</#if>>教育</option>
                                            <option value="6" <#if industryScene?? && industryScene='6'>selected</#if>>交通</option>
                                            <option value="7" <#if industryScene?? && industryScene='7'>selected</#if>>医疗</option>
                                            <option value="8" <#if industryScene?? && industryScene='8'>selected</#if>>电力资源</option>
                                            <option value="9" <#if industryScene?? && industryScene='9'>selected</#if>>运营商</option>
                                            <option value="10" <#if industryScene?? && industryScene='10'>selected</#if>>金融</option>
                                            <option value="11" <#if industryScene?? && industryScene='11'>selected</#if>>专网</option>
                                            <option value="12" <#if industryScene?? && industryScene='12'>selected</#if>>其他</option>
                                            <option value="13" <#if industryScene?? && industryScene='13'>selected</#if>>互联网</option>
                                            <option value="14" <#if industryScene?? && industryScene='14'>selected</#if>>银行</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">项目解决方案</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 500}" id="resolvePlan" name="resolvePlan">
                                            <option value="-1">全部</option>
                                            <option value="1" <#if resolvePlan?? && resolvePlan='1'>selected</#if>>公共服务(智慧交通、雪亮工程、治安防控体系等)</option>
                                            <option value="2" <#if resolvePlan?? && resolvePlan='2'>selected</#if>>泛行业(智慧园区、智慧医疗、智慧工地等)</option>
                                            <option value="3" <#if resolvePlan?? && resolvePlan='3'>selected</#if>>其他生态</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">最后更新时间</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <i class="am-icon-calendar"></i>
                                            <input type="text" class="am-form-field am-input-sm" id="startUpdateDate"
                                                   value="${startUpdateDate!}" placeholder="开始日期" autocomplete="off" data-am-datepicker>
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <i class="am-icon-calendar"></i>
                                            <input type="text" class="am-form-field am-input-sm" id="endUpdateDate"
                                                   value="${endUpdateDate!}" placeholder="结束日期" autocomplete="off" data-am-datepicker>
                                        </div>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">项目周期</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <i class="am-icon-calendar"></i>
                                            <input type="text" class="am-form-field am-input-sm" id="startDate"
                                                   value="${startDate!}" placeholder="开始日期" autocomplete="off" data-am-datepicker>
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <i class="am-icon-calendar"></i>
                                            <input type="text" class="am-form-field am-input-sm" id="endDate"
                                                   value="${endDate!}" placeholder="结束日期" autocomplete="off" data-am-datepicker>
                                        </div>
                                    </div>
                                </div>
                                <div class="st-col">
                                    <div class="st-col-title">预计合同签订时间</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <i class="am-icon-calendar"></i>
                                            <input type="text" class="am-form-field am-input-sm" id="contractStartTime"
                                                   value="${contractStartTime!}" placeholder="开始日期" autocomplete="off" data-am-datepicker>
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <i class="am-icon-calendar"></i>
                                            <input type="text" class="am-form-field am-input-sm" id="contractEndTime"
                                                   value="${contractEndTime!}" placeholder="结束日期" autocomplete="off" data-am-datepicker>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- 第五行 -->
                            <div class="flex-row st-row">
                                <div class="st-col st-col-4">
                                    <div class="st-col-title">汇智产品金额</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="huizhiStart"
                                                   value="${huizhiStart!}" placeholder="汇智产品金额" autocomplete="off">
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="huizhiEnd"
                                                   value="${huizhiEnd!}" placeholder="汇智产品金额" autocomplete="off">
                                        </div>
                                    </div>
                                </div>
                                <div class="st-col st-col-4">
                                    <div class="st-col-title">华智产品金额</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="huazhiStart"
                                                   value="${huazhiStart!}" placeholder="华智产品金额" autocomplete="off">
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="huazhiEnd"
                                                   value="${huazhiEnd!}" placeholder="华智产品金额" autocomplete="off">
                                        </div>
                                    </div>
                                </div>
                                <div class="st-col st-col-4">
                                    <div class="st-col-title">华三产品金额</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="huasanStart"
                                                   value="${huasanStart!}" placeholder="华三产品金额" autocomplete="off">
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="huasanEnd"
                                                   value="${huasanEnd!}" placeholder="华三产品金额" autocomplete="off">
                                        </div>
                                    </div>
                                </div>
                                <div class="st-col st-col-4">
                                    <div class="st-col-title">其他产品金额</div>
                                    <div class="flex-row st-col-field">
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="otherStart"
                                                   value="${otherStart!}" placeholder="其他产品金额" autocomplete="off">
                                        </div>
                                        <div class="mid-connect">至</div>
                                        <div class="am-form-icon">
                                            <input type="text" class="am-form-field am-input-sm" id="otherEnd"
                                                   value="${otherEnd!}" placeholder="其他产品金额" autocomplete="off">
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!-- 第六行 -->
                            <div class="flex-row st-row">
                                <div class="st-col st-col-4">
                                    <div class="st-col-title">项目阶段</div>
                                    <div class="st-col-field">
                                        <select data-am-selected="{btnSize: 'sm',btnWidth: '100%',maxHeight: 130,searchBox: 1}" id="stage" name="stage">
                                            <option value="-1">全部</option>
                                            <option value="0" <#if stage?? && stage='0'>selected</#if>>S0-概算立项</option>
                                            <option value="1" <#if stage?? && stage='1'>selected</#if>>S1-项目调研</option>
                                            <option value="2" <#if stage?? && stage='2'>selected</#if>>S2-方案设计</option>
                                            <option value="3" <#if stage?? && stage='3'>selected</#if>>S3-预算评估</option>
                                            <option value="4" <#if stage?? && stage='4'>selected</#if>>S4-招标期</option>
                                            <option value="5" <#if stage?? && stage='5'>selected</#if>>S5-合同期</option>
                                            <option value="6" <#if stage?? && stage='6'>selected</#if>>S6-交付期</option>
                                            <option value="7" <#if stage?? && stage='7'>selected</#if>>S7-结算期</option>
                                            <option value="8" <#if stage?? && stage='8'>selected</#if>>S8-决算期</option>
                                            <option value="9" <#if stage?? && stage='9'>selected</#if>>L-项目丢失</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- 按钮 -->
                        <div class="flex-row tools-row">
                            <button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
                                    id="extend" value="${extend!}">扩展筛选项
                            </button>
                            <@shiro.hasPermission name="APPROVE_QUERY">
                                <button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
                                        id="submit-btn">搜索
                                </button>
                            </@shiro.hasPermission>
                            <@shiro.hasPermission name="APPROVE_EXPORT">
                                <button type="button" class="am-btn am-btn-default am-btn-sm am-text-secondary"
                                        id="submit-btn-export">导出
                                </button>
                            </@shiro.hasPermission>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        <div class="am-g fixed-list is-vertical-scroll">
            <div class="am-u-sm-12">
                <div class="list-content">
                    <style>
                        td {
                            word-break: break-all;
                        }
                    </style>
                    <table class="am-table am-table-striped am-table-hover table-main">
                        <thead style="display:block;width: 1888px;">
                            <tr class="am-text-nowrap">
                            <th class="table-title" width="60px">序号</th>
                            <th class="table-title" width="120px">项目编号</th>
                            <th class="table-title" width="200px">项目名称</th>
                            <th class="table-title">项目类型</th>
                            <#--<th class="table-title">垫资模式</th>-->
                            <#--<th class="table-title">垫资利息</th>-->
                            <#--<th class="table-title">垫资峰值</th>-->
                            <th class="table-title">项目合同金额</th>
                            <th class="table-title">项目阶段</th>
                            <#--<th class="table-title">项目毛利</th>-->
                            <#--<th class="table-title">项目毛利率</th>-->
                            <#--<th class="table-title">项目把握度</th>-->
                           <#-- <th class="table-title">汇智产品金额</th>-->
                            <#--<th class="table-title">华智产品金额</th>-->
                            <#--<th class="table-title">华三产品金额</th>-->
                            <#--<th class="table-title">其他产品金额</th>-->
                            <#--<th class="table-title">项目状态</th>-->
                            <#--<th class="table-title">行业场景应用</th>-->
                            <#--<th class="table-title">解决方案</th>-->
                            <#--<th class="table-title">客户名称</th>-->
                            <#--<th class="table-title">最终用户名称</th>-->
                            <#--<th class="table-title">预计合同签订时间</th>-->
                            <#--<th class="table-title">项目计划招标时间</th>-->
                            <#--<th class="table-title">是否二次合作</th>-->
                            <#--<th class="table-title">直签</th>-->
                            <#--<th class="table-title">战略合作对象</th>-->
                            <#--<th class="table-title">项目负责人</th>-->
                            <#--<th class="table-title">审核状态</th>-->
                            <th class="table-title">当前审核人</th>
                            <th class="table-title">项目创建者</th>
                            <#--<th class="table-title">部门名称</th>-->
                            <#--<th class="table-title">项目周期</th>-->
                            <#--<th class="table-title">最后更新时间</th>-->
                            <th class="table-title" width="240px">操作</th>
                        </tr>
                        </thead>
                        <tbody style="display:block;width: 1888px;">
                        <#list pager.list as list>
                            <tr>
                                <#--序号-->
                                <td width="60px">${list.tempId!}</td>
                                <#--项目编号-->
                                <td class="huanhang" width="120px">${list.projectNo!}</td>
                                <#--项目名称-->
                                <td class="huanhang" width="200px">
                                    <a style="cursor: pointer;text-decoration:none" onclick="approve2(${list.id})">${list.name!}</a>
                                </td>
                                <#--项目类型-->
                                <td>${list.typeDesc!}</td>
                                <#--垫资模式-->
                                <#--<td>${list.underwrittenModeStr!}</td>-->
                                <#--垫资利息-->
                                <#--<td>${Utils.format(list.advanceInterestAmount, "0.00")}</td>-->
                                <#--垫资峰值-->
                                <#--<td>${Utils.format(list.advancePeakAmount, "0.00")}</td>-->
                                <#--项目合同金额-->
                                <td>${Utils.format(list.contractAmount, "0.00")}</td>
                                <#--项目阶段-->
                                <td>
                                    <#if list.stage??>
                                        <#if list.stage==0>S0-概算立项
                                            <#elseif list.stage==1>S1-项目调研
                                            <#elseif list.stage==2>S2-方案设计
                                            <#elseif list.stage==3>S3-预算评估
                                            <#elseif list.stage==4>S4-招标期
                                            <#elseif list.stage==5>S5-合同期
                                            <#elseif list.stage==6>S6-交付期
                                            <#elseif list.stage==7>S7-结算期
                                            <#elseif list.stage==8>S8-决算期
                                            <#elseif list.stage==9>L-项目丢失
                                        </#if>
                                        <#else>
                                    </#if>
                                </td>
                                <#--项目毛利-->
                                <#--<td>${Utils.format(list.grossProfit, "0.00")}</td>-->
                                <#--项目毛利率-->
                                <#--<td>${Utils.format(list.grossProfitMargin, "0.00")}</td>-->
                                <#--项目把握度-->
                                <#--<td>${list.certaintyStr!}</td>-->
                                <#--汇智产品金额-->
                                <#--<td>${Utils.format(list.huizhiProductAmount, "0.00")}</td>-->
                                <#--华智产品金额-->
                                <#--<td>${Utils.format(list.huazhiProductAmount, "0.00")}</td>-->
                                <#--华三产品金额-->
                                <#--<td>${Utils.format(list.huasanProductAmount, "0.00")}</td>-->
                                <#--其他产品金额-->
                                <#--<td>${Utils.format(list.ziguangOtherAmount, "0.00")}</td>-->
                                <#--项目状态-->
                                <#--<td>${list.statusDesc!}</td>-->
                                <#--行业场景应用-->
                                <#--<td>${list.industryScenario!}</td>-->
                                <#--解决方案-->
                                <#--<td>${list.resolvePlanStr!}</td>-->
                                <#--客户名称-->
                                <#--<td>${list.customer!}</td>-->
                                <#--最终用户名称-->
                                <#--<td>${list.terminalCustomer!}</td>-->
                                <#--预计合同签订时间-->
                                <#--<td>${(list.contractTime?string("yyyy-MM-dd"))!}</td>-->
                                <#--项目计划招标时间-->
                                <#--<td>${(list.bidsTime?string("yyyy-MM-dd"))!}</td>-->
                                <#--是否二次合作-->
                                <#--<td>${list.isSecondStr!}</td>-->
                                <#--直签-->
                                <#--<td>${list.signTypeStr!}</td>-->
                                <#--战略合作对象-->
                                <#--<td>${list.collaborator!}</td>-->
                                <#--项目负责人-->
                                <#--<td>${list.principal!}</td>-->
                                <#--审核状态-->
                                <#--<td>${list.approveStatusDesc!}</td>-->
                                <#--当前审核人-->
                                <td>${list.approveName!}</td>
                                <#--项目创建者-->
                                <td>${list.creatorName!}</td>
                                <#--部门名称-->
                                <#--<td>${list.deptName!}</td>-->
                                <#--项目周期-->
                                <#--<td>${(list.startDate?string("yyyy-MM"))!} ~ ${(list.endDate?string("yyyy-MM"))!}</td>-->
                                <#--最后更新时间-->
                                <#--<td>${(list.lastUpdateTime?string("yyyy-MM-dd HH:mm:ss"))!}</td>-->
                                <#--操作-->
                                <td width="240px">
                                    <div class="am-btn-toolbar">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <#--<button type="button"
                                                    class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                    onclick="location.href='${base}/project/approve?listFrom=list&id=${list.id}'"><span
                                                        class="am-icon-pencil-square-o"></span>查看
                                            </button>-->

                                            <button type="button"
                                                    class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                    onclick="location.href='${base}/project/approve?listFrom=list&type=2&id=${list.id}'"><span
                                                        class="am-icon-pencil-square-o"></span>审核
                                            </button>

                                            <button type="button"
                                                    class="am-btn am-btn-default am-btn-xs am-text-secondary"
                                                    onclick="location.href='${base}/project/taskRecords/${list.id?c}'"><span
                                                        class="am-icon-pencil-square-o"></span>查看审核流程
                                            </button>

                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>


        <footer class="admin-content-footer">
            <div class="am-cf">
                <!-- 分页 -->
                <#if (pager.list)?exists && (pager.list?size>0) >
                    <div class="am-fr">
                        <#include "../common/common_pager.ftl">
                    </div>
                <#else>
                    <div class="am-kai" align="center">
                        <h3>没有找到任何记录!</h3>
                    </div>
                </#if>
            </div>
        </footer>
    </div>
</@defaultLayout.layout>

<script src="../assets/js/amazeui.switch.js"></script>
<script type="text/javascript">
    $(function () {
        $("#extend").on("click", function () {
            var extend = $("#extend").val();
            if (extend === '0') {
                $(".extendCondition").hide();
                $('.expand-section').hide()
                $("#extend").val(1);
                $("#extend").text("扩展筛选项");
            } else {
                $(".extendCondition").show();
                $('.expand-section').show()
                $("#extend").val(0);
                $("#extend").text("隐藏筛选项");
            }
        });

        $("#submit-btn").on("click", function () {
            $("#pageNumber").val(1);
            setKeywords();
            $("#listForm").attr("action","${base}/project/listApprove");
            $("#listForm").submit();
        });

        $("#submit-btn-export").on("click", function () {
            setKeywords();
            $("#listForm").attr("action","${base}/project/exportApprove");
            $("#listForm").submit();
        });


        function setKeywords() {
            var keywordsObj = {};
            var extend = $("#extend").val();
            keywordsObj.extend = extend;
            if ($("#projectNo").val())
                keywordsObj.projectNo = $("#projectNo").val();
            if ($("#name").val())
                keywordsObj.name = $("#name").val();
            if ($("#creatorName").val())
                keywordsObj.creatorName = $("#creatorName").val();
            if ($("#status").val())
                keywordsObj.status = $("#status").val();
            if ($("#approveStatus").val())
                keywordsObj.approveStatus = $("#approveStatus").val();
            if ($("#deptId").val())
                keywordsObj.deptId = $("#deptId").val();
            if ($("#type").val())
                keywordsObj.type = $("#type").val();
            if ($("#cooperateType").val())
                keywordsObj.cooperateType = $("#cooperateType").val();
            if ($("#underwrittenMode").val())
                keywordsObj.underwrittenMode = $("#underwrittenMode").val();
            if ($("#certainty").val())
                keywordsObj.certainty = $("#certainty").val();
            if (extend === '0') {
                if ($("#isSecond").val())
                    keywordsObj.isSecond = $("#isSecond").val();
                if ($("#signType").val())
                    keywordsObj.signType = $("#signType").val();
                if ($("#resolvePlan").val())
                    keywordsObj.resolvePlan = $("#resolvePlan").val();
                if ($("#startDate").val())
                    keywordsObj.startDate = $("#startDate").val();
                if ($("#endDate").val())
                    keywordsObj.endDate = $("#endDate").val();
                if ($("#startUpdateDate").val())
                    keywordsObj.startUpdateDate = $("#startUpdateDate").val();
                if ($("#endUpdateDate").val())
                    keywordsObj.endUpdateDate = $("#endUpdateDate").val();
                if ($("#contractStartTime").val())
                    keywordsObj.contractStartTime = $("#contractStartTime").val();
                if ($("#contractEndTime").val())
                    keywordsObj.contractEndTime = $("#contractEndTime").val();
                if ($("#industryScene").val())
                    keywordsObj.industryScene = $("#industryScene").val();
                if ($("#huizhiStart").val())
                    keywordsObj.huizhiStart = $("#huizhiStart").val();
                if ($("#huizhiEnd").val())
                    keywordsObj.huizhiEnd = $("#huizhiEnd").val();
                if ($("#huazhiStart").val())
                    keywordsObj.huazhiStart = $("#huazhiStart").val();
                if ($("#huazhiEnd").val())
                    keywordsObj.huazhiEnd = $("#huazhiEnd").val();
                if ($("#huasanStart").val())
                    keywordsObj.huasanStart = $("#huasanStart").val();
                if ($("#huasanEnd").val())
                    keywordsObj.huasanEnd = $("#huasanEnd").val();
                if ($("#otherStart").val())
                    keywordsObj.otherStart = $("#otherStart").val();
                if ($("#otherEnd").val())
                    keywordsObj.otherEnd = $("#otherEnd").val();
                if ($("#stage").val())
                    keywordsObj.stage = $("#stage").val();
            }
            if ($("#customer").val())
                keywordsObj.customer = $("#customer").val();
            if ($("#terminalCustomer").val())
                keywordsObj.terminalCustomer = $("#terminalCustomer").val();
            if ($("#principal").val())
                keywordsObj.principal = $("#principal").val();
            var keywords = "";
            if (!$.isEmptyObject(keywordsObj)) {
                keywords = JSON.stringify(keywordsObj);
            }
            console.log("keywords = " + keywords);

            $("#keywords").val(keywords);
        }

    });

    var approve2 = function (id) {
        var pageNumber = $("#pageNumber").val();
        var keywords = $("#keywords").val();
        keywords = keywords.replace(/\{/g, '%7b').replace(/\}/g, '%7d');
        console.log("keywords: " + keywords);
        location.href = '${base}/project/approve?listFrom=list&type=2&id=' + id + '&pageNumber=' + pageNumber + '&keywords=' + keywords;
    };
    // function handlerStage(stage){
    //     console.log('handlerStage:');
    //     console.log('handlerStage:',stage);
    // }

</script>
