|
|
@ -2,7 +2,7 @@ |
|
|
|
<page-meta root-font-size="18px"></page-meta> |
|
|
|
<view class=""> |
|
|
|
<win-blank-view @goScan='openScanPopup' v-if="allDataList.length==0"></win-blank-view> |
|
|
|
<scroll-view scroll-y class="scroll-detail" style="margin-top: 10rpx;padding-bottom:100px" > |
|
|
|
<scroll-view scroll-y class="scroll-detail" style="margin-top: 10rpx;padding-bottom:100px"> |
|
|
|
<view class="detail-list " v-for="(item, index) in allDataList" :key="index"> |
|
|
|
<view class="detail-content"> |
|
|
|
<view class="" style=""> |
|
|
@ -18,6 +18,14 @@ |
|
|
|
<uni-td align="center">箱码</uni-td> |
|
|
|
<uni-td>{{item.packingCode}}</uni-td> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-td align="center">批次</uni-td> |
|
|
|
<uni-td>{{item.lot}}</uni-td> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-td align="center">库位</uni-td> |
|
|
|
<uni-td>{{item.recommendLocationCode}}</uni-td> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-td align="center">单位</uni-td> |
|
|
|
<uni-td>{{item.uom}}</uni-td> |
|
|
@ -119,7 +127,7 @@ |
|
|
|
return { |
|
|
|
options: [], |
|
|
|
currentItem: {}, |
|
|
|
toLocationInfo:{}, |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationCode: "", |
|
|
|
allCount: 0, |
|
|
|
allDataList: [], |
|
|
@ -133,8 +141,7 @@ |
|
|
|
props: { |
|
|
|
|
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
}, |
|
|
|
onLoad() {}, |
|
|
|
onPullDownRefresh() { |
|
|
|
uni.stopPullDownRefresh() |
|
|
|
}, |
|
|
@ -152,7 +159,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value <= 0) { |
|
|
|
this.showMessage('退货数量必须大于0') |
|
|
@ -165,7 +172,7 @@ |
|
|
|
if (res) { |
|
|
|
this.allDataList.splice(index, 1); |
|
|
|
this.allCount = this.allDataList.length; |
|
|
|
var title =this.allCount>0?"客户退货"+"("+this.allCount+")":"客户退货" |
|
|
|
var title = this.allCount > 0 ? "客户退货箱码" + "(" + this.allCount + ")" : "客户退货箱码" |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: title |
|
|
|
}) |
|
|
@ -175,7 +182,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
var resultData =result.data |
|
|
|
var resultData = result.data |
|
|
|
var filterItem = this.allDataList.filter(res => { |
|
|
|
if (res.packingCode == resultData.code) { |
|
|
|
return res; |
|
|
@ -186,23 +193,41 @@ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
var item = { |
|
|
|
packingCode:resultData.code, |
|
|
|
itemCode: resultData.itemCode, |
|
|
|
itemName: resultData.itemName, |
|
|
|
itemDesc1: resultData.itemDesc1, |
|
|
|
stdPackQty: resultData.stdPackQty, |
|
|
|
uom: resultData.uom, |
|
|
|
qty: resultData.stdPackQty |
|
|
|
locations(resultData.recommendLocationCode).then(res => { |
|
|
|
if (res) { |
|
|
|
//不用隔离、在途、待检 |
|
|
|
if (res.type == 1 || res.type == 6 || res.type == 13) { |
|
|
|
that.showMessage("来源库位不可以是待检、隔离、在途库位类型"); |
|
|
|
} else { |
|
|
|
var item = { |
|
|
|
packingCode: resultData.code, |
|
|
|
itemCode: resultData.itemCode, |
|
|
|
itemName: resultData.itemName, |
|
|
|
itemDesc1: resultData.itemDesc1, |
|
|
|
stdPackQty: resultData.stdPackQty, |
|
|
|
lot:resultData.lot, |
|
|
|
recommendLocationCode:resultData.recommendLocationCode, |
|
|
|
uom: resultData.uom, |
|
|
|
qty: resultData.qty |
|
|
|
|
|
|
|
} |
|
|
|
this.allDataList.unshift(item) |
|
|
|
this.allCount = this.allDataList.length; |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "客户退货箱码" + "(" + this.allCount + ")" |
|
|
|
}) |
|
|
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showMessage('来源库位【' + resultData.recommendLocationCode + '】不存在'); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
this.allDataList.unshift(item) |
|
|
|
this.allCount = this.allDataList.length; |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "客户退货"+"("+this.allCount+")" |
|
|
|
}).catch(err => { |
|
|
|
this.showMessage(err.message); |
|
|
|
}) |
|
|
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -215,16 +240,27 @@ |
|
|
|
locations(locationCode).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res) { |
|
|
|
this.toLocationInfo =res; |
|
|
|
this.toLocationCode = res.code |
|
|
|
if (res.type == 2) { |
|
|
|
this.toLocationInfo = res; |
|
|
|
this.toLocationCode = res.code |
|
|
|
} else { |
|
|
|
this.toLocationInfo = {} |
|
|
|
this.toLocationCode = "" |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
this.showMessage('目标库位必须是原料库位类型'); |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.toLocationInfo = {} |
|
|
|
this.toLocationCode = "" |
|
|
|
this.showMessage('目标库位【' + locationCode + '】不存在'); |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
uni.hideLoading(); |
|
|
|
this.toLocationInfo={} |
|
|
|
this.toLocationInfo = {} |
|
|
|
this.toLocationCode = "" |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
this.showMessage(err.message); |
|
|
|
|
|
|
|
}) |
|
|
@ -244,9 +280,9 @@ |
|
|
|
this.showMessage('请扫描目标库位'); |
|
|
|
return; |
|
|
|
} |
|
|
|
var checkQtyItem =this.checkQty() |
|
|
|
if(checkQtyItem!=undefined){ |
|
|
|
this.showMessage("【"+checkQtyItem.itemCode+'】数量为0,退货数量必须大于0'); |
|
|
|
var checkQtyItem = this.checkQty() |
|
|
|
if (checkQtyItem != undefined) { |
|
|
|
this.showMessage("【" + checkQtyItem.itemCode + '】数量为0,退货数量必须大于0'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -256,27 +292,26 @@ |
|
|
|
}); |
|
|
|
|
|
|
|
let params = this.setSubmitParam(); |
|
|
|
console.log( JSON.stringify(params) ) |
|
|
|
console.log(JSON.stringify(params)) |
|
|
|
customerReturnCommit(params) |
|
|
|
.then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showCommitSuccess(); |
|
|
|
this.clearInfo(); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showMessage(err.message); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
checkQty(){ |
|
|
|
var isCheck =true; |
|
|
|
var result =undefined |
|
|
|
|
|
|
|
checkQty() { |
|
|
|
var isCheck = true; |
|
|
|
var result = undefined |
|
|
|
for (let item of this.allDataList) { |
|
|
|
if(item.qty==0){ |
|
|
|
result =item |
|
|
|
if (item.qty == 0) { |
|
|
|
result = item |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
@ -296,16 +331,19 @@ |
|
|
|
uom: res.uom, |
|
|
|
qty: res.qty, |
|
|
|
stdPackQty: res.stdPackQty, |
|
|
|
toLocationCode:this.toLocationCode, |
|
|
|
toLocationArea:this.toLocationInfo.areaCode, |
|
|
|
toLocationGroup:this.toLocationInfo.locationGroupCode, |
|
|
|
toLocationErpCode:this.toLocationInfo.erpLocationCode, |
|
|
|
recommendPackingCode :res.packingCode, |
|
|
|
handledPackingCode :res.packingCode |
|
|
|
toLocationCode: this.toLocationCode, |
|
|
|
toLocationArea: this.toLocationInfo.areaCode, |
|
|
|
toLocationGroup: this.toLocationInfo.locationGroupCode, |
|
|
|
toLocationErpCode: this.toLocationInfo.erpLocationCode, |
|
|
|
recommendPackingCode: res.packingCode, |
|
|
|
recommendLot: res.lot, |
|
|
|
handledPackingCode: res.packingCode, |
|
|
|
handledLot: res.lot, |
|
|
|
handledQty:res.qty |
|
|
|
} |
|
|
|
item.details.push(detail) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return item; |
|
|
|
|
|
|
|
}, |
|
|
@ -405,12 +443,12 @@ |
|
|
|
|
|
|
|
clearInfo() { |
|
|
|
this.allDataList = []; |
|
|
|
this.toLocationInfo={} |
|
|
|
this.toLocationInfo = {} |
|
|
|
this.toLocationCode = ""; |
|
|
|
this.allCount = 0; |
|
|
|
this.loadingType = "" |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "客户退货" |
|
|
|
title: "客户退货箱码" |
|
|
|
}) |
|
|
|
this.$refs.comCollapseLocation.clearLocation(); |
|
|
|
}, |
|
|
|