Commit 183e68c3 authored by caicaicai's avatar caicaicai

修改

parent e5a4f52f
......@@ -28,3 +28,7 @@ export const faultDayAdd = '/api/Fault'; //添加故障日报
export const faultMonthAdd = '/api/FaultMonth'; //添加故障月报
export const faultYearAdd = '/api/FaultYear'; //添加故障年报
export const waitingtrucksQuery = '/api/Dispatch/waitingtrucks'; //获取待装车卡车列表
export const manmadeStatusQuery = '/api/Manmade/status'; //获取调度车辆次数为一天或者长期的数据
export const dingDanBiaoCaoZuo = '/api/Order'; //订单表操作
export const getZhuangCheDingDanQuery = '/api/Order/ZC'; //获取装车订单
export const getXieCheDingDanQuery = '/api/Order/XC'; //获取卸车订单
......@@ -38,7 +38,6 @@ export default {
data() {
return {
showDecide:false,
carInformationData1:{},
carInformationData2:{},
carnumber:'',
personalName:'',
......
......@@ -8,13 +8,13 @@
</div>
<div class="orderText2" @click="startPaidanFn()" v-show="btnShow1">开始派单</div>
<div class="orderText2" @click="refusePaidanFn()" v-show="btnShow1">拒绝派单</div>
<div class="orderText2" @click="finishPaidanFn()" v-show="btnShow2">完成派单</div>
<div class="orderText2" @click="finishPaidanFn()" v-show="btnShow2">卸车</div>
</div>
</template>
<script>
import { httpGet, httpPostForJson, putForJson, httpDelForJson} from "@/common/httpBean.js"
import {manualSchedulingQuery,} from "@/axios/api.js"
import {manualSchedulingQuery,manmadeStatusQuery,vehicleInformationQuery,vehicleInformationUpdate,dingDanBiaoCaoZuo,getZhuangCheDingDanQuery,getXieCheDingDanQuery} from "@/axios/api.js"
export default {
data(){
......@@ -22,59 +22,105 @@ export default {
showDe:false,
carnumber:'',
carDestination:'',
btnShow1:true, //开始派单和拒绝派单展示
btnShow1:false, //开始派单和拒绝派单展示
btnShow2:false, //完成派单展示
timer1:null,
sonTimer1:null,
}
},
mounted(){
this.timer1 = setInterval(() => {
httpGet(manualSchedulingQuery,{sort:'createTime,desc',size:1,carNo:this.carnumber}).then((res) => {
if(res.code == 200){
if(res.data.totalElements == 0){
return
}else{
this.showDe = true;
this.carDestination = res.data.content[0].destination;
}
}
this.sonTimer1 = setInterval(() => {
httpGet(getZhuangCheDingDanQuery,{sort:'createTime,desc',size:1,carNo:this.carnumber}).then((res) => {
if(res.length == 0){
this.loadData2();
}else{
this.showDe = true;
this.btnShow1 = true;
this.btnShow2 = false;
this.carDestination = res[0].destination;
}
});
}, 20000)
},
methods:{
loadData(carnumber){
this.carnumber = carnumber;
this.$nextTick(()=>{
httpGet(manualSchedulingQuery,{sort:'createTime,desc',size:1,carNo:this.carnumber}).then((res) => {
if(res.code == 200){
if(res.data.totalElements == 0){
return
}else{
this.showDe = true;
this.carDestination = res.data.content[0].destination;
}
httpGet(getZhuangCheDingDanQuery,{sort:'createTime,desc',size:1,carNo:this.carnumber}).then((res) => {
if(res.length == 0){
this.loadData2();
}else{
this.showDe = true;
this.btnShow1 = true;
this.btnShow2 = false;
this.carDestination = res[0].destination;
}
});
})
},
//查询是否有卸车
loadData2(){
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
if(res.data.content[0].weightStatus == 1){
httpGet(getXieCheDingDanQuery,{sort:'createTime,desc',size:1,carNo:this.carnumber}).then((res) => {
if(res.length == 0){
return
}else{
this.showDe = true;
this.btnShow1 = false;
this.btnShow2 = true;
this.carDestination = res[0].destination;
}
});
}
}
});
},
//开始派单
startPaidanFn(){
this.btnShow1 = false;
this.btnShow2 = true;
putForJson(vehicleInformationUpdate,{number:this.carnumber,workStatus:1}).then((res) => {});
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
putForJson(vehicleInformationUpdate,{id:res.data.content[0].id,number:this.carnumber,workStatus:1,weightStatus:2}).then((res) => {});
}
});
httpGet(manualSchedulingQuery,{sort:'createTime,desc',size:1,number:this.carnumber}).then((res) => {
if(res.code == 200){
putForJson(manualSchedulingQuery,{id:res.data.content[0].id,number:this.carnumber,status:1}).then((res) => {});
}
});
},
//拒绝派单
refusePaidanFn(){
putForJson(vehicleInformationUpdate,{number:this.carnumber,workStatus:1}).then((res) => {});
this.btnShow1 = false;
this.showDe = false;
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
putForJson(vehicleInformationUpdate,{id:res.data.content[0].id,number:this.carnumber,oddStatus:1,workStatus:0}).then((res) => {});
}
});
httpGet(manualSchedulingQuery,{sort:'createTime,desc',size:1,number:this.carnumber}).then((res) => {
if(res.code == 200){
putForJson(manualSchedulingQuery,{id:res.data.content[0].id,number:this.carnumber,status:0}).then((res) => {});
}
});
},
//完成派单
//卸车
finishPaidanFn(){
this.btnShow1 = true;
this.btnShow2 = false;
putForJson(vehicleInformationUpdate,{number:this.carnumber,workStatus:1}).then((res) => {});
this.showDe = false;
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
putForJson(vehicleInformationUpdate,{id:res.data.content[0].id,number:this.carnumber,workStatus:0,weightStatus:0}).then((res) => {});
}
});
httpGet(manualSchedulingQuery,{sort:'createTime,desc',size:1,number:this.carnumber}).then((res) => {
if(res.code == 200){
putForJson(manualSchedulingQuery,{id:res.data.content[0].id,number:this.carnumber,status:0}).then((res) => {});
}
});
httpDelForJson(dingDanBiaoCaoZuo,{number:this.carnumber}).then((res) => {});
},
//获取当前时间
currentTime(){
......@@ -113,8 +159,8 @@ export default {
},
beforeDestroy() {
if(this.timer1) { //如果定时器还在运行 或者直接关闭,不用判断
clearInterval(this.timer1); //关闭
if(this.sonTimer1) { //如果定时器还在运行 或者直接关闭,不用判断
clearInterval(this.sonTimer1); //关闭
}
}
}
......
......@@ -702,7 +702,7 @@ export default {
}
.voiceAppMainViews{
position: absolute;
z-index: 1;
z-index: 2;
top: 50%;
left: 50%;
height: 80vh;
......
......@@ -55,15 +55,27 @@
<carInformation ref="carInformationMethod" v-show="selectFunction == 5"/>
<personalCenter ref="personalCenterMethod" v-show="selectFunction == 6"/>
<smallWindow ref="smallWindowMethod" v-show="selectFunction == 7"/>
<div id="centerDiv" class="mapcontainer">
<!-- 地图区域 -->
<!-- <div id="centerDiv" class="mapcontainer">
<mars3dViewerMap :url="configUrl" @onload="onMapload"/>
</div> -->
<!-- 电铲待装车辆列表 -->
<div class="waitingtrucksView" v-if="carclass == '电铲'">
<div class="waitingtrucksView_title">待装卡车列表</div>
<div class="waitingtrucksView_content">
<div v-for="(item,index) in daizhangCar" :key="index">
<div>车牌号:{{item.number}}</div>
<div>司机:{{item.driver}}</div>
<el-button type="primary" style="font-size:18px;" @click="wanchengzhuangcheFn(item.number)">完成装车</el-button>
</div>
</div>
</div>
</div>
</template>
<script>
import { httpGet, httpPostForJson, putForJson, httpDelForJson} from "@/common/httpBean.js"
import {personalCenterInforQuery} from "@/axios/api.js"
import {personalCenterInforQuery,vehicleInformationQuery,waitingtrucksQuery,vehicleInformationUpdate} from "@/axios/api.js"
import startOrderReceiving from './components/startOrderReceiving/index.vue' //接受派单
import voiceApplication from './components/voiceApplication/index.vue' //语音申请
import failureDeclaration from './components/failureDeclaration/index.vue' //故障申报
......@@ -92,19 +104,27 @@ export default {
orderReceiving:'开始接单',
carName:'4001',
personalName:'李三',
timer:null,
zongTimer1:null,
zongTimer2:null,
currentTime:'',
selectFunction:0,
carnumber:'鲁k123456',
userName1:'',
carclass:'',
daizhangCar:[],
}
},
mounted(){
this.loadData();
this.setNowTimes();
this.timer = setInterval(() => {
this.zongTimer1 = setInterval(() => {
this.setNowTimes();
}, 1000)
this.zongTimer2 = setInterval(() => {
if(this.carclass == '电铲'){
this.loadData1();
}
}, 20000)
},
methods:{
loadData(){
......@@ -117,9 +137,32 @@ export default {
this.carnumber = res.data.content[0].car;
this.personalName = res.data.content[0].name;
this.$refs.startOrderReceivingMethod.loadData(this.carnumber);
httpGet(vehicleInformationQuery,{number:this.carnumber}).then((res) => {
if(res.code == 200){
if(res.data.totalElements == 0){
return
}else{
this.carclass = res.data.content[0].carclass;
if(this.carclass == '电铲'){
this.loadData1();
}else{
return;
}
}
}
});
}
});
},
//获取待装卡车列表
loadData1(){
httpGet(waitingtrucksQuery,{carno:this.carnumber}).then((res) => {
if(res.code == 200){
this.daizhangCar = res.data;
}
});
},
//获取当前时间
setNowTimes () {
let myDate = new Date();
......@@ -280,6 +323,10 @@ export default {
this.$refs.smallWindowMethod.carInCloseFn();
}
},
//完成装车
wanchengzhuangcheFn(number){
//putForJson(vehicleInformationUpdate,{number:number,workStatus:1}).then((res) => {});
},
//地图构造完成回调
onMapload(map) {
// 以下为演示代码
......@@ -318,8 +365,11 @@ export default {
},
},
beforeDestroy(){
if(this.timer) {
clearInterval(this.timer);
if(this.zongTimer1) {
clearInterval(this.zongTimer1);
}
if(this.zongTimer2) {
clearInterval(this.zongTimer2);
}
}
}
......@@ -549,4 +599,65 @@ export default {
left: 50%;
transform: translate(-50%,-50%);
}
.waitingtrucksView{
position: absolute;
right: 0px;
top: 8vh;
width: 25vw;
height: 80vh;
background:no-repeat center center url('~@/assets/images/truckTuPian/juxingkaobei6_1.png');
background-size:100% 100%;
z-index: 1;
padding: 10px 10px 0px;
box-sizing: border-box;
}
.waitingtrucksView_title{
font-size: 26px;
font-weight: 600;
text-align: center;
width: 100%;
background-image:-webkit-linear-gradient(bottom, #59C8FF, #FAFEFF);
-webkit-background-clip:text;
-webkit-text-fill-color:transparent;
}
.waitingtrucksView_content{
margin-top: 10px;
height: 70vh;
width: 100%;
overflow-y:auto;
}
.waitingtrucksView_content::-webkit-scrollbar {
/*滚动条整体样式*/
width : 8px; /*高宽分别对应横竖滚动条的尺寸*/
height: 1px;
}
.waitingtrucksView_content::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius : 10px;
background-color: #274088;
background-image: -webkit-linear-gradient(
45deg,
rgba(255, 255, 255, 0.2) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, 0.2) 50%,
rgba(255, 255, 255, 0.2) 75%,
transparent 75%,
transparent
);
}
.waitingtrucksView_content::-webkit-scrollbar-track {
/*滚动条里面轨道*/
box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2);
background : #ededed;
border-radius: 10px;
}
.waitingtrucksView_content>div{
color: rgb(254,210,5);
font-size: 20px;
margin-bottom: 15px;
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
\ No newline at end of file
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