Commit 559a8f2d authored by zhanglw's avatar zhanglw

订单操作

parent 0eb52769
......@@ -60,5 +60,8 @@ export const changeJinJiReadStatus = '/api/Notice/changeJinJiReadStatus'; //终
export const crossingFence = '/api/crossingFence'; //终端围栏出入消息回传
export const tRealTimeOrder = '/api/tRealTimeOrder'; //获取当前车辆的订单
export const arriveCaiDian = '/api/tRealTimeOrder/arriveCaiDian'; //判断车辆到达采点后,提供订单id,使进入待装车状态
export const getAllLoadableKC = '/api/tRealTimeOrder/getAllLoadableKC'; //铲车查询附近五十米内是否有状态为2(到达采点,等待装车)的卡车
export const chooseKCZC = '/api/tRealTimeOrder/chooseKCZC'; //铲车给指定卡车进行装车
export const getAllLoadableKC = '/api/tRealTimeOrder/getAllLoadableKC'; //铲车界面展示可装车的卡车
export const chooseKCZC = '/api/tRealTimeOrder/chooseKCZC'; //铲车界面点击给卡车装车
export const completeZC = '/api/tRealTimeOrder/completeZC'; //卡车界面点击完成装车
export const crossDB = '/api/tRealTimeOrder/crossDB'; //卡车界面点击到达卸点
export const completeXC = '/api/tRealTimeOrder/completeXC'; //卡车界面点击完成装车
......@@ -56,8 +56,8 @@ export default {
data() {
return {
loginForm: {
username: "testkc",
password: "123456",
username: "",
password: "",
uuid: "",
},
loading: false,
......@@ -65,8 +65,7 @@ export default {
keyboardShowType: "",
//设备OAID testkc test999
//testcc deviceOAID: "test888",
deviceOAID: "test999",
// deviceOAID: "140945db5f9b8e04",
deviceOAID: "",
//判断设备是否与车绑定
bindingStatus: false,
//绑定的车牌号
......@@ -80,17 +79,18 @@ export default {
this.getCookie();
},
mounted() {
console.log(window, 1111111);
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//app获取设备号方法
// this.appGetDeviceId();
this.appGetDeviceId();
//5+app获取OAID方法
if (window.plus) {
this.plusReady();
} else {
document.addEventListener("plusready", this.plusReady, false);
}
// if (window.plus) {
// this.plusReady();
// } else {
// document.addEventListener("plusready", this.plusReady, false);
// }
},
components: {
// Keyboard
......@@ -98,41 +98,45 @@ export default {
methods: {
//app获取设备号方法
appGetDeviceId() {
// let that = this;
let that = this;
let appDeviceId1 = window.Device.getDeviceId();
// let appDeviceId1 = window.Device.getDeviceId();
// // let appDeviceId1 = window.Device.getDeviceId();
// console.log("app设备号", window.Device);
// if (appDeviceId1) {
// that.deviceOAID = appDeviceId1;
// //查询设备表是否存在该设备编号
// httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
// (resSheiBei) => {
// if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
// //查询车辆表中设备是否与车辆绑定
// httpGet(vehicleInformationQuery, {
// equipmentName: that.deviceOAID,
// }).then((resCar) => {
// if (resCar.code == 200 && resCar.data.totalElements != 0) {
// that.bindingStatus = true;
// } else {
// that.bindingStatus = false;
// }
// });
// } else {
// httpPostForJson(apiEquipmentQuery, {
// name: that.deviceOAID,
// status: "正常",
// }).then((res) => {
// that.bindingStatus = false;
// });
// }
// }
// );
// }
if (appDeviceId1) {
that.deviceOAID = appDeviceId1;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
}
},
//5+app获取OAID方法
plusReady() {
// let that = this;
let that = this;
console.log("设备身份码:" + plus.device.imei);
console.log("用户识别码:" + plus.device.imsi);
console.log("设备型号信息:" + plus.device.model);
console.log("设备厂商信息:" + plus.device.vendor);
console.log("设备唯一标识号:" + plus.device.uuid);
// plus.device.getOAID({
// success: function (e) {
// console.log("oaid", e.oaid);
......@@ -170,6 +174,45 @@ export default {
// that.bindingStatus = false;
// },
// });
//无法获取oaid的设备尝试获取uuid或imei
plus.device.getInfo({
success:function(e){
console.log('getDeviceInfo success: '+JSON.stringify(e));
that.deviceOAID = e.uuid;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (
resSheiBei.code == 200 &&
resSheiBei.data.totalElements != 0
) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
},
fail:function(e){
console.log('getDeviceInfo failed: '+JSON.stringify(e));
that.bindingStatus = false;
}
});
},
getCode() {
httpGet(code).then((res) => {
......
......@@ -56,8 +56,8 @@ export default {
data() {
return {
loginForm: {
username: "",
password: "",
username: "testkc",
password: "123456",
uuid: "",
},
loading: false,
......@@ -65,7 +65,8 @@ export default {
keyboardShowType: "",
//设备OAID testkc test999
//testcc deviceOAID: "test888",
deviceOAID: "",
deviceOAID: "test999",
// deviceOAID: "140945db5f9b8e04",
//判断设备是否与车绑定
bindingStatus: false,
//绑定的车牌号
......@@ -79,18 +80,17 @@ export default {
this.getCookie();
},
mounted() {
console.log(window, 1111111);
//两种方法相互冲突,每次只需要一种,并且获取的id不一样
//app获取设备号方法
this.appGetDeviceId();
// this.appGetDeviceId();
//5+app获取OAID方法
// if (window.plus) {
// this.plusReady();
// } else {
// document.addEventListener("plusready", this.plusReady, false);
// }
if (window.plus) {
this.plusReady();
} else {
document.addEventListener("plusready", this.plusReady, false);
}
},
components: {
// Keyboard
......@@ -98,45 +98,41 @@ export default {
methods: {
//app获取设备号方法
appGetDeviceId() {
let that = this;
let appDeviceId1 = window.Device.getDeviceId();
// let that = this;
// let appDeviceId1 = window.Device.getDeviceId();
if (appDeviceId1) {
that.deviceOAID = appDeviceId1;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
}
// // let appDeviceId1 = window.Device.getDeviceId();
// console.log("app设备号", window.Device);
// if (appDeviceId1) {
// that.deviceOAID = appDeviceId1;
// //查询设备表是否存在该设备编号
// httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
// (resSheiBei) => {
// if (resSheiBei.code == 200 && resSheiBei.data.totalElements != 0) {
// //查询车辆表中设备是否与车辆绑定
// httpGet(vehicleInformationQuery, {
// equipmentName: that.deviceOAID,
// }).then((resCar) => {
// if (resCar.code == 200 && resCar.data.totalElements != 0) {
// that.bindingStatus = true;
// } else {
// that.bindingStatus = false;
// }
// });
// } else {
// httpPostForJson(apiEquipmentQuery, {
// name: that.deviceOAID,
// status: "正常",
// }).then((res) => {
// that.bindingStatus = false;
// });
// }
// }
// );
// }
},
//5+app获取OAID方法
plusReady() {
let that = this;
console.log("设备身份码:" + plus.device.imei);
console.log("用户识别码:" + plus.device.imsi);
console.log("设备型号信息:" + plus.device.model);
console.log("设备厂商信息:" + plus.device.vendor);
console.log("设备唯一标识号:" + plus.device.uuid);
// let that = this;
// plus.device.getOAID({
// success: function (e) {
// console.log("oaid", e.oaid);
......@@ -174,45 +170,6 @@ export default {
// that.bindingStatus = false;
// },
// });
//无法获取oaid的设备尝试获取uuid或imei
plus.device.getInfo({
success:function(e){
console.log('getDeviceInfo success: '+JSON.stringify(e));
that.deviceOAID = e.uuid;
//查询设备表是否存在该设备编号
httpGet(apiEquipmentQuery, { name: that.deviceOAID }).then(
(resSheiBei) => {
if (
resSheiBei.code == 200 &&
resSheiBei.data.totalElements != 0
) {
//查询车辆表中设备是否与车辆绑定
httpGet(vehicleInformationQuery, {
equipmentName: that.deviceOAID,
}).then((resCar) => {
if (resCar.code == 200 && resCar.data.totalElements != 0) {
that.bindingStatus = true;
} else {
that.bindingStatus = false;
}
});
} else {
httpPostForJson(apiEquipmentQuery, {
name: that.deviceOAID,
status: "正常",
}).then((res) => {
that.bindingStatus = false;
});
}
}
);
},
fail:function(e){
console.log('getDeviceInfo failed: '+JSON.stringify(e));
that.bindingStatus = false;
}
});
},
getCode() {
httpGet(code).then((res) => {
......
......@@ -61,7 +61,7 @@
</div>
<div class="sijikaoheTitle">
<img src="../../../../assets/images/truckTuPian/fuxiaobiaotititle.png">
<span>智能派单</span>
<span>跑单记录</span>
</div>
<!-- 卡车列表 -->
<div class="co-table" v-if="carclass != '铲车'">
......
......@@ -117,7 +117,7 @@ export default {
type: 'success',
duration: 2500
});
this.showDecide = false;
this.viewClose();
this.$parent.safetySubmitCheckFn();
}else{
this.$notify({
......
......@@ -17,10 +17,19 @@
<div class="orderText2" @click="reachCD()" v-show="orderObj.status===1 && navStu===1">
到达采点
</div>
<div class="orderText2" @click="reachCD()" v-show="orderObj.status===3">
<div class="orderText2" @click="loadTruck()" v-show="orderObj.status===3">
完成装车
</div>
<div class="orderText2" @click="navigation()" v-show="orderObj.status===4 && navStu===0">
导航前往
</div>
<div class="orderText2" @click="checkDestination()" v-show="orderObj.status===4 && navStu===1">
到达卸点
</div>
<div class="orderText2" @click="unloadTruck()" v-show="orderObj.status===5">
完成卸车
</div>
<audio id="audioMp3" controls :src="mp3Url" style="display:none;"></audio>
</div>
</template>
......@@ -33,9 +42,18 @@ import {
} from "@/common/httpBean.js";
import {
tRealTimeOrder,
arriveCaiDian
arriveCaiDian,
completeZC,
completeXC,
crossDB,
} from "@/axios/api.js";
import newOrder from "@/assets/dingdan.mp3";
import xdd from "@/assets/audio/xdd.mp3";
import ddcd from "@/assets/audio/ddcd.mp3";
import qkjwj from "@/assets/audio/qkjwj.mp3";
import qzc from "@/assets/audio/qzc.mp3";
import gdb from "@/assets/audio/gdb.mp3";
import wdd from "@/assets/audio/wdd.mp3";
import ddwc from "@/assets/audio/ddwc.mp3";
export default {
data() {
......@@ -46,7 +64,8 @@ export default {
sonTimer1: null,
navStu: 0,
orderStuText: '正在前往',
orderAudio: null
orderAudio: null,
mp3Url:'',
};
},
mounted() {
......@@ -71,25 +90,32 @@ export default {
this.navStu=0;
this.orderStuText='正在前往';
this.orderObj = res.data;
this.audioPlayByUrl(newOrder);
this.audioPlayByUrl(xdd);
} else {
if (res.data.id !== this.orderObj) {
this.orderObj = res.data;
}
if (res.data.status === 6) {
this.orderObj.status = res.data.status;
if (this.orderObj.status === 6) {
this.showDe = false;
this.$parent.kcListView = true;
return;
} else {
this.showDe = true;
}
if (res.data.status === 2) {
if (this.orderObj.status === 2) {
this.orderStuText = '等待装车';
//播放靠近挖机语音
return;
}
if (res.data.status === 3) {
this.orderStuText = '开始装车';
if (this.orderObj.status === 3) {
this.orderStuText = '正在装车';
this.audioPlayByUrl(qzc);
return;
//播放根据提示进行装车
}
if (this.orderObj.status === 4) {
this.orderStuText = '完成装车';
//播放根据提示进行装车
}
}
......@@ -99,16 +125,111 @@ export default {
}
});
},
//导航开启
//点击导航
navigation() {
// this.$parent.zhixinglujing(true, this.carnumber, this.carDestination);
this.navStu = 1;
},
//到达采点
//点击到达采点
reachCD() {
putForJson(arriveCaiDian,{orderNumber: this.orderObj.orderNumber}).then((res) => {
putForJson(arriveCaiDian,{carNumber:this.carNumber,orderNumber: this.orderObj.orderNumber}).then((res) => {
if(res.code===200){
this.navStu = 2;
if(res.data>0){
this.navStu = 0;
this.audioPlayByUrl(ddcd);
this.queryOrder();
}else{
this.$notify({
title: res.msg,
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
this.audioPlayByUrl(qkjwj);
}
} else {
this.$notify({
title: '网络异常,请稍后再试',
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
}
});
},
//点击完成装车
loadTruck() {
putForJson(completeZC,{kc:this.carNumber, orderNumber: this.orderObj.orderNumber}).then((res) => {
if(res.code===200){
this.$notify({
title: res.msg,
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
this.queryOrder();
} else {
this.$notify({
title: '网络异常,请稍后再试',
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
}
});
},
//校验目的地
checkDestination() {
if(this.$parent.currArea==this.orderObj.xcArea){
this.navStu = 0;
this.$notify({
title: '您已到达'+this.orderObj.xcArea+',请卸车',
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
this.orderObj.status=0;
this.orderStuText = '正在卸车';
putForJson(crossDB,{orderNumber: this.orderObj.orderNumber}).then((res) => {
if(res.code===200){
this.$notify({
title: res.msg,
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
this.queryOrder();
this.audioPlayByUrl(gdb);
} else {
this.$notify({
title: '网络异常,请稍后再试',
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
}
});
}else{
this.$notify({
title: '您尚未到达'+this.orderObj.xcArea,
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
this.audioPlayByUrl(wdd);
}
},
//点击完成卸车
unloadTruck() {
httpDelForJson(completeXC,{id: this.orderObj.id, orderNumber: this.orderObj.orderNumber}).then((res) => {
if(res.code===200){
this.$notify({
title: res.msg,
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
this.audioPlayByUrl(ddwc);
this.queryOrder();
} else {
this.$notify({
......@@ -122,12 +243,20 @@ export default {
},
//播放语音
audioPlayByUrl(url) {
if(!this.orderAudio){
this.orderAudio = document.createElement("audio");
}
this.orderAudio.currentTime = 0;
this.orderAudio.src = url;
this.orderAudio.play();
this.$nextTick(() => {
this.mp3Url = url;
let au = document.getElementById("audioMp3");
au.currentTime = 0;
setTimeout(()=>{
au.play();
},500);
});
// if(!this.orderAudio){
// this.orderAudio = document.createElement("audio");
// }
// this.orderAudio.currentTime = 0;
// this.orderAudio.src = url;
// this.orderAudio.play();
},
//关闭清除定时器
dingshiqiCloseFn() {
......
......@@ -98,10 +98,11 @@
<div class="waitingtrucksView_title">待装卡车列表</div>
<div class="waitingtrucksView_content">
<div v-for="(item, index) in daizhangCar" :key="index">
<div>车牌号:{{ item.number }}</div>
<button class="daizhangCarBtn1" @click="wanchengzhuangcheFn(item)">
准备装车
<div>车牌号:{{ item.kc }}</div>
<button v-show="item.status===1" class="daizhangCarBtn1" @click="wanchengzhuangcheFn(item)">
邀请装车
</button>
<span v-show="item.status===2" style="color:white;opacity:40%">正在装车...</span>
</div>
</div>
</div>
......@@ -126,7 +127,7 @@ import {
getAllLoadableKC,
vehicleInformationUpdate,
dingDanBiaoCaoZuo,
manualSchedulingQuery,
chooseKCZC,
getalarmRealQuery,
dispatchFinishQuery,
carRealTimeLocationQuery2,
......@@ -136,7 +137,7 @@ import {
faultDayAdd,
faultMonthAdd,
faultYearAdd,
creatOrder,
crossingFence,
} from "@/axios/api.js";
import axios from "axios";
import startOrderReceiving from "./components/startOrderReceiving/index.vue"; //接受派单
......@@ -163,7 +164,6 @@ import luzhangtubiao from "@/assets/images/truckTuPian/luzhang.png";
import 'maptalks/dist/maptalks.css';
import * as maptalks from 'maptalks';
import {crossingFence} from "../../axios/api";
import { config as appConfig } from '@/config.js';
export default {
......@@ -213,8 +213,6 @@ export default {
jsession: "",
//摄像头车辆设备号
devices: "",
//禁用完成装车
interdictBtn: false,
//语音组件播放
indexSrcUrl: "",
//语音数据
......@@ -757,8 +755,6 @@ export default {
httpGet(getAllLoadableKC, {carNumber: this.carnumber}).then((res) => {
if (res.code == 200 && res.data && res.data.length) {
this.daizhangCar = res.data;
console.log(this.daizhangCar)
this.interdictBtn = false;
}
});
},
......@@ -1147,69 +1143,27 @@ export default {
}
},
//完成装车
wanchengzhuangcheFn(number, id, odd) {
console.log(number, id, odd, "完成装车");
this.finishNum = number;
this.interdictBtn = true;
//改订单状态
httpGet(manualSchedulingQuery, {
sort: "createTime,desc",
size: 1,
carNo: number,
}).then((res) => {
if (res.code == 200) {
if (res.data.totalElements == 0) {
} else {
putForJson(manualSchedulingQuery, {
id: res.data.content[0].id,
status: 0,
}).then((res) => {
});
}
}
});
//查询Oredr接口,判断是智能调度还是人工调度从而进行车辆信息状态修改
httpGet(dingDanBiaoCaoZuo, {
carNo: number,
size: 1,
sort: "createTime,desc",
}).then((res) => {
if (res.code == 200) {
if (res.data.content[0].flag != 0) {
//车辆信息状态修改
httpGet(vehicleInformationQuery, {number: number}).then(
(res11) => {
if (res11.code == 200) {
putForJson(vehicleInformationUpdate, {
id: res11.data.content[0].id,
workStatus: 0,
weightStatus: 1,
oddStatus: 1,
}).then((res) => {
});
}
}
);
} else {
//车辆信息状态修改
httpGet(vehicleInformationQuery, {number: number}).then(
(res11) => {
if (res11.code == 200) {
putForJson(vehicleInformationUpdate, {
id: res11.data.content[0].id,
workStatus: 0,
weightStatus: 1,
}).then((res) => {
});
}
}
);
}
wanchengzhuangcheFn(item) {
item.status=2;
putForJson(chooseKCZC,item).then((res) => {
if(res.code===200){
this.$notify({
title: res.msg,
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
} else {
this.$notify({
title: '网络异常,请稍后再试',
type: "warning",
duration: 5000,
dangerouslyUseHTMLString: true,
});
}
});
//智能调度是否完成
this.finishDispatch(number);
},
//智能调度是否完成
finishDispatch(number1) {
let that = this;
let number = number1 || this.finishNum;
......
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