<template>
|
<view>
|
<!-- 站点详情 -->
|
<view class="station" :class="station.style" >
|
<view class="mt-flex">
|
<view class="station-title" style="flex: 1;">{{station.devNo}}</view>
|
<view><button size="mini" :loading="reload.loading" @click="reloadStation()">{{reload.loadingText}}</button></view>
|
</view>
|
<view>站点类型:{{station.locType1$}}区</view>
|
<view>货架前两位:{{station.locType2$}}</view>
|
<view>站点状态:{{station.locSts$}}</view>
|
<view class="mt-flex">
|
<view class="station-barcode" style="flex: 1">货架码:<text>{{station.barcode ? station.barcode : '--'}}</text></view>
|
<view v-if="station.barcode"><button size="mini" type="warn" @click="unbind">解除绑定</button></view>
|
</view>
|
</view>
|
|
|
|
|
|
|
<!-- 底部操作按钮 -->
|
<view class="buttom">
|
<button size="mini" type="primary" @click="containerMoveOut(searchValue)">确认出库</button>
|
<button size="mini" type="primary" @click="pickIn(searchValue)">已拣料回库</button>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
station: null,
|
reload: {
|
loading: false,
|
loadingText: '更新状态'
|
}
|
}
|
},
|
onLoad() {
|
let _this = this
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
// const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
|
const eventChannel = this.getOpenerEventChannel();
|
// 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
|
eventChannel.on('item', function(data) {
|
console.log(data);
|
_this.station = data.item
|
})
|
},
|
methods: {
|
// 更新站点
|
reloadStation() {
|
let _this = this
|
_this.reload.loading = true
|
_this.reload.loadingText = '更新中...'
|
uni.request({
|
url: `${_this.baseUrl}/agv/basDevp/list/auth`,
|
header: {'token': uni.getStorageSync('token')},
|
data: {
|
curr: 1,
|
limit: 1000,
|
dev_no: _this.station.devNo
|
},
|
method: 'GET',
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
setTimeout(()=>{
|
for (let k of res.data.records) {
|
if (k.locSts != 'O') {
|
k['style'] = 'station-wrk'
|
} else {
|
k['style'] = 'station-nowrk'
|
}
|
}
|
_this.station = res.data.records[0]
|
_this.reload.loading = false
|
_this.reload.loadingText = '更新状态'
|
},500)
|
} else if (res.code == 403) {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../login/login'
|
});
|
}, 1000);
|
} else {
|
uni.showToast({ title: res.msg, icon: "error", position: 'top' })
|
}
|
}
|
})
|
},
|
// 站点解绑
|
unbind() {
|
|
}
|
}
|
}
|
</script>
|
|
<style>
|
@import url('../../../static/css/common/order.css');
|
.station-title {
|
font-size: 32px;
|
font-weight: bold;
|
padding: 24rpx 0;
|
}
|
.station {
|
font-size: 18px;
|
padding: 24rpx;
|
}
|
.station-barcode {
|
font-size: 24px;
|
font-weight: bold;
|
padding: 24rpx 0;
|
}
|
.station-wrk {
|
background-color: #ff7356;
|
color: #fff;
|
}
|
.station-nowrk {
|
background-color: #3eb689;
|
color: #fff;
|
}
|
</style>
|