<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctxPlugin}/static/css/print_style.css" media="print">
    <link rel="stylesheet" href="${ctxPlugin}/static/css/print_style.css">
    <style>
        .bo_hide{
            display: none !important;
        }
    </style>
</head>
<body style="padding: 0 10px; " class="bo_hide">
<h1 class="title">
    <img src="${ctxPlugin}/static/djximg/sungrow_work.png" style="float: left; margin-top: 14px;">
    接货单<input type="button" value="打印" id="printOrder" onclick="printOrder()"  style="float: right;margin-top: 20px;
    margin-right: 20px;"/></h1>
<table cellspacing="0" cellpadding="0" border="0">
    <tbody>
    <tr>
        <td width="21%">发货单位</td>
        <td colspan="3" width="50%">能辉科技有限公司（简称：能辉）</td>
        <td width="14%">发货日期</td>
        <td width="15%"><fmt:formatDate value="${apply.columns.deliver_time}" pattern="yyyy-MM-dd"/></td>
    </tr>
    <tr>
        <td>发货单号</td>
        <td>项目号</td>
        <td>接货单位</td>
        <td>交货地址</td>
        <td>收货人</td>
        <td>收货联系人</td>
    </tr>
    <tr>
        <td>${apply.columns.number}</td>
        <td>${apply.columns.project_code}</td>
        <td>${apply.columns.applyOrderTrader}</td>
        <td><c:choose>
            <c:when test="${empty apply.columns.address}">
                ${apply.columns.w_address}
            </c:when>
            <c:otherwise>
                ${apply.columns.address}
            </c:otherwise>
        </c:choose>
           </td>
        <td>${apply.columns.person_in_charge}</td>
        <td>${apply.columns.mobile}</td>

    </tr>
    <tr>
        <td>采购订单号</td>
        <td colspan="2"></td>
        <td colspan="3">${apply.columns.deliver_method_name},${deliver_name}</td>
    </tr>
    <c:if test="${apply.columns.place_by eq '2c9080787e4882f3017e4c67e9f642e2'}"></c:if>
    <tr>
        <td>订单/发货备注</td>
        <td colspan="5">${apply.columns.applyOrderRemarks}<br>${apply.columns.deliver_remark}</td>
    </tr>

    </tbody>
</table>
<div class="line"></div>
<div class="msg">
    <span>尊敬的收货人：</span>
    <p>
        我们在此诚挚要求您在收货时签署本接货单或相关快递单据，以作为能辉交货凭证；届时，第三方物流单位会在交付货物时请您签字，请您在签字前认真核对货物清单，对货物的数量、型号、外观进行检查；如经您检查批后与货物清单一致，请您在本单上签字确认，如经您检查后与货物清单不一致，请您立即联系能辉物流专员，并请在本单上不符处注明。我们将认真调查，并尽快给您提供相关反馈。</p>
    <p>收货人/收货人处签字人员被认为是接货单位合法的授权代理人，其签署的单据均视为已经接货单位的许可，接货单位自愿与其共同承担相应责任。</p>
</div>
<div class="line"></div>
<div>
    <div class="msg">
        <span>货物清单</span>
    </div>
</div>
<table cellspacing="0" cellpadding="0" border="0">
    <tbody>
    <tr>
        <td width="15%">物料代码</td>
        <td width="34%">物料描述</td>
        <td width="7%">单位</td>
        <td width="12%">订单数量</td>
        <td width="12%">实发数量</td>
        <td width="20%">备注</td>
    </tr>

        <c:forEach items="${applyDetails}" var="applyDetail" varStatus="vs">
        <tr>
        <td>${applyDetail.columns.code}</td>
        <td>${applyDetail.columns.remarks}</td>
        <td>${applyDetail.columns.unit_name}</td>
        <td>${applyDetail.columns.apply_amount}</td>
        <td>${applyDetail.columns.apply_amount}</td>
        <td></td>
    </tr>
    </c:forEach>

    </tbody>
</table>
<div class="list">
    <span>收货人：</span><span>身份证号：</span><span>日期：</span>
</div>
<div class="list">
    <span>接货单位（盖章）</span>
</div>
<div class="line"></div>
<h6>如有不符，请在此注明：</h6>
<h4>您对此次运输质量是否满意：1. 满意 2. 一般 3.不满意</h4>

<script src="${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
    //初始数据
    var $form;
    var form;
    var $;
    var imgs = '';
    var myreg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
    layui.config({
        base: '${ctxPlugin}/lib/layuiAdmin/dist/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['jquery', 'layer'], function () {
        $ = layui.jquery;

        printOrder();


    })

   function  printOrder(){
        $("body").removeClass("bo_hide")
        $("#printOrder").hide();
       window.print();
       parent.window.layer.closeAll();
    }
</script>
</body>
</html>
