| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1.0">
- <title>AI派单中心</title>
- <link rel="stylesheet" href="/static/elementui2.15.5/index.css"/>
- <script src="/static/hplus/js/jquery.min.js?v=2.1.4"></script>
- <script src="/static/layer3.2.0/layer.js"></script>
- <script src="/static/elementui2.15.5/vue-2.6.14.js"></script>
- <script src="/static/elementui2.15.5/index.js"></script>
- <script src="/static/echarts.js"></script>
- <style>
- *{
- margin:0;
- padding:0;
- box-sizing:border-box;
- }
- html,body{
- width:100%;
- height:100%;
- background:#f3f3f4;
- font-family:"PingFang SC","Microsoft YaHei",sans-serif;
- color:#303133;
- }
- #app{
- padding:10px;
- width:98%;
- height:100%;
- margin-left: -10px;
- }
- .main-card{
- border-radius:14px !important;
- border:none !important;
- overflow:hidden;
- box-shadow:0 2px 12px rgba(0,0,0,.04);
- }
- .main-card .el-card__body{
- padding:12px;
- }
- .top-area{
- margin-bottom:10px;
- }
- .stat-wrap{
- display:flex;
- flex-direction:column;
- gap:8px;
- height:100%;
- }
- .big-card{
- height:70px;
- border-radius:6px !important;
- position:relative;
- overflow:hidden;
- background-repeat: no-repeat;
- background-size: cover;
- background-position: center;
- display:flex;
- align-items:center;
- justify-content:space-between;
- padding:0 18px;
- cursor: pointer;
- }
- .big-card.orange{
- background:linear-gradient(135deg,#fff,#fff0eb);
- }
- .big-card::after{
- content:"";
- position:absolute;
- right:-25px;
- top:-25px;
- width:90px;
- height:90px;
- border-radius:50%;
- background:rgba(137,67,221,.06);
- }
- .big-left{
- display:flex;
- align-items:center;
- gap:12px;
- z-index:2;
- }
- .big-card.orange .big-icon{
- background:linear-gradient(135deg,#ffb347,#ff7d4d);
- }
- .big-title{
- font-size:16px;
- font-weight: bold;
- color: #FFFFFF;
- }
- .big-value{
- font-size:24px;
- font-weight:600;
- color:#FFFFFF;
- z-index:2;
- }
- .small-grid{
- flex:1;
- }
- .stat-card {
- flex:1 1 100px;
- padding:12px;
- border-radius: 6px;
- color:#333333FF;
- background-repeat: no-repeat;
- background-size: cover;
- background-position: center;
- width: 100%;
- height:100px;
- margin-top: 7px;
- cursor: pointer;
- }
- .stat-card h3 { margin-top:5px;font-size:16px;color: #333333FF}
- .stat-card p { margin:5px 0 0;font-size:22px; font-weight: bold}
- .small{
- height:142px;
- }
- .icon{
- margin-top: 7px;
- }
- .arrow{
- margin-left: 7px;
- }
- .center-banner{
- width: 100%;
- /*height: 280px;*/
- background: #fff;
- border-radius: 8px;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-top: 10px;
- }
- .center-banner video {
- width: 100%;
- height: 100%;
- display: block;
- }
- .chart-card{
- margin-top:10px;
- border:none !important;
- height:140px;
- }
- .chart-card .el-card__body{
- height:100%;
- padding:10px;
- display:flex;
- flex-direction:column;
- }
- #chart{
- flex:1;
- width:110%;
- min-height:160px;
- margin-left: -55px;
- }
- .chart-title{
- font-size:16px;
- font-weight:700;
- color:#444;
- margin-bottom:8px;
- }
- .table-card{
- border:none !important;
- border-radius:0 !important;
- overflow:hidden;
- background-color: #F7FAFFFF;
- }
- .table-card .el-card__body{
- padding:0;
- }
- .table-header{
- height:46px;
- display:flex;
- align-items:center;
- justify-content:center;
- font-size:16px;
- font-weight:600;
- color:#444;
- background-color: #F7FAFFFF;
- }
- .el-table{
- background-color: #F7FAFFFF;
- }
- .el-table th, .el-table td { text-align:center;color: #333333FF;background-color: #F7FAFFFF; }
- .status-dispatch { color:#7000FBFF; font-weight:600; } /* 紫色 */
- .status-pending { color:#fa8c16; font-weight:600; } /* 橙色 */
- .status-inprogress { color:#7000FBFF; font-weight:600; } /* 蓝色 */
- .status-fail { color: #da0727; font-weight:600; } /* 蓝色 */
- .page{
- margin: 15px 0;
- text-align: center;
- }
- @media(max-width:1200px){
- .big-value{
- font-size:28px;
- }
- .stat-card p{
- font-size:28px;
- }
- .center-banner{
- margin-top:10px;
- }
- }
- </style>
- </head>
- <body>
- <div id="app">
- <el-card class="main-card">
- <!-- 顶部 -->
- <el-row :gutter="10" class="top-area">
- <!-- 左侧整体 -->
- <el-col :lg="18" :md="24">
- <!-- 上部分 -->
- <el-row :gutter="10">
- <!-- 左侧统计 -->
- <el-col :span="8">
- <div class="stat-wrap">
- <div class="big-card" style='background-image: url("/static/ai/img/done.png")' @click="handleModeChange(0)">
- <div class="big-left">
- <div class="big-title">AI派单总数</div>
- </div>
- <div class="big-value">{{done.total}}</div>
- </div>
- <div class="small-grid">
- <el-row :gutter="8" style="height:100%;">
- <el-col :span="12" style="margin-bottom:8px;">
- <div class="stat-card" style='background-image: url("/static/ai/img/bj.png")' @click="handleModeChange(2)">
- <h3>保洁派单数</h3><p style="color: #0983E2FF">{{done.bj}}</p>
- </div>
- </el-col>
- <el-col :span="12" style="margin-bottom:8px;">
- <div class="stat-card" style='background-image: url("/static/ai/img/bx.png")' @click="handleModeChange(1)">
- <h3>维修派单数</h3><p style="color: #00905DFF">{{done.bx}}</p>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="stat-card" style='background-image: url("/static/ai/img/ys.png")' @click="handleModeChange(3)">
- <h3>运送工单数</h3><p style="color: #E68417FF">{{done.ys}}</p>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="stat-card" style='background-image: url("/static/ai/img/ab.png")' @click="handleModeChange(4)">
- <h3>安保待派单数</h3><p style="color: #8943DDFF">{{done.ab}}</p>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- </el-col>
- <!-- 中间banner -->
- <el-col :span="16">
- <div class="center-banner">
- <video
- class="video"
- src="/static/ai/img/ai.mp4"
- autoplay
- loop
- muted
- playsinline
- webkit-playsinline
- x5-playsinline
- disablePictureInPicture>
- 您的浏览器不支持视频播放
- </video>
- </div>
- </el-col>
- </el-row>
- <!-- 趋势图 -->
- <el-card class="chart-card" v-loading="loading3" shadow="never">
- <!-- <div class="chart-title">-->
- <!-- 派单趋势分析-->
- <!-- </div>-->
- <div id="chart"></div>
- </el-card>
- </el-col>
- <!-- 右侧 -->
- <el-col :lg="6" :md="24">
- <div class="stat-wrap">
- <div class="big-card" style='background-image: url("/static/ai/img/undo.png")' @click="handleModeChange2(0)">
- <div class="big-left">
- <div class="big-title">待派单总数</div>
- </div>
- <div class="big-value">{{undo.total}}</div>
- </div>
- <div class="small-grid">
- <el-row :gutter="8" style="height:100%;">
- <el-col :span="12" style="margin-bottom:8px;">
- <div class="stat-card" style='background-image: url("/static/ai/img/bj.png")' @click="handleModeChange2(2)">
- <h3>保洁待派单数</h3><p style="color: #0983E2FF">{{undo.bj}}</p>
- </div>
- </el-col>
- <el-col :span="12" style="margin-bottom:8px;">
- <div class="stat-card" style='background-image: url("/static/ai/img/bx.png")' @click="handleModeChange2(1)">
- <h3>维修待派单数</h3><p style="color: #00905DFF">{{undo.bx}}</p>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="stat-card" style='background-image: url("/static/ai/img/ys.png")' @click="handleModeChange2(3)">
- <h3>运送待派单数</h3><p style="color: #E68417FF">{{undo.ys}}</p>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="stat-card" style='background-image: url("/static/ai/img/ab.png")' @click="handleModeChange2(4)">
- <h3>安保待派单数</h3><p style="color: #8943DDFF">{{undo.ab}}</p>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="stat-card small" style='background-image: url("/static/ai/img/yc.png")' @click="abnormal(1)">
- <div class="icon">
- <img src="/static/ai/img/icon-yc.png">
- </div>
- <h3>异常单数</h3><p style="color: #F53F3FFF">{{undo.yc}}<img class="arrow" src="/static/ai/img/arrow-yc.png"></p>
- </div>
- </el-col>
- <el-col :span="12">
- <div class="stat-card small" style='background-image: url("/static/ai/img/bh.png")' @click="abnormal(2)">
- <div class="icon">
- <img src="/static/ai/img/icon-bh.png">
- </div>
- <h3>被驳回单数</h3><p style="color: #6D76A2FF">{{undo.bh}}<img class="arrow" src="/static/ai/img/arrow-bh.png"></p>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- </el-col>
- </el-row>
- <!-- 底部表格 -->
- <el-row :gutter="12" style="margin-top:10px;">
- <el-col :span="12">
- <el-card class="table-card" shadow="never">
- <div class="table-header">
- <img src="/static/ai/img/triangle-right.png" style="width: 10px;height: 10px;margin-right: 10px">
- 今日已派单看板
- <img src="/static/ai/img/triangle-left.png" style="width: 10px;height: 10px;margin-left: 10px">
- </div>
- <el-table v-loading="loading"
- ref="dispatchedTable"
- :data="dispatchedList"
- style="width:100%;">
- <el-table-column prop="sn" label="订单编号">
- <template slot-scope="scope">
- <a href="javascript:;"
- data-title="详情"
- @click="layerOpen(scope.row.id)"
- data-title="详情"
- style="color:#0056DBFF;text-decoration: none">
- {{ scope.row.sn }}
- </a>
- </template>
- </el-table-column>
- <el-table-column prop="type" label="类型"></el-table-column>
- <el-table-column prop="status" label="状态">
- <template slot-scope="scope">
- <span class="status-dispatch">已派单</span>
- </template>
- </el-table-column>
- <el-table-column prop="user" label="发起人"></el-table-column>
- <el-table-column prop="create_time" label="派单时间"></el-table-column>
- <el-table-column prop="toUser" label="指派员工"></el-table-column>
- <el-table-column label="操作">
- <template slot-scope="scope">
- <a href="javascript:;"
- data-title="重新派单"
- @click="send(scope.row.todo_id,scope.row.mode,0)"
- style="color:#0056DBFF;text-decoration: none">
- 重新派单
- </a>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <div class="page">
- <el-pagination
- background
- layout="prev, pager, next, sizes, total"
- :total="total"
- :page-size="pageSize"
- :current-page.sync="currentPage"
- @size-change="handleSizeChange"
- @current-change="handlePageChange">
- </el-pagination>
- </div>
- </el-card>
- </el-col>
- <el-col :span="12">
- <el-card class="table-card">
- <div class="table-header">
- <img src="/static/ai/img/triangle-right.png" style="width: 10px;height: 10px;margin-right: 10px">
- 今日待派单看板
- <img src="/static/ai/img/triangle-left.png" style="width: 10px;height: 10px;margin-left: 10px">
- </div>
- <el-table v-loading="loading2" ref="pendingTable" :data="pendingList" style="width:100%;">
- <el-table-column prop="sn" label="订单编号">
- <template slot-scope="scope">
- <a href="javascript:;"
- @click="layerOpen(scope.row.id)"
- style="color:#0056DBFF;text-decoration: none">
- {{ scope.row.sn }}
- </a>
- </template>
- </el-table-column>
- <el-table-column prop="type" label="类型"></el-table-column>
- <el-table-column prop="user" label="发起人"></el-table-column>
- <el-table-column prop="status" label="状态">
- <template slot-scope="scope">
- <div v-if="fail == 0">
- <img v-if="scope.row.flag" src="/static/ai/img/wait.png" class="loading-ico">
- <span :class="scope.row.flag ? 'status-inprogress':'status-pending'">{{ scope.row.flag && ai == 1 ? 'Ai派单中...':'待派单' }}</span>
- </div>
- <div v-else>
- <span class="status-fail">派单未匹配</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column v-if="fail" prop="fail" label="操作">
- <template slot-scope="scope">
- <a href="javascript:;"
- data-title="手动派单"
- @click="send(scope.row.id,scope.row.work_type_mode,1)"
- style="color:#0056DBFF;text-decoration: none">
- 手动派单
- </a>
- </template>
- </el-table-column>
- </el-table>
- <!-- 分页 -->
- <div class="page">
- <el-pagination
- background
- layout="prev, pager, next, sizes, total"
- :total="total2"
- :page-size="pageSize2"
- :current-page.sync="currentPage2"
- @size-change="handleSizeChange2"
- @current-change="handlePageChange2">
- </el-pagination>
- </div>
- </el-card>
- </el-col>
- </el-row>
- </el-card>
- </div>
- <script>
- new Vue({
- el:'#app',
- data: function() {
- return {
- ai:{$ai},
- aiList:[0,0,0,0,0,0,0],
- userList:[0,0,0,0,0,0,0],
- done: {'total':0,'bx':0, 'bj': 0, 'ys' : 0, 'ab' : 0,},
- undo: {'total':0,'bx':0, 'bj': 0, 'ys' : 0, 'ab' : 0,'yc':0,'bh':0},
- dateList:[],
- currentPage: 1,
- pageSize: 10,
- total: 0,
- mode: 0,
- dispatchedList:[],
- currentPage2: 1,
- pageSize2: 10,
- total2: 0,
- mode2: 0,
- pendingList:[],
- loading:true,
- loading2:true,
- loading3:true,
- fail:0,
- }
- },
- mounted(){
- this.getData();
- setInterval(() => {
- this.getData();
- }, 1000 * 60);
- },
- methods: {
- getData(){
- this.fetchEchart();
- this.fetchTodo();
- this.fetchOrder();
- },
- layerOpen(id){
- layer.open({
- type: 2,
- title: "详情",
- shadeClose: true,
- shade: 0.3,
- maxmin: true,
- area: ['80%', '80%'],
- content: "{:url('orders/detail2',[],'')}/id/"+id,
- end: function () {
- // window.location.reload();
- }
- });
- },
- send(id,mode,type){
- const self = this;
- layer.open({
- type: 2,
- title: "派单",
- shadeClose: true,
- shade: 0.3,
- maxmin: true,
- area: ['80%', '80%'],
- content: "{:url('send',[],'')}/id/"+id+"/mode/"+mode+"/type/"+type,
- end: function () {
- if (type === 0){
- self.fetchTodo();
- }else{
- self.fetchOrder();
- }
- }
- });
- },
- abnormal(type){
- const self = this;
- layer.open({
- type: 2,
- title: type === 1 ? "异常单列表" : '被驳回单列表',
- shadeClose: true,
- shade: 0.3,
- maxmin: true,
- area: ['80%', '80%'],
- content: "{:url('abnormal',[],'')}/type/"+type,
- end: function () {
- }
- });
- },
- fetchEchart() {
- const url = "{:url('show')}";
- $.ajax({
- url: url,
- type: 'POST',
- dataType: 'json',
- success: (res) => { // 使用箭头函数
- this.aiList = res.ai;
- console.log(this.aiList);
- this.userList = res.user;
- this.date = res.date;
- this.done = res.done;
- this.undo = res.undo;
- this.initEchart();
- },
- error: function(xhr, status, error) {
- console.error('请求失败:', error);
- }
- });
- },
- fetchTodo() {
- const url = "{:url('todoList')}";
- $.ajax({
- url: url,
- type: 'POST',
- dataType: 'json',
- data:{
- page:this.currentPage,
- size:this.pageSize,
- mode:this.mode
- },
- success: (res) => { // 使用箭头函数
- this.dispatchedList = res.data;
- this.total = res.total;
- this.loading = false;
- },
- error: function(xhr, status, error) {
- console.error('请求失败:', error);
- }
- });
- },
- handlePageChange(page) {
- this.currentPage = page;
- this.loading = true;
- this.fetchTodo();
- },
- handleSizeChange(val) {
- this.pageSize = val;
- this.loading = true;
- this.fetchTodo();
- },
- handleModeChange(val) {
- layer.open({
- type: 2,
- title: "历史派单",
- shadeClose: true,
- shade: 0.3,
- maxmin: true,
- area: ['90%', '90%'],
- content: "{:url('history',[],'')}/mode/"+val,
- end: function () {
- // window.location.reload();
- }
- });
- },
- fetchOrder() {
- const url = "{:url('orderList')}";
- $.ajax({
- url: url,
- type: 'POST',
- dataType: 'json',
- data:{
- page:this.currentPage2,
- size:this.pageSize2,
- mode:this.mode2,
- },
- success: (res) => { // 使用箭头函数
- this.pendingList = res.data;
- this.total2 = res.total;
- this.loading2 = false;
- this.fail = res.fail;
- },
- error: function(xhr, status, error) {
- console.error('请求失败:', error);
- }
- });
- },
- handlePageChange2(page) {
- this.currentPage2 = page;
- this.loading2 = true;
- this.fetchOrder();
- },
- handleSizeChange2(val) {
- this.pageSize2 = val;
- this.loading2 = true;
- this.fetchOrder();
- },
- handleModeChange2(val) {
- this.mode2 = val;
- this.loading2 = true;
- this.fetchOrder();
- },
- initEchart() {
- // 左侧折线图
- var chart = echarts.init(document.getElementById('chart'));
- window.addEventListener('resize', () => {
- chart.resize();
- });
- var option = {
- backgroundColor: '#F6FAFFFF',
- tooltip:{trigger:'axis'},
- legend:{data:['AI派单','人工派单']},
- xAxis:{type:'category', splitLine: {show: false}, data:this.date},
- yAxis: {
- type: 'value',
- splitLine: { show: false },
- name: '派单趋势分析',
- nameTextStyle: {
- fontSize: 15,
- color: '#333',
- }
- },
- series:[
- { name:'AI派单', type:'line',symbolSize: 10, data:this.aiList, smooth:false , itemStyle:{color:'#7000FBFF'}, areaStyle:{color: {
- type: 'linear',
- x: 0, y: 0,
- x2: 0, y2: 1, // 从左到右
- colorStops: [
- { offset: 0, color: '#eee0ffFF' },
- { offset: 1, color: '#7000fb03' }
- ]
- }}},
- { name:'人工派单', type:'line',symbolSize: 10, data:this.userList, smooth:false, itemStyle:{color:'#0062FBFF'},areaStyle: {
- color: {
- type: 'linear',
- x: 0, y: 0,
- x2: 0, y2: 1, // 从左到右
- colorStops: [
- { offset: 0, color: '#a9cbffFF' },
- { offset: 1, color: '#ffffff03' }
- ]
- }
- }}
- ]
- };
- chart.setOption(option);
- this.loading3 = false;
- }
- },
- });
- </script>
- </body>
- </html>
|