<template>
|
<view class="">
|
<!-- 选择站点 -->
|
<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="stationNos" v-model="stationNo" @click="staNoSelect()" 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="square-content">
|
<view class="content-input">
|
<input type="text" v-model="matnr" placeholder="扫码 / 输入" :focus="matnrFocus"
|
@input="findMat" placeholder-style="line-height: 85rpx;">
|
<uni-icons type="closeempty" size="20" color="#dadada" @click="removeLocNo"></uni-icons>
|
</view>
|
</view>
|
</view>
|
<!-- 物料区域 -->
|
<view class="square-1">
|
<view class="square-title">
|
<view class="title-sign"><view class="sign"></view></view>
|
<view class="title-text"><text>商品列表</text></view>
|
</view>
|
</view>
|
<view class="square-none" v-show="matList.length === 0">
|
<view class="v-show">暂无更多数据...</view>
|
</view>
|
<checkbox-group @change="checkbox">
|
<view v-for="(item,index) in matList" :key="index" class="data-list bg-false" :class="'bg-'+item.checked" >
|
<view class="data-list-left">
|
<view class="matnr"><text style="width: 700rpx;">编码:{{item.matnr}}</text></view>
|
<view><text style="width: 700rpx;">品名:{{item.maktx}}</text></view>
|
<view><text style="width: 700rpx;">批号:{{item.batch}}</text></view>
|
<view>
|
<text style="width: 700rpx;">数量:{{item.fullQty}}</text>
|
</view>
|
</view>
|
<view class="data-list-right">
|
</view>
|
</view>
|
</checkbox-group>
|
<!-- 操作区域 -->
|
<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="startWarehousing()">启动出库</button>
|
</label>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
commonUrl: null,
|
wcsUrl: '',
|
stationNos: [101,103],
|
stationNo: '',
|
matnr: '',
|
matnrFocus: true,
|
matList: []
|
}
|
},
|
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
|
const WCSURL = uni.getStorageSync('WCSURL');
|
this.wcsUrl = WCSURL
|
this.getUrl()
|
},
|
methods: {
|
// 获取url
|
getUrl() {
|
this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
|
},
|
// 物料搜索绑定
|
findMat() {
|
let that = this
|
let len = that.matnr.length,batch = '',matnr = ''
|
if (len == 26 || len == 25) {
|
batch = that.matnr.substring(18,22)
|
matnr = that.matnr.substring(3,16) + that.matnr.substring(16,17)
|
} else {
|
setTimeout(()=>{
|
that.matnr = ''
|
},100)
|
return
|
}
|
uni.request({
|
url: that.commonUrl + "/mat/auth",
|
data: { matnr:matnr},
|
header: { 'token':uni.getStorageSync('token') },
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
res.data.batch = batch
|
that.matList.push(res.data)
|
}
|
}
|
})
|
},
|
// 启动入库
|
startWarehousing() {
|
let that = this
|
if (that.stationNo == '') {
|
uni.showToast({title: "请选择站点后重试", icon: "none",position: 'top'})
|
return;
|
}
|
if (that.matnr == '') {
|
uni.showToast({title: "请选择输入或者扫描条码", icon: "none",position: 'top'})
|
return;
|
}
|
var matnr = that.matnr.substring(3,16) + that.matnr.substring(16,17)
|
uni.request({
|
url: that.wcsUrl + "/mobile/start/warehousing/auth",
|
data: { matnr:that.matnr,stationNo:that.stationNo},
|
header: { 'token':uni.getStorageSync('token') },
|
success(res) {
|
res = res.data
|
if (res.code === 200) {
|
uni.showToast({title: "启动成功", icon: "none",position: 'top'})
|
that.resst()
|
}
|
}
|
})
|
},
|
// 重置
|
resst() {
|
this.stationNo = '';
|
this.matList = [];
|
this.matnr = '';
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.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;
|
width: 94%;
|
margin: 15rpx auto 15rpx auto;
|
border-radius: 20rpx;
|
}
|
.data-list:first-child {
|
margin-top: 20rpx;
|
}
|
.data-list:last-child {
|
margin-bottom: 160rpx;
|
}
|
/* .data-list-left {
|
display: inline-block;
|
float: left;
|
text-align: center;
|
width: 100rpx;
|
height: 180rpx;
|
line-height: 180rpx;
|
} */
|
.left-check-box {
|
display: inline-block;
|
/* background-color: #1E9FFF; */
|
float: left;
|
height: 100%;
|
width: 100rpx;
|
text-align: center;
|
line-height: 170rpx;
|
}
|
.data-list-left {
|
/* background-color: #ffff7f; */
|
display: inline-block;
|
float: left;
|
height: 180rpx;
|
width: 500rpx;
|
color: #676767;
|
text-indent: 20rpx;
|
}
|
.matnr {
|
padding-top: 10rpx;
|
}
|
.data-list-right {
|
/* background-color: #55ffff; */
|
display: inline-block;
|
float: right;
|
width: 100rpx;
|
height: 180rpx;
|
line-height: 180rpx;
|
}
|
.data-list-right label {
|
display: inline-block;
|
float: left;
|
width: 100rpx;
|
height: 180rpx;
|
}
|
.revise-box {
|
width: 500rpx;
|
height: 500rpx;
|
}
|
.revise-box-top {
|
width: 100%;
|
height: 100rpx;
|
background-color: #fff;
|
padding: 10rpx;
|
}
|
.changeBox {
|
width: 100%;
|
height: 100rpx;
|
line-height: 120rpx;
|
text-align: center;
|
background-color: #FFF;
|
margin-top: 20rpx;
|
border-bottom: 1px solid #e3e3e3;
|
}
|
.text-box {
|
width: 100%;
|
height: 100rpx;
|
line-height: 120rpx;
|
text-align: center;
|
/* padding-left: 120rpx; */
|
background-color: #FFF;
|
margin-top: 20rpx;
|
border-bottom: 1px solid #e3e3e3;
|
}
|
.changeBox .num-box {
|
display: inline-block;
|
float: left;
|
}
|
.changeBox button {
|
float: left;
|
}
|
.revise-box-buttom {
|
position: absolute;
|
width: 100%;
|
height: 100rpx;
|
line-height: 100rpx;
|
background-color: #FFFFFF;
|
bottom: 0;
|
text-align: center;
|
}
|
</style>
|