|
|
@ -25,7 +25,7 @@ |
|
|
|
<view class="page-main"> |
|
|
|
<scroll-view scroll-y="true" class="page-main-scroll"> |
|
|
|
<view class="detail-list" v-for="(item, index) in detailSource" :key="item.id"> |
|
|
|
<view class="" style="margin: 2px;"> |
|
|
|
<view class=""> |
|
|
|
<com-count-detail-card :ref="'countDetail_'+index" :dataContent="item" :index="index" |
|
|
|
@editItem="editItem" :settingParam="jobContent" @remove="updateData" |
|
|
|
@updateData="updateData"> |
|
|
@ -48,7 +48,8 @@ |
|
|
|
</view> |
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" @getResult='getScanResult'></win-scan-pack-and-location> |
|
|
|
<win-scan-pack-and-location ref="scanPopup" :noShowBalanceMessage="true" @getCountScanResult='getScanResult'> |
|
|
|
</win-scan-pack-and-location> |
|
|
|
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="false" |
|
|
|
:isShowBalance="jobContent.isOpenCount=='TRUE'"> |
|
|
|
</count-qty-edit> |
|
|
@ -109,7 +110,8 @@ |
|
|
|
jobContent: {}, //任务内容 |
|
|
|
subList: [], //接口返回的任务subList |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
itemEditInfo: {} |
|
|
|
itemEditInfo: {}, |
|
|
|
balance: {} //库存余额 |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
@ -305,13 +307,29 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
|
//明盘 |
|
|
|
getOpenScanResult(result) { |
|
|
|
try { |
|
|
|
var packingNumber = result.balance.packingNumber; |
|
|
|
var batch = result.balance.batch; |
|
|
|
var balanceQty = result.balance.qty; |
|
|
|
var itemCode = result.balance.itemCode; |
|
|
|
var inventoryStatus = result.balance.inventoryStatus; |
|
|
|
let label = result.label; |
|
|
|
this.balance = result.balance[0]; |
|
|
|
//盘点了没有库存余额的数据,直接编辑盘点数量和盘点状态 |
|
|
|
if (result.balance.length == 0) { |
|
|
|
|
|
|
|
return; |
|
|
|
} else { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.balance = result.balance[0]; |
|
|
|
|
|
|
|
var packingNumber = label.packingNumber; |
|
|
|
var batch = label.batch; |
|
|
|
var itemCode = label.itemCode; |
|
|
|
|
|
|
|
var balanceQty = this.balance.qty; |
|
|
|
var inventoryStatus = this.balance.inventoryStatus; |
|
|
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
var itemEditInfo; |
|
|
|
//检查物料号是否存在 |
|
|
@ -320,7 +338,75 @@ |
|
|
|
this.addNewItemCodeToList(result) |
|
|
|
} else { |
|
|
|
//物料号存在,查询是否在任务列表中 |
|
|
|
itemEditInfo = detail.subList.find(item => { |
|
|
|
if (item.packingNumber == packingNumber && |
|
|
|
item.batch == batch && |
|
|
|
item.inventoryStatus == inventoryStatus) { |
|
|
|
return item; |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (itemEditInfo == undefined) { |
|
|
|
//不在任务列表中,提示是否添加到列表 |
|
|
|
this.addExistItemCodeToList(detail, result); |
|
|
|
|
|
|
|
} else { |
|
|
|
//在列表中,更新已扫描状态, |
|
|
|
if (itemEditInfo.scaned) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("箱码【" + packingNumber + |
|
|
|
"】已经完成盘点,是否要编辑数量", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
this.$refs.countQtyEdit.openEditPopup(itemEditInfo, |
|
|
|
detail.subList); |
|
|
|
} else { |
|
|
|
this.scanPopupGetFocus(); |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} else { |
|
|
|
itemEditInfo.scaned = true; |
|
|
|
itemEditInfo.handleQty = balanceQty; |
|
|
|
itemEditInfo.balanceQty = balanceQty; |
|
|
|
itemEditInfo.stdPackQty = result.package.stdPackQty; |
|
|
|
itemEditInfo.stdPackUnit = result.package.stdPackUnit; |
|
|
|
this.$refs.countQtyEdit.openEditPopupShowSeconds(itemEditInfo, detail |
|
|
|
.subList); |
|
|
|
this.updateData() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
this.showErrorMessage(e.message) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//盲盘 |
|
|
|
getUnOpenScanResult(result) { |
|
|
|
try { |
|
|
|
debugger; |
|
|
|
//盘点了没有库存余额的数据 |
|
|
|
if (result.balance.length == 0) { |
|
|
|
|
|
|
|
} |
|
|
|
let label = result.label; |
|
|
|
this.balance = result.balance[0]; |
|
|
|
|
|
|
|
var packingNumber = label.packingNumber; |
|
|
|
var batch = label.batch; |
|
|
|
var itemCode = label.itemCode; |
|
|
|
|
|
|
|
var balanceQty = this.balance.qty; |
|
|
|
var inventoryStatus = this.balance.inventoryStatus; |
|
|
|
|
|
|
|
var detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
|
var itemEditInfo; |
|
|
|
//检查物料号是否存在 |
|
|
|
if (detail == undefined) { |
|
|
|
//物料号不存在,创建物料号数据添加到列表。设置为已经扫描 |
|
|
|
this.addNewItemCodeToList(result) |
|
|
|
} else { |
|
|
|
//物料号存在,查询是否在任务列表中 |
|
|
|
itemEditInfo = detail.subList.find(item => { |
|
|
|
if (item.packingNumber == packingNumber && |
|
|
|
item.batch == batch && |
|
|
@ -365,12 +451,14 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addNewItemCodeToList(result) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("物料[" + result.balance.itemCode + "]不在列表中,是否添加到列表?", |
|
|
|
this.$refs.comMessage.showSelectMessageModal("物料[" + this.balance.itemCode + "]不在列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
var item = this.createAddItemInfo(result.balance, result.package); |
|
|
|
let newDetail = this.createAddDetailInfo(result.balance, result.package); // |
|
|
|
var item = this.createAddItemInfo(this.balance, result.package); |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, result.package); // |
|
|
|
item.subList.push(newDetail); |
|
|
|
this.detailSource.push(item) |
|
|
|
this.updateData() |
|
|
@ -380,12 +468,12 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
addExistItemCodeToList(detail, result) { |
|
|
|
this.$refs.comMessage.showSelectMessageModal("箱码[" + result.balance.packingNumber + |
|
|
|
this.$refs.comMessage.showSelectMessageModal("箱码[" + this.balance.packingNumber + |
|
|
|
"]不在列表中,是否添加到列表?", |
|
|
|
res => { |
|
|
|
if (res) { |
|
|
|
detail.qty = calc.add(detail.qty, detail.qty) |
|
|
|
let newDetail = this.createAddDetailInfo(result.balance, result.package); // |
|
|
|
let newDetail = this.createAddDetailInfo(this.balance, result.package); // |
|
|
|
detail.subList.push(newDetail); |
|
|
|
this.updateData() |
|
|
|
|
|
|
|