移动系统liao
2024-06-13 80aa425c4ca51f7c0224a6245968cdd08940321b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<style>
    .btn-print { width: 100%; margin-top: 20px; height: 50px; color: #fff; background-color: #009688; border: none; cursor: pointer }
</style>
<script type="text/html" template lay-done="layui.data.sendParams(d);">
    <div style="width: calc(100% -40px); margin: 0 auto; background: #fff; padding: 20px; " id="printDiv">
        <table style="width: 100%; border-spacing: 0; font-family: '微软雅黑';">
            <colgroup>
                <col width="40%">
                <col width="20%">
                <col width="40%">
            </colgroup>
            <tbody>
            <tr>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">
                    <p>订单号-{{d.params.data.order.orderId}}</p>
 
                    <p>日期:{{d.params.data.order.createTime}}</p>
                </td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center"><h3>配货清单</h3></td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;text-align: right">
                    <p>客户:{{d.params.data.order.user.nickName}}</p>
 
                    <p>电话:{{d.params.data.order.user.mobile}}</p>
                </td>
            </tr>
            </tbody>
        </table>
 
        <table style="width: 100%; border-spacing: 0; text-align: left; font-family: '微软雅黑';">
            <colgroup>
                <col width="50%">
                <col width="10%">
                <col width="10%">
                <col width="10%">
                <col width="10%">
                <col width="10%">
            </colgroup>
            <tbody>
            <tr>
                <th style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: left">商品名称</th>
                <th style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">货号</th>
                <th style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">单价</th>
                <th style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">数量</th>
                <th style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">小计</th>
            </tr>
            {{# layui.each(d.params.data.order.items, function(index, item){ }}
            <tr>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: left">
                    {{item.name}} {{#  if(item.addon){ }} - {{item.addon}} {{#  } }}
                </td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">{{item.sn}} </td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">¥{{item.price}} </td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">
                    {{item.nums-item.sendNums-item.reshipNums+item.reshipedNums}}
                </td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top; text-align: center">¥ {{  Number(item.price * (item.nums-item.sendNums-item.reshipNums+item.reshipedNums)).toFixed(2) }}</td>
            </tr>
            {{# }); }}
            </tbody>
        </table>
 
        <table style="width: 100%; border-spacing: 0; font-family: '微软雅黑';">
            <colgroup>
                <col width="50%">
                <col width="50%">
            </colgroup>
            <tr>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">订单附言:{{d.params.data.order.memo}}</td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">配送: {{d.params.data.order.logisticsName || ''}}</td>
            </tr>
            <tr>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">地址:{{d.params.data.order.shipAreaName}} - {{d.params.data.order.shipAddress}}</td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">收货人:{{d.params.data.order.shipName}}</td>
            </tr>
            <tr>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">手机:{{d.params.data.order.shipMobile}}</td>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;">订单备注:{{d.params.data.order.mark || ''}}</td>
            </tr>
        </table>
 
        <table style="width: 100%; border-spacing: 0; font-family: '微软雅黑';">
            <tr>
                <td style="padding: 10px 5px; border-bottom: 1px solid #ddd; font-size: 14px; vertical-align: top;"><h4><strong>签字:</strong></h4></td>
            </tr>
        </table>
    </div>
 
    <div class="layui-fluid">
        <div class="layui-row  layui-col-space10">
            <div class="layui-col-md12">
                <input type="submit" class="btn btn-print" lay-submit lay-filter="LAY-app-order-distributionPrint-submit" id="LAY-app-order-distributionPrint-submit" value="打印(需安装打印插件)" />
            </div>
            <!--<div class="layui-col-md6">
                <button type="submit" class="btn btn-print" lay-submit lay-filter="LAY-app-order-distributionPrint-htmltopdf-submit" id="LAY-app-order-distributionPrint-htmltopdf-submit">导出PDF</button>
            </div>-->
        </div>
    </div>
 
</script>
 
<script>
    var debug = layui.setter.debug;
    layui.data.sendParams = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;
 
                //重载form
                form.render();
            })
    };
</script>