<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        @page {
            margin: 15px 30px 20px 30px;
            size: 211mm 140mm;
        }

        body {
            font-family: Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 10px;
        }

        th, td {
            text-align: center;
            padding: 5px;
            border: 1px solid #000;
        }

        .total-row {
            font-weight: bold;
            /*background-color: lightgray;*/
            text-align: center;
        }

        .right-align { text-align: right; }
        .center-align { text-align: center; }
        .left-align { text-align: left; }

        .right-align1 {
            font-size: 12px;
            margin-left: auto;
            padding-right: 110px;
        }
        .center-align1 {
            font-size: 13px;
            padding-right: 90px;
        }
        .left-align1 {
            font-size: 14px;
            margin-right: 5px;
        }
        .title-row {
            font-size: 13px ;
            display: flex;
            justify-content: space-between; /* 元素之间的间距均匀分布 */
            align-items: center; /* 垂直居中对齐 */
            width: 100%; /* 确保标题行占满整个容器宽度 */
            /*margin-bottom: 10px; !* 根据需要调整间距 *!*/
        }

        .title-row div {
            /* 移除默认的外边距 */
            margin: 0 ;
        }
    </style>
</head>
<#list returnReceipt.detailLists as detail>
<body>

<!-- 标题行 -->
<div class="title-row">
    <div class="right-align1" style=" font-size: 12px ; margin-left: 5px;padding-right: 130px ">外协单位： ${returnReceipt.supplierCode} ${returnReceipt.supplierName}</div>
    <div class="center-align1"  style="font-size: 13px ;padding-right: 90px">大连德迈仕精密科技股份有限公司</div>
    <div class="left-align1"  style=" font-size: 14px ;">单据号：${returnReceipt.formCode}</div>
</div>
<!-- 标题行 -->
<div class="title-row" style="margin-top: 5px ; font-size: 12px ;">
    <div class="right-align" style="margin-left: 5px; padding-right:220px;" >单据日期：${returnReceipt.stringDate}</div>
    <div class="center-align" style="font-size: 13px ; padding-right: 185px">外协收回明细表</div>
    <div class="left-align" style="margin-right: 5px">第${detail_index+1}页 共 ${returnReceipt.detailLists?size}页</div>
</div>
<div class="title-row" style="margin-top: 5px ; font-size: 12px ;">
    <div class="left-align" style="margin-left: 5px;">产品描述: ${detail[0].productDescription }</div>
</div>
<table>
    <!-- 第三行 -->
    <tr>
        <td style="width: 12px;">序号</td>
        <td style="width: 76px;">批号</td>
        <td>工序名称</td>
        <td style="width: 44px;">收回量</td>
        <td style="width: 12px;">箱数</td>
        <td style="width: 210px;">收回箱号</td>
        <td style="width: 100px;">炉号</td>
        <td style="width: 20px;">备注</td>
    </tr>

    <!-- 动态数据行 -->
    <#list detail as item>
    <tr>
        <td style="width: 12px;"><div style="width: 10px;">${ item_index + 1 }</div></td>
        <td style="width: 76px;"  >
            <#if item.lotCode??>
            <div style="width: 74px;">
                ${ item.lotCode }
            </div>
        </#if>
        </td>
        <td >
            <#if item.processNames??>
            <div style="white-space: nowrap">
                ${ item.processNames }
            </div>
            <#else>

        </#if>
        </td>
        <td style="width: 44px;text-align: right;" >
            <#if item.productNum??>
            <div style="width: 42px;">
                ${ item.receiptNum }
            </div>
            <#else>

        </#if>
        </td>
        <td style="width: 12px;" >
            <#if item.originalCarrierCount??>
            <div style="width: 10px;">
                ${ item.originalCarrierCount }
            </div>
            <#else>

        </#if>
        </td>
        <td style="width: 210px;">
            <#if item.newCarrier??>
            <div style="width: 208px;">
                ${ item.newCarrier }
            </div>
            <#else>
        </#if>

        </td>
        <td style="width: 100px;">
            <#if item.furnaceNumber??>
            <div style="width: 98px;">
                ${ item.furnaceNumber }
            </div>
            <#else>
        </#if>

        </td
        <td style="width: 20px;" >
            <#if item.remark??>
            <div style="width: 18px; white-space: nowrap ">
                ${ item.remark }
            </div>
            <#else>
        </#if>
        </td>

    </tr>
</#list>
<!--小计行-->
<tr class="total-row">
    <td></td>
    <td>小计</td>
    <td></td>
    <td>${detail[0].sum }</td>
    <td></td>
    <td></td>
    <td></td>
    <td></td>
    <!-- ... 类似地填充剩余单元格 -->
</tr>
</table>
<div class="title-row"  style="margin-bottom: 35px">
    <!--    <div  style=" height: 25px"></div>-->
    <div class="center-align"  style="margin-left: 60px;padding-right: 90px">外协发出人：</div>
    <div class="center-align"  style="margin-left: 60px;padding-right: 120px">搬运接收人：</div>
    <div class="left-align" style="margin-right: 15px">白-存根, 粉-生产, 黄-外协</div>
</div>
</body>
</#list>
</html>