php+echarts实现数据可视化实例3

 效果

全部代码





    
    
    
    
    
    
    电子看板



    

采购看板

近一月供应商新增采购单含税金额前五榜单
近一月不同采购类型的含税总金额
近一周新增采购单含税金额分析
近一月产品新增采购单含税金额前五榜单
  • Top1:
  • Top2:
  • Top3:
  • Top4:
  • Top5:
近一月供应商入库数量前五榜单
  • Top1:
  • Top2:
  • Top3:
  • Top4:
  • Top5:
近一月未入库采购单
0 AND v.vendor_code = pha.vendor_code '; $sql5 .= " and pha.status = '已签核'"; $sql5 .= " order by pha.creation_date DESC"; $result5 = DB_query($sql5, $db); // 检查查询是否成功 if ($result5) { // 检查查询结果是否为空 if (mysqli_num_rows($result5) > 0) { ?>
供应商代码 采购单号 料号 采购数量 收货量 待收量 建立日期
近一月不同仓库入库数量前五榜单
近一月产品入库数量前五榜单
  • Top1:
  • Top2:
  • Top3:
  • Top4:
  • Top5:
= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MONTH)) AND po.vendor_code = ve.vendor_code GROUP BY vendor_code ORDER BY total_amount desc LIMIT 5 "; $result = DB_query($sql, $db); while ($array = mysqli_fetch_assoc($result)) { $arrays[] = $array; } if (is_array($arrays)) { foreach ($arrays as $key => $value) { $vendor[] = $value['vendor_code']; $amount[] = $value['total_amount']; } } else { $vendor[] = 0; $amount[] = 0; } sort($amount); echo ""; //近一月不同采购类型的含税总金额 $sql1 = "SELECT po.order_type,po.po_all_amount, SUM(po.po_all_amount) AS total_amount FROM po_headers_all po WHERE po.creation_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MONTH)) GROUP BY po.order_type ORDER BY total_amount desc LIMIT 5 "; $result1 = DB_query($sql1, $db); $index = 1; while ($array1 = mysqli_fetch_assoc($result1)) { $name = $array1['order_type']; $value = $array1['total_amount']; $title = 'TOP' . $index; if (!$value) { $value = 0; } $array_data1[] = array( 'name' => $name, 'value' => $value, 'title' => $title ); $index++; } echo ""; //近一周新增采购单含税金额分析 $sql2 = " SELECT DATE_FORMAT(date_table.date, '%Y-%m-%d') AS date, COALESCE(SUM(po_headers_all.po_all_amount), 0) AS total_amount FROM ( SELECT DATE_SUB(CURDATE(), INTERVAL n DAY) AS date FROM ( SELECT a.N + b.N * 10 AS n FROM (SELECT 0 AS N UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) AS a CROSS JOIN (SELECT 0 AS N UNION ALL SELECT 1 UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 UNION ALL SELECT 6 UNION ALL SELECT 7 UNION ALL SELECT 8 UNION ALL SELECT 9) AS b ORDER BY n DESC ) AS numbers WHERE n <= 6 -- 指定查询的天数 ) AS date_table LEFT JOIN po_headers_all ON DATE(FROM_UNIXTIME(po_headers_all.creation_date)) = date_table.date GROUP BY date_table.date ORDER BY date_table.date "; $result2 = DB_query($sql2, $db); while ($array2 = mysqli_fetch_assoc($result2)) { $arrays2[] = $array2; } if (is_array($arrays2)) { foreach ($arrays2 as $key => $value) { $date2[] = $value['date']; $total_amount2[] = $value['total_amount']; } } else { $date2[] = 0; $total_amount2[] = 0; } echo ""; //计算近一月供应商入库数量榜单 $sql3 = " SELECT a.vendor_code,d.vendor_name,SUM(prt.transaction_quantity) as quantity FROM po_headers_all a, po_lines_all b, sf_item_no c, vendors d, po_rcv_transactions prt,po_rcv_receipt_line prr WHERE a.po_num = b.po_num AND a.vendor_code = d.vendor_code AND b.po_num = prt.po_num AND prr.receipt_num=prt.receipt_num AND prt.po_num=prr.po_num AND prt.po_line=prr.po_line AND b.stockid=prr.stockid AND prt.transaction_type in ('RECEIVE') AND b.line = prt.po_line AND b.stockid = c.item_no AND prt.transaction_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MONTH)) GROUP BY vendor_code ORDER BY prt.transaction_quantity desc LIMIT 5 "; $result3 = DB_query($sql3, $db); $index = 1; while ($array3 = mysqli_fetch_assoc($result3)) { $name = $array3['vendor_name']; $value = $array3['quantity']; $title = 'TOP' . $index; if (!$value) { $value = 0; } $array_data3[] = array( 'name' => $name, 'value' => $value, 'title' => $title ); $index++; } echo ""; // 近一月产品新增采购单含税金额 $sql4 = " SELECT po.stockid,sf.item_name,SUM(line_amount) AS total_amount FROM po_lines_all po,sf_item_no sf WHERE po.stockid = sf.item_no AND po.creation_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MONTH)) GROUP BY stockid ORDER BY total_amount desc LIMIT 5 "; $result4 = DB_query($sql4, $db); $index = 1; while ($array4 = mysqli_fetch_assoc($result4)) { $name = $array4['stockid']; $value = $array4['total_amount']; $title = 'TOP' . $index; if (!$value) { $value = 0; } $array_data4[] = array( 'name' => $name, 'value' => $value, 'title' => $title ); $index++; } echo ""; //近一月不同仓库入库数量 $sql6 = " SELECT prr.subinventory_code,SUM(prt.transaction_quantity) as quantity FROM po_headers_all a, po_lines_all b, sf_item_no c, vendors d, po_rcv_transactions prt,po_rcv_receipt_line prr WHERE a.po_num = b.po_num AND a.vendor_code = d.vendor_code AND b.po_num = prt.po_num AND prr.receipt_num=prt.receipt_num AND prt.po_num=prr.po_num AND prt.po_line=prr.po_line AND b.stockid=prr.stockid AND prt.transaction_type in ('RECEIVE') AND b.line = prt.po_line AND b.stockid = c.item_no AND prt.transaction_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MONTH)) GROUP BY subinventory_code ORDER BY prt.transaction_quantity desc LIMIT 5 "; $result6 = DB_query($sql6, $db); while ($array6 = mysqli_fetch_assoc($result6)) { $arrays6[] = $array6; } if (is_array($arrays6)) { foreach ($arrays6 as $key => $value) { $subinventory_code6[] = $value['subinventory_code']; $quantity6[] = $value['quantity']; } } else { $subinventory_code6[] = 0; $quantity6[] = 0; } echo ""; //近一月产品入库数量榜单 $sql7 = " SELECT b.stockid,SUM(prt.transaction_quantity) as quantity FROM po_headers_all a, po_lines_all b, sf_item_no c, vendors d, po_rcv_transactions prt,po_rcv_receipt_line prr WHERE a.po_num = b.po_num AND a.vendor_code = d.vendor_code AND b.po_num = prt.po_num AND prr.receipt_num=prt.receipt_num AND prt.po_num=prr.po_num AND prt.po_line=prr.po_line AND b.stockid=prr.stockid AND prt.transaction_type in ('RECEIVE') AND b.line = prt.po_line AND b.stockid = c.item_no AND prt.transaction_date >= UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 1 MONTH)) GROUP BY stockid ORDER BY prt.transaction_quantity desc LIMIT 5 "; $result7 = DB_query($sql7, $db); $index = 1; while ($array7 = mysqli_fetch_assoc($result7)) { $name = $array7['stockid']; $value = $array7['quantity']; $title = 'TOP' . $index; if (!$value) { $value = 0; } $array_data7[] = array( 'name' => $name, 'value' => $value, 'title' => $title ); $index++; } echo "";

