yangle
2022-09-14 75bc98ff981323d6d4de86868a68f701acc19dee
HDEquipment.html
@@ -18,6 +18,7 @@
    <script src="js/jquery.SuperSlide.2.1.3.js"></script>
    <script src='js/template.js'></script>
    <script src="js/jquery.qrcode.min.js"></script>
    <script src="js/webConfig.js"></script>
    <style>
        .clock {
            font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
@@ -28,33 +29,30 @@
            margin-top: -75px;
            margin-right: 5px;
            color: #09d1ea;
        }
        .clock #Date {
            text-align: center;
            text-shadow: 0 0 0px #00c6ff;
            .clock #Date {
                text-align: center;
                text-shadow: 0 0 0px #00c6ff;
            }
            .clock ul {
                width: 450px;
                margin: 0 auto;
                padding: 0px;
                list-style: none;
                text-align: right;
                margin-left: 15px;
                position: relative;
            }
        }
        .clock ul {
            width: 450px;
            margin: 0 auto;
            padding: 0px;
            list-style: none;
            text-align: right;
            margin-left: 15px;
            position: relative;
        }
        .clock ul li {
            display: inline;
            font-size: 24px;
            text-align: left;
            font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
            text-shadow: 0 0 0px #00c6ff;
        }
                .clock ul li {
                    display: inline;
                    font-size: 24px;
                    text-align: left;
                    font-family: 'BebasNeueRegular', Arial, Helvetica, sans-serif;
                    text-shadow: 0 0 0px #00c6ff;
                }
        body {
            padding-left: 50px;
@@ -62,7 +60,6 @@
        }
        .title {
            font-size: 44px;
            font-family: PingFangSC;
            font-weight: 500;
@@ -165,28 +162,27 @@
            float: left;
        }
        #cList1 li {
            float: left;
            height: 450px;
            color: #00c6ff;
            font-size: 20px;
            /*文字居中*/
            text-align: center;
            /*display: flex;*/
        }
            #cList1 li {
                float: left;
                height: 450px;
                color: #00c6ff;
                font-size: 20px;
                /*文字居中*/
                text-align: center;
                /*display: flex;*/
            }
        #cList1 li span {
            /*文字居中*/
            display: inline-block;
            height: 100%;
            /*文字居中*/
            /*文字竖排*/
            writing-mode: vertical-lr;
            /*从左向右 从右向左是 writing-mode: vertical-rl;*/
            writing-mode: tb-lr;
            /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
        }
                #cList1 li span {
                    /*文字居中*/
                    display: inline-block;
                    height: 100%;
                    /*文字居中*/
                    /*文字竖排*/
                    writing-mode: vertical-lr;
                    /*从左向右 从右向左是 writing-mode: vertical-rl;*/
                    writing-mode: tb-lr;
                    /*IE浏览器的从左向右 从右向左是 writing-mode: tb-rl;*/
                }
        #cList2 {
            height: 450px;
