|
|
@ -1,8 +1,20 @@ |
|
|
|
<template> |
|
|
|
<page-meta root-font-size="18px"></page-meta> |
|
|
|
<view class=""> |
|
|
|
<view class="" style="display: flex; flex-direction: column;"> |
|
|
|
<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" > |
|
|
|
|
|
|
|
<view class="uni-flex uni-row " style="align-items: center; justify-content: space-between;" |
|
|
|
v-if="allDataList.length>0"> |
|
|
|
<view class="" style=" font-size: 35rpx; margin-left: 20rpx; font-weight: bold;"> |
|
|
|
退货客户 : {{customerCode}} |
|
|
|
</view> |
|
|
|
<view class="" style="margin-right: 20rpx; margin-top: 10rpx;"> |
|
|
|
<button type="primary" @click="seletCustomer" size="mini"> 选择客户 </button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<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=""> |
|
|
@ -64,6 +76,7 @@ |
|
|
|
</div> |
|
|
|
<win-scan-button @goScan='openScanPopup' v-if="allDataList.length>0"></win-scan-button> |
|
|
|
<winScanByProductCode ref="scanPackPopup" title="单件码" @getScanResult='getScanResult'></winScanByProductCode> |
|
|
|
<wz-select-popup ref="wzSelectPopup" @select="selectCheckbox" title="选择客户" :isShowItem="false" /> |
|
|
|
<com-message ref="comMessage" @afterCloseScanMessage='closeScanMessage' @afterRescanMessage='afterRescan' |
|
|
|
@afterCloseCommitMessage='closeCommitMessage'> |
|
|
|
</com-message> |
|
|
@ -76,12 +89,15 @@ |
|
|
|
getBalancesByFilterAsync, |
|
|
|
getWipListAsync, |
|
|
|
customerReturnCommit, |
|
|
|
getCustomerList |
|
|
|
} from '@/api/index.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
showConfirmMsg, |
|
|
|
goHome, |
|
|
|
getRemoveOption |
|
|
|
getRemoveOption, |
|
|
|
scanSuccessAudio, |
|
|
|
scanFailedAudio |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import winBlankView from '@/mycomponents/wincom/winBlankView.vue' |
|
|
@ -119,7 +135,7 @@ |
|
|
|
return { |
|
|
|
options: [], |
|
|
|
currentItem: {}, |
|
|
|
toLocationInfo:{}, |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationCode: "", |
|
|
|
allCount: 0, |
|
|
|
allDataList: [], |
|
|
@ -128,6 +144,13 @@ |
|
|
|
old: { |
|
|
|
scrollTop: 0 |
|
|
|
}, |
|
|
|
customerList: ['客户1', '客户2'], |
|
|
|
customerCode: '', |
|
|
|
userForm: { |
|
|
|
names: [], |
|
|
|
values: [], |
|
|
|
origin: [] |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: { |
|
|
@ -155,7 +178,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
|
|
|
|
qtyChanged(value, item, index) { |
|
|
|
if (value <= 0) { |
|
|
|
this.showMessage('退货数量必须大于0') |
|
|
@ -168,7 +191,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 |
|
|
|
}) |
|
|
@ -177,6 +200,47 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
seletCustomer() { |
|
|
|
this.$refs.wzSelectPopup.open({ |
|
|
|
mode: 'radio', //radio checkbox 单选、多选 |
|
|
|
// dataList:[], //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig |
|
|
|
selected: this.userForm.values, //已选中的数据 |
|
|
|
proxyConfig: { //组件内部代理请求数据配置 |
|
|
|
reqFun: this.reqGetList, //请求方法,在方法中请返回Promise.resolve([]) |
|
|
|
localPaging: false //前端本地分页 |
|
|
|
}, |
|
|
|
search: { |
|
|
|
type: 'remote', //local本地数据搜索 | remote请求接口 |
|
|
|
}, |
|
|
|
fields: { |
|
|
|
label: 'name', |
|
|
|
value: 'code' |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
reqGetList(data) { |
|
|
|
var params = { |
|
|
|
condition: { |
|
|
|
filters: [{ |
|
|
|
logic: "And", |
|
|
|
column: "code", |
|
|
|
action: "Like", |
|
|
|
value: data.searchValue |
|
|
|
}] |
|
|
|
}, |
|
|
|
Sorting: "", |
|
|
|
SkipCount: (data.pageIndex-1)*data.pageSize, |
|
|
|
MaxResultCount: data.pageSize |
|
|
|
} |
|
|
|
return getCustomerList(params); |
|
|
|
}, |
|
|
|
|
|
|
|
selectCheckbox(mode, resultData){ |
|
|
|
console.log(mode, resultData) |
|
|
|
this.customerCode =resultData.code |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
var filterItem = this.allDataList.filter(res => { |
|
|
|
if (res.itemCode == result.itemCode) { |
|
|
@ -200,9 +264,9 @@ |
|
|
|
this.allDataList.unshift(item) |
|
|
|
this.allCount = this.allDataList.length; |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "客户退货单件码"+"("+this.allCount+")" |
|
|
|
title: "客户退货单件码" + "(" + this.allCount + ")" |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
|
|
|
|
@ -216,15 +280,18 @@ |
|
|
|
locations(locationCode).then(res => { |
|
|
|
uni.hideLoading(); |
|
|
|
if (res) { |
|
|
|
this.toLocationInfo =res; |
|
|
|
this.toLocationInfo = res; |
|
|
|
this.toLocationCode = res.code |
|
|
|
scanSuccessAudio() |
|
|
|
} else { |
|
|
|
scanFailedAudio() |
|
|
|
this.showMessage('目标库位【' + locationCode + '】不存在'); |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
scanFailedAudio() |
|
|
|
uni.hideLoading(); |
|
|
|
this.toLocationInfo={} |
|
|
|
this.toLocationInfo = {} |
|
|
|
this.toLocationCode = "" |
|
|
|
this.showMessage(err.message); |
|
|
|
|
|
|
@ -245,9 +312,16 @@ |
|
|
|
this.showMessage('请扫描目标库位'); |
|
|
|
return; |
|
|
|
} |
|
|
|
var checkQtyItem =this.checkQty() |
|
|
|
if(checkQtyItem!=undefined){ |
|
|
|
this.showMessage("【"+checkQtyItem.itemCode+'】数量为0,退货数量必须大于0'); |
|
|
|
|
|
|
|
if (this.customerCode == "") { |
|
|
|
this.showMessage('请选择客户'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var checkQtyItem = this.checkQty() |
|
|
|
if (checkQtyItem != undefined) { |
|
|
|
this.showMessage("【" + checkQtyItem.itemCode + '】数量为0,退货数量必须大于0'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
@ -257,27 +331,27 @@ |
|
|
|
}); |
|
|
|
|
|
|
|
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 |
|
|
|
} |
|
|
|
} |
|
|
@ -287,6 +361,7 @@ |
|
|
|
setSubmitParam() { |
|
|
|
let item = { |
|
|
|
worker: localStorage.userName_CN == "" ? localStorage.userName : localStorage.userName_CN, |
|
|
|
customerCode: this.customerCode, |
|
|
|
details: [] |
|
|
|
} |
|
|
|
this.allDataList.forEach(res => { |
|
|
@ -297,14 +372,14 @@ |
|
|
|
uom: res.uom, |
|
|
|
qty: res.qty, |
|
|
|
stdPackQty: res.stdPackQty, |
|
|
|
toLocationCode:this.toLocationCode, |
|
|
|
toLocationArea:this.toLocationInfo.areaCode, |
|
|
|
toLocationGroup:this.toLocationInfo.locationGroupCode, |
|
|
|
toLocationErpCode:this.toLocationInfo.erpLocationCode |
|
|
|
toLocationCode: this.toLocationCode, |
|
|
|
toLocationArea: this.toLocationInfo.areaCode, |
|
|
|
toLocationGroup: this.toLocationInfo.locationGroupCode, |
|
|
|
toLocationErpCode: this.toLocationInfo.erpLocationCode |
|
|
|
} |
|
|
|
item.details.push(detail) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return item; |
|
|
|
|
|
|
|
}, |
|
|
@ -404,10 +479,11 @@ |
|
|
|
|
|
|
|
clearInfo() { |
|
|
|
this.allDataList = []; |
|
|
|
this.toLocationInfo={} |
|
|
|
this.toLocationInfo = {} |
|
|
|
this.toLocationCode = ""; |
|
|
|
this.allCount = 0; |
|
|
|
this.loadingType = "" |
|
|
|
this.customerCode = "" |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: "客户退货单件码" |
|
|
|
}) |
|
|
|