<template>
|
<view class="wrap">
|
<view>
|
<view class="search">
|
<u-search v-model="query.locationDesc" @custom="search" @search="search" placeholder="库位描述"></u-search>
|
</view>
|
<scroll-view class="scroll-list" scroll-y="true">
|
<u-cell-group class="list" :border="false">
|
<view class="content" v-for="(item, index) in locationList" :key="item.id" :index="index" @click="locationCardClick(item)">
|
<view class="row-list location-row">
|
<span class="span-lable">库位号: </span>{{ item.locationNo }}
|
</view>
|
<view class="row-list location-row">
|
<span class="span-lable">仓库: </span>{{ item.warehouseDesc }}
|
</view>
|
<view class="row-list location-row">
|
<span class="span-lable">库位描述: </span>{{ item.locationDesc }}
|
</view>
|
<view class="row-list location-row">
|
<span class="span-lable">库位类型: </span>{{ item.locationTypeDesc }}
|
</view>
|
</view>
|
<view v-if="locationList.length===0">
|
<view style="text-align: center;">
|
<span>未查询到IFS库位记录</span>
|
</view>
|
</view>
|
</u-cell-group>
|
</scroll-view>
|
</view>
|
<!--<view style="position: absolute;bottom: 0">
|
<view style="height: 50rpx;display: flex;align-items: flex-end;">
|
<u-button type="success" text="库位扫码" size="medium"
|
:customStyle="{width:'750rpx',borderRadius:'0rpx'}" @click="scanLocationCodeClick()">库位扫码
|
</u-button>
|
</view>
|
</view>-->
|
</view>
|
</template>
|
<script>
|
export default {
|
data() {
|
return {
|
locationList: [],
|
originList: [],
|
query:{locationDesc:''}
|
};
|
},
|
onLoad() {
|
this.loadList();
|
},
|
onShow() {
|
|
},
|
methods: {
|
loadList() {
|
// 查询库位列表
|
this.$u.api.ifsLocation.page(this.query).then(res => {
|
let _code =res.code
|
let _data =res.data
|
if(_code===0){
|
this.locationList = _data.map((item, index) => {
|
return {
|
id: index + 1,
|
locationNo: item.LOCATION_NO,
|
locationDesc: item.LOCATION_DESC,
|
locationGroupDesc: item.LOCATION_GROUP_DESC,
|
locationTypeDesc: item.LOCATION_TYPE_DESC,
|
warehouseDesc: item.WAREHOUSE_DESC
|
}
|
})
|
}else{
|
this.locationList=[]
|
}
|
})
|
},
|
search(value){
|
this.locationList = [];
|
this.query.locationDesc = value;
|
this.loadList();
|
},
|
scanLocationCodeClick() {
|
uni.scanCode({
|
scanType: ['qrCode'],
|
success: function(res) {
|
console.log('条码类型:' + res.scanType);
|
console.log('条码内容:' + res.result);
|
},
|
fail: function() {
|
console.log('扫码失败');
|
}
|
});
|
},
|
locationCardClick(task) {
|
this.refreshLastPage(task)
|
},
|
|
//刷新上一个页面
|
refreshLastPage(task) {
|
// 告知 A.vue 更新数据
|
// 获取页面栈
|
let pages = getCurrentPages()
|
|
// 获取上一页栈
|
let prevPage = pages[pages.length - 2]
|
|
// 触发上一页 upData 函数(并携带参数)
|
prevPage.$vm.setMaterialLocation(task)
|
|
// 返回上一页
|
uni.navigateBack({
|
delta: 1
|
})
|
},
|
}
|
};
|
</script>
|
<style lang="scss">
|
.list .content {
|
font-size: 12px;
|
background-color: #efefef;
|
box-sizing: border-box;
|
border-radius: 14rpx;
|
margin: 8px;
|
padding: 5px 10px;
|
box-shadow: none;
|
}
|
.location-row{
|
display: flex;
|
justify-content:space-between;
|
}
|
</style>
|