Commit 1a4a833d authored by caicaicai's avatar caicaicai

修改

parent ec92cf7f
...@@ -3,7 +3,7 @@ ENV = 'development' ...@@ -3,7 +3,7 @@ ENV = 'development'
# 接口地址 # 接口地址
#VUE_APP_BASE_API = 'http://localhost:8000' #VUE_APP_BASE_API = 'http://localhost:8000'
VUE_APP_BASE_API = 'http://192.168.0.110:8001' VUE_APP_BASE_API = 'http://192.168.0.110:8001'
VUE_APP_WS_API = 'ws://localhost:8000' VUE_APP_WS_API = 'ws://192.168.0.111:8001/webSocket'
VUE_APP_LOCAL_API = 'http://192.168.0.110:8001' VUE_APP_LOCAL_API = 'http://192.168.0.110:8001'
VUE_APP_LOCAL_API2 = 'http://192.168.0.110:8001' VUE_APP_LOCAL_API2 = 'http://192.168.0.110:8001'
......
...@@ -4,7 +4,7 @@ ENV = 'production' ...@@ -4,7 +4,7 @@ ENV = 'production'
# 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http
VUE_APP_BASE_API = 'https://el-admin.xin' VUE_APP_BASE_API = 'https://el-admin.xin'
# 如果接口是 http 形式, wss 需要改为 ws # 如果接口是 http 形式, wss 需要改为 ws
VUE_APP_WS_API = 'wss://el-admin.xin' VUE_APP_WS_API = 'ws://192.168.0.111:8001/webSocket'
VUE_APP_LOCAL_API = 'http://www.wheccloud.com:8002 VUE_APP_LOCAL_API = 'http://www.wheccloud.com:8002
VUE_APP_LOCAL_API2 = 'http://www.wheccloud.com:8002' VUE_APP_LOCAL_API2 = 'http://www.wheccloud.com:8002'
\ No newline at end of file
...@@ -1938,6 +1938,16 @@ var HttpReq = function(){ ...@@ -1938,6 +1938,16 @@ var HttpReq = function(){
params:param, params:param,
}) })
}, },
//车辆调度——只获取采区接口
onlyGetMiningAreaQuery: function(param){
return request({
url: '/api/AreaNew/class',
method: 'get',
params:param,
})
},
......
<template> <template>
<div style="wight:100%;height:100vh;position: absolute;"> <div style="wight:100%;height:100%;">
<div :id="`mars3d-container${mapKey}`" <div :id="`mars3d-container${mapKey}`"
:class="['mars3d-container', customClass, { 'mars3d-container-compare-rh' : compare }]"></div> :class="['mars3d-container', customClass, { 'mars3d-container-compare-rh' : compare }]"></div>
...@@ -42,6 +42,7 @@ export default { ...@@ -42,6 +42,7 @@ export default {
data(){ data(){
return{ return{
historyTrajectoryData:[],
persons:[ persons:[
["122.128833", "37.526448", "500"], ["122.128833", "37.526448", "500"],
["122.128638", "37.522818", "500"], ["122.128638", "37.522818", "500"],
...@@ -89,6 +90,7 @@ export default { ...@@ -89,6 +90,7 @@ export default {
["122.127833", "37.525448", "500"], ["122.127833", "37.525448", "500"],
], ],
deviceId:'DESKTOP-L56LKGM',
zuobianData:[], zuobianData:[],
toJavaCoordinates:[], toJavaCoordinates:[],
weilanName:[], weilanName:[],
...@@ -136,8 +138,9 @@ export default { ...@@ -136,8 +138,9 @@ export default {
//后台获取数据 //后台获取数据
getCoordinate() { getCoordinate() {
let that = this; let that = this;
//获取电子围栏
HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => { HttpReq.truckDispatching.screenMapSetUpQuery({size:9999}).then((res) => {
if(true){ if(true){;
//console.log(res); //console.log(res);
let data1 = []; let data1 = [];
for(let key in res){ for(let key in res){
...@@ -154,25 +157,58 @@ export default { ...@@ -154,25 +157,58 @@ export default {
} }
that.zuobianData = data1 that.zuobianData = data1
//console.log("zuobianData",that.zuobianData); //console.log("zuobianData",that.zuobianData);
//console.log("weilanName",that.weilanName); //console.log("weilanName",that.weilanName);
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
})
}
})
} }
}) })
//获取历史轨迹
this.$nextTick(()=>{ HttpReq.truckDispatching.getAllHistroyCarTrajectoryQuery({id:that.deviceId}).then((res) => {
if (this.appendToBody) { //console.log('获取历史轨迹',res);
document.body.appendChild(this.$el) if(res.code == 200){
} let obj1 = {};
if (this.mapKey) { let array1 = [];
this.initMars3d(this.options) res.data.line.forEach((item,index)=>{
} else { let array2 = [];
mars3d.Resource.fetchJson({ url: this.url }).then((data) => { array2.push(item.location.x);
this.initMars3d(data.map3d)// 构建地图 array2.push(item.location.y);
array2.push('500');
array1.push(array2);
})
obj1.name = res.data.devId;
obj1.arrays = array1;
let hisCenterData = [...that.historyTrajectoryData];
hisCenterData.push(obj1);
that.historyTrajectoryData = [...hisCenterData];
this.$nextTick(()=>{
if (this.appendToBody) {
document.body.appendChild(this.$el)
}
if (this.mapKey) {
this.initMars3d(this.options)
} else {
mars3d.Resource.fetchJson({ url: this.url }).then((data) => {
this.initMars3d(data.map3d)// 构建地图
})
}
}) })
} }
}) })
}, },
//上传围栏数据 //上传围栏数据
uploaded(){ uploaded(){
...@@ -248,20 +284,36 @@ export default { ...@@ -248,20 +284,36 @@ export default {
initLayerManager(graphicLayer,that.weilanName[index]); initLayerManager(graphicLayer,that.weilanName[index]);
that.addGraphic_01(graphicLayer,item,that.weilanName[index]); that.addGraphic_01(graphicLayer,item,that.weilanName[index]);
}) })
//历史轨迹回放
that.historyTrajectoryData.forEach(function(item,index){
var graphicLayer2 = new mars3d.layer.GraphicLayer();
map.addLayer(graphicLayer2);
var itemText = `<table style="width: auto;">
<tr>
<th scope="col" colspan="2" style="text-align:center;font-size:15px;">卡车号码:${item.name}</th>
</tr>
<tr>
<td>名称:卡车二</td>
</tr>
</table>`;
initGraphicManager(graphicLayer2,itemText);
that.addGraphic_02(graphicLayer2,item.arrays,item.name);
})
//创建矢量数据图层2 //创建矢量数据图层2
// var graphicLayer1 = new mars3d.layer.GraphicLayer(); var graphicLayer1 = new mars3d.layer.GraphicLayer();
// map.addLayer(graphicLayer1); map.addLayer(graphicLayer1);
// var item = `<table style="width: auto;"> var itemText = `<table style="width: auto;">
// <tr> <tr>
// <th scope="col" colspan="2" style="text-align:center;font-size:15px;">卡车号码:鲁K12345</th> <th scope="col" colspan="2" style="text-align:center;font-size:15px;">卡车号码:鲁K12345</th>
// </tr> </tr>
// <tr> <tr>
// <td>名称:卡车一</td> <td>名称:卡车一</td>
// </tr> </tr>
// </table>`; </table>`;
// initGraphicManager(graphicLayer1,item); initGraphicManager(graphicLayer1,itemText);
// this.addGraphic_02(graphicLayer1,this.persons); that.addGraphic_02(graphicLayer1,this.persons,'卡车一');
// 抛出事件 // 抛出事件
this.$emit('onload', map) this.$emit('onload', map)
...@@ -318,7 +370,7 @@ export default { ...@@ -318,7 +370,7 @@ export default {
graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer) graphicLayer.addGraphic(graphic); //还可以另外一种写法: graphic.addTo(graphicLayer)
}, },
//车辆轨迹 //车辆轨迹
addGraphic_02(graphicLayer1,positions) { addGraphic_02(graphicLayer1,positions,truckName) {
var property = new Cesium.SampledPositionProperty(); var property = new Cesium.SampledPositionProperty();
var tempTime; var tempTime;
...@@ -345,7 +397,7 @@ export default { ...@@ -345,7 +397,7 @@ export default {
}, },
}, },
label: { label: {
text: "卡车一", text: truckName,
font_size: 19, font_size: 19,
font_family: "楷体", font_family: "楷体",
color: Cesium.Color.AZURE, color: Cesium.Color.AZURE,
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="调度截止日期" style="display: inline-block;"> <el-form-item label="调度截止日期" style="display: inline-block;">
<el-date-picker v-model="form.endTime" type="datetime" placeholder="选择日期时间" style="width:220px;"></el-date-picker> <el-date-picker v-model="form.endTime" type="datetime" placeholder="选择日期时间" style="width:220px;" :disabled='form.duration != "长期" '></el-date-picker>
</el-form-item> </el-form-item>
<br> <br>
<el-form-item label="说明" style="display: inline-block;"> <el-form-item label="说明" style="display: inline-block;">
...@@ -124,10 +124,8 @@ export default { ...@@ -124,10 +124,8 @@ export default {
} }
}) })
//获取区域信息 //获取区域信息
HttpReq.truckDispatching.RegionalInformationQuery({size:9999}).then((res) => { HttpReq.truckDispatching.onlyGetMiningAreaQuery({size:9999}).then((res) => {
if(res.code == 200){ this.areaInformationData = res;
this.areaInformationData = res.data.content;
}
}) })
//获取车辆类型 //获取车辆类型
HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => { HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => {
...@@ -141,23 +139,26 @@ export default { ...@@ -141,23 +139,26 @@ export default {
//发起调度 //发起调度
toDispatch(){ toDispatch(){
let that = this; let that = this;
let query1 = {...this.form}; this.checkDataList.forEach((item,index)=>{
query1.carNo = JSON.stringify(this.checkDataList); let query1 = {...that.form};
HttpReq.truckDispatching.manualSchedulingAdd(query1).then((res) => { query1.carNo = item;
if(res.code == 200){ HttpReq.truckDispatching.manualSchedulingAdd(query1).then((res) => {
this.$notify({ if(res.code == 200){
title: '车辆调度发起成功!',
type: 'success', }else{
duration: 2500 this.$notify({
}); title: res.msg,
}else{ type: 'error',
this.$notify({ duration: 2500
title: res.msg, })
type: 'error', }
duration: 2500 }).catch(function(error) { });
}) })
} this.$notify({
}).catch(function(error) { }); title: '车辆调度发起成功!',
type: 'success',
duration: 2500
});
this.query = {}; this.query = {};
this.form = {}; this.form = {};
this.checkDataList = []; this.checkDataList = [];
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName"> <el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName">
<el-table-column prop="odd" label="调度单号" align="center"></el-table-column> <el-table-column prop="odd" label="调度单号" align="center"></el-table-column>
<el-table-column prop="carclass" label="车辆类型" align="center"></el-table-column> <el-table-column prop="carclass" label="车辆类型" align="center"></el-table-column>
<el-table-column prop="carNo" label="车牌号" align="center"></el-table-column>
<el-table-column prop="createTime" label="调度时间" align="center"></el-table-column> <el-table-column prop="createTime" label="调度时间" align="center"></el-table-column>
<el-table-column prop="endTime" label="调度截止日期" align="center"></el-table-column> <el-table-column prop="endTime" label="调度截止日期" align="center"></el-table-column>
<el-table-column prop="finishTime" label="完成调度时间" align="center"></el-table-column> <el-table-column prop="finishTime" label="完成调度时间" align="center"></el-table-column>
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
<el-table-column prop="carshow" label="说明" align="center"></el-table-column> <el-table-column prop="carshow" label="说明" align="center"></el-table-column>
<el-table-column label="操作" align="center" fixed="right"> <el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button> <!-- <el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button> -->
<el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button> <el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -164,17 +165,18 @@ export default { ...@@ -164,17 +165,18 @@ export default {
//删除提示 //删除提示
toDelete(item) { toDelete(item) {
var id = item.id; var id = item.id;
var odd = item.odd; var itemAll = item;
this.$confirm('确认删除该条数据吗?', '提示', { this.$confirm('确认删除该条数据吗?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then((e) => { }).then((e) => {
this.reqRemoveProject([id],odd) this.reqRemoveProject([id],itemAll)
}).catch((e) => {}) }).catch((e) => {})
}, },
//删除调度 //删除调度
reqRemoveProject(item){ reqRemoveProject(item,itemAll){
//删除调度
HttpReq.truckDispatching.manualSchedulingDel(item).then((res) => { HttpReq.truckDispatching.manualSchedulingDel(item).then((res) => {
if(res.status == 400){ if(res.status == 400){
this.$notify({ this.$notify({
...@@ -191,6 +193,22 @@ export default { ...@@ -191,6 +193,22 @@ export default {
} }
this.loadData(); this.loadData();
}) })
let obj1 = {...itemAll};
delete obj1.id;
obj1.flag = 1;
//新增到订单历史
HttpReq.truckDispatching.personRecordingAdd(obj1).then((res) => {
if(res.code == 200){
}else{
this.$notify({
title: res.msg,
type: 'error',
duration: 2500
})
}
}).catch(function(error) { });
}, },
currentTime(time){ currentTime(time){
var date = new Date(time); var date = new Date(time);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</div> </div>
<!-- 表格 --> <!-- 表格 -->
<div class="panel-bottom page-row"> <div class="panel-bottom page-row">
<h3>人工补录管理</h3> <h3>订单历史</h3>
<div class="ctin-box"> <div class="ctin-box">
<div class="content-within"> <div class="content-within">
<div class="content-fix"> <div class="content-fix">
...@@ -31,15 +31,17 @@ ...@@ -31,15 +31,17 @@
<div class="content"> <div class="content">
<el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName"> <el-table :data="tableData" v-loading="loading" border style="width:auto" :row-class-name="tableRowClassName">
<el-table-column prop="odd" label="调度单号" align="center"></el-table-column> <el-table-column prop="odd" label="调度单号" align="center"></el-table-column>
<el-table-column prop="carname" label="车辆类型" align="center"></el-table-column> <el-table-column prop="carclass" label="车辆类型" align="center"></el-table-column>
<el-table-column prop="endTime" label="调度时间" align="center"></el-table-column> <el-table-column prop="carNo" label="车牌号" align="center"></el-table-column>
<el-table-column prop="createTime" label="调度时间" align="center"></el-table-column>
<el-table-column prop="name" label="调度人" align="center"></el-table-column> <el-table-column prop="name" label="调度人" align="center"></el-table-column>
<el-table-column prop="startad" label="调度起点" align="center"></el-table-column> <!-- <el-table-column prop="startad" label="调度起点" align="center"></el-table-column> -->
<el-table-column prop="destination" label="调度目的地" align="center"></el-table-column> <el-table-column prop="destination" label="调度目的地" align="center"></el-table-column>
<el-table-column prop="flag" label="调度类型" align="center" :formatter="flagChange"></el-table-column>
<el-table-column prop="carshow" label="说明" align="center"></el-table-column> <el-table-column prop="carshow" label="说明" align="center"></el-table-column>
<el-table-column label="操作" align="center" fixed="right"> <el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button> <!-- <el-button size="mini" type="success" icon="el-icon-view" @click="showCars(scope.row)"></el-button> -->
<el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button> <el-button size="mini" type="danger" icon="el-icon-delete" @click="toDelete(scope.row)"></el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -99,12 +101,11 @@ ...@@ -99,12 +101,11 @@
<el-option label="清扫车" value="清扫车"></el-option> <el-option label="清扫车" value="清扫车"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<br> <!-- <el-form-item label="起点" style="display: inline-block;">
<el-form-item label="起点" style="display: inline-block;">
<el-select v-model="formAdd.destination" placeholder="请选择起点" style="width:220px;"> <el-select v-model="formAdd.destination" placeholder="请选择起点" style="width:220px;">
<el-option v-for="(obj,index) in areaInformationDataAdd" :label="obj.name" :value="obj.name" :key="index"></el-option> <el-option v-for="(obj,index) in areaInformationDataAdd" :label="obj.name" :value="obj.name" :key="index"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="目的地" style="display: inline-block;"> <el-form-item label="目的地" style="display: inline-block;">
<el-select v-model="formAdd.startad" placeholder="请选择目的地" style="width:220px;"> <el-select v-model="formAdd.startad" placeholder="请选择目的地" style="width:220px;">
<el-option v-for="(obj,index) in areaInformationDataAdd" :label="obj.name" :value="obj.name" :key="index"></el-option> <el-option v-for="(obj,index) in areaInformationDataAdd" :label="obj.name" :value="obj.name" :key="index"></el-option>
...@@ -122,7 +123,7 @@ ...@@ -122,7 +123,7 @@
<el-input type="textarea" v-model="formAdd.carshow" style="width:545px;"></el-input> <el-input type="textarea" v-model="formAdd.carshow" style="width:545px;"></el-input>
</el-form-item> </el-form-item>
<br> <br>
<el-button type="primary" style="height:40px;width:100px;margin-left:100px;" round @click="toDispatchAdd">调度</el-button> <el-button type="primary" style="height:40px;width:100px;margin-left:100px;" round @click="toDispatchAdd">确认</el-button>
</el-form> </el-form>
</el-dialog> </el-dialog>
...@@ -306,9 +307,11 @@ export default { ...@@ -306,9 +307,11 @@ export default {
param.size = 9999; param.size = 9999;
this.$nextTick(()=>{ this.$nextTick(()=>{
//获取车辆信息以及状态 //获取车辆信息
HttpReq.truckDispatching.carPeopStatus1Query(param).then((res) => { HttpReq.truckDispatching.carInformationQuery(param).then((res) => {
this.carInformationDataAdd = res; if(res.code == 200){
this.carInformationDataAdd = res.data.content;
}
}) })
//获取车队 //获取车队
HttpReq.truckDispatching.carFleetQuery({size:9999}).then((res) => { HttpReq.truckDispatching.carFleetQuery({size:9999}).then((res) => {
...@@ -317,10 +320,8 @@ export default { ...@@ -317,10 +320,8 @@ export default {
} }
}) })
//获取区域信息 //获取区域信息
HttpReq.truckDispatching.RegionalInformationQuery({size:9999}).then((res) => { HttpReq.truckDispatching.onlyGetMiningAreaQuery({size:9999}).then((res) => {
if(res.code == 200){ this.areaInformationDataAdd = res;
this.areaInformationDataAdd = res.data.content;
}
}) })
//获取车辆类型 //获取车辆类型
HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => { HttpReq.truckDispatching.carTypeQuery({size:9999}).then((res) => {
...@@ -333,30 +334,42 @@ export default { ...@@ -333,30 +334,42 @@ export default {
}, },
//发起调度 //发起调度
toDispatchAdd(){ toDispatchAdd(){
let query1 = {...this.formAdd}; let that = this;
query1.carNo = JSON.stringify(this.checkDataListAdd); this.checkDataListAdd.forEach((item,index)=>{
HttpReq.truckDispatching.personRecordingAdd(query1).then((res) => { let query1 = {...this.formAdd};
if(res.code == 200){ query1.carNo = item;
this.$notify({ query1.flag = 2;
title: '车辆调度发起成功!', HttpReq.truckDispatching.personRecordingAdd(query1).then((res) => {
type: 'success', if(res.code == 200){
duration: 2500
}); }else{
this.loadDataAdd(); this.$notify({
this.loadData(); title: res.msg,
}else{ type: 'error',
this.$notify({ duration: 2500
title: res.msg, })
type: 'error', }
duration: 2500 }).catch(function(error) { });
}) })
} this.$notify({
}).catch(function(error) { }); title: '添加成功!',
type: 'success',
duration: 2500
});
this.loadDataAdd();
this.loadData();
this.form.toAddVisible = false; this.form.toAddVisible = false;
this.queryAdd = {}; this.queryAdd = {};
this.formAdd = {}; this.formAdd = {};
this.checkDataListAdd = []; this.checkDataListAdd = [];
} },
//调度状态更改
flagChange(row){
return row.flag == 0 ? '智能调度' : row.flag == 1 ? '人工调度' : row.flag == 2 ? '人工补录' : row.flag
},
} }
} }
</script> </script>
......
...@@ -399,13 +399,13 @@ export default { ...@@ -399,13 +399,13 @@ export default {
//初始化weosocket //初始化weosocket
initWebSocket(){ initWebSocket(){
//const wsuri = "ws://114.116.108.246:81/websocket/socketServer?userId="+userId;//连接地址,可加参数 //const wsuri = "ws://114.116.108.246:81/websocket/socketServer?userId="+userId;//连接地址,可加参数
const wsuri = "ws://192.168.0.111:8001/webSocket?userId=7"; const wsuri = process.env.VUE_APP_WS_API + "/" + 7;
this.websocket = new WebSocket(wsuri); this.websocket = new WebSocket(wsuri);
this.websocket.onopen = this.websocketonopen; this.websocket.onopen = this.websocketonopen;
this.websocket.onerror = this.websocketonerror; this.websocket.onerror = this.websocketonerror;
this.websocket.onmessage = this.websocketonmessage; this.websocket.onmessage = this.websocketonmessage;
this.websocket.onclose = this.websocketclose; this.websocket.onclose = this.websocketclose;
}, },
//WebSocket连接成功 //WebSocket连接成功
websocketonopen() { websocketonopen() {
console.log("WebSocket连接成功"); console.log("WebSocket连接成功");
......
...@@ -25,7 +25,7 @@ module.exports = { ...@@ -25,7 +25,7 @@ module.exports = {
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
// host: 'localhost', // 也可以直接写IP地址这样方便真机测试 // host: 'localhost', // 也可以直接写IP地址这样方便真机测试
host: '192.168.0.101', // 也可以直接写IP地址这样方便真机测试 host: '192.168.0.107', // 也可以直接写IP地址这样方便真机测试
port: port, port: port,
open: true, open: true,
overlay: { overlay: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment