<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <title></title>
    <style type="text/css">
        .container-fluid {
            position: relative;
            margin-left: auto;
            margin-right: auto;
            padding-right: 15px;
            padding-left: 15px;
        }
        .row {
            margin-right: -15px;
            margin-left: -15px;
        }
        .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{
            display: inline-block;
            position: relative;
            width: 100%;
            min-height: 1px;
            padding-right: 15px;
            padding-left: 15px;
        }
        .col-md {

            max-width: 100%;
        }
        .col-md-auto {
            width: auto;
        }
        .col-md-1 {

            max-width: 8.333333%;
        }
        .col-md-2 {

            max-width: 16.666667%;
        }
        .col-md-3 {

            max-width: 25%;
        }
        .col-md-4 {

            max-width: 33.333333%;
        }
        .col-md-5 {

            max-width: 41.666667%;
        }
        .col-md-6 {

            max-width: 50%;
        }
        .col-md-7 {

            max-width: 58.333333%;
        }
        .col-md-8 {

            max-width: 66.666667%;
        }
        .col-md-9 {

            max-width: 75%;
        }
        .col-md-10 {

            max-width: 83.333333%;
        }
        .col-md-11 {

            max-width: 91.666667%;
        }
        .col-md-12 {

            max-width: 100%;
        }
        .pull-md-0 {
            right: auto;
        }
        .pull-md-1 {
            right: 8.333333%;
        }
        .pull-md-2 {
            right: 16.666667%;
        }
        .pull-md-3 {
            right: 25%;
        }
        .pull-md-4 {
            right: 33.333333%;
        }
        .pull-md-5 {
            right: 41.666667%;
        }
        .pull-md-6 {
            right: 50%;
        }
        .pull-md-7 {
            right: 58.333333%;
        }
        .pull-md-8 {
            right: 66.666667%;
        }
        .pull-md-9 {
            right: 75%;
        }
        .pull-md-10 {
            right: 83.333333%;
        }
        .pull-md-11 {
            right: 91.666667%;
        }
        .pull-md-12 {
            right: 100%;
        }
        .push-md-0 {
            left: auto;
        }
        .push-md-1 {
            left: 8.333333%;
        }
        .push-md-2 {
            left: 16.666667%;
        }
        .push-md-3 {
            left: 25%;
        }
        .push-md-4 {
            left: 33.333333%;
        }
        .push-md-5 {
            left: 41.666667%;
        }
        .push-md-6 {
            left: 50%;
        }
        .push-md-7 {
            left: 58.333333%;
        }
        .push-md-8 {
            left: 66.666667%;
        }
        .push-md-9 {
            left: 75%;
        }
        .push-md-10 {
            left: 83.333333%;
        }
        .push-md-11 {
            left: 91.666667%;
        }
        .push-md-12 {
            left: 100%;
        }
        .offset-md-0 {
            margin-left: 0%;
        }
        .offset-md-1 {
            margin-left: 8.333333%;
        }
        .offset-md-2 {
            margin-left: 16.666667%;
        }
        .offset-md-3 {
            margin-left: 25%;
        }
        .offset-md-4 {
            margin-left: 33.333333%;
        }
        .offset-md-5 {
            margin-left: 41.666667%;
        }
        .offset-md-6 {
            margin-left: 50%;
        }
        .offset-md-7 {
            margin-left: 58.333333%;
        }
        .offset-md-8 {
            margin-left: 66.666667%;
        }
        .offset-md-9 {
            margin-left: 75%;
        }
        .offset-md-10 {
            margin-left: 83.333333%;
        }
        .offset-md-11 {
            margin-left: 91.666667%;
        }

        .text-center {
            margin-top: 0px;
            text-align: center;
        }


        .table {
            margin-top: 10px;
            width: 100%;
            max-width: 100%;
            margin-bottom: 1rem;
        }

        .table th,
        .table td {
            padding: 0.75rem;
            vertical-align: top;
            border-top: 1px solid #000000;
        }

        .table thead th {
            vertical-align: bottom;
            border-bottom: 2px solid #000000;
        }

        .table-sm th,
        .table-sm td {
            padding: 0.3rem;
        }

        .table-bordered {
            border: 1px solid #000000;
        }

        .table-bordered th,
        .table-bordered td {
            border: 1px solid #000000;
            border-left: 0px solid;
            border-top: 0px solid;
        }

        .table-bordered thead th,
        .table-bordered thead td {
            border-bottom-width: 2px;
        }



        .fixed-bottom {
            position: fixed;
            right: 0;
            bottom: 10px;
            left: 0;
            z-index: 1030;
        }

        .white{
            white-space: :pre;
        }

        .under-line{
            white-space: :pre;
            font-size: 1em;
            border-bottom: 0px solid black;

            /* -- reduce the width of the h1 element to the size of it's content -- */
            display: inline-block;

            /* -- add extra length to each side -- */
            padding: 0 1rem;
        }

        .left {
            margin-left: 21px;
        }
        .title_left{
            margin-left: 350px;
        }

        #last td{
            border-right-width: 0px;
            border-bottom-width: 0px;
        }

    </style>
