219 lines
4.6 KiB
Vue
219 lines
4.6 KiB
Vue
|
|
<template>
|
|||
|
|
<view>
|
|||
|
|
<view :key="1">
|
|||
|
|
<view class="tip-box">
|
|||
|
|
<u-row :gutter="20">
|
|||
|
|
<u-col span="1">
|
|||
|
|
<u-text text="起点" size="32"></u-text>
|
|||
|
|
</u-col>
|
|||
|
|
<u-col span="3">
|
|||
|
|
<uni-data-select v-model="start_point" :localdata="startOptions" placeholder="请选择起点"></uni-data-select>
|
|||
|
|
</u-col>
|
|||
|
|
<u-col span="1">
|
|||
|
|
<u-text text="终点" size="32"></u-text>
|
|||
|
|
</u-col>
|
|||
|
|
<u-col span="3">
|
|||
|
|
<uni-data-select v-model="end_point" :localdata="endOptions" placeholder="请选择终点"></uni-data-select>
|
|||
|
|
</u-col>
|
|||
|
|
<u-col span="1" offset="0.5">agv</u-col>
|
|||
|
|
<u-col span="3">
|
|||
|
|
<uni-data-select v-model="agv_num" :localdata="agv_num_list"></uni-data-select>
|
|||
|
|
</u-col>
|
|||
|
|
</u-row>
|
|||
|
|
<u-gap height="20"></u-gap>
|
|||
|
|
<u-row>
|
|||
|
|
<u-col span="6" align="center">
|
|||
|
|
<view class="tip-icon" @click="start_agv"><span>启动</span></view>
|
|||
|
|
</u-col>
|
|||
|
|
<u-col span="6" align="center">
|
|||
|
|
<view class="tip-icon2" @click="stop_agv"><span style="font-size: 0.5rem">紧急终止</span></view>
|
|||
|
|
</u-col>
|
|||
|
|
</u-row>
|
|||
|
|
</view>
|
|||
|
|
</view>
|
|||
|
|
<u-toast ref="uToast"></u-toast>
|
|||
|
|
</view>
|
|||
|
|
</template>
|
|||
|
|
|
|||
|
|
<script>
|
|||
|
|
import { go_workshop, emergency_stop_agv, getAllOptions } from '@/api/materialManagement/MaterialRequsition.js';
|
|||
|
|
import { debounce } from '@/utils/common.js';
|
|||
|
|
export default {
|
|||
|
|
data() {
|
|||
|
|
return {
|
|||
|
|
loading: false,
|
|||
|
|
start_point: '',
|
|||
|
|
startOptions: [],
|
|||
|
|
end_point: '',
|
|||
|
|
endOptions: [],
|
|||
|
|
reqCode: '',
|
|||
|
|
agv_num_list: [
|
|||
|
|
{ value: '1743', text: '1号' },
|
|||
|
|
{ value: '1744', text: '2号' }
|
|||
|
|
],
|
|||
|
|
agv_num: ''
|
|||
|
|
};
|
|||
|
|
},
|
|||
|
|
watch: {},
|
|||
|
|
filters: {},
|
|||
|
|
mounted() {
|
|||
|
|
this.init();
|
|||
|
|
},
|
|||
|
|
methods: {
|
|||
|
|
init() {
|
|||
|
|
getAllOptions().then((res) => {
|
|||
|
|
if (res.code === 200) {
|
|||
|
|
let _list = [];
|
|||
|
|
res.data.forEach((item) => {
|
|||
|
|
_list.push({
|
|||
|
|
value: item,
|
|||
|
|
text: item
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
this.startOptions = _list;
|
|||
|
|
this.endOptions = _list;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},
|
|||
|
|
start_agv() {
|
|||
|
|
uni.$u.throttle(()=>{
|
|||
|
|
if (this.start_point == '' || this.end_point == '') {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
type: 'error',
|
|||
|
|
message: '起点或者终点不能为空'
|
|||
|
|
});
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
const query = {
|
|||
|
|
start_point: this.start_point,
|
|||
|
|
end_point: this.end_point,
|
|||
|
|
agvCode: this.agv_num
|
|||
|
|
};
|
|||
|
|
go_workshop(query).then((res) => {
|
|||
|
|
if (res.code == 200) {
|
|||
|
|
try {
|
|||
|
|
let json = JSON.parse(res.data);
|
|||
|
|
this.reqCode = json.data;
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
type: 'success',
|
|||
|
|
message: 'agv起动成功' + this.reqCode
|
|||
|
|
});
|
|||
|
|
} catch (e) {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
type: 'error',
|
|||
|
|
message: 'agv起动失败:' + this.reqCode
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}, 5000)
|
|||
|
|
},
|
|||
|
|
stop_agv() {
|
|||
|
|
uni.$u.throttle(()=>{
|
|||
|
|
if (this.reqCode == '') {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
type: 'error',
|
|||
|
|
message: '无任务编号'
|
|||
|
|
});
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
const query = {
|
|||
|
|
reqCode: this.reqCode
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
emergency_stop_agv(query).then((res) => {
|
|||
|
|
if (res.code == 200) {
|
|||
|
|
this.$refs.uToast.show({
|
|||
|
|
type: 'success',
|
|||
|
|
message: '成功取消' + res.data
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
},5000)
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
</script>
|
|||
|
|
|
|||
|
|
<style scoped>
|
|||
|
|
.area {
|
|||
|
|
height: 350px;
|
|||
|
|
background-color: white;
|
|||
|
|
|
|||
|
|
overflow: hidden;
|
|||
|
|
/* 隐藏超出部分 */
|
|||
|
|
overflow-y: scroll;
|
|||
|
|
/* 添加垂直滚动条 */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.cartoon-list-item {
|
|||
|
|
background-color: #c8d3db;
|
|||
|
|
/* 设置蓝色背景 */
|
|||
|
|
padding: 10px;
|
|||
|
|
/* 设置内边距 */
|
|||
|
|
border-radius: 10px;
|
|||
|
|
/* 设置圆角边框 */
|
|||
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
|||
|
|
/* 添加阴影效果 */
|
|||
|
|
margin-bottom: 10px;
|
|||
|
|
/* 设置底部外边距 */
|
|||
|
|
font-family: 'Comic Sans MS', cursive;
|
|||
|
|
/* 设置卡通化字体 */
|
|||
|
|
color: white;
|
|||
|
|
/* 设置文字颜色为白色 */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.cartoon-list-item:hover {
|
|||
|
|
transform: scale(1.05);
|
|||
|
|
/* 鼠标悬停时放大 */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tip-box {
|
|||
|
|
width: 100%;
|
|||
|
|
margin-top: 20px;
|
|||
|
|
background-color: #fff;
|
|||
|
|
/* 白色背景 */
|
|||
|
|
padding: 20px;
|
|||
|
|
border-radius: 10px;
|
|||
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|||
|
|
/* 添加阴影 */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tip-icon {
|
|||
|
|
margin-top: 5px;
|
|||
|
|
width: 50px;
|
|||
|
|
height: 50px;
|
|||
|
|
background-color: #00ff00;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: center;
|
|||
|
|
align-items: center;
|
|||
|
|
font-size: 24px;
|
|||
|
|
color: #fff;
|
|||
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|||
|
|
/* 添加阴影 */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tip-icon2 {
|
|||
|
|
margin-top: 5px;
|
|||
|
|
width: 50px;
|
|||
|
|
height: 50px;
|
|||
|
|
background-color: red;
|
|||
|
|
border-radius: 50%;
|
|||
|
|
display: flex;
|
|||
|
|
justify-content: center;
|
|||
|
|
align-items: center;
|
|||
|
|
font-size: 24px;
|
|||
|
|
color: #fff;
|
|||
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|||
|
|
/* 添加阴影 */
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
.tip-text {
|
|||
|
|
margin-top: 10px;
|
|||
|
|
font-size: 16px;
|
|||
|
|
color: #333;
|
|||
|
|
}
|
|||
|
|
</style>
|