|
@ -8,7 +8,7 @@ |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
<view class=""> |
|
|
<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" |
|
|
:isShowLocation="true" @removeItem="removeItem(index,item)" @updateData="updateData" |
|
|
@removePack="removePack"> |
|
|
@removePack="removePack"> |
|
|
</record-com-detail-card> |
|
|
</record-com-detail-card> |
|
@ -17,13 +17,12 @@ |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<requiredLocation v-if="showToLoaction" title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
|
|
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
<view class="page-footer"> |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
<view class=""> |
|
|
<view class=""> |
|
|
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
|
|
:locationTypeList="tolocationTypeList"></requiredLocation> |
|
|
</view> |
|
|
</view> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<view class=" uni-flex uni-row"> |
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
<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> |
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</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> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
@ -44,7 +43,6 @@ |
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
|
getBasicCustomerList, |
|
|
getBasicCustomerList, |
|
|
customerReturnRequestSubmit, |
|
|
|
|
|
customerReturnRecordSubmit |
|
|
customerReturnRecordSubmit |
|
|
} from '@/api/request2.js'; |
|
|
} from '@/api/request2.js'; |
|
|
import { |
|
|
import { |
|
@ -53,12 +51,12 @@ |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
|
getManagementPrecisions |
|
|
getPrecisionStrategyList |
|
|
} from '@/common/balance.js'; |
|
|
} from '@/common/balance.js'; |
|
|
import { |
|
|
import { |
|
|
goHome, |
|
|
goHome, |
|
|
updateTitle, |
|
|
updateTitle, |
|
|
getPackingNumberAndBatch |
|
|
getPackingNumberAndBatchByList |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -98,35 +96,21 @@ |
|
|
received: false, |
|
|
received: false, |
|
|
isShowPackingCode: true, |
|
|
isShowPackingCode: true, |
|
|
scanCount: 0, |
|
|
scanCount: 0, |
|
|
jobContent: {}, //任务内容 |
|
|
dataContent: {}, //任务内容 |
|
|
subList: [], //接口返回的任务subList |
|
|
subList: [], //接口返回的任务subList |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
locationTypeList: [], |
|
|
locationTypeList: [], |
|
|
toLocationInfo: {}, |
|
|
|
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
fromLocationInfo: {}, |
|
|
|
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
toLocationInfo: {}, |
|
|
|
|
|
toLocationCode: "", |
|
|
toLocationCode: "", |
|
|
isShowLocation: false, |
|
|
|
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
allowModifyLocation: false, |
|
|
managementList: [], |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
toWarehouseCode:'' |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
|
|
fromType :"", |
|
|
|
|
|
showToLoaction:true |
|
|
|
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
this.fromType = option.fromType |
|
|
var typeCode ="CustomerreturnRecord" |
|
|
if(this.fromType=="requestType"){ |
|
|
|
|
|
var typeCode = "CustomerreturnRequest"
updateTitle("客户退货申请") |
|
|
|
|
|
this.showToLoaction = false;
}else { |
|
|
|
|
|
var typeCode = "CustomerreturnRecord" |
|
|
|
|
|
updateTitle("客户退货记录") |
|
|
|
|
|
this.showToLoaction = true;
} |
|
|
|
|
|
|
|
|
|
|
|
getBusinessType(typeCode, res => { |
|
|
getBusinessType(typeCode, res => { |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.businessType = res.businessType; |
|
|
this.businessType = res.businessType; |
|
@ -134,7 +118,7 @@ |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.showFromLocationPopup(); |
|
|
this.showFromLocationPopup(); |
|
|
} else { |
|
|
} else { |
|
|
this.$refs.comMessage.showBreakMessage(res.message ); |
|
|
this.showErrorMessage(res.message ) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -265,96 +249,118 @@ |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.showToLoaction &&this.toLocationCode == "") { |
|
|
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.toLocationCode == "") { |
|
|
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
|
|
//查询管理模式 |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "提交中....", |
|
|
title: "提交中....", |
|
|
mask: true |
|
|
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"){ |
|
|
} else { |
|
|
var params = this.setParams(false) |
|
|
uni.hideLoading(); |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
this.showErrorMessage(res.message); |
|
|
// 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); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}) |
|
|
|
|
|
|
|
|
setParams(queryModel) { |
|
|
} else { |
|
|
var subList = [] |
|
|
this.showErrorMessage("没有要提交的数据,请先扫描") |
|
|
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 = "" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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 itemList; |
|
|
return this.jobContent; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
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) { |
|
|
showMessage(message) { |
|
@ -385,25 +391,21 @@ |
|
|
this.getFromLocationCode(location, code) |
|
|
this.getFromLocationCode(location, code) |
|
|
}, |
|
|
}, |
|
|
getFromLocationCode(location, code) { |
|
|
getFromLocationCode(location, code) { |
|
|
this.fromLocationInfo = location; |
|
|
|
|
|
this.fromLocationCode = code; |
|
|
this.fromLocationCode = code; |
|
|
this.openScanPopup(); |
|
|
this.openScanPopup(); |
|
|
}, |
|
|
}, |
|
|
getToLocationCode(location, code) { |
|
|
getToLocationCode(location, code) { |
|
|
if (this.fromLocationCode == code) { |
|
|
|
|
|
uni.showToast({ |
|
|
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
|
|
duration: 2000 |
|
|
|
|
|
}) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.toLocationCodeInfo = location; |
|
|
|
|
|
this.toLocationCode = code; |
|
|
this.toLocationCode = code; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.fromLocationCode = ''; |
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
this.subList = []; |
|
|
|
|
|
this.detailSource = []; |
|
|
|
|
|
this.toLocationCode = ''; |
|
|
|
|
|
this.dataContent = {} |
|
|
|
|
|
this.toWarehouseCode = "" |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|