diff --git a/src/common/record.js b/src/common/record.js
index 905b0501..10c6e606 100644
--- a/src/common/record.js
+++ b/src/common/record.js
@@ -81,8 +81,6 @@ export function calcHandleQty(detailSource) {
}
//添加数量
export function calcHandleQtyAdd(detailSource,label) {
- console.log(label.qty)
- console.log(detailSource)
for (let item of detailSource) {
item.handleQty = item.handleQty || new Decimal(0).toNumber();
item.qty = item.qty|| new Decimal(0).toNumber();
diff --git a/src/mycomponents/record/recordComDetailCardBatch.vue b/src/mycomponents/record/recordComDetailCardBatch.vue
new file mode 100644
index 00000000..cb5eaf75
--- /dev/null
+++ b/src/mycomponents/record/recordComDetailCardBatch.vue
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/pages/putaway/record/putawayRecord.vue b/src/pages/putaway/record/putawayRecord.vue
index 23d62c41..ab989921 100644
--- a/src/pages/putaway/record/putawayRecord.vue
+++ b/src/pages/putaway/record/putawayRecord.vue
@@ -15,12 +15,21 @@
+
+
+ @removePack="removePack"
+ v-else>
@@ -81,7 +90,8 @@
getBusinessType,
createItemInfo,
createDetailInfo,
- calcHandleQty
+ calcHandleQty,
+ calcHandleQtyAdd
} from '@/common/record.js';
import {
@@ -97,6 +107,7 @@
import winScanLocation from "@/mycomponents/scan/winScanLocation.vue"
import winScanPackAndLocation from "@/mycomponents/scan/winScanPackAndLocation.vue"
import recordComDetailCard from '@/mycomponents/record/recordComDetailCard.vue'
+ import recordComDetailCardBatch from '@/mycomponents/record/recordComDetailCardBatch.vue'
export default {
components: {
@@ -106,7 +117,8 @@
comBlankView,
winScanLocation,
winScanPackAndLocation,
- recordComDetailCard
+ recordComDetailCard,
+ recordComDetailCardBatch
},
data() {
return {
@@ -125,6 +137,7 @@
fromWarehouseCode: '', //来源仓库
businessTypeCode: "PurchasePutaway",
editItem:{},
+ managementType:''
};
},
onLoad(option) {
@@ -157,7 +170,88 @@
mounted() {},
methods: {
- getScanResult(result) {
+ getScanResult(result,managementType) {
+ this.managementType = managementType
+ if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){
+ this. getScanResultAfterBatch(result)
+ }else{
+ this. getScanResultAfter(result)
+ }
+
+ },
+ getScanResultAfterBatch(result){
+ let balance = result.balance;
+ let label = result.label;
+ let pack = result.package;
+ let poLine =label.poLine;
+ let poNumber =label.poNumber;
+ let supplierCode=label.supplierCode;
+ var item = this.detailSource.find(res => {
+ if (res.itemCode == balance.itemCode) {
+ return res
+ }
+ })
+ if (this.fromWarehouseCode == '') {
+ this.fromWarehouseCode = balance.warehouseCode;
+ }
+ if (item == undefined) {
+ // 获取推荐库位
+ this.getRecommendLocation(balance, pack, toLocation => {
+ var itemp = createItemInfo(balance, pack);
+ itemp.toLocationCode = toLocation.locationCode;
+ let newDetail = createDetailInfo(balance, pack); //
+ newDetail.toLocationCode = toLocation.locationCode;
+ newDetail.toWarehouseCode = toLocation.toWarehouseCode;
+ newDetail.poLine=poLine;
+ newDetail.poNumber=poNumber;
+ newDetail.supplierCode=supplierCode;
+ newDetail.fromInventoryStatus = balance.inventoryStatus;
+ newDetail.handleQty =0;
+ newDetail.balanceQty =result.balance.qty;
+ itemp.subList.push(newDetail);
+ this.detailSource.push(itemp)
+ calcHandleQtyAdd(this.detailSource,result.label);
+ })
+
+ } else {
+ var detail = item.subList.find(r => {
+ if (
+ r.batch == balance.batch &&
+ r.locationCode == balance.locationCode &&
+ r.inventoryStatus == balance.inventoryStatus) {
+ return r;
+ }
+ })
+ if (detail == undefined) {
+ this.getRecommendLocation(balance, pack, toLocation => {
+ let newDetail = createDetailInfo(balance, pack);
+ newDetail.toLocationCode = toLocation.locationCode;
+ newDetail.toWarehouseCode = toLocation.toWarehouseCode;
+ newDetail.poLine=poLine;
+ newDetail.poNumber=poNumber;
+ newDetail.supplierCode=supplierCode;
+ newDetail.fromInventoryStatus = balance.inventoryStatus;
+ newDetail.handleQty =0;
+ newDetail.balanceQty =result.balance.qty;
+ if(item.subList&&item.subList.length>0){
+ if(item.subList[0].batch!=newDetail.batch){
+ this.showErrorMessage("扫描的批次是["+newDetail.batch+"],请扫描["+item.subList[0].batch+"的批次的箱码")
+ }
+ }else {
+ item.subList.push(newDetail);
+ calcHandleQtyAdd(this.detailSource,result.label);
+ }
+ });
+ } else {
+ if (detail.scaned == true) {
+ calcHandleQtyAdd(this.detailSource,result.label);
+ // this.showErrorMessage( "批次[" + balance.batch + "]重复扫描")
+ }
+ }
+ }
+
+ },
+ getScanResultAfter(result){
let balance = result.balance;
let label = result.label;
let pack = result.package;
@@ -189,7 +283,7 @@
this.detailSource.push(itemp)
calcHandleQty(this.detailSource);
})
-
+
} else {
var detail = item.subList.find(r => {
if (r.packingNumber == balance.packingNumber &&
@@ -225,7 +319,6 @@
}
},
-
//获取推荐库位
getRecommendLocation(balance, pack, callback) {
uni.showLoading({
@@ -344,8 +437,14 @@
if (res.success) {
this.managementList = res.list;
var params = this.setRecordParams()
- console.log("提交参数", JSON.stringify(params));
-
+ console.log("提交参数", params);
+ const isHaveItem =params.subList.find(item=>item.handleQty > item.balanceQty)
+ if(isHaveItem){
+ this.showErrorMessage(`物料号${isHaveItem.itemCode}`)
+ this.$refs.comMessage.showConfirmWarningModal('物料号'+isHaveItem.itemCode+'数量[' + isHaveItem.handleQty + ']不允许大于库存数量[' + isHaveItem.balanceQty + ']')
+ uni.hideLoading()
+ return
+ }
putawayRecordSubmit(params).then(res => {
uni.hideLoading()
if (res.data) {
@@ -415,6 +514,8 @@
submitItem.fromLocationCode = detail.locationCode;
submitItem.toLocationCode = detail.toLocationCode;
+ submitItem.balanceQty = detail.balanceQty;
+
submitItem.itemName = item.itemName;
// detail.toInventoryStatus = detail.inventoryStatus