|
|
@ -12,8 +12,7 @@ |
|
|
|
<record-com-detail-card :dataContent="item" :index="index" :settingParam="dataContent" |
|
|
|
:isShowFromLocation="true" @removeItem="removeItem(index,item)" |
|
|
|
:isShowToLocation="false" :isShowParentToLocation="false" @updateData="updateData" |
|
|
|
:allowModifyQty="true" |
|
|
|
@removePack="removePack"> |
|
|
|
:allowModifyQty="true" :isShowPackingNumberProps="true" @removePack="removePack"> |
|
|
|
</record-com-detail-card> |
|
|
|
|
|
|
|
</view> |
|
|
@ -48,7 +47,7 @@ |
|
|
|
<!-- <winComScanBalance ref="scanPopup" @getBalance='getScanResult' :bussinessCode="businessTypeCode"> |
|
|
|
</winComScanBalance> --> |
|
|
|
<fifoQuery ref="refFifoQuery" :businessTypeCode="businessTypeCode"></fifoQuery> |
|
|
|
|
|
|
|
|
|
|
|
<comMessage ref="comMessage"></comMessage> |
|
|
|
</view> |
|
|
|
</template> |
|
|
@ -57,7 +56,8 @@ |
|
|
|
import { |
|
|
|
issueRecordSubmit, |
|
|
|
getWorkShopLineStation, |
|
|
|
getBalanceByFilter |
|
|
|
getBalanceByFilter, |
|
|
|
issueCheck |
|
|
|
} from '@/api/request2.js'; |
|
|
|
|
|
|
|
import { |
|
|
@ -104,7 +104,7 @@ |
|
|
|
import balanceSelect from '@/mycomponents/balance/balanceSelect.vue' |
|
|
|
import winComScanBalance from '@/mycomponents/scan/winComScanBalance.vue' |
|
|
|
import fifoQuery from '@/mycomponents/query/fifoQuery.vue' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
@ -142,7 +142,7 @@ |
|
|
|
resultData: {}, |
|
|
|
itemCode: "", |
|
|
|
managementType: '', |
|
|
|
fifoSwitch:false |
|
|
|
fifoSwitch: false |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -197,13 +197,36 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
|
getScanResult(result, managementTypeParams) { |
|
|
|
this.managementType = managementTypeParams |
|
|
|
if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
|
|
|
this.setDataBatch(result); |
|
|
|
} else { |
|
|
|
this.setData(result); |
|
|
|
// if (managementTypeParams == "BY_BATCH" || managementTypeParams == "BY_QUANTITY") { |
|
|
|
// this.setDataBatch(result); |
|
|
|
// } else { |
|
|
|
// this.setData(result); |
|
|
|
// } |
|
|
|
if(!result.package.number){ |
|
|
|
this.showErrorMessage("包装号不能为空") |
|
|
|
return; |
|
|
|
} |
|
|
|
uni.showLoading({ |
|
|
|
title:"校验中...", |
|
|
|
mask:true |
|
|
|
}) |
|
|
|
//校验箱码是否已经发料 |
|
|
|
issueCheck(result.package.number).then(res=>{ |
|
|
|
uni.hideLoading() |
|
|
|
if(res.data.length==0){ |
|
|
|
this.setData(result); |
|
|
|
}else { |
|
|
|
this.showErrorMessage("箱码["+result.package.number+"]已经发过料") |
|
|
|
} |
|
|
|
|
|
|
|
}).catch(error=>{ |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error.message) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
async setData(result) { |
|
|
|
let balance = result.balance; |
|
|
@ -217,11 +240,12 @@ |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
|
var detail = item.subList.find(r => { |
|
|
|
if (r.packingNumber == balance.packingNumber && |
|
|
|
if (r.packingNumber == pack.number && |
|
|
|
r.batch == balance.batch && |
|
|
|
r.locationCode == balance.locationCode && |
|
|
|
r.inventoryStatus == balance.inventoryStatus) { |
|
|
@ -230,17 +254,18 @@ |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
if (detail.scaned == true) { |
|
|
|
this.showErrorMessage("箱码[" + balance.packingNumber + "批次[" + balance.batch + "]重复扫描") |
|
|
|
this.showErrorMessage("箱码[" + pack.number + "]已经扫描") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
calcHandleQty(this.detailSource) |
|
|
|
}, |
|
|
|
|
|
|
|
setDataBatch(result) { |
|
|
|
|
|
|
|
setDataBatch(result) { |
|
|
|
let balance = result.balance; |
|
|
|
let label = result.label; |
|
|
|
let pack = result.package; |
|
|
@ -251,8 +276,9 @@ |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = createItemInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack,label); |
|
|
|
newDetail.handleQty =label.qty |
|
|
|
let newDetail = createDetailInfo(balance, pack, label); |
|
|
|
newDetail.handleQty = label.qty |
|
|
|
|
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
@ -264,14 +290,15 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = createDetailInfo(balance, pack,label); |
|
|
|
newDetail.handleQty =label.qty |
|
|
|
let newDetail = createDetailInfo(balance, pack, label); |
|
|
|
newDetail.handleQty = label.qty |
|
|
|
newDetail.packingNumber = pack.number |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
detail.handleQty =calc.add(detail.handleQty, result.label.qty) |
|
|
|
detail.handleQty = calc.add(detail.handleQty, result.label.qty) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
calcHandleQty(this.detailSource) |
|
|
|
}, |
|
|
|
|
|
|
@ -395,17 +422,18 @@ |
|
|
|
this.showErrorMessage("请选择生产线") |
|
|
|
return |
|
|
|
} |
|
|
|
var commitHint="" |
|
|
|
var commitHint = "" |
|
|
|
this.detailSource.forEach((item) => { |
|
|
|
item.subList.forEach(cur=>{ |
|
|
|
if(cur.scaned){ |
|
|
|
if(parseFloat(cur.handleQty)>parseFloat(cur.qty)){ |
|
|
|
commitHint += `物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.qty}】\n` |
|
|
|
item.subList.forEach(cur => { |
|
|
|
if (cur.scaned) { |
|
|
|
if (parseFloat(cur.handleQty) > parseFloat(cur.qty)) { |
|
|
|
commitHint += |
|
|
|
`物料号【${item.itemCode}】批次【${cur.batch}】实际提交数量【${cur.handleQty}】不可以大于库存数量【${cur.qty}】\n` |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(commitHint){ |
|
|
|
if (commitHint) { |
|
|
|
this.showErrorMessage(commitHint) |
|
|
|
return; |
|
|
|
} |
|
|
@ -479,7 +507,7 @@ |
|
|
|
submitItem.recordList = [{ |
|
|
|
toInventoryStatus: detail.inventoryStatus, |
|
|
|
fromParentPackingNumber: detail.parentNumber, |
|
|
|
fromPackingNumber: info.packingNumber, |
|
|
|
fromPackingNumber: detail.packingNumber, |
|
|
|
fromBatch: info.batch, |
|
|
|
toPackingNumber: info.packingNumber, |
|
|
|
toBatch: info.batch, |
|
|
@ -501,6 +529,7 @@ |
|
|
|
this.dataContent.subList = subList |
|
|
|
this.dataContent.creator = creator; |
|
|
|
this.dataContent.fromWarehouseCode = this.fromWarehouseCode; |
|
|
|
this.dataContent.sourceType="record" |
|
|
|
return this.dataContent; |
|
|
|
}, |
|
|
|
|
|
|
|