@@ -207,15 +203,14 @@
            border: none;
        }
        .table>caption+thead>tr:first-child>td,
        .table>caption+thead>tr:first-child>th,
        .table>colgroup+thead>tr:first-child>td,
        .table>colgroup+thead>tr:first-child>th,
        .table>thead:first-child>tr:first-child>td,
        .table>thead:first-child>tr:first-child>th {
        .table > caption + thead > tr:first-child > td,
        .table > caption + thead > tr:first-child > th,
        .table > colgroup + thead > tr:first-child > td,
        .table > colgroup + thead > tr:first-child > th,
        .table > thead:first-child > tr:first-child > td,
        .table > thead:first-child > tr:first-child > th {
            background-color: #000;
            color: #3bff72;
        }
        .fixed-table-container tbody td .th-inner,
@@ -309,9 +304,9 @@
        var num = 0;
        var num1 = 0;
        var TLProgress = 0;  //退料率
        var CallData = [];  //近日配送时间数组
        var CallPSQty = [];  //近日配送总数数组
        var CAllQty = [];  //今日叫料总数数组
        var CallData = [];  //饼图结果数组
        var CAllDataX = [];  //柱状图x轴
        var CAllDataXval = [];  //柱状图y轴
        $(document).ready(function () {
            // 创建两个变量,一个数组中的月和日的名称
            var monthNames = ["1 月", "2 月", "3 月", "4 月", "5 月", "6 月", "7 月", "8 月", "9 月", "10 月", "11 月", "12 月"];
@@ -342,54 +337,50 @@
            interval = setInterval(function () {
                $("#tb_order").bootstrapTable('refresh');
            }, 10000);
            // interval1 = setInterval(function () {
            //     $("#tb_order1").bootstrapTable('refresh');
            // }, 10000);
            // interval2 = setInterval(function () {
            //     TLProgress = 0;
            //     CallData = [];
            //     CallPSQty = [];
            //     CAllQty = [];
            //     Chart(mychart1, mychart2);
            // }, 20000);
            interval2 = setInterval(function () {
                CallData = [];
                CAllDataX = [];
                CAllDataXval = [];
                Chart(mychart1, mychart2);
            }, 20000);
            //根据窗口的大小变动图表 --- 重点
            // window.onresize = function () {
            //     myChart1.resize();
            //     myChart2.resize();
            // }
            window.onresize = function () {
                mychart1.resize();
                mychart2.resize();
            }
        })
        function Chart(mychart1, mychart2) {
            // $.ajax({
            //     url: "http://localhost:12298/api/loaddata/CallData",
            //     dataType: "JSON",
            //     async: false,//使用同步的方式,true为异步方式
            //     type: "Get",
            //     data: { "CallHouseCode": CallHouseCode },
            //     success: function (data) {
            //         TLProgress = parseFloat((data.data[1][1].qty / data.data[1][0].qty) * 100).toFixed(2);
            //         if (isNaN(TLProgress)) {
            //             TLProgress = 0;
            //         }
            //         //今日配送率
            //         $.each(data.data[0], function (index, val) {
            //             CallData.push(val.hour);
            //             CallPSQty.push(parseFloat(val.HSendQTY).toFixed(2));
            //             CAllQty.push(parseFloat(val.HQty).toFixed(2));
            //         });
            //     },
            //     error: function (data) {
            $.ajax({
                url: GetWEBURL() + "/loaddata/SearchGetWorkStepBillPie",
                dataType: "JSON",
                async: false,//使用同步的方式,true为异步方式
                type: "Get",
                data: { "CallHouseCode": CallHouseCode },
                success: function (data) {
                    //饼图
                    CallData.push(data.Table[0]["column3"]);
                    CallData.push(data.Table[0]["column4"]);
                    CallData.push(data.Table[0]["column5"]);
                    CallData.push(data.Table[0]["column6"]);
                    CallData.push(data.Table[0]["column7"]);
                    //柱状图
                    $.each(data.Table1, function (index, val) {
                        CAllDataX.push(val.countDay);
                        CAllDataXval.push(val.HName);
                    });
                },
                error: function (data) {
            //     }
            // })
                }
            })
            const colorList = ['#91CC75 ', '#5470C6', '#73C0DE', '#EE6666', '#FAC858']
            option1 = {
                title: [
                    {
                        show: true,
                        text: '设备稼动率',
                        text: '设备运行状态',
                        textStyle: {
                            color: '#00c6ff',
                            fontSize: '16',
@@ -409,24 +400,22 @@
                    {
                        name: '占比',
                        type: 'pie',
                        radius: '60 %',//打小
                        radius: '60 %',//大小
                        itemStyle: {
                            borderWidth: 3,
                            borderColor: '#000000'
                        },
                        data: [
                            { value: 12, name: '运行' },
                            { value: 4, name: '停机' },
                            { value: 2, name: '未开机' },
                            { value: 1, name: '维修中' },
                            { value: 1, name: '保养中' }
                            { value: CallData[0], name: '工作' },
                            { value: CallData[1], name: '待机' },
                            { value: CallData[2], name: '离线' },
                            { value: CallData[3], name: '报警' },
                            { value: CallData[4], name: '维修' }
                        ],
                    }
                ]
            };
            CallData = ['08-28', '08-29', '08-30', '08-31', '09-01'];
            option2 = {
                title: {
                    text: '总产值',
@@ -443,10 +432,9 @@
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '10%',
                    containLabel: true
                    left: "20%",//grid 组件离容器左侧的距离。
                    right: "30px",
                    bottom: "20%" //
                },
                legend: {
                    left: 'right',
@@ -461,11 +449,10 @@
                xAxis: [
                    {
                        type: 'category',
                        data: CallData,
                        data: CAllDataXval,
                        axisTick: {
                            alignWithLabel: true
                        },
                        axisLine: {
                            show: true,
                            lineStyle: {
@@ -476,6 +463,8 @@
                        },
                        axisLabel: {
                            show: true,
                            interval: 0, //控制X轴刻度全部显示
                            rotate: 45, //倾斜角度
                            textStyle: {
                                color: '#00c6ff', //坐标值得具体的颜色
                                fontSize: '16'
@@ -507,7 +496,7 @@
                ],
                series: [
                    {
                        data: [120, 200, 150, 80, 70],
                        data: CAllDataX,
                        type: 'bar',
                        showBackground: true,
                        backgroundStyle: {
@@ -528,7 +517,7 @@
        }
        function TopData() {
            $('#tb_order').bootstrapTable({
                url: 'http://localhost:12298/api/loaddata/EquipMentData',
                url: GetWEBURL() + '/loaddata/EquipMentData',
                //data: dataJson,
                method: 'get',                      //请求方式(*)
                dataType: "json",
@@ -549,13 +538,14 @@
                detailView: false,                   //是否显示父子表
                columns: [
                    { field: 'HICMOBillNO', title: '设备数量', align: "left" },
                    { field: 'HNUMBER', title: '开机率', align: "left" },
                    { field: 'HNAME', title: '运行', align: "left" },
                    { field: 'HMODEL', title: '停机', align: "left" },
                    { field: 'HQTY', title: '未开机', align: "left" },
                    { field: 'HLEFT', title: '维修中', align: "left" },
                    { field: 'HSTATUS', title: '保养中', align: "left" }
                    { field: 'column1', title: '设备数量', align: "left" },
                    { field: 'column2', title: '开机率', align: "left" },
                    { field: 'column3', title: '工作', align: "left" },
                    { field: 'column4', title: '待机', align: "left" },
                    { field: 'column5', title: '离线', align: "left" },
                    { field: 'column6', title: '报警', align: "left" },
                    { field: 'column7', title: '维修', align: "left" }
                    //{ field: 'column7', title: '保养', align: "left" }
                ],
                onClickRow: function (row, $element) {
@@ -573,34 +563,76 @@
            })
        }
        function BottomData() {
            for (var i = 0; i < 20; i++) {
                var html1 = '';
                html1 += '<div class="col-sm-12 col-md-2" >';
                if (i == 2 || i == 4 || i == 6)
                    html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#91CC75"  onclick="CheckBtom(this,' + (i + 1) + ')">';
                else if (i % 2 == 0)
                    html1 += '<div class="cns" id="bs' + (i + 1) + '" style=""  onclick="CheckBtom(this,' + (i + 1) + ')">';
                else
                    html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#EE6666; color:#FFF"  onclick="CheckBtom(this,' + (i + 1) + ')">';
            $.ajax({
                url: GetWEBURL() + "/loaddata/SearchGetWorkStepBillList",
                dataType: "JSON",
                async: false,//使用同步的方式,true为异步方式
                type: "Get",
                data: { "CallHouseCode": CallHouseCode },
                success: function (data) {
                    for (var i = 0; i < data.Table.length; i++) {
                        var html1 = '';
                html1 += '<dl>';
                //html1 += '<img src="img/device.png">'
                html1 += '<dd class="tcenter">';
                html1 += '<h1><span>设备名称:</span><span id="ptn' + (i + 1) + '">' + '测试设备机' + i + '</span></h1>';
                html1 += '<h1><span>工单:MO20220901001' + i + '</span></h1>';
                html1 += '<h1><span>产品名称:底壳组件</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                html1 += '<h1><span>产品规格型号:645mm*320mm</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                html1 += '<h1><span>计划数量:</span><span>100' + i + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + i + '</span></h1>';
                html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span>';
                html1 += '</div > ';
                html1 += '</div>';
                html1 += '</dd>';
                html1 += '</dl>';
                html1 += '</div>';
                html1 += '</div>';
                $("#btomleft").append(html1);
            }
                        html1 += '<div class="col-sm-12 col-md-2" >';
                        if (data.Table[i]["设备状态"] == '离线')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#9A9999">';
                        else if (data.Table[i]["设备状态"] == '工作')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#259D27">';
                        else if (data.Table[i]["设备状态"] == '待机')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#199687">';
                        else if (data.Table[i]["设备状态"] == '报警')
                            html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#FC522A">';
                        html1 += '<dl>';
                        //html1 += '<img src="img/device.png">'
                        html1 += '<dd class="tcenter">';
                        html1 += '<h1><span></span><span id="ptn' + (i + 1) + '">' + data.Table[i]["设备名称"] + '</span></h1>';
                        html1 += '<h1><span>工单:' + data.Table[i]["工单"] + '</span></h1>';
                        html1 += '<h1><span>' + data.Table[i]["产品编码"] + '</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                        html1 += '<h1><span>' + data.Table[i]["产品名称"] + '</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                        html1 += '<h1><span>计划数量:</span><span>' + data.Table[i]["计划数量"] + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + data.Table[i]["汇报总数"] + '</span></h1>';
                        html1 += '<h1><span>设备状态:' + data.Table[i]["设备状态"] + '</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
                        html1 += '</div > ';
                        html1 += '</div>';
                        html1 += '</dd>';
                        html1 += '</dl>';
                        html1 += '</div>';
                        html1 += '</div>';
                        $("#btomleft").append(html1);
                    }
                },
                error: function (data) {
                }
            })
            //for (var i = 0; i < 20; i++) {
            //    var html1 = '';
            //    html1 += '<div class="col-sm-12 col-md-2" >';
            //    if (i == 2 || i == 4 || i == 6)
            //        html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#91CC75"  onclick="CheckBtom(this,' + (i + 1) + ')">';
            //    else if (i % 2 == 0)
            //        html1 += '<div class="cns" id="bs' + (i + 1) + '" style=""  onclick="CheckBtom(this,' + (i + 1) + ')">';
            //    else
            //        html1 += '<div class="cns" id="bs' + (i + 1) + '" style="background:#EE6666; color:#FFF"  onclick="CheckBtom(this,' + (i + 1) + ')">';
            //    html1 += '<dl>';
            //    //html1 += '<img src="img/device.png">'
            //    html1 += '<dd class="tcenter">';
            //    html1 += '<h1><span>设备名称:</span><span id="ptn' + (i + 1) + '">' + '测试设备机' + i + '</span></h1>';
            //    html1 += '<h1><span>工单:MO20220901001' + i + '</span></h1>';
            //    html1 += '<h1><span>产品名称:底壳组件</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
            //    html1 += '<h1><span>产品规格型号:645mm*320mm</span><span id="pts' + (i + 1) + '">' + '' + '</span></h1>';
            //    html1 += '<h1><span>计划数量:</span><span>100' + i + '</span><span style="margin-left:20px;">汇报总数:</span><span>' + i + '</span></h1>';
            //    html1 += '<h1><span>当前状态:</span><span class="gj_icon color_border1"></span>';
            //    html1 += '</div > ';
            //    html1 += '</div>';
            //    html1 += '</dd>';
            //    html1 += '</dl>';
            //    html1 += '</div>';
            //    html1 += '</div>';
            //    $("#btomleft").append(html1);
            //}
        }
        //得到查询的参数
        function queryParams(params) {