<template>
|
<view>
|
<view class="view-bg">
|
<uni-section title="播种位" type="line" />
|
<uni-data-select v-model="value" :localdata="range" @change="change" style="padding: 20rpx; height: 100rpx;background-color: white;">
|
</uni-data-select>
|
</view>
|
<view class="view-bg">
|
<uni-section title="订单" type="line" />
|
<input maxlength="10" placeholder="PDA扫描站点标签" v-model="orderNo"/>
|
</view>
|
<view class="view-bg">
|
<uni-section title="容器" type="line" />
|
<input maxlength="10" placeholder="PDA扫描托盘/料箱标签" v-model="barcode"/>
|
</view>
|
|
<view class="button-sp-buttom">
|
<button class="btn-span" type="primary" @click="bindOrder">绑定</button>
|
<button class="btn-span" type="default">解绑</button>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
value: 0,
|
range: [],
|
orderNo: '',
|
barcode: ''
|
}
|
},
|
|
onLoad () {
|
this.baseUrl = uni.getStorageSync('baseUrl');
|
this.token = uni.getStorageSync('token');
|
this.getSeedLocs()
|
},
|
|
methods: {
|
getSeedLocs() {
|
let that = this
|
uni.request({
|
url: this.baseUrl + '/pda/pick/seed/locs',
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(res) {
|
let result = res.data;
|
if (result.code === 200) {
|
if (result.data != undefined && result.data.length > 0) {
|
let array = result.data
|
console.log(array)
|
that.range = array.map((item, index) => {
|
return {text: item.siteNo, value: item.id}
|
})
|
console.log(that.range)
|
}
|
}
|
}
|
})
|
},
|
|
change(e) {
|
console.log("e:", e);
|
},
|
//绑定订单至播种墙
|
bindOrder() {
|
let that = this
|
uni.request({
|
url: that.baseUrl + "/pda/pick/seed/bind",
|
data: {barcode: that.barcode, orderNo: that.orderNo, siteNo: '', type: 'bind'},
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(res) {
|
let result = res.data;
|
if (result.code === 200) {
|
|
}
|
}
|
})
|
},
|
//解绑
|
unbindOrder() {
|
let that = this
|
uni.request({
|
url: that.baseUrl + "/pda/pick/seed/bind",
|
data: {barcode: that.barcode, orderNo: that.orderNo, siteNo: '', type: 'unbind'},
|
header: {
|
'token': uni.getStorageSync('token')
|
},
|
success(res) {
|
let result = res.data;
|
if (result.code === 200) {
|
|
}
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
@import url('../../static/css/wms.css/wms.css');
|
|
.view-bg {
|
background-color: white;
|
|
input {
|
padding: 30rpx;;
|
}
|
|
.uni-section__content-title {
|
font-size: 16px;
|
}
|
|
.uni-section__head {
|
.line {
|
background-color: #007aff;
|
}
|
}
|
}
|
|
.button-sp-buttom {
|
margin-top: 90rpx;
|
padding: 40rpx;
|
|
.btn-span {
|
margin: 30rpx 20rpx;
|
}
|
}
|
</style>
|