<template>
|
<view>
|
<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" @confirm="barcodeInput()" placeholder-style="line-height: 85rpx;">
|
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
|
</view>
|
</view>
|
</view>
|
|
<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="content-combox" @click="staNoSelect()">
|
<uni-combox emptyTips="暂无数据"
|
:candidates="sites" v-model="siteId" placeholder="请选择入库站点" @input="check">
|
</uni-combox>
|
</view>
|
</view>
|
<!-- 底部按钮 -->
|
<view class="footer flex justify-around">
|
<!-- 底部全选 反选按钮 -->
|
<!-- <label class="label-btn" style="width: 170rpx;">
|
<checkbox :checked="check" @click="allChecked()">{{checkText}}</checkbox>
|
</label>
|
<label class="label-btn" style="width: 100rpx;">
|
<text @click="reChecked()">反选</text>
|
</label> -->
|
|
<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="outbound()">启动入库</button>
|
</label>
|
</view>
|
</view>
|
|
</template>
|
|
|
<script>
|
import permision from "@/common/permission.js"
|
import loginVue from "../login/login.vue";
|
export default {
|
data() {
|
return {
|
commonUrl:null,
|
barcode: '',
|
barcodeFocus: true,
|
sites: ["102入库"],
|
siteId: "102入库",
|
staNo: 102
|
}
|
},
|
onShow() {
|
setTimeout(()=>{
|
// this.focuss()
|
}, 100);
|
|
},
|
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
|
},
|
removeBarcode() {
|
this.barcode = ''
|
uni.vibrateShort();
|
this.barcodeFocus = false;
|
this.$nextTick(function() {
|
this.barcodeFocus = true;
|
});
|
},
|
// 重置
|
resst() {
|
this.barcode = ''
|
this.siteId = ''
|
},
|
staNoSelect() {
|
// this.siteId = ''
|
},
|
outbound() {
|
let that = this
|
if (that.barcode == '') {
|
uni.showToast({title: "请扫描托盘码", icon: "none",position: 'top'})
|
return;
|
}
|
uni.request({
|
url: that.commonUrl + "/mobile/pakin/request",
|
header: {
|
'token':uni.getStorageSync('token'),
|
'content-type': 'application/x-www-form-urlencoded'
|
},
|
data: {
|
barcode: that.barcode,
|
staNo: that.staNo
|
},
|
method: "POST",
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
that.barcode = ''
|
uni.showToast({title: res.msg, icon: "none",position: 'top'})
|
} else {
|
uni.showToast({title: res.msg, icon: "none",position: 'top'})
|
}
|
}
|
})
|
},
|
check() {
|
switch(this.siteId) {
|
case "102入库":
|
this.staNo = 102
|
break;
|
case "103入库":
|
this.staNo = 103
|
break;
|
default:
|
this.staNo = 0
|
|
}
|
}
|
}
|
}
|
</script>
|
|
<style>
|
</style>
|