<template>
|
<view class="container">
|
<uni-icons type="bars" size="30" color="#b1b3b8" class="select" @click="jump()"></uni-icons>
|
<!-- 左 -->
|
<view class="zcard">
|
<view class="zcard-flex">
|
<view class="button-nk" v-for="item in groundSiteList" @click="click(item,'left')">{{item.name}}</view>
|
</view>
|
</view>
|
<!-- 右 -->
|
<view class="zcard">
|
<view class="zcard-flex">
|
<view class="button-nk" style="background-color: brown;" v-for="item in traySiteList" @click="click(item,'right')">{{item.name}}</view>
|
</view>
|
</view>
|
|
|
<view>
|
<uni-popup ref="revise" type="dialog">
|
<view class="popup">
|
<view class="popup3-input-title">{{text}}</view>
|
<view class="button-nk" @click="upTray()">{{btnTitle1}}</view>
|
<view class="button-nk" @click="downTray()">{{btnTitle2}}</view>
|
<view v-show="outType" class="button-nk" @click="downTray1()">{{btnTitle3}}</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<view>
|
<uni-popup ref="numberPopup" type="dialog">
|
<view class="popup2">
|
<view class="popup3-input-title">{{tipsTitle}}</view>
|
<view class="button-nk" @click="goUp(2)">2个</view>
|
<view class="button-nk" @click="goUp(4)">4个</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
<view>
|
<uni-popup ref="inputPopup" type="dialog">
|
<view class="popup3">
|
<view class="popup3-input-title">{{tipsTitle}}</view>
|
<view class="popup3-input-box2" :class="item.chose"
|
v-if="!meterShow" v-for="item in emptyMatList" @click="chose(item.matnr)">
|
<view>
|
{{item.maktx}}
|
</view>
|
</view>
|
<view class="popup3-input-box" v-if="meterShow">
|
<text>{{desc}}:</text>
|
<view style="margin-left: 3rpx;">
|
<input type="text" v-model="code"/>
|
</view>
|
</view>
|
<view class="popup3-input-box" v-if="meterShow">
|
<text>米数:</text>
|
<view style="margin-left: 3rpx;">
|
<input type="text" v-model="meter"/>
|
</view>
|
</view>
|
<view class="button-nk" @click="confirm(2)">确定</view>
|
</view>
|
</uni-popup>
|
</view>
|
|
</view>
|
</template>
|
|
<script>
|
import code from '../../../uni_modules/uview-ui/libs/config/props/code';
|
export default {
|
data() {
|
return {
|
baseUrl: '',
|
token: '',
|
groundSiteList: [
|
{name: '1号地面站',code:'1-C1',traget: '1-A1',type: 'foolr'},
|
{name: '2号地面站',code:'2-C1',traget: '2-A1',type: 'foolr'},
|
{name: '3号地面站',code:'3-C1',traget: '3-A1',type: 'foolr'},
|
{name: '4号地面站',code:'4-C1',traget: '4-A1',type: 'foolr'},
|
{name: '5号地面站',code:'5-C1',traget: '5-A1',type: 'foolr'},
|
{name: '6号地面站',code:'6-C1',traget: '6-A1',type: 'foolr'},
|
{name: '7号地面站',code:'7-C1',traget: '7-A1',type: 'foolr'},
|
{name: '8号地面站',code:'8-C1',traget: '8-A1',type: 'foolr'},
|
{name: '9号地面站',code:'9-C1',traget: '9-A1',type: 'foolr'},
|
{name: '10号地面站',code:'10-C1',traget: '10-A1',type: 'foolr'}
|
],
|
traySiteList: [
|
{name: '1号托盘站',code:'KW-1',type: 'tray'},
|
{name: '2号托盘站',code:'KW-2',type: 'tray'},
|
{name: '3号托盘站',code:'KW-3',type: 'tray'},
|
{name: '4号托盘站',code:'KW-4',type: 'tray'},
|
{name: '5号托盘站',code:'KW-5',type: 'tray'},
|
{name: '6号托盘站',code:'KW-6',type: 'tray'},
|
{name: '7号托盘站',code:'KW-7',type: 'tray'},
|
{name: '8号托盘站',code:'KW-8',type: 'tray'},
|
{name: '9号托盘站',code:'KW-9',type: 'tray'},
|
{name: '10号托盘站',code:'KW-10',type: 'tray'}
|
],
|
emptyMatList: [],
|
item: '',
|
text: '',
|
btnTitle1: '',
|
btnTitle2: '',
|
btnTitle3: '',
|
outType: '',
|
stationType: 'load',
|
type: '' ,
|
originLocal: '',
|
targetLocal: '',
|
code: '',
|
meter: '',
|
meterShow: '',
|
desc: '',
|
tipsTitle: '',
|
}
|
},
|
onShow() {
|
let network = uni.getStorageSync('Network')
|
this.baseUrl = `http://${network[0].ip}:${network[0].port}/${network[0].address}`
|
this.token = uni.getStorageSync('token');
|
},
|
methods: {
|
jump() {
|
uni.redirectTo({
|
url: '/pages/project/jmAGV/floorOne'
|
})
|
},
|
click(item,type) {
|
this.item = item
|
this.text = item.name
|
if (type == 'left') {
|
this.outType = false
|
this.btnTitle1 = '地面站放置托盘(上架)'
|
this.btnTitle2 = '托盘站取置地面(下架)'
|
} else {
|
this.outType = true
|
this.btnTitle1 = '托盘-仓库(入库)'
|
this.btnTitle2 = '仓库-空托盘(出库)'
|
this.btnTitle3 = '仓库-满托盘(出库)'
|
}
|
this.$refs.revise.open(type)
|
},
|
chose(matnr) {
|
for (let k of this.emptyMatList) {
|
if (k.matnr == matnr) {
|
k.chose = 'chosed'
|
} else {
|
k.chose = ''
|
}
|
this.$forceUpdate() // 强制刷新
|
}
|
this.code = matnr
|
},
|
// 地面站上架 / 托盘站入库按钮
|
upTray() {
|
if (this.item.type == 'foolr') {
|
this.type = 'load', // 上架
|
this.originLocal = this.item.code,
|
this.targetLocal = this.item.traget
|
this.tipsTitle = '上架数量'
|
this.numberPopup()
|
} else {
|
this.type = 'in' // 入库
|
this.originLocal = this.item.code,
|
this.targetLocal = 'KW-J'
|
this.pakin()
|
}
|
},
|
downTray() {
|
if (this.item.type == 'foolr') {
|
this.type = 'unload', // 下架
|
this.originLocal = this.item.traget,
|
this.targetLocal = this.item.code
|
this.tipsTitle = '下架数量'
|
this.numberPopup()
|
} else {
|
this.type = 'out1' // 出库
|
this.originLocal = 'KW-C'
|
this.targetLocal = this.item.code
|
this.inputPopup()
|
}
|
},
|
downTray1() {
|
if (this.item.type == 'foolr') {
|
this.type = 'unload', // 下架
|
this.originLocal = this.item.traget,
|
this.targetLocal = this.item.code
|
} else {
|
this.type = 'out2' // 出库
|
this.originLocal = 'KW-C'
|
this.targetLocal = this.item.code
|
this.inputPopup()
|
}
|
},
|
numberPopup() {
|
this.$refs.numberPopup.open('center')
|
},
|
inputPopup() {
|
if (this.type == 'out1') {
|
this.tipsTitle = '空托盘出库'
|
this.desc = '物料码'
|
this.meterShow = false
|
let that = this
|
uni.request({
|
url: `${that.baseUrl}/agv/getEmptyMat`,
|
header: { 'token': uni.getStorageSync('token') },
|
method: 'GET',
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
res.data['chose'] = ''
|
that.emptyMatList = res.data
|
|
}
|
}
|
})
|
} else {
|
this.tipsTitle = '满托盘出库'
|
this.desc = '订单号'
|
this.meterShow = true
|
this.$refs.inputPopup.open('center')
|
}
|
this.$refs.inputPopup.open('center')
|
},
|
// 上 / 下 架数量
|
goUp(num) {
|
let data = {}
|
data = {
|
originLocal: this.originLocal,
|
targetLocal: this.targetLocal,
|
type: this.type,
|
anfme: num,
|
}
|
this.webServer(data)
|
setTimeout(()=>{
|
this.$refs.numberPopup.close()
|
},300)
|
},
|
pakin() {
|
let data = {}
|
data = {
|
originLocal: this.originLocal,
|
targetLocal: this.targetLocal,
|
type: this.type,
|
}
|
this.webServer(data)
|
setTimeout(()=>{
|
this.$refs.numberPopup.close()
|
},300)
|
},
|
confirm() {
|
let data = {}
|
if (this.type == 'out1') {
|
data = {
|
originLocal: this.originLocal,
|
targetLocal: this.targetLocal,
|
type: this.type,
|
matnr: this.code,
|
anfme: 4
|
}
|
} else {
|
data = {
|
originLocal: this.originLocal,
|
targetLocal: this.targetLocal,
|
type: this.type,
|
orderNo: this.code,
|
meter: this.meter
|
}
|
}
|
this.webServer(data)
|
setTimeout(()=>{
|
this.$refs.inputPopup.close()
|
this.code = ''
|
this.meter = ''
|
},300)
|
},
|
// 所有服务
|
webServer(data) {
|
let _this = this
|
uni.request({
|
url: `${_this.baseUrl}/agv/requestTask`,
|
data: data,
|
header: { 'token': uni.getStorageSync('token') },
|
method: 'POST',
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
this.$refs.revise.close()
|
uni.showToast({ title: '操作成功', icon: "none", position: 'top' })
|
} else {
|
uni.showToast({ title: res.msg, icon: "none", position: 'top' })
|
}
|
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.container {
|
height: 100%;
|
/* background-color: aqua; */
|
display: grid;
|
grid-template-columns: 50% 50%;
|
width: 100%;
|
|
}
|
.btn-box {
|
/* margin: 1%; */
|
background-color: azure;
|
}
|
/* .zcard {
|
margin: 10px 100px;
|
background-color: #409EFF;
|
} */
|
.zcard-flex {
|
/* background-color: coral; */
|
margin-top: 20rpx;
|
width: 100%;
|
height: 100%;
|
display: flex;
|
flex-wrap: wrap;
|
/* flex-direction: column; */
|
justify-content: space-around;
|
align-items: center;
|
}
|
.button-nk {
|
margin: 10rpx 0rpx;
|
/* padding: 20rpx 70rpx; */
|
/* background-color: azure; */
|
min-width: 100rpx;
|
/* margin: 0 auto; */
|
height: 50rpx;
|
text-align: center;
|
line-height: 50rpx;
|
font-size: 20rpx;
|
background-color: #409EFF;
|
color: #ECF0F1;
|
border-radius: 7px;
|
box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .3),
|
inset -4px -4px 4px rgba(255, 255, 255, .4),
|
-4px -4px 5px rgba(0, 0, 0, .4);
|
}
|
.button-nk:active {
|
transform: translateY(2px) scale(0.99, 0.99);
|
box-shadow: inset 4px 4px 4px rgba(0, 0, 0, .3),
|
inset -4px -4px 8px rgba(255, 255, 255, .7),
|
-5px -5px 5px rgba(0, 0, 0, .3);
|
}
|
.popup {
|
background-color: #eee;
|
width: 30vw;
|
height: 100%;
|
padding: 0 10vw;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-around;
|
}
|
.popup2 {
|
background-color: #eee;
|
width: 30vw;
|
height: 100%;
|
padding: 0 10vw;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-around;
|
border-radius: 10rpx;
|
}
|
.popup3 {
|
background-color: #eee;
|
max-height: 80vw;
|
width: 50vw;
|
padding: 0 10vw;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-around;
|
border-radius: 10rpx;
|
color: #565656;
|
}
|
.popup3-input-title {
|
text-align: center;
|
margin: 10rpx;
|
font-size: 18px;
|
font-weight: bold;
|
}
|
.popup3-input-box {
|
display: flex;
|
border: 1px solid #cecece;
|
border-radius: 5rpx;
|
padding: 2rpx 10rpx;
|
margin: 20rpx;
|
}
|
.popup3-input-box2 {
|
display: flex;
|
border: 1px solid #cecece;
|
border-radius: 5rpx;
|
padding: 2rpx 10rpx;
|
margin: 10rpx;
|
background-color: #FFF;
|
}
|
.chosed {
|
background-color: #67C23A;
|
color: #e8e8e8;
|
}
|
.select {
|
position: absolute;
|
bottom: 12px;
|
right: 16px;
|
border-radius: 10px;
|
padding: 4px 10px;
|
box-shadow: inset 2px 2px 2px rgba(0, 0, 0, .3),
|
inset -2px -2px 2px rgba(255, 255, 255, .7),
|
-2px -2px 2px rgba(0, 0, 0, .4);
|
}
|
</style>
|