zhao
2021-07-19 8347f2fbddbd25369359dcb2da1233ac48a19fdc
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
@{
    ViewBag.Title = "OutItemBoard";
    Layout = "~/Views/Shared/_LayoutVue.cshtml";
}
@section head{
    <link href="~/Content/OutItemBoard/CSS/style.css" rel="stylesheet" />
    <style type="text/css">
        .el-carousel__arrow {
            display: none;
        }
 
        .el-carousel__indicators {
            position: fixed;
        }
    </style>
}
<div class="wrapper" id="OutItemBoard" v-cloak>
    <div class="head">
        <div class="fL"><h2>宁波三生生物科技有限公司</h2></div>
        <div class="fR"><span>{{year}}年{{month}}月{{date}}日</span><span style="margin:0 15px;">{{dayByDay}}</span><span>{{hour}}:{{minutes}}:{{seconds}}</span></div>
        <div class="clear"></div>
    </div>
    <div class="content">
        <div class="tableList" id="tableList">
            <el-carousel v-bind:interval="5000" arrow="always" v-bind:height="itemHeight+'px'">
                <el-carousel-item v-for="m in outItemBoardData">
                    <table width="100%" border="0" cellspacing="0" v-for="n in m.d">
                        <thead>
                            <tr>
                                <td align="left" colspan="3">
                                    <div><label>发货单号:</label><span>{{n.OpNo}}</span></div>
                                    <div v-if="n.FromNo"><label>来源单号:</label><span>{{n.FromNo}}</span></div>
                                    <div><span class="state" style="color:#E9CC01">{{n.PickState}}</span></div>
                                </td>
                                <td align="right" colspan="3">
                                    <div><label>客户名称:</label><span>{{n.Customer}}</span></div>
                                </td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <th width="15%" align="center">物料编码</th>
                                <th width="23%" align="center">物料名称</th>
                                <th width="22%" align="center">规格型号</th>
                                <th width="15%" align="center">批次</th>
                                <th width="13%" align="center">数量</th>
                                <th width="12%" align="center">单位</th>
                            </tr>
                            <tr v-for="item in n.Items">
                                <td align="center">{{item.ItemCode}}</td>
                                <td align="center">{{item.ItemName}}</td>
                                <td align="center">{{item.ItemModel}}</td>
                                <td align="center">{{item.ProductNo}}</td>
                                <td align="center">{{item.Qty}}</td>
                                <td align="center">{{item.Unit}}</td>
                            </tr>
                        </tbody>
                    </table>
                </el-carousel-item>
            </el-carousel>
        </div>
    </div>
 
    <div class="footer">
        <div class="fR"><img src="~/Content/OutItemBoard/Images/hhLogo.png" style="width:20px; height:20px;" /><span style="line-height:20px;">汉和智能WMS</span></div>
    </div>
 
</div>
@section scripts{
    <script type="text/javascript">
        $(function () {
            var height = $("#tableList").height();
            $(".alarm").css("height", height);
            $(".content .tableList").css("height", $(window).height() - 130);
            $(window).resize(function () {
                var height = $("#tableList").height();
                $(".alarm").css("height", height);
                $(".content .tableList").css("height", $(window).height() - 130);
            })
        });
        new Vue({
            mixins: [useAutoHeight],
            computed: {
                itemHeight: function () {
                    return this.autoHeight - 138;
                },
                dayByDay: function () {
                    switch (this.day) {
                        case 0: return '星期天';
                        case 1: return '星期一';
                        case 2: return '星期二';
                        case 3: return '星期三';
                        case 4: return '星期四';
                        case 5: return '星期五';
                        case 6: return '星期六';
                    }
                    return '';
                },
            },
            el: '#OutItemBoard',
            data: {
                year: (new Date()).getFullYear(),
                month: ((new Date()).getMonth() + 1) < 10 ? "0" + ((new Date()).getMonth() + 1) : (new Date()).getMonth() + 1,
                date: ((new Date()).getDate()) < 10 ? "0" + ((new Date()).getDate()) : (new Date()).getDate(),
                day: (new Date()).getDay(),
                hour: ((new Date()).getHours()) < 10 ? "0" + ((new Date()).getHours()) : (new Date()).getHours(),
                minutes: ((new Date()).getMinutes()) < 10 ? "0" + ((new Date()).getMinutes()) : (new Date()).getMinutes(),
                seconds: ((new Date()).getSeconds()) < 10 ? "0" + (new Date()).getSeconds() : (new Date()).getSeconds(),
                outItemBoardData: [],
                outItemData: [],
            },
            methods: {
                loadOutItemBoard: function () {
                    var $this = this;
                    ajaxManage({
                        url: "@Url.Action("OutItemBoardData")",
                        success: function (result) {
                            if (result.Success) {
                                var currentData = result.Data;
                                if (JSON.stringify(currentData) === JSON.stringify($this.outItemData))
                                    return;
                                $this.outItemData = result.Data;
                                $this.outItemBoardData = [];
                                var temp = [];
                                result.Data.forEach(function (n, i) {
                                    temp.push(n);
                                    if ((i + 1) % 2 == 0) {
                                        $this.outItemBoardData.push({
                                            d: temp
                                        });
                                        temp = [];
                                    } else {
                                        if (i == result.Data.length - 1) {
                                            $this.outItemBoardData.push({
                                                d: temp
                                            });
                                        }
                                    }
                                });
                            }
                            else
                                wms.error(result.Msg);
                        }
                    });
                }
            },
            mounted: function () {
                var $this = this;
                $this.loadOutItemBoard();
                setInterval(function () {
                    var dt = new Date();
                    $this.year = dt.getFullYear();
                    $this.month = (dt.getMonth() + 1) < 10 ? "0" + (dt.getMonth() + 1) : dt.getMonth() + 1;
                    $this.date = (dt.getDate()) < 10 ? "0" + (dt.getDate()) : dt.getDate();
                    $this.day = dt.getDay();
                    $this.hour = (dt.getHours()) < 10 ? "0" + (dt.getHours()) : dt.getHours();
                    $this.minutes = (dt.getMinutes()) < 10 ? "0" + (dt.getMinutes()) : dt.getMinutes();
                    $this.seconds = (dt.getSeconds()) < 10 ? "0" + (dt.getSeconds()) : dt.getSeconds();
                }, 1000);
                setInterval(function () {
                    $this.loadOutItemBoard();
                }, 2000);
            }
        });
    </script>
}