编写登录页面,首页面,入库页面,样式修改,扫码功能实现
This commit is contained in:
133
pages/inWarehouse/inWarehouse.vue
Normal file
133
pages/inWarehouse/inWarehouse.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<template>
|
||||
<view class="content">
|
||||
<view class="title-box">
|
||||
<span class="title-text">入库</span>
|
||||
<view class="warehoseInfo-box">
|
||||
<view>仓库名称:{{ warehouseInfo.warehouse }}</view>
|
||||
<view>库位名称:{{ warehouseInfo.location }}</view>
|
||||
<view>货架名称:{{ warehouseInfo.shelf }}</view>
|
||||
<view>当前货物数:{{ warehouseInfo.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 货物列表 -->
|
||||
<view class="">
|
||||
<scroll-view class="scroll-view-box" :scroll-y="true">
|
||||
<view v-for="item in materialList">
|
||||
<materialItem :materialInfo="item"></materialItem>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<!-- 底部按钮 -->
|
||||
<view class="button-box">
|
||||
<button type="default" @click="handlerSubmit">入库</button>
|
||||
</view>
|
||||
<!-- 扫描操作 -->
|
||||
<view>
|
||||
<PdaScanInput @getInfo="handleGetInfo" :type="searchType"></PdaScanInput>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import materialItem from '@/components/material-item/material-item.vue';
|
||||
// 入库
|
||||
export default {
|
||||
components: {
|
||||
materialItem
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
clearData: {
|
||||
warehouseInfo: {},
|
||||
materialList: []
|
||||
},
|
||||
warehouseInfo: {
|
||||
id: '',
|
||||
warehouse: '',
|
||||
warehouse_num: '',
|
||||
location: '',
|
||||
shelf: '',
|
||||
layer: '',
|
||||
number: 0
|
||||
},
|
||||
materialList: [],
|
||||
// 1-仓库扫码 2-物料扫码
|
||||
searchType: 1
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'warehouseInfo.id': {}
|
||||
},
|
||||
created() {
|
||||
this.init();
|
||||
for (let i = 1; i <= 20; i++) {
|
||||
this.materialList.push({
|
||||
title: '货物' + i,
|
||||
time: '2024/3/12'
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 初始化,并且清空数据
|
||||
this.clearData.warehouseInfo = JSON.parse(JSON.stringify(this.warehouseInfo));
|
||||
this.clearData.materialList = JSON.parse(JSON.stringify(this.materialList));
|
||||
this.searchType = 1;
|
||||
},
|
||||
clear() {
|
||||
this.warehouseInfo = JSON.parse(JSON.stringify(this.clearData.warehouseInfo));
|
||||
this.materialList = JSON.parse(JSON.stringify(this.clearData.materialList));
|
||||
this.searchType = 1;
|
||||
},
|
||||
handleGetInfo(data, type) {
|
||||
if(type === 1){
|
||||
this.searchType = 2;
|
||||
}
|
||||
uni.showToast({
|
||||
title: '扫描成功',
|
||||
icon: 'success'
|
||||
});
|
||||
this.warehouseInfo = data;
|
||||
console.log('仓库信息扫描出', data);
|
||||
},
|
||||
// 入库提交
|
||||
handlerSubmit() {
|
||||
//TODO提交操作
|
||||
this.clear();
|
||||
// uni.navigateBack();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.title-box {
|
||||
margin-top: 40px;
|
||||
margin-bottom: 20px;
|
||||
height: 80px;
|
||||
font-size: 26px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.warehoseInfo-box {
|
||||
font-size: 16px;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
}
|
||||
.list-box {
|
||||
width: 100%;
|
||||
}
|
||||
.scroll-view-box {
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
height: 450px;
|
||||
}
|
||||
.button-box{
|
||||
width:80%;
|
||||
margin:0 auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user