<template>
|
<view>
|
<scroll-view scroll-y>
|
<!-- 托盘码窗口 -->
|
<view class="square-2">
|
<view class="square-title">
|
<view class="title-sign"><view class="sign"></view></view>
|
<view class="title-text"><text>托盘条码</text></view>
|
</view>
|
<view class="square-content">
|
<view class="content-input">
|
<input v-model="barcode" type="text" placeholder="扫码 / 输入"
|
:focus="barcodeFocus" placeholder-style="line-height: 85rpx;">
|
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
|
</view>
|
</view>
|
</view>
|
</scroll-view>
|
<!-- 底部按钮 -->
|
<view class="footer flex justify-around">
|
<label class="label-btn" style="width: 150rpx;">
|
<button class="cu-btn" @click="resst()">重置</button>
|
</label>
|
<label class="label-btn">
|
<button class="cu-btn bg-blue " @click="startPaking()">入库</button>
|
</label>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
commonUrl: null,
|
barcode: null,
|
barcodeFocus: true,
|
matList:[],
|
sites: [2,4,5,7,9,11,13,15],
|
siteId: '',
|
}
|
},
|
mounted(){
|
const UIP = uni.getStorageSync('UIP');
|
this.baseIP = UIP;
|
const UPORT = uni.getStorageSync('UPORT');
|
this.basePORT = UPORT
|
const PROJ = uni.getStorageSync('UPROJ');
|
this.baseUrl = PROJ
|
this.getUrl()
|
},
|
methods: {
|
// 获取url
|
getUrl() {
|
this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
|
},
|
startPaking() {
|
uni.showLoading({})
|
let that = this
|
uni.request({
|
url: that.commonUrl + "/open/asrs/wrk/pickback",
|
data: {barcode:that.barcode},
|
method: 'GET',
|
header: {
|
'token':uni.getStorageSync('token')
|
},
|
success(result) {
|
console.log(result);
|
var res = result.data
|
if (res.code === 200) {
|
uni.showToast({title: res.msg, icon: "none", position: 'top'})
|
uni.hideLoading()
|
} else if (res.code == 403) {
|
uni.showToast({title: res.msg, icon: "none", position: 'top'})
|
setTimeout(() => {
|
uni.reLaunch({
|
url: '../login/login'
|
});
|
}, 1000);
|
} else {
|
uni.showToast({title: res.msg, icon: "none",position: 'top'})
|
}
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style>
|
</style>
|