|
@ -9,11 +9,13 @@ |
|
|
<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=""> |
|
|
<view class="" style="padding: 20rpx; font-size: 35rpx;"> |
|
|
<view class="" style="padding: 20rpx; font-size: 32rpx;"> |
|
|
<view> 来源库位 : {{item.subList[0].locationCode}} |
|
|
<view> 来源库位 : {{item.subList[0].locationCode}} |
|
|
</view> |
|
|
</view> |
|
|
<view> 来源包装规格 : {{getPackUnitName(packUnit)}} |
|
|
<view> 来源包装规格 : |
|
|
|
|
|
{{fromPackUnit}}/{{item.subList[0].packQty}}{{getUomInfo(item.subList[0].uom)}} |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<record-com-detail-card :dataContent="item" :index="index" |
|
|
<record-com-detail-card :dataContent="item" :index="index" |
|
@ -30,17 +32,19 @@ |
|
|
<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 class="uni-flex uni-row title u-col-center" style="font-size: 30rpx;"> |
|
|
<view class="uni-flex uni-row title u-col-center" style="font-size: 28rpx;"> |
|
|
<text>目标包装规格 :</text> |
|
|
<text>目标包装规格 :</text> |
|
|
<view class="uni-flex u-col-center uni-row" @click="showPackage"> |
|
|
<view class="uni-flex u-col-center uni-row" @click="showPackage"> |
|
|
<view class="" style="margin-left: 5rpx;width: 100%;"> |
|
|
<view class="" style="margin-left: 5rpx;width: 100%;"> |
|
|
{{toPackUnit}} |
|
|
{{toPackUnitShow}} |
|
|
</view> |
|
|
</view> |
|
|
<u-select v-model="show" mode="single-column" :list="packageList" |
|
|
<u-select v-model="show" mode="single-column" :list="packageList" |
|
|
@confirm="confirmSelect"></u-select> |
|
|
@confirm="confirmSelect"> |
|
|
|
|
|
|
|
|
|
|
|
</u-select> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
</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> |
|
@ -53,10 +57,10 @@ |
|
|
<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="fromLocationAreaTypeList"></win-scan-location> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { |
|
|
import { |
|
@ -70,7 +74,8 @@ |
|
|
import { |
|
|
import { |
|
|
getInventoryStatusDesc, |
|
|
getInventoryStatusDesc, |
|
|
getDirectoryItemArray, |
|
|
getDirectoryItemArray, |
|
|
getPackUnitName |
|
|
getPackUnitName, |
|
|
|
|
|
getUomInfo |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
import { |
|
|
import { |
|
@ -113,17 +118,18 @@ |
|
|
fromLocationCode: "", |
|
|
fromLocationCode: "", |
|
|
isShowLocation: false, |
|
|
isShowLocation: false, |
|
|
fromlocationTypeList: [], |
|
|
fromlocationTypeList: [], |
|
|
|
|
|
fromLocationAreaTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
tolocationTypeList: [], |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
inInventoryStatus: "", //目标入库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
outInventoryStatus: "", //来源出库库存状态 |
|
|
businessType: {}, |
|
|
businessType: {}, |
|
|
dataContent: {}, |
|
|
dataContent: {}, |
|
|
packUnit: "", |
|
|
fromPackUnit: "", |
|
|
packageList:[], |
|
|
packageList: [], |
|
|
show: false, |
|
|
show: false, |
|
|
toPackUnit:"包装规格", |
|
|
toPackUnitShow: "包装规格", |
|
|
toPackQty:"", |
|
|
toPackQty: "", |
|
|
itemCode:"" |
|
|
itemCode: "" |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
@ -132,13 +138,13 @@ |
|
|
if (res.success) { |
|
|
if (res.success) { |
|
|
this.businessType = res.businessType; |
|
|
this.businessType = res.businessType; |
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
this.fromlocationTypeList = res.fromlocationTypeList; |
|
|
|
|
|
this.fromLocationAreaTypeList = res.fromLocationAreaTypeList |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.tolocationTypeList = res.tolocationTypeList; |
|
|
this.showFromLocationPopup(); |
|
|
this.showFromLocationPopup(); |
|
|
} else { |
|
|
} else { |
|
|
this.showErrorMessage(res.message) |
|
|
this.showErrorMessage(res.message) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
// this.getPackUnitByItemCode("LENS") |
|
|
|
|
|
}, |
|
|
}, |
|
|
//返回首页 |
|
|
//返回首页 |
|
|
onNavigationBarButtonTap(e) { |
|
|
onNavigationBarButtonTap(e) { |
|
@ -154,61 +160,67 @@ |
|
|
mounted() {}, |
|
|
mounted() {}, |
|
|
|
|
|
|
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
getUomInfo(uom) { |
|
|
|
|
|
let item = getUomInfo(uom); |
|
|
|
|
|
if (item == '') { |
|
|
|
|
|
return uom; |
|
|
|
|
|
} else { |
|
|
|
|
|
return item.label |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
scanPopupPack() { |
|
|
scanPopupPack() { |
|
|
this.$refs.scanPopupPack.openScanPopup(); |
|
|
this.$refs.scanPopupPack.openScanPopup(); |
|
|
}, |
|
|
}, |
|
|
showPackage(){ |
|
|
showPackage() { |
|
|
getPackUnitByItemCode(this.itemCode).then(res=>{ |
|
|
getPackUnitByItemCode(this.itemCode).then(res => { |
|
|
if(res.data != null && res.data.list.length > 0){ |
|
|
if (res.data != null && res.data.list.length > 0) { |
|
|
res.data.list.forEach(item => { |
|
|
res.data.list.forEach(item => { |
|
|
item.value = item.packQty; |
|
|
item.value = item.packQty; |
|
|
item.label = item.packUnit; |
|
|
item.label = item.packUnit + "/" + item.packQty + this |
|
|
|
|
|
.getUomInfo(item.uom); |
|
|
}) |
|
|
}) |
|
|
this.packageList = res.data.list |
|
|
this.packageList = res.data.list |
|
|
this.show = true; |
|
|
this.show = true; |
|
|
}else { |
|
|
} else { |
|
|
this.showErrorMessage("未查找到包装规格"); |
|
|
this.showErrorMessage("未查找到包装规格"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
}).catch(error => { |
|
|
this.showErrorMessage("未查找到包装规格"+error); |
|
|
this.showErrorMessage("未查找到包装规格" + error); |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
confirmSelect(e){ |
|
|
|
|
|
this.toPackQty = e[0].value; |
|
|
|
|
|
this.toPackUnit = e[0].label; |
|
|
|
|
|
}, |
|
|
}, |
|
|
getPackUnitByItemCode(itemCode){ |
|
|
confirmSelect(e) { |
|
|
getPackUnitByItemCode(itemCode).then(res=>{ |
|
|
if (this.fromPackUnit == e[0].label) { |
|
|
res.data.list.forEach(item => { |
|
|
this.showErrorMessage("来源包装规格【" + this.fromPackUnit + "】与目标包装规格【" + e[0].label + "】不能相等") |
|
|
item.value = item.packQty; |
|
|
return |
|
|
item.label = item.packUnit; |
|
|
} |
|
|
}) |
|
|
this.toPackUnitShow = e[0].label |
|
|
this.packageList = res.data.list |
|
|
var toPackUnit = e[0].label.split("/")[0] |
|
|
}) |
|
|
this.toPackUnit =toPackUnit |
|
|
|
|
|
this.toPackQty = e[0].value |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
getScanResult(result) { |
|
|
let balance = result.balance; |
|
|
let balance = result.balance; |
|
|
let label = result.label; |
|
|
let label = result.label; |
|
|
let pack = result.package; |
|
|
let pack = result.package; |
|
|
this.packUnit = pack.packUnit; |
|
|
this.fromPackUnit = pack.packUnit; |
|
|
var item = this.detailSource.find(res => { |
|
|
var item = this.detailSource.find(res => { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
if (res.itemCode == balance.itemCode) { |
|
|
return res |
|
|
return res |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
if (item == undefined) { |
|
|
if (item == undefined) { |
|
|
if(this.itemCode!=""&&this.itemCode!=balance.itemCode){ |
|
|
if (this.itemCode != "" && this.itemCode != balance.itemCode) { |
|
|
this.showErrorMessage("请扫描物料为【"+this.itemCode+"】的箱码") |
|
|
this.showErrorMessage("请扫描物料为【" + this.itemCode + "】的箱码") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
var itemp = createItemInfo(balance, pack); |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
itemp.subList.push(newDetail); |
|
|
itemp.subList.push(newDetail); |
|
|
this.detailSource.push(itemp) |
|
|
this.detailSource.push(itemp) |
|
|
this.itemCode =balance.itemCode; |
|
|
this.itemCode = balance.itemCode; |
|
|
} else { |
|
|
} else { |
|
|
var detail = item.subList.find(r => { |
|
|
var detail = item.subList.find(r => { |
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
if (r.packingNumber == balance.packingNumber && |
|
@ -228,7 +240,7 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
this.calcHandleQty(); |
|
|
this.calcHandleQty(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -245,9 +257,6 @@ |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
updateData() { |
|
|
|
|
|
this.calcHandleQty(); |
|
|
|
|
|
}, |
|
|
|
|
|
removeItem(index, item) { |
|
|
removeItem(index, item) { |
|
|
this.detailSource.splice(index, 1) |
|
|
this.detailSource.splice(index, 1) |
|
|
}, |
|
|
}, |
|
@ -285,34 +294,55 @@ |
|
|
this.$refs.scanPopup.getfocus(); |
|
|
this.$refs.scanPopup.getfocus(); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
commit() { |
|
|
commit() { |
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
if(this.toPackUnit=="目标包装"){ |
|
|
if (this.toPackUnit == "包装规格") { |
|
|
this.showErrorMessage("请选择目标包装规格") |
|
|
this.showErrorMessage("请选择目标包装规格") |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
uni.showLoading({ |
|
|
this.checkSubmit(); |
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
|
|
overPackageRecordSubmit(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 { |
|
|
} else { |
|
|
this.showErrorMessage("没有要扫描的数据") |
|
|
this.showErrorMessage("没有要扫描的数据") |
|
|
} |
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
checkSubmit() { |
|
|
|
|
|
var tempHandleQty = this.detailSource[0].subList[0].handleQty |
|
|
|
|
|
var toPackQty = this.toPackQty; |
|
|
|
|
|
//包装提示 |
|
|
|
|
|
if (tempHandleQty % toPackQty > 0) { |
|
|
|
|
|
// var count = Math.ceil(tempHandleQty / toPackQty); |
|
|
|
|
|
this.$refs.comMessage.showQuestionMessage( "扫描数量【" + tempHandleQty + |
|
|
|
|
|
"】,将有1个非整包,是否提交?", res => { |
|
|
|
|
|
if (res) { |
|
|
|
|
|
this.submitJob() |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.submitJob() |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
submitJob() { |
|
|
|
|
|
uni.showLoading({ |
|
|
|
|
|
title: "提交中....", |
|
|
|
|
|
mask: true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var params = this.setParams(); |
|
|
|
|
|
console.log("提交" + JSON.stringify(params)) |
|
|
|
|
|
overPackageRecordSubmit(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) |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -335,8 +365,11 @@ |
|
|
subItem.fromPackingNumber = detail.packingNumber; |
|
|
subItem.fromPackingNumber = detail.packingNumber; |
|
|
subItem.fromBatch = detail.batch; |
|
|
subItem.fromBatch = detail.batch; |
|
|
subItem.fromLocationCode = detail.locationCode; |
|
|
subItem.fromLocationCode = detail.locationCode; |
|
|
subItem.toPackQty =this.toPackQty; |
|
|
subItem.fromPackUnit = detail.packUnit; |
|
|
subItem.toPackUnit =this.toPackUnit; |
|
|
subItem.fromPackQty = detail.packQty; |
|
|
|
|
|
|
|
|
|
|
|
subItem.toPackQty = this.toPackQty; |
|
|
|
|
|
subItem.toPackUnit = this.toPackUnit; |
|
|
subItem.package = "" |
|
|
subItem.package = "" |
|
|
subList.push(subItem) |
|
|
subList.push(subItem) |
|
|
} |
|
|
} |
|
|