<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="content-combox">
|
<uni-combox emptyTips="暂无数据"
|
:candidates="sites" v-model="siteId" @click="getInBound()" placeholder="请选择入库站点">
|
</uni-combox>
|
</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">
|
<uni-combox emptyTips="暂无数据" v-model="bucketId" placeholder="请选择桶类型">
|
<option value="1">油桶</option>
|
<option value="2">净桶</option>
|
</uni-combox>
|
</view> -->
|
<!-- <v-select class="content-combox" v-model="bucketId" style="color:#716e7d;border-radius: 5px;">
|
<option value="">请选择桶类型</option>
|
<option value="1">油桶</option>
|
<option value="2">净桶</option>
|
</v-select> -->
|
<v-select v-model="bucketId"
|
:options="bucket"
|
:options-label="'label'"
|
:options-value="'value'" ></v-select>
|
</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="comb()">启动入库</button>
|
</label>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
commonUrl:null,
|
matnr:'',
|
focus: true,
|
matList: [],
|
sites: [],
|
siteId: '',
|
count:0,
|
// bucket:['油桶','净桶'],
|
bucket:[
|
{
|
label:'油桶',
|
value:1
|
},
|
{
|
label:'净桶',
|
value:2
|
}
|
],
|
bucketId:'',
|
}
|
},
|
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()
|
this.getInBound();
|
},
|
methods: {
|
// 获取url
|
getUrl() {
|
this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
|
},
|
// 清空input
|
remove(e) {
|
this[e] = ''
|
},
|
// 获取可用入库站点
|
getInBound() {
|
let that = this;
|
uni.request({
|
url: that.commonUrl + "/available/put/site",
|
header: {'token':uni.getStorageSync('token')},
|
success(result) {
|
let res = result.data
|
if (res.code === 200 ) {
|
that.sites = [];
|
for (var i = 0; i < res.data.length; i++) {
|
that.sites.push(res.data[i])
|
}
|
} 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'})
|
}
|
}
|
})
|
},
|
// 启动入库
|
comb() {
|
|
let that = this
|
if (that.siteId == '') {
|
uni.showToast({title: "请选择入库口", icon: "none",position: 'top'})
|
return;
|
}
|
let buchid=0;
|
if (that.bucketId == '') {
|
uni.showToast({title: "请选择桶类型", icon: "none",position: 'top'})
|
return;
|
}else{
|
if(that.bucketId == '1'){
|
buchid=1;
|
}else if(that.bucketId == '2'){
|
buchid=2;
|
}else{
|
console.log(that.bucketId)
|
uni.showToast({title: "请选择正确桶类型", icon: "none",position: 'top'})
|
return;
|
}
|
}
|
uni.request({
|
url: that.commonUrl + '/empty/plate/in/start',
|
data: {
|
sourceStaNo: that.siteId,
|
bucket:buchid
|
},
|
method:"GET",
|
header: {
|
'token':uni.getStorageSync('token'),
|
},
|
success(result) {
|
var res = result.data
|
if (result.data.code === 200) {
|
uni.showToast({title: "入库启动成功,目标库位:" + res.data, icon: "none",position: 'top'})
|
that.resst()
|
} else {
|
uni.showToast({title: result.data.msg, icon: "none",position: 'top'})
|
}
|
}
|
});
|
},
|
resst() {
|
this.matnr = '';
|
this.siteId = '';
|
this.matList = [];
|
this.bucketId='';
|
},
|
}
|
}
|
</script>
|
|
<style>
|
.color-block-blue {
|
background-color: #1E9FFF;
|
display: inline-block;
|
float: left;
|
margin: 15rpx 15rpx 0 15rpx;
|
width: 12rpx;
|
height: 40rpx;
|
border: 5rpx solid #1E9FFF;
|
border-radius: 20rpx;
|
}
|
.title {
|
display: inline-block;
|
float: left;
|
font-size: 34rpx;
|
font-weight: 700;
|
height: 50rpx;
|
line-height: 50rpx;
|
margin-top: 10rpx;
|
}
|
.pda-btn1 {
|
margin-left:260rpx;
|
margin-right: auto;
|
margin-top: 150rpx;
|
width: 200rpx;
|
height: 80rpx;
|
font-size: 30upx;
|
font-weight: bold;
|
}
|
.combox {
|
width: 200px;
|
padding: 12px;
|
}
|
.bg-false {
|
background-color: #FFFFFF;
|
}
|
.bg-true {
|
background-color: #ebebeb;
|
}
|
.data-list {
|
border-bottom: 1px solid #d8d8d8;
|
height: 180rpx;
|
margin: 15rpx;
|
border-radius: 20rpx;
|
}
|
.data-list:first-child {
|
margin-top: 20rpx;
|
}
|
.data-list:last-child {
|
margin-bottom: 120rpx;
|
}
|
.data-list-left {
|
display: inline-block;
|
float: left;
|
margin-left: 6%;
|
height: 180rpx;
|
color: #676767;
|
}
|
.matnr {
|
padding-top: 10rpx;
|
}
|
.data-list-right {
|
display: inline-block;
|
float: right;
|
height: 180rpx;
|
line-height: 180rpx;
|
}
|
.data-list-right label {
|
display: inline-block;
|
float: left;
|
width: 80rpx;
|
height: 180rpx;
|
}
|
.revise-box {
|
width: 400rpx;
|
height: 300rpx;
|
border-radius: 25px;
|
}
|
.revise-box-top {
|
width: 400rpx;
|
height: 120rpx;
|
border-radius: 25px;
|
}
|
.changeBox {
|
width: 400rpx;
|
height: 100rpx;
|
}
|
.num-box {
|
margin-left: 100rpx;
|
}
|
.revise-box-buttom{
|
margin-left: 130rpx;
|
}
|
</style>
|