<template style = "width: 100%;height:100%">
|
|
<!-- <el-button style="width:200px;height:100px;margin-top:100px;margin-left:100px" type="success" size="big" @click="generalFun">通信按钮</el-button> -->
|
<div>
|
<el-button class="btnStyle" type="success" size="big" @click="checkToNormalModel">切换到正常模式</el-button>
|
<el-button class="btnStyle" type="danger" size="big" @click="checkToEmergeModel">切换到应急模式</el-button>
|
<el-button class="btnStyle" type="success" size="big" @click="checkToEmptyIn">切换到空托入库</el-button>
|
<el-button class="btnStyle" type="danger" size="big" @click="checkToBoxIn">切换到轴承入库</el-button>
|
</div>
|
|
<div>
|
<div class="fontStyle">入库线体控制模式:{{inboundRunModelVal}}</div>
|
</div>
|
|
<div>
|
<div class="fontStyle">入库线体当前模式:正常模式值:{{normalModelVal}},应急模式值:{{emergeModelVal}}</div>
|
</div>
|
|
<div>
|
<div class="fontStyle">当前执行的模式为:{{inboundModel}}</div>
|
</div>
|
|
<div>
|
<div class="fontStyle">三台穿梭车的状态:{{carStatusValue}}</div>
|
</div>
|
|
<div>
|
<div class="fontStyle">测量设备状态:{{measureStatusValue}}</div>
|
</div>
|
|
<el-row type="flex" justify="left" align="middle" style="background-color:#ffffff">
|
<div class="fontStyle">当前称重工位重量:{{currentWeight}}</div>
|
<el-button style="width:150px;height:45px;margin-left:20px;margin-top:30px;" type="success" size="big" @click="weightCheckByManualOk">继续任务</el-button>
|
</el-row>
|
|
<el-row type="flex" justify="left" align="middle" style="background-color:#ffffff">
|
<div class="fontStyle">入库检验托盘码结果:系统条码值:{{systemBarcode_30301}},PLC条码值:{{plcBarcode_30301}}</div>
|
<el-button style="width:150px;height:45px;margin-left:20px;margin-top:30px;" type="success" size="big" @click="checkByManualOk">继续任务</el-button>
|
</el-row>
|
|
|
<div>
|
<div class="fontStyle" style="color: red;">测量不合格数量:{{goodscount}}</div>
|
</div>
|
<div>
|
<div class="fontStyle" style="color: red;">称重不合格数量:{{standarcount}}</div>
|
</div>
|
<div>
|
<div class="fontStyle" style="color: red;">超期数量:{{dateDiffResultcount}}</div>
|
</div>
|
</template>
|
|
<script>
|
import VolForm from "@/components/basic/VolForm.vue";
|
import VolBox from "@/components/basic/VolBox.vue";
|
export default {
|
components: {VolForm,VolBox},
|
|
data() {
|
return {
|
timer:'',
|
normalModelVal:"",
|
emergeModelVal:"",
|
inboundRunModelVal:"", //手动、单机、联机
|
inboundModel:"",
|
carStatusValue:"",
|
measureStatusValue:"",
|
currentWeight:"",
|
currentWeight_RFID:"",
|
systemBarcode_30301:"",
|
plcBarcode_30301:"",
|
taskNum_30301:"",
|
station_30301:"",
|
goodscount:0,
|
standarcount:0,
|
dateDiffResultcount:0,
|
};
|
},
|
|
mounted() {
|
this.timer = setInterval(this.getInboundLineModel, 5000);
|
setTimeout(() => {
|
|
this.openWebSocket();
|
|
}, 1000)
|
this.gevvcontian();
|
},
|
|
methods:{
|
|
//开启webscoket服务,接受站台消息
|
openWebSocket () {
|
const _this = this;
|
//初始化websocket
|
// const ws = new WebSocket("ws://127.0.0.1:9111/");
|
const ws = new WebSocket("ws://192.168.1.10:9111/");
|
ws.onopen = function () {
|
console.log("websocket开启成功");
|
};
|
|
ws.onmessage = function (evt) {
|
var msgData = evt.data;
|
var jsonObj = JSON.parse(msgData);
|
|
//debugger;
|
var keys = Object.keys(jsonObj);
|
if (keys.includes('checkBarcode')) {
|
_this.systemBarcode_30301 = jsonObj.systemRFID;
|
_this.plcBarcode_30301 = jsonObj.lineRFID;
|
_this.taskNum_30301 = jsonObj.taskNumber;
|
_this.station_30301 = jsonObj.station;
|
}
|
if(keys.includes('currentWeight')){
|
_this.currentWeight = jsonObj.currentWeight;
|
_this.currentWeight_RFID = jsonObj.currentWeight_RFID;
|
}
|
if(keys.includes('measure')){
|
_this.measureStatusValue = jsonObj.measureStatusValue;
|
}
|
};
|
|
ws.onclose = function () {
|
// 关闭 websocket
|
};
|
},
|
|
generalFun(){
|
|
var para = {};
|
|
this.http.post("/api/Dt_locationinfo/InsertLocationInfo",para,"请求发送中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("成功");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
},
|
|
//获取超期数据
|
gevvcontian(){
|
this.http.post("/api/VV_ContainerInfo/Getgqrkts", null, false).then(x => {
|
this.goodscount=x.data.goodscount;
|
this.standarcount=x.data.standarcount;
|
this.dateDiffResultcount=x.data.dateDiffResultcount;
|
});
|
},
|
|
//获取当前入库线体模式
|
getInboundLineModel(){
|
|
var para = {};
|
|
this.http.post("/api/ToWCS/GetInboundLineCurrentModel",para,null).then(x=>{
|
if(x.status===true){
|
|
this.normalModelVal = x.data["normal"];
|
this.emergeModelVal = x.data["emerge"];
|
this.inboundRunModelVal = x.data["controlModel"];
|
this.carStatusValue = x.data["carStatus"];
|
this.measureStatusValue = x.data["measureStatus"];
|
|
} else {
|
//this.$Message.error(x.message);
|
}
|
})
|
|
this.http.post("/api/Dt_general_info/GetInboundModel",null,null).then(x=>{
|
if(x.status===true){
|
|
this.inboundModel = x.data;
|
|
} else {
|
//this.$Message.error(x.message);
|
}
|
})
|
},
|
|
|
//切换到正常模式
|
checkToNormalModel(){
|
this.$confirm("确定要切换到正常模式吗", "请注意!", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
center: true,
|
}).then(() => {
|
var para = {
|
MainData:
|
{
|
model:"normal",
|
},
|
};
|
|
this.http.post("/api/ToWCS/ChangeInboundLineModel",para,"模式切换中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("已切换到正常模式");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
});
|
|
},
|
|
//切换到应急模式
|
checkToEmergeModel(){
|
this.$confirm("确定要切换到应急模式吗", "请注意!", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
center: true,
|
}).then(() => {
|
var para = {
|
MainData:
|
{
|
model:"emerge",
|
},
|
};
|
|
this.http.post("/api/ToWCS/ChangeInboundLineModel",para,"模式切换中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("已切换到应急模式");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
});
|
|
},
|
|
//切换到空托入库
|
checkToEmptyIn(){
|
this.$confirm("确定要切换到空托入库吗", "请注意!", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
center: true,
|
}).then(() => {
|
var para = {
|
MainData:
|
{
|
model:"empty",
|
},
|
};
|
|
this.http.post("/api/Dt_general_info/ChangeInboundModel",para,"切换中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("已切换到空托入库");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
});
|
|
},
|
|
|
//切换到轴承入库
|
checkToBoxIn(){
|
this.$confirm("确定要切换到轴承入库吗", "请注意!", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
center: true,
|
}).then(() => {
|
var para = {
|
MainData:
|
{
|
model:"box",
|
},
|
};
|
|
this.http.post("/api/Dt_general_info/ChangeInboundModel",para,"切换中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("已切换到轴承入库");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
});
|
|
},
|
|
//上报托盘码不一致后,由人工核验后继续继续任务
|
checkByManualOk(){
|
|
this.$confirm("系统记录托盘码和线体读取到的不一致,确定要继续任务吗", "请注意!", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
center: true,
|
}).then(() => {
|
var para = {
|
MainData:
|
{
|
systemRFID:this.systemBarcode_30301,
|
lineRFID:this.plcBarcode_30301,
|
taskNumber:this.taskNum_30301,
|
station:this.station_30301,
|
},
|
};
|
|
this.http.post("/api/ToWCS/CheckBarcodeSameOk",para,"指令下发中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("下发成功");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
});
|
},
|
|
|
//得到称重值后,手动继续任务
|
weightCheckByManualOk(){
|
|
this.$confirm("确认重量值在合理范围之内吗", "请注意!", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
center: true,
|
}).then(() => {
|
var para = {
|
MainData:
|
{
|
barcode:this.currentWeight_RFID,
|
},
|
};
|
|
this.http.post("/api/ToWCS/WeightCheckOk",para,"指令下发中...").then(x=>{
|
if(x.status===true){
|
this.$Message.success("下发成功");
|
} else {
|
this.$Message.error(x.message);
|
}
|
})
|
});
|
},
|
|
},
|
|
beforeUnmount(){
|
},
|
|
};
|
|
|
</script>
|
|
|
|
<style>
|
|
.btnStyle{
|
width:150px;
|
height:45px;
|
margin-top:50px;
|
margin-left:50px
|
}
|
|
.fontStyle{
|
margin-left:50px;
|
margin-top:30px;
|
font-size:20px;
|
color: rgb(56, 55, 55);
|
}
|
|
|
.forside{
|
display: flex;
|
justify-content: space-between;
|
}
|
|
|
</style>
|