</head>
<body>
<div class="container-fluid">


    <#assign header = list[0] />
    <#assign planNumber = 0 />

    <div class="row">
        <div class="col-md-8" style="margin-bottom: 47px">
            <h1 class="text-center title_left">
                ${topOrg}
            </h1>
            <h1 class="text-center title_left">
                ${header.headline!}(${allPage}-${page})
            </h1>
	   <h3 style="visibility:hidden">0</h3>
        </div>
        <div class="col-md-2">
            <img src="${collect_image}"/>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="row" style="margin-bottom: 10px">
                <div class="col-md-2">
                    <a>手术科室:  <a class="under-line">${header.org_name!}</a></a>
                </div>
                <div class="col-md-3">
                    <a>住院编码:  <a class="under-line">${header.hospitalization_number!}</a></a>
                </div>
                <div class="col-md-2">
                    <a>手术时间:  <a class="under-line">${header.surgery_date!}</a></a>
                </div>
                <div class="col-md-3">
                    <a>手术名称:  <a class="under-line">${header.surgery_name!}</a></a>
                </div>
            </div>

            <div class="row" >
                <div class="col-md-2">
                    <a>主治医生:  <a class="under-line">${header.doctor_name!}</a></a>
                </div>
                <div class="col-md-3">
                    <a>患者姓名:  <a class="under-line">${header.patient_name!}</a></a>
                </div>
                <div class="col-md-2">
                    <a>患者性别:  <a class="under-line">${header.gender!}</a></a>
                </div >
                <div class="col-md-3">
                    <a>患者年龄:  <a class="under-line">${header.patient_age!}</a></a>
                </div>
            </div>

            <div class="row">
                <div class="col-md-11">
                    <table class="table table-sm table-hover table-bordered">
                        <thead>
                        <tr>
                            <th>
                                序号
                            </th>
                            <th>
                                商品编码
                            </th>
                            <th>
                                商品名称
                            </th>
                            <th>
                                规格型号
                            </th>
                            <th>
                                注册证号
                            </th>


                            <#if header.header_status == "APPROVED">
                                <th>
                                    计划领用数量
                                </th>
                                <th style="border-right-width: 0px;">
                                    生产厂商
                                </th>
                            <#else >
                                <th>
                                    生产厂商
                                </th>
                                <th>
                                    批号
                                </th>
                                <th>
                                    生产日期
                                </th>
                                <th style="border-right-width: 0px;">
                                    商品序列
                                </th>

                            </#if>

                        </tr>
                        </thead>

                            <tbody>
                            <#assign  index = index/>
                    <#list list as line>
                            <tr>
                                <td>
                                    ${index}
                                    <#assign index = index+1/>
                                </td>


                                <td>
                                ${line.item_code!}
                                </td>
                                <td>
                                    ${line.item_name!}
                                </td>
                                <td>
                                    ${line.item_specification!}
                                </td>
                                <td>
                                    ${line.reg_number!}
                                </td>

                                <#if header.header_status == "APPROVED">
                                    <td>
                                    ${line.plan_quantity!}
                                        <#if (line.plan_quantity)??>
                                            <#assign planNumber = planNumber + line.plan_quantity />
                                        </#if>
                                    </td>
                                    <td style="border-right-width: 0px;">
                                        ${line.manufacture_name!}
                                    </td>
                                    <#else >
                                    <td>
                                        ${line.manufacture_name!}
                                    </td>
                                    <td>
                                        ${line.lot_number!}
                                    </td>
                                    <td>
                                        ${line.production_date!}
                                    </td>
                                    <td style="border-right-width: 0px;">
                                    ${line.serial_number!}
                                    </td>
                                </#if>
                            </tr>
                    </#list>
                            <tr id="last">
                                <td colspan="9">
                                    <p>备注:</p>
                                     <p style="margin-left: 50px">${header.surgery_desc!}</p>
                                </td>
                            </tr>
                            </tbody>
                    </table>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="row">
                        <div class="col-md-1">
                            小计:
                        </div>
                        <div class="col-md-9">
                        </div>
                        <#if header.header_status == "APPROVED">
                                <div class="col-md-1">
                                    ${planNumber} 件
                                </div>

                            <#else>
                                <div class="col-md-1">
                                ${currentNum} 件
                                </div>
                        </#if>


                    </div>
                    <div class="row">
                        <div class="col-md-1">
                            总计:
                        </div>
                        <div class="col-md-9">
                        </div>
                    <#if header.header_status == "APPROVED">
                            <div class="col-md-1">
                            ${planNumber} 件
                            </div>
                        <#else >
                            <div class="col-md-1">
                                ${allNum} 件
                            </div>
                    </#if>


                    </div>
                </div>
            </div>

            <#if header.header_status == "APPROVED">

             <div class="row fixed-bottom" >
                    <div class="col-md-1">
                    </div>
                    <div class="col-md-10">
                        <div class="row" style="margin-bottom: 10px">
                            <div class="col-md-3">
                                <a class="white">制单人:  <a class="under-line">${createUserName}</a></a>
                            </div>
                            <div class="col-md-2">
                            </div>
                            <div class="col-md-3">
                                <a>日期:     <a class="under-line" style="margin-left: 30px">${createTime}</a></a>
                            </div>

                         </div>
                    </div>
             </div>
              <#else >
              <div class="row fixed-bottom" >
                      <div class="col-md-1">
                      </div>
                      <div class="col-md-10">
                          <div class="row" style="margin-bottom: 10px">
                              <div class="col-md-3">
                                  <a class="white">制单人:  <a class="under-line">${createUserName}</a></a>
                              </div>
                              <div class="col-md-3">
                                  <a class="white" style="margin-left: 170px">仓管员:  <a class="under-line">${header.master_admin!}</a></a>
                              </div>
                              <div class="col-md-1">
                              </div>
                              <div class="col-md-3">
                                  <#if header.header_status == "COLLECTED_WAITTING_CONFIRMED">
                                      <a class="white">领用人:  <a class="under-line"> ${userName}</a></a>
                                  <#elseif header.header_status == "RETURNED_WATTING_CONFIRMED">
                                      <a class="white">归还人:  <a class="under-line"> ${userName}</a></a>
                                  </#if>

                              </div>
                          </div>
                          <div class="row">
                              <div class="col-md-3">
                                  <a>日期:     <a class="under-line white">${createTime}</a></a>
                              </div>
                              <div class="col-md-3">
                                  <a class="left" style="margin-left: 170px">日期:     <a class="under-line">${userTime}</a></a>
                              </div>
                              <div class="col-md-1">
                              </div>
                              <div class="col-md-3">
                                  <a>日期:    <a class="under-line">${userTime}</a></a>
                              </div>
                          </div>
                      </div>
               </div>
            </#if>

        </div>
    </div>
</div>
</body>
</html>