|
|
@ -27,13 +27,14 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan='showScanPopupPack'></win-scan-button> |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' allowModifyLocation="false"> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' :allowModifyLocation="false"> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<win-scan-location ref="scanLocationCode" title="来源库位" @getLocation='getLocation' |
|
|
|
:locationTypeList="fromlocationTypeList"></win-scan-location> |
|
|
|
<win-scan-button @goScan='showScanPopupPack'></win-scan-button> |
|
|
|
<win-scan-pack title="拆分标签" ref="scanPopupPack" @getResult='getScanPackResult'></win-scan-pack> |
|
|
|
<com-message ref="comMessage"></com-message> |
|
|
|
</view> |
|
|
@ -43,6 +44,9 @@ |
|
|
|
import { |
|
|
|
goHome, |
|
|
|
} from '@/common/basic.js'; |
|
|
|
import { |
|
|
|
splitPackageRecordSubmit |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
|
getInventoryStatusDesc, |
|
|
@ -87,27 +91,28 @@ |
|
|
|
locationTypeList: [], |
|
|
|
fromLocationCode: "", |
|
|
|
toLocationCode: "", |
|
|
|
isShowLocation: false, |
|
|
|
fromlocationTypeList: [], |
|
|
|
tolocationTypeList: [], |
|
|
|
allowModifyLocation: false, |
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
|
businessType: {} |
|
|
|
businessType: {}, |
|
|
|
dataContent: {}, |
|
|
|
currentItemCode: "", |
|
|
|
toPackingNumber: "" |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
// var typeCode = "SplitPackage" |
|
|
|
// getBusinessType(typeCode, res => { |
|
|
|
// if (res.success) { |
|
|
|
// this.businessType = res.businessType; |
|
|
|
// this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
|
// this.tolocationTypeList = res.tolocationTypeList; |
|
|
|
// this.showFromLocationPopup(); |
|
|
|
// } else { |
|
|
|
// this.$refs.comMessage.showBreakMessage(res.message); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
var typeCode = "SplitPackage" |
|
|
|
getBusinessType(typeCode, res => { |
|
|
|
if (res.success) { |
|
|
|
this.businessType = res.businessType; |
|
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
|
this.showFromLocationPopup(); |
|
|
|
} else { |
|
|
|
this.showErrorMessage(res.message) |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
//返回首页 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
@ -121,7 +126,7 @@ |
|
|
|
onPullDownRefresh() {}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.showFromLocationPopup(); |
|
|
|
// this.showFromLocationPopup(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
showScanPopupPack() { |
|
|
@ -160,7 +165,7 @@ |
|
|
|
var uom = result.package.uom; |
|
|
|
var item = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
if (item == undefined) { |
|
|
|
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
this.showErrorMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
} else { |
|
|
|
var temp = { |
|
|
|
scaned: true, |
|
|
@ -248,11 +253,7 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
commit() { |
|
|
|
if (this.toLocationCode == "") { |
|
|
|
this.showMessage("请先选择目标库位") |
|
|
|
return; |
|
|
|
} |
|
|
|
//允许部分提交 |
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
@ -260,20 +261,59 @@ |
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
// (this.id, params).then(res => { |
|
|
|
// uni.hideLoading() |
|
|
|
// if (res.data) { |
|
|
|
// var hint = res.data.Number; |
|
|
|
// this.showCommitSuccessMessage("提交成功" + hint, ) |
|
|
|
|
|
|
|
// } else { |
|
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// uni.hideLoading() |
|
|
|
// this.showErrorMessage(error) |
|
|
|
// }) |
|
|
|
splitPackageRecordSubmit(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) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("没有要提交的数据") |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
setParams() { |
|
|
|
|
|
|
|
var subList = [] |
|
|
|
var creator = this.$store.state.user.id |
|
|
|
this.detailSource.forEach(item => { |
|
|
|
item.subList.forEach(detail => { |
|
|
|
detail.Records.forEach(record => { |
|
|
|
if (record.scaned) { |
|
|
|
var subItem = {}; |
|
|
|
Object.assign(subItem, detail) |
|
|
|
subItem.itemCode = subItem.itemCode; |
|
|
|
subItem.itemName = detail.package.itemName; |
|
|
|
subItem.itemDesc1 = detail.package.itemDesc1; |
|
|
|
subItem.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
subItem.fromInventoryStatus = subItem.inventoryStatus; |
|
|
|
subItem.toInventoryStatus = subItem.inventoryStatus; |
|
|
|
subItem.fromQty = subItem.qty |
|
|
|
subItem.fromPackingNumber = subItem.packingNumber; |
|
|
|
subItem.toPackingNumber = record.packingNumber; |
|
|
|
|
|
|
|
subItem.fromBatch = subItem.batch; |
|
|
|
subItem.toBatch = record.batch; |
|
|
|
subItem.fromLocationCode = subItem.fromLocationCode; |
|
|
|
subItem.package = "" |
|
|
|
subItem.Records="" |
|
|
|
subList.push(subItem) |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
this.dataContent.subList = subList; |
|
|
|
this.dataContent.creator = creator; |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|
showMessage(message) { |
|
|
@ -320,7 +360,10 @@ |
|
|
|
|
|
|
|
showCommitSuccessMessage(hint) { |
|
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
this.detailSource = [] |
|
|
|
this.fromLocationCode = ''; |
|
|
|
this.currentItemCode = "" |
|
|
|
this.dataContent = {} |
|
|
|
|
|
|
|
}) |
|
|
|
}, |
|
|
|