|
|
@ -12,7 +12,7 @@ |
|
|
|
<com-move-record-card :dataContent="item" :index="index" @removeData="removeData" |
|
|
|
:isShowStatus="isShowStatus" @updateData="updateData" @removePack='removePack' |
|
|
|
:allowEditQty="true" |
|
|
|
:allowEditStatus="allowEditStatus"> |
|
|
|
:allowEditStatus="allowEditStatus" > |
|
|
|
</com-move-record-card> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -35,7 +35,7 @@ |
|
|
|
<win-scan-button @goScan='showFromLocationPopup'></win-scan-button> |
|
|
|
</view> |
|
|
|
<!-- 合格转隔离单独的弹窗--> |
|
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :fromLocationCodeProps='fromLocationCode' :itemCodeProps='itemCode' :batchProps='batch' :showOnePop='showOnePop' :isClearFromLocationCode='isClearFromLocationCode' :isClearItemCode='isClearItemCode' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg'></okToHoldRecordPack> |
|
|
|
<okToHoldRecordPack ref="okToHoldRecordPackRef" :showOnePop='showOnePop' @showFromLocationPopup='showFromLocationPopup' @itemCodeClick='openScanPopup' @confirm='okToHoldRecordPackConfirm' @getInputMsgResult="getInputMsgResult" @itemCodeScanMsg='itemCodeScanMsg' @clickBtnClearFromLocation='clearFromLocation' @clickBtnClearItemCode='clearItemCode'></okToHoldRecordPack> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult' @clearItemCode='clearItemCode' :title="'箱码'" > |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<win-scan-location ref="scanFromLocationCode" title="来源库位" @getLocation='getFromLocation' |
|
|
@ -147,10 +147,6 @@ |
|
|
|
fromLocationAreaTypeList: [], |
|
|
|
toLocationAreaTypeList: [], |
|
|
|
isShowEditLocation: false, |
|
|
|
itemCode:'', |
|
|
|
batch:'', |
|
|
|
isClearFromLocationCode:false,//是否清除输入框的来源库位 |
|
|
|
isClearItemCode:false,//是否清除输入框的零件和批次 |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -247,7 +243,12 @@ |
|
|
|
showFromLocationPopup() { |
|
|
|
setTimeout(()=>{ |
|
|
|
if(this.showOnePop){ |
|
|
|
this.$refs.okToHoldRecordPackRef.fromLocationCode = '' |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode = '' |
|
|
|
this.$refs.okToHoldRecordPackRef.batch = '' |
|
|
|
this.$refs.okToHoldRecordPackRef.handleQty = 0 |
|
|
|
this.$refs.okToHoldRecordPackRef.showOne = true |
|
|
|
|
|
|
|
}else{ |
|
|
|
this.$refs.scanFromLocationCode.openScanPopup(); |
|
|
|
} |
|
|
@ -267,20 +268,19 @@ |
|
|
|
this.toLocationCode = code; |
|
|
|
this.toLocationInfo = location; |
|
|
|
}, |
|
|
|
getScanResult(result,managementType) { |
|
|
|
getScanResult(result,managementTypeParams) { |
|
|
|
this.managementType = managementTypeParams |
|
|
|
if(this.showOnePop){ |
|
|
|
this.itemCode= result.balance.itemCode |
|
|
|
this.batch = result.balance.batch |
|
|
|
this.isClearItemCode = false |
|
|
|
debugger |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode= result.balance.itemCode |
|
|
|
this.$refs.okToHoldRecordPackRef.batch = result.balance.batch |
|
|
|
this.getResult = result//存储接受的结果 |
|
|
|
this.$refs.scanPopup.closeScanPopup() |
|
|
|
|
|
|
|
}else{ |
|
|
|
if(managementType == "BY_BATCH" ||managementType == "BY_QUANTITY" ){ |
|
|
|
this.getScanResultAfterBatch(result) |
|
|
|
if(managementTypeParams == "BY_BATCH" ||managementTypeParams == "BY_QUANTITY" ){ |
|
|
|
this.getScanResultAfterBatch(result,managementTypeParams) |
|
|
|
}else{ |
|
|
|
this.getScanResultAfter(result) |
|
|
|
this.getScanResultAfter(result,managementTypeParams) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -302,7 +302,7 @@ |
|
|
|
// this.getResult.fromLocationCode = obj.fromLocationCode |
|
|
|
this.getResult.label.batch = obj.handleQty |
|
|
|
this.getResult.label.qty = obj.handleQty |
|
|
|
this.getScanResultAfterBatch(this.getResult) |
|
|
|
this.getScanResultAfterBatch(this.getResult,this.managementType) |
|
|
|
}, |
|
|
|
getScanResultAfter(result){ |
|
|
|
var balance = result.balance; |
|
|
@ -364,7 +364,7 @@ |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
getScanResultAfterBatch(result){ |
|
|
|
getScanResultAfterBatch(result,managementTypeParams){ |
|
|
|
var balance = result.balance; |
|
|
|
this.balanceInfo = result.balance; |
|
|
|
var pack = result.package; |
|
|
@ -387,18 +387,31 @@ |
|
|
|
newDetail.toInventoryStatus = this.toInventoryStatus; |
|
|
|
} |
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
newDetail.managementTypeParams = managementTypeParams; |
|
|
|
newDetail.fromLocationCode = result.fromLocationCode |
|
|
|
newDetail.handleQty = Number(result.label.qty) |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.batch == pack.batch && |
|
|
|
r.fromLocationCode == balance.locationCode && |
|
|
|
r.scaned == true) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
var detail = '' |
|
|
|
console.log(9988,managementTypeParams) |
|
|
|
if(managementTypeParams == 'BY_QUANTITY'){ |
|
|
|
detail = item.subList.find(r => { |
|
|
|
if (r.fromLocationCode == balance.locationCode && |
|
|
|
r.scaned == true) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
}else if(managementTypeParams == 'BY_BATCH'){ |
|
|
|
detail = item.subList.find(r => { |
|
|
|
if (r.batch == pack.batch && |
|
|
|
r.fromLocationCode == balance.locationCode && |
|
|
|
r.scaned == true) { |
|
|
|
return r; |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(detail) |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
// newDetail.inventoryStatus = balance.inventoryStatus; |
|
|
@ -412,12 +425,15 @@ |
|
|
|
newDetail.packingNumber = pack.number; |
|
|
|
} |
|
|
|
newDetail.toLocationCode = this.toLocationCode; |
|
|
|
newDetail.managementTypeParams = managementTypeParams; |
|
|
|
newDetail.fromLocationCode = result.fromLocationCode |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
console.log(999,detail.handleQty) |
|
|
|
detail.handleQty =calc.add(detail.handleQty, result.label.qty) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
}, |
|
|
|
getInputMsgResult(result,fromWitch){ |
|
|
@ -426,17 +442,17 @@ |
|
|
|
}, |
|
|
|
// 清除来源库位 |
|
|
|
clearFromLocation(fromLocationCodeParams){ |
|
|
|
this.fromLocationCode = fromLocationCodeParams |
|
|
|
this.itemCode ='' |
|
|
|
this.batch ='' |
|
|
|
this.isClearFromLocationCode = true |
|
|
|
this.$refs.okToHoldRecordPackRef.fromLocationCode = '' |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode ='' |
|
|
|
this.$refs.okToHoldRecordPackRef.batch ='' |
|
|
|
// this.isClearFromLocationCode = true |
|
|
|
}, |
|
|
|
// 清除零件 |
|
|
|
// 清除批次和物料 |
|
|
|
clearItemCode(label){ |
|
|
|
this.itemCode = label.itemCode |
|
|
|
this.batch ='' |
|
|
|
this.isClearItemCode = true |
|
|
|
this.$refs.okToHoldRecordPackRef.itemCode ='' |
|
|
|
this.$refs.okToHoldRecordPackRef.batch ='' |
|
|
|
}, |
|
|
|
|
|
|
|
showErrorMessage(message) { |
|
|
|
if (this.$refs.scanPopup) { |
|
|
|
this.$refs.scanPopup.packLoseFocus() |
|
|
@ -547,7 +563,12 @@ |
|
|
|
} |
|
|
|
// if(this.balanceInfo) |
|
|
|
console.log("提交" ,params) |
|
|
|
|
|
|
|
let obj = params.subList.find(item=>item.balanceQty < item.handleQty) |
|
|
|
if(obj){ |
|
|
|
this.$refs.comMessage.showConfirmWarningModal('批次[' +obj.batch + ']数量[' + obj.handleQty + ']不允许大于库存数量[' +obj.balanceQty + ']') |
|
|
|
uni.hideLoading() |
|
|
|
return |
|
|
|
} |
|
|
|
inventoryMoveRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|