|
|
@ -8,7 +8,7 @@ |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class=""> |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="jobContent" |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" |
|
|
|
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" |
|
|
|
@removePack="removePack"> |
|
|
|
</record-com-detail-card> |
|
|
@ -17,13 +17,12 @@ |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
|
<view class=""> |
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
</view> |
|
|
|
<view class=" uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
@ -33,7 +32,7 @@ |
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' headerType="HPQ,HMQ"></win-scan-pack-and-location> |
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
@ -44,7 +43,6 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
getBasicCustomerList, |
|
|
|
customerReturnRequestSubmit, |
|
|
|
customerReturnRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
import { |
|
|
@ -53,12 +51,12 @@ |
|
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getManagementPrecisions |
|
|
|
getPrecisionStrategyList |
|
|
|
} from '@/common/balance.js'; |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
updateTitle, |
|
|
|
getPackingNumberAndBatch |
|
|
|
getPackingNumberAndBatchByList |
|
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -98,35 +96,21 @@ |
|
|
|
received: false, |
|
|
|
isShowPackingCode: true, |
|
|
|
scanCount: 0, |
|
|
|
jobContent: {}, //任务内容 |
|
|
|
dataContent: {}, //任务内容 |
|
|
|
subList: [], //接口返回的任务subList |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
locationTypeList: [], |
|
|
|
toLocationInfo: {}, |
|
|
|
businessType: {}, |
|
|
|
fromLocationInfo: {}, |
|
|
|
fromLocationCode: "", |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationCode: "", |
|
|
|
isShowLocation: false, |
|
|
|
fromlocationTypeList: [], |
|
|
|
tolocationTypeList: [], |
|
|
|
allowModifyLocation: false, |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
fromType :"", |
|
|
|
showToLoaction:true |
|
|
|
managementList: [], |
|
|
|
toWarehouseCode:'' |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.fromType = option.fromType |
|
|
|
if(this.fromType=="requestType"){ |
|
|
|
var typeCode = "CustomerreturnRequest"
updateTitle("客户退货申请") |
|
|
|
this.showToLoaction = false;
}else { |
|
|
|
var typeCode = "CustomerreturnRecord" |
|
|
|
updateTitle("客户退货记录") |
|
|
|
this.showToLoaction = true;
} |
|
|
|
|
|
|
|
var typeCode ="CustomerreturnRecord" |
|
|
|
getBusinessType(typeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
@ -134,7 +118,7 @@ |
|
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
} else { |
|
|
|
this.$refs.comMessage.showBreakMessage(res.message ); |
|
|
|
this.showErrorMessage(res.message ) |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -265,96 +249,118 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.showToLoaction &&this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
|
} |
|
|
|
commit() { |
|
|
|
|
|
|
|
if (this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
//查询管理模式 |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
this.managementList = []; |
|
|
|
var precisionStrategParams = this.setPrecisionStrategParams() |
|
|
|
|
|
|
|
getPrecisionStrategyList(precisionStrategParams, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams() |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
customerReturnRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成客户退货记录<br>" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
|
|
|
|
if(this.fromType=="requestType"){ |
|
|
|
var params = this.setParams(false) |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// putawayRequestSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
}else { |
|
|
|
//记录有目标库位,需要查询管理模式 |
|
|
|
var itemCodes = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
itemCodes.push(item.itemCode) |
|
|
|
}) |
|
|
|
//获取管理模式,封装参数 |
|
|
|
getManagementPrecisions(itemCodes, this.toLocationCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.managementList = res.list; |
|
|
|
var params = this.setParams(true) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
// putawayRecordSubmit(params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// this.showCommitSuccessMessage("提交成功<br>生成采购收货记录" + res.data, ) |
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
uni.hideLoading(); |
|
|
|
this.showErrorMessage(res.message); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}) |
|
|
|
|
|
|
|
setParams(queryModel) { |
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
// var subItem = {}; |
|
|
|
// Object.assign(subItem, detail) |
|
|
|
if (queryModel) { |
|
|
|
var info = getPackingNumberAndBatch(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.batch); |
|
|
|
detail.toPackingNumber = info.packingNumber;; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = info.batch; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = this.toLocationCode |
|
|
|
} else { |
|
|
|
detail.toPackingNumber = detail.packingNumber; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
detail.toBatch = detail.toBatch; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus |
|
|
|
detail.toLocationCode = "" |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
setPrecisionStrategParams() { |
|
|
|
var itemList = [] |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
detail.toLocationCode = this.toLocationCode; |
|
|
|
var filterResult = itemList.filter(res => { |
|
|
|
if (res.itemCode == item.itemCode && |
|
|
|
detail.toLocationCode == res.locationCode) { |
|
|
|
return res |
|
|
|
} |
|
|
|
}) |
|
|
|
//去掉重复元素 |
|
|
|
if (filterResult.length == 0) { |
|
|
|
var result = { |
|
|
|
itemCode: item.itemCode, |
|
|
|
locationCode: detail.toLocationCode |
|
|
|
} |
|
|
|
itemList.push(result) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
this.jobContent.subList = subList |
|
|
|
this.jobContent.creator = creator; |
|
|
|
return this.jobContent; |
|
|
|
}, |
|
|
|
}) |
|
|
|
return itemList; |
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
|
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
if (detail.scaned) { |
|
|
|
var info = getPackingNumberAndBatchByList(this.managementList, detail.itemCode, |
|
|
|
detail.packingNumber, detail.toLocationCode, detail.batch); |
|
|
|
detail.itemCode = detail.itemCode; |
|
|
|
detail.itemName = detail.package.itemName; |
|
|
|
detail.itemDesc1 = detail.package.itemDesc1; |
|
|
|
detail.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
detail.inventoryStatus = detail.inventoryStatus; |
|
|
|
detail.toInventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
|
|
detail.fromPackingNumber = info.packingNumber; |
|
|
|
detail.toPackingNumber = info.packingNumber; |
|
|
|
|
|
|
|
detail.fromContainerNumber = detail.containerNumber; |
|
|
|
detail.toContainerNumber = detail.containerNumber |
|
|
|
|
|
|
|
detail.fromBatch = info.batch; |
|
|
|
detail.toBatch = info.batch; |
|
|
|
|
|
|
|
detail.fromLocationCode = detail.locationCode; |
|
|
|
detail.toLocationCode = detail.toLocationCode; |
|
|
|
|
|
|
|
subList.push(detail) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.dataContent.subList = subList; |
|
|
|
this.dataContent.creator = creator; |
|
|
|
this.dataContent.fromWarehouseCode = this.detailSource[0].subList[0].warehouseCode; |
|
|
|
this.dataContent.toWarehouseCode = this.toWarehouseCode; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
@ -385,25 +391,21 @@ |
|
|
|
this.getFromLocationCode(location, code) |
|
|
|
}, |
|
|
|
getFromLocationCode(location, code) { |
|
|
|
this.fromLocationInfo = location; |
|
|
|
this.fromLocationCode = code; |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getToLocationCode(location, code) { |
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
uni.showToast({ |
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.toLocationCodeInfo = location; |
|
|
|
this.toLocationCode = code; |
|
|
|
}, |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.subList = []; |
|
|
|
this.detailSource = []; |
|
|
|
this.toLocationCode = ''; |
|
|
|
this.dataContent = {} |
|
|
|
this.toWarehouseCode = "" |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|