cl
2024-01-23 ff13e6159eab48d53bb528a10d0ab8850fdf7ad5
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>${constants.getSystemName()}</title>
    <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
    <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}"/>
    <link rel="stylesheet" href="${ctxPath}/assets/expand/css/style.css?v=${constants.getReleaseVersion()}" media="all"/>
 
    <style>
        /** 卡片轮播图样式 */
        .admin-carousel .layui-carousel-ind {
            position: absolute;
            top: -41px;
            text-align: right;
        }
 
        .admin-carousel .layui-carousel-ind ul {
            background: 0 0;
        }
 
        .admin-carousel .layui-carousel-ind li {
            background-color: #e2e2e2;
        }
 
        .admin-carousel .layui-carousel-ind li.layui-this {
            background-color: #999;
        }
 
        /** 广告位轮播图 */
        .admin-news .layui-carousel-ind {
            height: 45px;
        }
 
        .admin-news a {
            display: block;
            line-height: 60px;
            text-align: center;
        }
 
    </style>
</head>
 
<body>
 
<!-- 加载动画,移除位置在common.js中 -->
<div class="page-loading">
    <div class="ball-loader">
        <span></span><span></span><span></span><span></span>
    </div>
</div>
 
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    计划数量<span class="layui-badge layui-bg-black pull-right">日</span>
                </div>
                <div class="layui-card-body">
                    <p class="lay-big-font" id="planNum"></p>
                    <p>月计划数量<span class="pull-right"><i class="layui-icon layui-icon-flag" id="planQtyWeek"></i></span></p>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    实时产量<span class="layui-badge layui-bg-black pull-right">日</span>
                </div>
                <div class="layui-card-body">
                    <p class="lay-big-font" id="realityNum"></p>
                    <p>月实时产量<span class="pull-right"><i class="layui-icon layui-icon-diamond" id="actualQtyWeek"></i></span></p>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    不良数量<span class="layui-badge layui-bg-black pull-right">日</span>
                </div>
                <div class="layui-card-body">
                    <p class="lay-big-font" id="repairQty"></p>
                    <p>月不良数量<span class="pull-right"><i class="layui-icon layui-icon-notice" id="repairQtyWeek"></i></span></p>
                </div>
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
            <div class="layui-card">
                <div class="layui-card-header">
                    报废数量<span class="layui-badge layui-bg-black pull-right">日</span>
                </div>
                <div class="layui-card-body">
                    <p class="lay-big-font" id="scrapQty"></p>
                    <p>月报废数量<span class="pull-right"><i class="layui-icon layui-icon-notice" id="scrapQtyWeek"></i></span></p>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-row layui-col-space15">
        <div class="layui-col-lg15 layui-col-md15">
            <div class="layui-card">
                <div class="layui-card-header">设备报警</div>
                <div class="layui-card-body">
                    <table class="layui-table" id="equipmentAlarmTable" lay-filter="equipmentAlarmTable"></table>
                </div>
            </div>
        </div>
    </div>
 
    <div class="layui-row layui-col-space15">
        <div class="layui-col-lg8 layui-col-md7">
            <div class="layui-card">
                <div class="layui-card-header">设备状态</div>
                <div class="layui-card-body">
                    <table class="layui-table" id="equipmentStatusTable" lay-filter="equipmentStatusTable"></table>
                </div>
            </div>
        </div>
        <div class="layui-col-lg4 layui-col-md5">
            <div class="layui-card">
                <div class="layui-card-header">日生产计划</div>
                <div class="layui-card-body">
                    <table class="layui-table layui-text">
                        <colgroup>
                            <col width="100">
                            <col>
                        </colgroup>
                        <tbody>
                        <tr>
                            <td>生产工单号</td>
                            <td id="workOrderNo"></td>
                        </tr>
                        <tr>
                            <td>产品编号</td>
                            <td id="materialCode"></td>
                        </tr>
                        <tr>
                            <td>产品名称</td>
                            <td id="materialName"></td>
                        </tr>
                        <tr>
                            <td>客户编号</td>
                            <td id="custom"></td>
                        </tr>
                        <tr>
                            <td>计划数量</td>
                            <td id="planQty"></td>
                        </tr>
                        <tr>
                            <td>完成数量</td>
                            <td id="actualQty"></td>
                        </tr>
                        <tr>
                            <td>实际上线数量</td>
                            <td id="actualOnlineQty"></td>
                        </tr>
                        <tr>
                            <td>创建时间</td>
                            <td id="createTime"></td>
                        </tr>
                        <tr>
                            <td>实际开始时间</td>
                            <td id="actualStartTime"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
 
