Commit 846de713 authored by 何远江's avatar 何远江

库存盘点对接

parent a820d6e0
...@@ -4,11 +4,12 @@ ...@@ -4,11 +4,12 @@
<NavBar title="库存盘点"></NavBar> <NavBar title="库存盘点"></NavBar>
<view class="planBox"> <view class="planBox">
<view class="planTitle">盘点计划:{{ inventoryInfo.IVNUM || inventoryInfo.IBLNR }}</view> <view class="planTitle">盘点计划:{{ inventoryInfo.IVNUM || inventoryInfo.IBLNR }}</view>
<view class="planTip">仓库:{{ inventoryInfo.LGOBE }} | 存货单元:{{ inventoryInfo.LGPLA }}</view> <!-- <view class="planTip">仓库:{{ inventoryInfo.LGOBE }} | 存货单元:{{ inventoryInfo.LGPLA }}</view> -->
</view> </view>
</StickyNavBar> </StickyNavBar>
<view class="scanningBtn"> <view class="scanningBtn">
<uni-easyinput prefixIcon="search" v-model="value" focus placeholder="请扫描盘点条码" @input="handleInput"></uni-easyinput> <uni-easyinput prefixIcon="search" v-model="value" focus placeholder="请扫描盘点条码" @input="handleInput">
</uni-easyinput>
</view> </view>
<view class="inventoryDetail"> <view class="inventoryDetail">
<view class="detailTitle">盘点明细</view> <view class="detailTitle">盘点明细</view>
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
<view class="items">物料名称:{{item.MAKTX}}</view> <view class="items">物料名称:{{item.MAKTX}}</view>
</view> </view>
<view class="boxRight"> <view class="boxRight">
<view class="items">0 / {{item.GESME}}pcs</view> <view class="items">0 / {{item.GESME}} {{ item.MEINS }}</view>
</view> </view>
</view> </view>
<view class="listBottom"> <view class="listBottom">
...@@ -45,13 +46,14 @@ ...@@ -45,13 +46,14 @@
<view v-if="!item.show" class="bottomBox"> <view v-if="!item.show" class="bottomBox">
<view class="boxAll" v-for="itm in item.list"> <view class="boxAll" v-for="itm in item.list">
<view class="bottomItem"> <view class="bottomItem">
<view class="items">{{ item.MATNR }}</view> <view class="items">仓位:{{ itm.LGPLA }}</view>
<view class="items">C009900 | 防霉抗菌包装纸</view> <view class="items">存储地点:{{ itm.LGOBE }}</view>
</view> </view>
<view class="boxRight"> <view class="boxRight">
<view class="items">891 / 1000pcs</view> <view class="items">{{ itm.MENGA }} / {{itm.PACMG}} {{itm.MEINS}}</view>
<view class="itemsBtn"> <view class="itemsBtn">
<u-button size="mini" class="" type="primary" @click="checkShowModel = true">盘点</u-button> <u-button size="mini" class="" type="primary" @click="checkShowModel = true">盘点
</u-button>
</view> </view>
</view> </view>
</view> </view>
...@@ -59,20 +61,16 @@ ...@@ -59,20 +61,16 @@
</view> </view>
</view> </view>
<BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn> <BottomBtn :btnArr="btnArr" @getBtnHandle="getBtnHandle"></BottomBtn>
<u-modal v-model="addShowModel" @confirm="addConfirm" ref="addShowModel" :show-title="false" :show-cancel-button="true">
<view class="slot-content"> <u-modal v-model="checkShowModel" @confirm="addConfirm" ref="checkShowModel" :show-title="false"
<u-form :model="addForm" ref="addForm"> :show-cancel-button="true">
<u-form-item label="批号"><u-input v-model="addForm.name" /></u-form-item>
<u-form-item label="批次"><u-input v-model="addForm.name" /></u-form-item>
<u-form-item label="数量"><u-input v-model="addForm.name" /></u-form-item>
</u-form>
</view>
</u-modal>
<u-modal v-model="checkShowModel" @confirm="addConfirm" ref="checkShowModel" :show-title="false" :show-cancel-button="true">
<view class="slot-content"> <view class="slot-content">
<u-form :model="checkForm" ref="checkForm"> <u-form :model="checkForm" ref="checkForm">
<uni-easyinput prefixIcon="search" class="topSearch" v-model="checkForm.name" focus placeholder="请扫描盘点库位条码" @input="handleInput"></uni-easyinput> <uni-easyinput prefixIcon="search" class="topSearch" v-model="checkForm.name" focus
<u-form-item label="数量"><u-input v-model="checkForm.name" /></u-form-item> placeholder="请扫描盘点库位条码" @input="handleInput"></uni-easyinput>
<u-form-item label="数量">
<u-input v-model="checkForm.name" />
</u-form-item>
</u-form> </u-form>
</view> </view>
</u-modal> </u-modal>
...@@ -80,10 +78,10 @@ ...@@ -80,10 +78,10 @@
</template> </template>
<script> <script>
import StickyNavBar from '@/components/StickyNavBar/index.vue'; import StickyNavBar from '@/components/StickyNavBar/index.vue';
import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue'; import ContentLoadingMore from '@/components/ContentLoadingMore/index.vue';
import BottomBtn from '@/components/BottomBtn/index.vue'; import BottomBtn from '@/components/BottomBtn/index.vue';
export default { export default {
components: { components: {
StickyNavBar, StickyNavBar,
ContentLoadingMore, ContentLoadingMore,
...@@ -93,14 +91,12 @@ export default { ...@@ -93,14 +91,12 @@ export default {
return { return {
urlPs: {}, urlPs: {},
value: '', value: '',
btnArr: [ btnArr: [{
{
style: '', style: '',
type: 'primary', type: 'primary',
text: '盘点确认', text: '盘点确认',
way: 'goBack' way: 'goBack'
} }],
],
inventoryList: [], inventoryList: [],
inventoryInfo: {}, inventoryInfo: {},
addShowModel: false, addShowModel: false,
...@@ -110,12 +106,30 @@ export default { ...@@ -110,12 +106,30 @@ export default {
}, },
checkForm: { checkForm: {
name: '' name: ''
} },
goodsList: []
}; };
}, },
computed: { onLoad(option) {
goodsList() { this.urlPs = option
return this.inventoryList.reduce((acc, cur) => { this.$u.api.sapApi
.sapInventory(this.urlPs).then(res => {
if (res.RDATA_IM.length || res.RDATA_WM.length) {
// 是否是 IM 数据结构
this.isIm = res.RDATA_IM.length > 0;
this.inventoryInfo = this.isIm ? res.RDATA_IM[0] : res.RDATA_WM[0];
this.inventoryList = this.isIm ? res.RDATA_IM : res.RDATA_WM
this.setGoodsList()
} else {
// 不能盘点
this.$u.toast(res.MSG[0].MESSAGE || "该盘点计划暂无库存数据");
}
})
},
methods: {
setGoodsList() {
this.goodsList = this.inventoryList.reduce((acc, cur) => {
// 没有分类的产品编码 // 没有分类的产品编码
const item = acc.find(v => v.MATNR == cur.MATNR) const item = acc.find(v => v.MATNR == cur.MATNR)
if (!item) { if (!item) {
...@@ -133,38 +147,14 @@ export default { ...@@ -133,38 +147,14 @@ export default {
} }
return acc return acc
}, []) }, [])
}
},
onLoad(option) {
this.urlPs = option
this.$u.api.sapApi
.sapInventory(this.urlPs).then(res => {
if (res.RDATA_IM.length || res.RDATA_WM.length) {
// 是否是IM
this.isIm = res.RDATA_IM.length > 0;
this.inventoryInfo = this.isIm ? res.RDATA_IM[0] : res.RDATA_WM[0];
this.inventoryList = (
this.isIm ? res.RDATA_IM : res.RDATA_WM
).reduce((acc, cur) => {
if (acc.findIndex((item) => item.MATNR === cur.MATNR) === -1) {
acc.push(cur);
}
return acc;
}, []);
} else {
// 不能盘点
this.$u.toast(res.MSG[0].MESSAGE || "该盘点计划暂无库存数据");
}
})
}, },
methods: {
handleInput(e) { handleInput(e) {
console.log(e, 'eee'); console.log(e, 'eee');
}, },
toggleShow(item, index) { toggleShow(item, index) {
console.log('触发了当前选项!', item) console.log('触发了当前选项!', item)
item.show = !item.show item.show = !item.show
this.$set(this.goodsList,index,item) this.$set(this.goodsList, index, item)
}, },
getBtnHandle(row) { getBtnHandle(row) {
console.log('getBtnHandle', row); console.log('getBtnHandle', row);
...@@ -180,59 +170,70 @@ export default { ...@@ -180,59 +170,70 @@ export default {
this.addShowModel = false; this.addShowModel = false;
} }
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
/deep/ .u-sticky { /deep/ .u-sticky {
top: 0 !important; top: 0 !important;
background: #fff; background: #fff;
} }
.planBox {
.planBox {
padding: 20rpx; padding: 20rpx;
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
} }
.planTitle {
.planTitle {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
text-align: center; text-align: center;
line-height: 60rpx; line-height: 60rpx;
} }
.planTip {
.planTip {
font-size: 28rpx; font-size: 28rpx;
text-align: center; text-align: center;
line-height: 40rpx; line-height: 40rpx;
} }
.scanningBtn {
.scanningBtn {
padding: 20rpx; padding: 20rpx;
background: #fff; background: #fff;
.topSearch { .topSearch {
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }
.workTitle {
.workTitle {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
line-height: 40rpx; line-height: 40rpx;
margin: 20rpx 0 0 40rpx; margin: 20rpx 0 0 40rpx;
} }
.inventoryDetail {
.inventoryDetail {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 0 20rpx; padding: 0 20rpx;
} }
.detailTitle {
.detailTitle {
font-size: 32rpx; font-size: 32rpx;
font-weight: 600; font-weight: 600;
line-height: 46rpx; line-height: 46rpx;
} }
.listBottom {
.listBottom {
padding: 0 10rpx 20rpx 10rpx; padding: 0 10rpx 20rpx 10rpx;
.bottomTitle { .bottomTitle {
height: 60rpx; height: 60rpx;
position: relative; position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
.topIcons { .topIcons {
position: absolute; position: absolute;
left: 50%; left: 50%;
...@@ -241,6 +242,7 @@ export default { ...@@ -241,6 +242,7 @@ export default {
color: #aaa; color: #aaa;
} }
} }
.bottomBox { .bottomBox {
.boxAll { .boxAll {
display: flex; display: flex;
...@@ -248,8 +250,10 @@ export default { ...@@ -248,8 +250,10 @@ export default {
background: #fff; background: #fff;
border-radius: 10rpx; border-radius: 10rpx;
} }
.bottomItem { .bottomItem {
padding: 20rpx; padding: 20rpx;
.items { .items {
color: #333; color: #333;
font-size: 24rpx; font-size: 24rpx;
...@@ -257,35 +261,42 @@ export default { ...@@ -257,35 +261,42 @@ export default {
line-height: 40rpx; line-height: 40rpx;
} }
} }
.boxRight { .boxRight {
padding: 20rpx 20rpx 0 20rpx; padding: 20rpx 20rpx 0 20rpx;
.items { .items {
color: #333; color: #333;
font-size: 24rpx; font-size: 24rpx;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
} }
.itemsBtn { .itemsBtn {
float: right; float: right;
padding: 20rpx 0 10rpx; padding: 20rpx 0 10rpx;
} }
} }
} }
} }
.cardContent {
.cardContent {
margin: 20rpx; margin: 20rpx;
background: #f8f8f8; background: #f8f8f8;
} }
.cardItem {
.cardItem {
padding: 20rpx 10rpx; padding: 20rpx 10rpx;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #333; border-bottom: 1px solid #333;
} }
.slot-content {
.slot-content {
padding: 20rpx; padding: 20rpx;
.u-form-item { .u-form-item {
padding: 0; padding: 0;
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment