lijuncheng
3 months ago
6 changed files with 383 additions and 51 deletions
@ -0,0 +1,257 @@ |
|||
<template> |
|||
<view style=" "> |
|||
<uni-drawer ref="showRight" mode="left" :mask-click="true" :width="330"> |
|||
<view style="height:100vh;display:flex;flex-direction:column;"> |
|||
<view class="uni-flex" style="justify-content: center; |
|||
background-color:#007AFF ; |
|||
color: #fff; |
|||
padding: 15rpx; |
|||
font-size: 35rpx;"> |
|||
库存查询 |
|||
</view> |
|||
<scroll-view v-if="true" style="height: calc(100vh - 180rpx)" scroll-y="true"> |
|||
<!-- <button @click="closeDrawer" type="primary">关闭Drawer</button> --> |
|||
<!-- <view v-for="item in 110" :key="item">可滚动内容 {{ item }}</view> --> |
|||
<view class="" style="margin: 10rpx; font-size: 35rpx;"> |
|||
物料号: |
|||
</view> |
|||
<view style=" margin: 10rpx; display: flex; align-items: center;"> |
|||
<uni-easyinput class="uni-mt-5" prefixIcon="search" v-model="itemCode" placeholder="请输入物料号" |
|||
@clear="clearItemCode" @confirm="onConfirmItemCode"></uni-easyinput> |
|||
<!-- <view>查询</view> --> |
|||
<!-- <button style="height: 80rpx; align-items: center; text-align: center;" type="primary" size="mini" >查询</button> --> |
|||
</view> |
|||
|
|||
<view v-for="(item, index) in itemCodeResult" :key="index" @click="selectItemCode(item)"> |
|||
<view class="" style="font-size: 30rpx; margin: 20rpx;"> |
|||
<view class=""> |
|||
({{index+1}}) 物料代码 : {{item.code}} |
|||
</view> |
|||
<view class=""> |
|||
名称 : {{item.name}} |
|||
</view> |
|||
<view class=""> |
|||
描述1 : {{item.desc1}} |
|||
</view> |
|||
<view class=""> |
|||
描述2 : {{item.desc1}} |
|||
</view> |
|||
</view> |
|||
<view class="split_line"></view> |
|||
</view> |
|||
<scroll-view scroll-x="true" v-if="tableData.length>0" style="width: 330px; display: flex; align-items: center; justify-content: center; "> |
|||
<view style="width: 330px; display: flex;justify-content: center; background-color: #fff; padding-bottom: 150rpx;"> |
|||
<uni-table border stripe emptyText="暂无更多数据"> |
|||
<!-- 表头行 --> |
|||
<uni-tr> |
|||
<uni-th width="60" style="font-weight: 800;" align="left">序号</uni-th> |
|||
<uni-th width="60" align="left">批次</uni-th> |
|||
<uni-th width="50" align="left">库位</uni-th> |
|||
<uni-th width="60" align="left">状态</uni-th> |
|||
<uni-th width="120" align="left">数量</uni-th> |
|||
</uni-tr> |
|||
<!-- 表格数据行 --> |
|||
<uni-tr v-for="(item, index) in tableData" :key="index"> |
|||
<uni-td>{{index+1}}</uni-td> |
|||
<uni-td>{{item.batch}}</uni-td> |
|||
<uni-td>{{item.locationCode}}</uni-td> |
|||
<uni-td>{{statusDesc(item.inventoryStatus)}}</uni-td> |
|||
<uni-td>{{item.qty}}</uni-td> |
|||
</uni-tr> |
|||
|
|||
</uni-table> |
|||
<view class="uni-flex" style=" flex-direction: column; position: fixed; bottom: 0; margin-bottom: 100rpx; background-color: #fff; width: 100%; align-items: center;" > |
|||
<view class="" style="width: 100%; display: flex; justify-content: center; font-size: 32rpx;margin-top: 10rpx;margin-bottom: 10rpx;"> |
|||
<view class="" >当前页:{{ current }},总数:{{ total }}条,每页:{{ pageSize }} |
|||
</view> |
|||
|
|||
</view> |
|||
<uni-pagination :current="current" :total="total" :show-icon="true" |
|||
@change="change" /> |
|||
</view> |
|||
|
|||
</view> |
|||
|
|||
</scroll-view> |
|||
|
|||
</scroll-view> |
|||
|
|||
<button @click="closeDrawer" type="primary" style="padding-left: 20rpx;">关闭</button> |
|||
</view> |
|||
|
|||
</uni-drawer> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getBasicItemByCodeSenior, |
|||
} from '@/api/request2.js'; |
|||
|
|||
import { |
|||
getInventoryStatusStyle, |
|||
getInventoryStatusName |
|||
} from '@/common/directory.js'; |
|||
|
|||
export default { |
|||
components: {}, |
|||
|
|||
data() { |
|||
return { |
|||
itemCode: "", |
|||
itemCodeResult: [], |
|||
current: 1, |
|||
total: 18, |
|||
tableData: [{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 1 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 2 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 3 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 4 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 3 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 4 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 3 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 4 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 3 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 4 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 3 |
|||
}, |
|||
{ |
|||
batch: "20240814", |
|||
locationCode: "901", |
|||
inventoryStatus: "OK", |
|||
qty: 4 |
|||
} |
|||
|
|||
] |
|||
} |
|||
}, |
|||
props: { |
|||
// detail: { |
|||
// type: Object, |
|||
// default: {} |
|||
// }, |
|||
// isShowPack: { |
|||
// type: Boolean, |
|||
// default: true |
|||
// } |
|||
}, |
|||
watch: { |
|||
|
|||
}, |
|||
methods: { |
|||
statusStyle: function(val) { |
|||
return getInventoryStatusStyle(val); |
|||
}, |
|||
statusDesc(value) { |
|||
return getInventoryStatusName(value) |
|||
}, |
|||
change() { |
|||
|
|||
}, |
|||
showErrorMessage(message) { |
|||
this.$refs.comMessage.showErrorMessage(message, res => { |
|||
if (res) { |
|||
|
|||
} |
|||
}); |
|||
}, |
|||
selectItemCode(item) { |
|||
this.itemCode = item.code |
|||
this.itemCodeResult = [] |
|||
}, |
|||
clearItemCode() { |
|||
this.itemCode = "" |
|||
this.itemCodeResult = [] |
|||
}, |
|||
onConfirmItemCode() { |
|||
if (!this.itemCode) { |
|||
this.showErrorMessage("物料号为空,请先输入物料号") |
|||
return; |
|||
} |
|||
uni.showLoading({ |
|||
title: "加载中", |
|||
mask: true |
|||
}) |
|||
|
|||
getBasicItemByCodeSenior(this.itemCode).then(res => { |
|||
uni.hideLoading() |
|||
if (res.data && res.data.list.length > 0) { |
|||
if (res.data.list.length == 1) { |
|||
this.itemCode = res.data.list[0].code |
|||
} else { |
|||
this.itemCodeResult = res.data.list |
|||
} |
|||
} else { |
|||
this.showErrorMessage("未查找到物料[" + this.itemCode + "]") |
|||
} |
|||
|
|||
}).catch(error => { |
|||
uni.hideLoading() |
|||
this.showErrorMessage(error) |
|||
}) |
|||
}, |
|||
showDrawer() { |
|||
this.$refs.showRight.open(); |
|||
}, |
|||
closeDrawer() { |
|||
this.$refs.showRight.close(); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style> |
|||
</style> |
@ -0,0 +1,84 @@ |
|||
<template> |
|||
<view class="wyf"> |
|||
<uni-popup ref="listPopup" type="dialog"> |
|||
<view class="container"> |
|||
<uni-list class="list"> |
|||
<uni-list-item v-for="(item,index) in list" :title="item.title" |
|||
thumb-size="lg" > |
|||
<template v-slot:footer> |
|||
<!-- <image class="slot-image" src="@/static/logo.png" mode="widthFix" @click="selectItem(item,index)"></image --> |
|||
<text class="go" @click="selectItem(item,index)">Go</text> |
|||
</template> |
|||
|
|||
</uni-list-item> |
|||
|
|||
</uni-list> |
|||
</view> |
|||
</uni-popup> |
|||
</view> |
|||
</template> |
|||
|
|||
<script> |
|||
import { onShow } from '@dcloudio/uni-app'; |
|||
export default { |
|||
emits: ["selectItem"], |
|||
components: { |
|||
}, |
|||
data() { |
|||
return { |
|||
isScanedASN:false, |
|||
list: [] |
|||
// [{ |
|||
// title:'哈哈哈哈', |
|||
// selected:false |
|||
// }], |
|||
} |
|||
}, |
|||
props: { |
|||
}, |
|||
methods:{ |
|||
openList(list){ |
|||
this.list = list; |
|||
this.$refs.listPopup.open('center') |
|||
}, |
|||
selectItem(item,index){ |
|||
this.$refs.listPopup.close(); |
|||
this.$emit("selectItem", item); |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss" scoped> |
|||
.wyf{ |
|||
// display: block; |
|||
position: fixed; |
|||
top: 0; |
|||
left: 0; |
|||
right: 0; |
|||
bottom: 0; |
|||
z-index: 1000 |
|||
} |
|||
.container{ |
|||
display: flex; |
|||
justify-content: center; |
|||
align-items: center; |
|||
.list{ |
|||
width: 80%; |
|||
max-height:50vh; |
|||
overflow-y: auto; |
|||
border-radius: 10px !important; |
|||
.slot-image{ |
|||
width: 40rpx; |
|||
} |
|||
.go{ |
|||
color: rgb(60, 156, 255); |
|||
} |
|||
|
|||
} |
|||
|
|||
} |
|||
.list ::v-deep .uni-list--border{ |
|||
border: 1rpx solid #e5e5e5; |
|||
} |
|||
</style> |
Loading…
Reference in new issue