<!-- js部分 -->
@/* 加入contextPath属性和session超时的配置 */
<script type="text/javascript">
    var Feng = {
        ctxPath: "${ctxPath}",
        version: '${constants.getReleaseVersion()}'
    };
</script>
 
<script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
<script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
 
<script>
    layui.use(['table', 'ax','layer', 'carousel'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var carousel = layui.carousel;
        var $ax = layui.ax;
        var table = layui.table;
        var device = layui.device;
 
        // 渲染轮播
        carousel.render({
            elem: '.layui-carousel',
            width: '100%',
            height: '60px',
            arrow: 'none',
            autoplay: true,
            trigger: device.ios || device.android ? 'click' : 'hover',
            anim: 'fade'
        });
 
        var order = new $ax(Feng.ctxPath + "/home/getOrder");
        var orderAjx = order.start();
        console.log(orderAjx);
        //头部
        $("#planNum").html(orderAjx.data.planQty);
        console.log(orderAjx.data.actualQty);
        if(orderAjx.data.actualQty === ""){
            $("#realityNum").html(0)
        }else {
            $("#realityNum").html(orderAjx.data.actualQty);
        }
        $("#scrapQty").html(orderAjx.data.scrapQty);
        $("#repairQty").html(orderAjx.data.repairQty);
 
        $("#planQtyWeek").html(orderAjx.data.planQtyWeek);
        $("#actualQtyWeek").html(orderAjx.data.actualQtyWeek);
        $("#repairQtyWeek").html(orderAjx.data.repairQtyWeek);
        $("#scrapQtyWeek").html(orderAjx.data.scrapQtyWeek);
 
 
 
        //日生产计划
        $("#workOrderNo").html(orderAjx.data.workOrderNo);
        $("#materialCode").html(orderAjx.data.materialCode);
        $("#materialName").html(orderAjx.data.materialName);
        $("#custom").html(orderAjx.data.custom);
        $("#planQty").html(orderAjx.data.planQty);
        $("#actualQty").html(orderAjx.data.actualQty);
        $("#actualOnlineQty").html(orderAjx.data.actualOnlineQty);
        $("#createTime").html(orderAjx.data.createTime);
        $("#actualStartTime").html(orderAjx.data.actualStartTime);
 
        /**
         * 设备状态管理
         */
        var EquipmentStatus = {
            tableId: "equipmentStatusTable"
        };
 
        /**
         * 初始化表格的列
         */
        EquipmentStatus.initColumn = function () {
            return [[
                {type: 'checkbox'},
                {field: 'id', hide: true, title: 'ID'},
                {field: 'equipmentNo', sort: true, title: '设备编号'},
                {field: 'equipmentName', sort: true, title: '设备名称'},
                {field: 'workshopCode', sort: true, title: '车间编号'},
                {field: 'productionLineCode', sort: true, title: '产线编号'},
                {field: 'locationCode', sort: true, title: '工位编号'},
                {field: 'status', sort: true, title: '设备状态'},//(1运转2待机3故障)
                {field: 'remarks', sort: true, title: '备注'},
                {field: 'updateTime', sort: true, title: '更新时间'},
            ]];
        };
 
        var tableResult = table.render({
            elem: '#' + EquipmentStatus.tableId,
            url: Feng.ctxPath + '/equipmentStatus/list',
            toolbar: '#toolbarDemo',
            page: true,
            // height: "full-158",
            cellMinWidth: 100,
            height: 412,
            cols: EquipmentStatus.initColumn()
        });
 
        /**
         * 设备报警管理
         */
        var EquipmentAlarm = {
            tableId: "equipmentAlarmTable"
        };
 
        /**
         * 初始化表格的列
         */
        EquipmentAlarm.initColumn = function () {
            return [[
                {type: 'checkbox'},
                {field: 'id', hide: true, title: 'ID'},
                {field: 'equipmentNo', sort: true, title: '设备编号'},
                {field: 'equipmentName', sort: true, title: '设备名称'},
                {field: 'workshopCode', sort: true, title: '车间编号'},
                {field: 'productionLineCode', sort: true, title: '产线编号'},
                {field: 'locationCode', sort: true, title: '工位编号'},
                {field: 'errorNo', sort: true, title: '故障代码'},
                {field: 'errorDesc', sort: true, title: '故障描述'},
                {field: 'alarmTime', sort: true, title: '报警时间'},
            ]];
        };
 
        // 渲染表格
        var tableResult = table.render({
            elem: '#' + EquipmentAlarm.tableId,
            url: Feng.ctxPath + '/equipmentAlarm/list',
            toolbar: '#toolbarDemo',
            page: true,
            // height: "full-158",
            cellMinWidth: 100,
            height: 287,
            limit:4,
            cols: EquipmentAlarm.initColumn()
        });
 
    });
</script>
</body>
 
</html>