css

body {
    background: linear-gradient(25deg, #0f2249, #182e5a 20%, #0f2249 40%, #182e5a 60%, #0f2249 80%, #182e5a 100%);
    padding: 0px;
    margin: 0px;
}

ul {
    padding: 0px;
    margin: 0px;
}

.head {
    /* height: 40px; */
    background: url(../../images/head_bg.png) no-repeat center center;
    background-size: 100% 100%;
    position: relative;
    margin-bottom: 20px;
    border: 1px solid rgb(255, 255, 255, 0);
}

.head h1 {
    color: #bde4ff;
    text-align: center;
    font-size: 25px;
    /* line-height: 40px; */
    letter-spacing: .06rem;
}

.head h1 img {
    width: 1.5rem;
    display: inline-block;
    vertical-align: middle;
    margin-right: .2rem
}

.all_title {
    background: linear-gradient(to top, #56c3ec, #b2f3f5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    letter-spacing: 2px;
    font-family: '微软雅黑';
    font-weight: bold;
    /* font-size: 32px; */
}


.kanban_all {
    /* border: 1px solid black; */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.kanban_all_position {
    /* border: 1px solid red; */
    width: 98%;
    display: flex;
    flex-wrap: wrap;
}

.kanban_item {
    /* border: 1px solid red; */
    width: calc(50% - 2%);
    margin: 0 1% 1% 1%;
}

.kanban_line {
    height: 280px;
    border: 1px solid #3486da;
    background: rgba(0, 70, 190, .1);
    padding: .15rem;
    position: relative;
    margin-bottom: .25rem;
    z-index: 10;
    /* width: calc(50% - 3%); */
    margin: 0 1% 1% 1%;
}


.kanban_line:before,
.kanban_line:after {
    position: absolute;
    /* width: .15rem;
    height: .15rem; */
    content: "";
    border-top: 3px solid #3486da;
    top: -2px;
}

.kanban_line:before,
.kanban_line:after,


.kanban_title {
    height: 20px;
    padding: 1%;
    font-family: '华文细黑';
    font-weight: bold;
    background: linear-gradient(to right, rgba(48, 82, 174, 1), rgba(48, 82, 174, 0));
    color: #fff;
    font-size: 14px;
}

.kanban_content {
    height: 220px;
    padding: 1%;
    display: flex;
    justify-content: center;
    /* border: 1px solid red; */
}

.kanban_content table {
    width: 100%;
    /* border: 1px solid green; */
}

.kanban_content_left {
    /* border: 1px solid red; */
    width: 65%;
}

.kanban_content_right {
    width: 35%;
    /* border: 1px solid green; */
}

.kanban_content_right li {
    margin-top: 5%;
    font-family: '微软雅黑';
}

.kanban_content_left1 {
    /* border: 1px solid red; */
    width: 55%;
}

.kanban_content_right1 {
    width: 45%;
    font-size: 85%;
    /* border: 1px solid green; */
}

.kanban_content_right1 li {
    margin-top: 5%;
    font-family: '微软雅黑';
}

.kanban_content table td {
    width: 100%;
    /* 或者您可以根据需求设置其他百分比值,例如33.33% */
}

.kanban_line_double {
    /* border: 1px solid blue; */
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.kanban_line_double .left {
    /* border: 1px solid red; */
    width: 48%;
    height: 100%;
}

.kanban_line_double .left .kanban_title {
    padding: 2%;
}

.kanban_line_double .middle {
    background: none;
    width: 3%;
}

.kanban_line_double .right {
    /* border: 1px solid black; */
    width: 48%;
    height: 100%;
}

.kanban_line_double .right .kanban_title {
    padding: 2%;
}

/* 表格_5 */
.table {
    text-align: center;
    /* border: 1px solid black; */
    border-collapse: collapse;
}

.table tr th {
    width: 20%;
    /* border: 1px solid black; */
    color: #c0dcf0;
    font-weight: bold;
}

.table tr td {
    width: 20%;
    text-align: center;
    padding-top: 1%;
    color: #8faade;
}

.quantity_show {
    width: 100%;
    font-size: 20px;
    letter-spacing: 2px;
    font-family: '微软雅黑';
    text-align: center;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity_show_position {
    width: 100%;
}

.quantity_show div {
    padding: 1%;
    color: white;

}

.quantity_show .quantity_line2 {
    color: white;
    font-size: 30px;
}

.quantity_show .quantity_line3 ul {
    display: flex;
    /* border: 1px solid red; */
    justify-content: center;
    /* 水平居中 */
    align-items: center;
    /* 垂直居中 */
}

.quantity_show .quantity_line3 ul li {
    margin: 0 5%;
    /* border: 1px solid black; */
    list-style: none;
}

.quantity_show .quantity_line3 ul li:nth-child(1):before {
    content: "";
    display: inline-block;
    width: 12px;
    /* 设置图标宽度 */
    height: 12px;
    /* 设置图标高度 */
    background-color: red;
    border-radius: 50%;
    /* 设置图标背景颜色 */
    margin-right: 5px;
    /* 调整图标与文本之间的间距 */
}

.quantity_show .quantity_line3 ul li:nth-child(2):before {
    content: "";
    display: inline-block;
    width: 12px;
    /* 设置图标宽度 */
    height: 12px;
    /* 设置图标高度 */
    background-color: green;
    border-radius: 50%;
    /* 设置图标背景颜色 */
    margin-right: 5px;
    /* 调整图标与文本之间的间距 */
}

.quantity_show .quantity_line3 span {
    color: #fff;
}

/* 表格 */
/* 表格_5 */
.table1 {
    text-align: center;
    /* border: 1px solid #8faade; */
    border-collapse: collapse;
}

.table1 tr th {
    /* width: 20%; */
    /* border: 1px solid #8faade; */
    color: #c0dcf0;
    font-weight: bold;
}

.table1 tr .th1 {
    width: 10%;
}

.table1 tr .th2 {
    width: 8%;
}

.table1 tr .th3 {
    width: 5%;
}

.table1 tr td {
    /* width: 20%; */
    text-align: center;
    padding-top: 1%;
    color: #8faade;
    /* border: 1px solid #8faade; */
}

.table1 tr .td1 {
    width: 10%;
}

.table1 tr .td2 {
    width: 8%;
}

.table1 tr .td3 {
    width: 5%;
}

/* 定义滚动动画 */
@keyframes scroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-100%);
    }
}

/* 应用动画到表格 */
/* .scroll table {
    animation: scroll 50s linear infinite;
    width: 100%;
    max-height: 200px;
    position: relative;
}

.scroll {
    overflow: hidden;
} */

/* .scroll:hover {
    overflow-y: scroll;
} */

你可能感兴趣的:(php,echarts,php)