<!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 40px 20px 10px;
            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;
            /*margin-bottom: 300px;*/
            font-size: 10px;
        }

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

        .border {
            border: 1px solid black !important;
        }

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

        /* 用于模拟13列布局 */
        .col-1 {

        }
        .right-align { text-align: right; }
        .center-align { text-align: center; }
        .left-align { text-align: left; }
        .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" style="margin-top: 20px ;">
    <div class="right-align" style=" font-size: 12px ; margin-left: 5px;padding-right: 150px ">外协单位：${returnReceipt.supplierCode} ${returnReceipt.supplierName}</div>
    <div class="center-align"  style="font-size: 13px ;padding-right: 90px">大连德迈仕精密科技股份有限公司</div>
    <div class="left-align"  style=" font-size: 12px ;margin-right: 5px">单据号：${returnReceipt.formCode}</div>
</div>
<!-- 标题行 -->
<div class="title-row" style="margin-top: 20px ; font-size: 12px ;">
    <div class="right-align" style="margin-left: 5px; padding-right:220px;" >单据日期：${returnReceipt.stringDate}</div>
    <div class="center-align" style="font-size: 14px ; padding-right: 170px">外协收回明细表</div>
    <div class="left-align" style="margin-right: 5px">第${detail_index+1}页 共 ${returnReceipt.detailLists?size}页</div>
</div>
<table>


    <!-- 第三行 -->
    <tr class="header border">
        <td class="col-0" align="center" valign="middle" style="width: 13px;">序号</td>
        <td class="col-1" align="center" valign="middle">产品描述</td>
        <td class="col-1" align="center" valign="middle" style="width: 60px;">批号</td>
<!--        <td class="col-1" align="center" valign="middle">工序名称</td>-->
        <td class="col-1" align="center" valign="middle" style="width: 30px;">数量</td>
<!--        <td class="col-1" align="center" valign="middle" style="width: 13px;">箱数</td>-->
        <td class="col-1" align="center" valign="middle" style="width: 100px;"> 发出箱号</td>
        <td class="col-1" align="center" valign="middle" style="width: 60px;">备注</td>
    </tr>

    <!-- 动态数据行 -->
    <#list detail as item>
    <tr class=" border">
        <td class="col-1" align="center">${ item_index + 1 }</td>
        <td class="col-1" style="text-align: left;">
            <#if item.productDescription??>
            ${ item.productDescription}
            <#else>

            </#if>
        </td>
        <td class="col-1" style="text-align: left;" >
            <#if item.lotCode??>
            ${ item.lotCode }
            <#else>

        </#if>
        </td>
<!--        <td class="col-1" style="text-align: left;" >-->
<!--            <#if item.processAlias??>-->
<!--            ${ item.processAlias }-->
<!--            <#else>-->

<!--        </#if>-->
<!--        </td>-->
        <td class="col-1" style=" text-align: right;" >
            <#if item.receiptNum??>
            ${ item.receiptNum }
            <#else>

        </#if>
           </td>
<!--        <td class="col-1" >-->
<!--            <#if item.originalCarrierCount??>-->
<!--            ${ item.originalCarrierCount }-->
<!--            <#else>-->

<!--        </#if>-->
<!--            </td>-->
        <td class="col-1" style="text-align: left;">
            <#if item.newCarrier??>
            ${ item.newCarrier }
            <#else>

        </#if>
       </td>
        <td class="col-1" style="text-align: left;" >
            <#if item.remark??>
            ${ item.remark }
            <#else>

        </#if>
        </td>

    </tr>
    </#list>
<!--小计行-->
<tr class="total-row border">
    <td class="col-1" align="center" colspan="1"></td>
    <td class="col-1" align="center" colspan="1">小计</td>
    <!-- 这里根据实际计算结果填充 -->
    <td class="col-1" align="center" colspan="1"></td>
<!--    <td class="col-1" align="center" colspan="1"></td>-->
    <td class="col-1" align="center" colspan="1" style=" text-align: right;">${detail[0].sum!0}</td>
<!--    <td class="col-1" align="center" colspan="1"></td>-->
    <td class="col-1" align="center" colspan="1"></td>
    <td class="col-1" align="center" colspan="1"></td>
    <!-- ... 类似地填充剩余单元格 -->
</tr>
</table>
<div class="title-row"  style="margin-bottom: 30px">
    <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>