|
@ -9,10 +9,11 @@ |
|
|
<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=""> |
|
|
<com-package-record :dataContent="item" @removeItem="removeItem(index,item)" |
|
|
<record-com-detail-card :dataContent="item" :index="index" |
|
|
@updateData="updateData" @removePack='updateData'> |
|
|
@removeItem="removeItem(index,item)" @updateData="updateData" @removePack="removePack"> |
|
|
</com-package-record> |
|
|
</record-com-detail-card> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<u-line /> |
|
|
</view> |
|
|
</view> |
|
|
</scroll-view> |
|
|
</scroll-view> |
|
|
</view> |
|
|
</view> |
|
@ -21,26 +22,28 @@ |
|
|
<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=""> |
|
|
|
|
|
|
|
|
</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> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
</view> |
|
|
</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-pack-and-location> |
|
|
<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> |
|
|
<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> |
|
|
<com-message ref="comMessage"></com-message> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import { |
|
|
|
|
|
overPackageRecordSubmit |
|
|
|
|
|
} from '@/api/request2.js'; |
|
|
import { |
|
|
import { |
|
|
goHome |
|
|
goHome |
|
|
} from '@/common/basic.js'; |
|
|
} from '@/common/basic.js'; |
|
@ -60,13 +63,13 @@ |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
import requiredLocation from '@/mycomponents/location/requiredLocation.vue' |
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
import comBlankView from '@/mycomponents/common/comBlankView.vue' |
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue" |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import comMessage from '@/mycomponents/common/comMessage.vue' |
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue" |
|
|
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' |
|
|
import recommendBalance from '@/mycomponents/balance/recommendBalance.vue' |
|
|
import comPackageRecord from '@/pages/package/coms/comPackageRecord.vue' |
|
|
import packageTarget from '@/mycomponents/package/packageTarget.vue' |
|
|
|
|
|
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
@ -78,8 +81,8 @@ |
|
|
comMessage, |
|
|
comMessage, |
|
|
winScanPackAndLocation, |
|
|
winScanPackAndLocation, |
|
|
recommendBalance, |
|
|
recommendBalance, |
|
|
recordComDetailCard, |
|
|
packageTarget, |
|
|
comPackageRecord |
|
|
recordComDetailCard |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
@ -88,27 +91,27 @@ |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
locationTypeList: [], |
|
|
locationTypeList: [], |
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
toLocationCode: "", |
|
|
isShowLocation: false, |
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
allowModifyLocation: false, |
|
|
|
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
businessType: {} |
|
|
businessType: {}, |
|
|
|
|
|
dataContent: {} |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
|
// var typeCode = "SplitPackage" |
|
|
var typeCode = "OverPackage" |
|
|
// getBusinessType(typeCode, res => { |
|
|
getBusinessType(typeCode, res => { |
|
|
// if (res.success) { |
|
|
if (res.success) { |
|
|
// this.businessType = res.businessType; |
|
|
this.businessType = res.businessType; |
|
|
// this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
// this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
// this.showFromLocationPopup(); |
|
|
this.showFromLocationPopup(); |
|
|
// } else { |
|
|
} else { |
|
|
// this.$refs.comMessage.showBreakMessage(res.message); |
|
|
this.showErrorMessage(res.message) |
|
|
// } |
|
|
} |
|
|
// }); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
//返回首页 |
|
|
//返回首页 |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
@ -121,11 +124,10 @@ |
|
|
|
|
|
|
|
|
onPullDownRefresh() {}, |
|
|
onPullDownRefresh() {}, |
|
|
|
|
|
|
|
|
mounted() { |
|
|
mounted() {}, |
|
|
this.showFromLocationPopup(); |
|
|
|
|
|
}, |
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
showScanPopupPack() { |
|
|
scanPopupPack() { |
|
|
this.$refs.scanPopupPack.openScanPopup(); |
|
|
this.$refs.scanPopupPack.openScanPopup(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -141,69 +143,35 @@ |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
newDetail.scaned = false; |
|
|
|
|
|
newDetail.Records = []; |
|
|
|
|
|
newDetail.handleQty = 0 |
|
|
|
|
|
itemp.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
|
this.detailSource.push(itemp) |
|
|
this.detailSource.push(itemp) |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") |
|
|
var detail = item.subList.find(r => { |
|
|
|
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
|
|
r.batch == balance.batch && |
|
|
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
|
|
|
return r; |
|
|
} |
|
|
} |
|
|
this.$refs.scanPopup.closeScanPopup(); |
|
|
}) |
|
|
this.showScanPopupPack(); |
|
|
if (detail == undefined) { |
|
|
}, |
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
|
|
item.subList.push(newDetail); |
|
|
getScanPackResult(result) { |
|
|
|
|
|
var packingNumber = result.label.packingNumber; |
|
|
|
|
|
var batch = result.label.batch; |
|
|
|
|
|
var qty = result.label.qty; |
|
|
|
|
|
var itemCode = result.label.itemCode; |
|
|
|
|
|
var uom = result.package.uom; |
|
|
|
|
|
var item = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
|
|
if (item == undefined) { |
|
|
|
|
|
this.showMessage("物料号【" + itemCode + "】不在列表中") |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
var temp = { |
|
|
if (detail.scaned == true) { |
|
|
scaned: true, |
|
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]已经在列表中") |
|
|
packingNumber: packingNumber, |
|
|
|
|
|
batch: batch, |
|
|
|
|
|
qty: Number(qty), |
|
|
|
|
|
LabelQty: Number(qty), |
|
|
|
|
|
stdPackUnit: result.package.stdPackUnit, |
|
|
|
|
|
stdPackQty: result.package.stdPackQty, |
|
|
|
|
|
uom: uom |
|
|
|
|
|
} |
|
|
} |
|
|
var sumQty = 0; |
|
|
|
|
|
item.subList[0].Records.forEach(function(item1, index) { |
|
|
|
|
|
sumQty += item1.qty; |
|
|
|
|
|
}); |
|
|
|
|
|
if ((Number(qty) + sumQty) > item.subList[0].qty) { |
|
|
|
|
|
this.showErrorMessage("扫描数量总和【" + (Number(qty) + sumQty) + "】(当前输入数量【" + qty + "】+已添加数量【" + |
|
|
|
|
|
sumQty + |
|
|
|
|
|
"】)已超过拆包箱码的数量【" + Number(item.subList[0].qty) + "】!"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
item.subList[0].Records.push(temp) |
|
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
|
} |
|
|
} |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
calcHandleQty() { |
|
|
calcHandleQty() { |
|
|
for (let detail of this.detailSource[0].subList) { |
|
|
calcHandleQty(this.detailSource) |
|
|
let hQty = 0; |
|
|
|
|
|
if (detail.Records.length > 0) { |
|
|
|
|
|
|
|
|
|
|
|
detail.Records.forEach(r => { |
|
|
|
|
|
hQty += Number(r.qty) |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
detail.handleQty = hQty; |
|
|
|
|
|
} |
|
|
|
|
|
this.$forceUpdate(); |
|
|
this.$forceUpdate(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
showErrorMessage(message) { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
this.$refs.comMessage.showErrorMessage(message, res => { |
|
|
if (res) { |
|
|
if (res) { |
|
@ -212,15 +180,21 @@ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateData() { |
|
|
updateData() { |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
}, |
|
|
}, |
|
|
removeItem(index, item) { |
|
|
removeItem(index, item) { |
|
|
this.detailSource.splice(index, 1) |
|
|
this.detailSource.splice(index, 1) |
|
|
}, |
|
|
}, |
|
|
|
|
|
removePack() { |
|
|
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
|
|
var item = this.detailSource[i]; |
|
|
|
|
|
if (item.subList.length == 0) { |
|
|
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
this.updateData(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
openScanPopup() { |
|
|
openScanPopup() { |
|
|
if (this.fromLocationCode == "") { |
|
|
if (this.fromLocationCode == "") { |
|
@ -248,11 +222,7 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.toLocationCode == "") { |
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
this.showMessage("请先选择目标库位") |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
//允许部分提交 |
|
|
|
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: "提交中....", |
|
|
title: "提交中....", |
|
|
mask: true |
|
|
mask: true |
|
@ -260,22 +230,52 @@ |
|
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
var params = this.setParams(); |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
// (this.id, params).then(res => { |
|
|
overPackageRecordSubmit(params).then(res => { |
|
|
// uni.hideLoading() |
|
|
uni.hideLoading() |
|
|
// if (res.data) { |
|
|
if (res.data) { |
|
|
// var hint = res.data.Number; |
|
|
this.showCommitSuccessMessage("提交成功<br>生成翻包记录<br>" + res.data) |
|
|
// this.showCommitSuccessMessage("提交成功" + hint, ) |
|
|
} else { |
|
|
|
|
|
this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
// } else { |
|
|
} |
|
|
// this.showErrorMessage("提交失败[" + res.msg + "]") |
|
|
}).catch(error => { |
|
|
// } |
|
|
uni.hideLoading() |
|
|
// }).catch(error => { |
|
|
this.showErrorMessage(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 => { |
|
|
|
|
|
if (detail.scaned) { |
|
|
|
|
|
var subItem = {}; |
|
|
|
|
|
Object.assign(subItem, detail) |
|
|
|
|
|
subItem.itemCode = detail.itemCode; |
|
|
|
|
|
subItem.itemName = detail.package.itemName; |
|
|
|
|
|
subItem.itemDesc1 = detail.package.itemDesc1; |
|
|
|
|
|
subItem.itemDesc2 = detail.package.itemDesc2; |
|
|
|
|
|
|
|
|
|
|
|
subItem.fromInventoryStatus = detail.inventoryStatus; |
|
|
|
|
|
subItem.fromQty = detail.qty |
|
|
|
|
|
subItem.fromPackingNumber = detail.packingNumber; |
|
|
|
|
|
subItem.fromBatch = detail.batch; |
|
|
|
|
|
subItem.fromLocationCode = detail.locationCode; |
|
|
|
|
|
subItem.package ="" |
|
|
|
|
|
subList.push(subItem) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
this.dataContent.subList = subList; |
|
|
|
|
|
this.dataContent.creator = creator; |
|
|
|
|
|
return this.dataContent; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
showMessage(message) { |
|
|
showMessage(message) { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
this.$refs.comMessage.showMessage(message, res => { |
|
|
if (res) {} |
|
|
if (res) {} |
|
@ -307,32 +307,62 @@ |
|
|
this.fromLocationCode = code; |
|
|
this.fromLocationCode = code; |
|
|
this.openScanPopup(); |
|
|
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) { |
|
|
showCommitSuccessMessage(hint) { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
this.$refs.comMessage.showSuccessMessage(hint, res => { |
|
|
|
|
|
this.detailSource = [] |
|
|
this.fromLocationCode = ''; |
|
|
this.fromLocationCode = ''; |
|
|
|
|
|
this.dataContent ={} |
|
|
|
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
updateData() { |
|
|
updateData() { |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
|
|
let item = this.detailSource[i]; |
|
|
|
|
|
if (item.qty == 0) { |
|
|
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
|
|
|
|
page { |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
background-color: #fff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.page-wraper { |
|
|
|
|
|
display: flex; |
|
|
|
|
|
flex-direction: column; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
height: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.page-main { |
|
|
|
|
|
flex: 1; |
|
|
|
|
|
position: relative; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.page-main-scroll { |
|
|
|
|
|
position: absolute; |
|
|
|
|
|
left: 0; |
|
|
|
|
|
right: 0; |
|
|
|
|
|
top: 0; |
|
|
|
|
|
bottom: 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.page-main-list { |
|
|
|
|
|
/* height: 80rpx; |
|
|
|
|
|
line-height: 80rpx; */ |
|
|
|
|
|
text-align: center; |
|
|
|
|
|
background: #e0e0e0; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |
|
|