<template>
|
<view>
|
<view class="cu-form-group margin-top">
|
<view class="title">库位</view>
|
<input v-model="locNo" placeholder="库位编号" name="input" @input="findByLocNo()" focus></input>
|
</view>
|
<view class="cu-form-group margin-top">
|
<view class="title">产品</view>
|
<input v-model="matNo" placeholder="产品信息" name="input" @input="findByMatNo()"></input>
|
</view>
|
<view class="margin-top">
|
<uni-table border stripe emptyText="暂无更多数据">
|
<uni-tr>
|
<uni-th width="90">产品ID</uni-th>
|
<uni-th width="90">产品名称</uni-th>
|
<uni-th width="90">库位</uni-th>
|
<uni-th width="70">数量</uni-th>
|
</uni-tr>
|
<uni-tr v-for="(item, index) in locDetlData" :key="index" @input="tabRender()">
|
<uni-td>{{item.matNo}}</uni-td>
|
<uni-td>{{item.matName}}</uni-td>
|
<uni-td>{{item.locNo}}</uni-td>
|
<uni-td>{{item.count}}</uni-td>
|
</uni-tr>
|
</uni-table>
|
|
</view>
|
<view class="reset">
|
<button class="cu-btn bg-grey pda-btn1" @click="reset">重 置</button>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
locNo:'',
|
matNo:'',
|
locDetlData:[],
|
}
|
},
|
mounted(){
|
const UIP = uni.getStorageSync('UIP');
|
this.baseIP = UIP
|
},
|
methods: {
|
reset:function() {
|
let that = this;
|
that.locNo = '';
|
that.matNo = '';
|
},
|
// 根据库位号查找库存明细
|
findByLocNo(){
|
if(this.locNo.length === 0){
|
return;
|
}
|
this.matNo = ''
|
this.find(this.locNo,this.matNo)
|
},
|
// 根据产品号查找库存明细
|
findByMatNo(){
|
if(this.matNo.length === 0){
|
return;
|
}
|
this.locNo = '',
|
this.find(this.locNo,this.matNo)
|
},
|
// find
|
find(){
|
let that = this
|
uni.request({
|
url: that.baseHttp + that.baseIP + that.baseUrl + "/mobile/locDetl/stockQuery",
|
header:{
|
'content-type':'application/x-www-form-urlencoded',
|
'token':uni.getStorageSync('token')
|
},
|
data:{
|
locNo: that.locNo,
|
matNo: that.matNo,
|
},
|
method: 'POST',
|
success(res) {
|
if(res.data.code === 200){
|
if(res.data.data != null){
|
that.locDetlData = res.data.data
|
} else if (res.data.code ===403){
|
uni.navigateBack({
|
delta: 1
|
})
|
} else {
|
this.messageToggle('error')
|
this.messageText = res.data.msg
|
}
|
}
|
}
|
})
|
},
|
|
}
|
}
|
</script>
|
|
<style>
|
.reset {
|
|
position: absolute;
|
width: 750upx;
|
bottom: 80upx;
|
}
|
.pda-btn1 {
|
display: flex;
|
flex-direction:row;
|
justify-content: center;
|
width: 150upx;
|
}
|
</style>
|