Commit fec46376 authored by 沈翠玲's avatar 沈翠玲

库存盘点

parent 3abb27f0
...@@ -60,6 +60,8 @@ const install = (Vue, vm) => { ...@@ -60,6 +60,8 @@ const install = (Vue, vm) => {
sapCasePlnr2: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr2?sap-language=ZH&sap-client=' + client, params), sapCasePlnr2: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_case/pda_case_plnr2?sap-language=ZH&sap-client=' + client, params),
// 待盘点 // 待盘点
sapInventory: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_inventory?sap-language=ZH&sap-client='+ client, params), sapInventory: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/search/sch_inventory?sap-language=ZH&sap-client='+ client, params),
// 回传盘点结果
postInventory: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/post_inventory?sap-client='+ client, params),
// 工厂调拨查询 // 工厂调拨查询
sapSearchAllot: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_allot/search_allot?sap-language=ZH&sap-client='+ client, params), sapSearchAllot: (params = {}, client = sapClient) => vm.$u.post(config.adminPath + '/sap/bc/erp_ep/pda_allot/search_allot?sap-language=ZH&sap-client='+ client, params),
// 工厂调拨下架 // 工厂调拨下架
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<StickyNavBar> <StickyNavBar>
<NavBar title="库存盘点"></NavBar> <NavBar title="库存盘点"></NavBar>
<view class="btn"> <view class="btn">
<uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫盘点凭证码" @change="handleInputNlpla"></uni-easyinput> <uni-easyinput prefixIcon="search" class="topSearch" v-model="nlpla" focus placeholder="请扫盘点凭证码" @input="handleInputNlpla"></uni-easyinput>
</view> </view>
</StickyNavBar> </StickyNavBar>
<waitInventoried ref="waitInventoriedRef" /> <waitInventoried ref="waitInventoriedRef" />
...@@ -52,7 +52,8 @@ export default { ...@@ -52,7 +52,8 @@ export default {
this[row.way](); this[row.way]();
}, },
handleInputNlpla(e) { handleInputNlpla(e) {
this.$refs.waitInventoriedRef.getList(e); const params = JSON.parse(e)
this.$refs.waitInventoriedRef.getList(params);
}, },
goBack() { goBack() {
console.log('返回了'); console.log('返回了');
......
...@@ -27,7 +27,7 @@ ...@@ -27,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}} {{ item.MEINS }}</view> <view class="items">{{sumMENGA(item)}} / {{item.GESME}} {{ item.MEINS }}</view>
</view> </view>
</view> </view>
<view class="listBottom"> <view class="listBottom">
...@@ -44,17 +44,20 @@ ...@@ -44,17 +44,20 @@
</view> </view>
</view> </view>
<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, inde) in item.list" :key="inde">
<view class="bottomItem"> <view class="bottomItem">
<view class="items">仓位:{{ itm.LGPLA }}</view> <view class="items">仓位:{{ itm.LGPLA }}</view>
<view class="items">存储地点:{{ itm.LGOBE }}</view> <view class="items">存储地点:{{ itm.LGOBE }}</view>
</view> </view>
<view class="boxRight"> <view class="boxRight">
<view class="items">{{ itm.MENGA }} / {{itm.PACMG}} {{itm.MEINS}}</view> <view class="items">
<view class="itemsBtn"> <u-input v-model="itm.MENGA" style="width: 120rpx;"/>
<view>/ {{itm.PACMG}} {{itm.MEINS}}</view>
</view>
<!-- <view class="itemsBtn">
<u-button size="mini" class="" type="primary" @click="checkShowModel = true">盘点 <u-button size="mini" class="" type="primary" @click="checkShowModel = true">盘点
</u-button> </u-button>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -127,6 +130,15 @@ ...@@ -127,6 +130,15 @@
} }
}) })
}, },
computed: {
sumMENGA(){
return function(item){
return item.list.reduce((pre, item) => {
return pre + Number(item['MENGA'])
}, 0)
}
}
},
methods: { methods: {
setGoodsList() { setGoodsList() {
this.goodsList = this.inventoryList.reduce((acc, cur) => { this.goodsList = this.inventoryList.reduce((acc, cur) => {
...@@ -149,7 +161,13 @@ ...@@ -149,7 +161,13 @@
}, []) }, [])
}, },
handleInput(e) { handleInput(e) {
console.log(e, 'eee'); this.goodsList.forEach(element => {
element.list.forEach(item => {
if (item['PLNR'] === e) {
item.MENGA = item.PACMG
}
})
})
}, },
toggleShow(item, index) { toggleShow(item, index) {
console.log('触发了当前选项!', item) console.log('触发了当前选项!', item)
...@@ -157,8 +175,30 @@ ...@@ -157,8 +175,30 @@
this.$set(this.goodsList, index, item) this.$set(this.goodsList, index, item)
}, },
getBtnHandle(row) { getBtnHandle(row) {
console.log('getBtnHandle', row); let params
this[row.way](); if (this.isIm) {
params = {
RDATA_IM: this.inventoryList,
RDATA_WM: []
}
} else {
params = {
RDATA_IM: [],
RDATA_WM: this.inventoryList
}
}
this.$u.api.sapApi
.postInventory(params)
.then((res) => {
if(res && res[0]) {
if (res[0]['TYPE'] === 'S') {
this[row.way]();
} else {
this.$u.toast(res[0].MESSAGE)
}
}
})
}, },
goBack() { goBack() {
console.log('返回了'); console.log('返回了');
...@@ -270,6 +310,8 @@ ...@@ -270,6 +310,8 @@
font-size: 24rpx; font-size: 24rpx;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
align-items: center;
display: flex;
} }
.itemsBtn { .itemsBtn {
...@@ -299,4 +341,4 @@ ...@@ -299,4 +341,4 @@
padding: 0; padding: 0;
} }
} }
</style> </style>
...@@ -75,13 +75,7 @@ export default { ...@@ -75,13 +75,7 @@ export default {
}, },
methods: { methods: {
getList(params) { getList(params) {
this.params = params || { this.params = params
IBLNR: "",
GJAHR: "2024",
IVNUM: "28",
NVERS: "00",
FLAG: 'X'
}
this.$u.api.sapApi this.$u.api.sapApi
.sapInventory(this.params) .sapInventory(this.params)
.then((res) => { .then((res) => {
......
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