|
|
@ -32,15 +32,23 @@ |
|
|
|
<view class="text_lightblue font_xs">{{item.itemName }}</view> |
|
|
|
</view> |
|
|
|
<view class="ljh_right"> |
|
|
|
<text class="tnum">{{item.qty}}</text> |
|
|
|
<text class="tunit">{{item.uom}}</text> |
|
|
|
<view class="uni-flex uni-row u-col-center"> |
|
|
|
<com-number-box :ref="'comNumberBox_'+index" v-model="item.qty" |
|
|
|
:max="99999" :min="0" |
|
|
|
@change="qtyChanged($event,item,index)"> |
|
|
|
</com-number-box> |
|
|
|
<text class="" style="margin-left: 8rpx;">{{item.uom}}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- <text class="tnum">{{item.qty}}</text> --> |
|
|
|
|
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="cell_box"> |
|
|
|
<view class="uni-flex uni-row fl"> |
|
|
|
<view class="cell_info"> |
|
|
|
<view class="text_lightblue">源库位</view> |
|
|
|
<view class="text_lightblue">来源库位</view> |
|
|
|
<view class="text_black font_sm">{{ item.locationCode }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -106,6 +114,7 @@ |
|
|
|
import winCollapseLocation from '@/mycomponents/wincom/winCollapseLocation.vue' |
|
|
|
import SemiCollapseItem from '@/mycomponents/common/SemiCollapseItem.vue' |
|
|
|
import winScanByProductCode from '@/mycomponents/wincom/winScanByProductCode.vue' |
|
|
|
import comNumberBox from '@/mycomponents/common/comNumberBox.vue'; |
|
|
|
|
|
|
|
export default { |
|
|
|
name: 'returnToWarehouse', |
|
|
@ -120,7 +129,8 @@ |
|
|
|
comBalance, |
|
|
|
winCollapseLocation, |
|
|
|
SemiCollapseItem, |
|
|
|
winScanByProductCode |
|
|
|
winScanByProductCode, |
|
|
|
comNumberBox |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@ -239,6 +249,13 @@ |
|
|
|
let balanceParams = [this.fromLocation.code] |
|
|
|
|
|
|
|
let balanceRes = await getRecommendBalanceByLocationAsync(balanceParams, itemCode, false); |
|
|
|
//查询库存出错 |
|
|
|
if (balanceRes.error) { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showMessage(balanceRes.error.message) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (balanceRes.length == 0) { |
|
|
|
this.showScanMessage('零件【' + itemCode + '】在【' + this.fromLocation.code + |
|
|
|
'】库位没有库存信息,不可以退库'); |
|
|
@ -299,17 +316,26 @@ |
|
|
|
//扫描默认目标库位 |
|
|
|
getDefaultToLocation(locationCode) { |
|
|
|
let that = this; |
|
|
|
if (locationCode == this.fromLocation.code) { |
|
|
|
this.showMessage('来源库位【' + this.fromLocation.code + '】不能与目标库位【' + locationCode + '】相同'); |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
uni.showLoading({ |
|
|
|
title: "扫描中", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
locations(locationCode).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res == null) { |
|
|
|
that.showMessage('目标库位【' + locationCode + '】不存在'); |
|
|
|
} else { |
|
|
|
if (res.type == 2 || res.type == 3 || res.type == 4 || res.type == 6) { |
|
|
|
|
|
|
|
var locationType = res.type |
|
|
|
//不可以是待检、隔离、在途 |
|
|
|
if (locationType == 1 || locationType == 6 || locationType == 13) { |
|
|
|
that.showMessage('目标库位的库位类型不可以是【待检库】或【隔离库】或【在途】') |
|
|
|
} else { |
|
|
|
showConfirmMsg('是否要将所有未扫描目标库位的零件,指定目标库位【' + locationCode + '】', |
|
|
|
confirm => { |
|
|
|
if (confirm) { |
|
|
@ -324,11 +350,9 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
that.showMessage('目标库位的库位类型必须是【原料库】或【半成品库】或【成品库】或【隔离库】') |
|
|
|
} |
|
|
|
} |
|
|
|
uni.hideLoading(); |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
that.toLocation = null; |
|
|
|
that.showMessage(err.message); |
|
|
@ -341,8 +365,8 @@ |
|
|
|
this.showMessage('目标库位不能为空'); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (code == this.currentItem.fromLocationCode) { |
|
|
|
this.showMessage('源库位【' + this.currentItem.fromLocationCode + '】与目标库位【' + code + '】不能相同'); |
|
|
|
if (code == this.fromLocation.code) { |
|
|
|
this.showMessage('来源库位【' + this.fromLocation.code + '】不能与目标库位【' + code + '】相同'); |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
@ -512,6 +536,27 @@ |
|
|
|
return item; |
|
|
|
}, |
|
|
|
|
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value <= 0) { |
|
|
|
this.showMessage('退数量必须大于0') |
|
|
|
item.qty = item.totalQty |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.qty); |
|
|
|
} else { |
|
|
|
if (value > item.totalQty) { |
|
|
|
this.showMessage("退货数量[" + value + "]不能大于库存数量[" + item.totalQty + "]"); |
|
|
|
item.qty = item.totalQty |
|
|
|
this.$refs['comNumberBox_' + index][0].setValue(item.qty); |
|
|
|
} |
|
|
|
} |
|
|
|
this.itemList.forEach(res => { |
|
|
|
res.scanQty = 0 |
|
|
|
res.labelList.forEach(item => { |
|
|
|
res.scanQty = res.scanQty + value |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$forceUpdate() |
|
|
|
}, |
|
|
|
|
|
|
|
cancel() { |
|
|
|
let that = this; |
|
|
|
showConfirmMsg('是否要清空已扫描的零件和库位信息?', confirm => { |
|
|
@ -527,6 +572,7 @@ |
|
|
|
that.fromLocation = null; |
|
|
|
that.toLocation = null; |
|
|
|
that.defaultToLocation = null; |
|
|
|
that.currentItem = null; |
|
|
|
}, |
|
|
|
|
|
|
|
openScanPopup() { |
|
|
|