|
@ -25,7 +25,7 @@ |
|
|
<view class="page-main"> |
|
|
<view class="page-main"> |
|
|
<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="" style="margin: 2px;"> |
|
|
<view class=""> |
|
|
<com-count-detail-card :ref="'countDetail_'+index" :dataContent="item" :index="index" |
|
|
<com-count-detail-card :ref="'countDetail_'+index" :dataContent="item" :index="index" |
|
|
@editItem="editItem" :settingParam="jobContent" @remove="updateData" |
|
|
@editItem="editItem" :settingParam="jobContent" @remove="updateData" |
|
|
@updateData="updateData"> |
|
|
@updateData="updateData"> |
|
@ -48,7 +48,8 @@ |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
|
|
|
<win-scan-button @goScan='openScanPopup'></win-scan-button> |
|
|
<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" |
|
|
<count-qty-edit ref="countQtyEdit" @confirm="editConfirm" :isShowStatus="true" :allowEditStatus="false" |
|
|
:isShowBalance="jobContent.isOpenCount=='TRUE'"> |
|
|
:isShowBalance="jobContent.isOpenCount=='TRUE'"> |
|
|
</count-qty-edit> |
|
|
</count-qty-edit> |
|
@ -75,7 +76,7 @@ |
|
|
import { |
|
|
import { |
|
|
getCountStageName |
|
|
getCountStageName |
|
|
} from '@/common/directory.js'; |
|
|
} from '@/common/directory.js'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanButton from '@/mycomponents/scan/winScanButton.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
|
import winScanPack from '@/mycomponents/scan/winScanPack.vue' |
|
@ -109,7 +110,8 @@ |
|
|
jobContent: {}, //任务内容 |
|
|
jobContent: {}, //任务内容 |
|
|
subList: [], //接口返回的任务subList |
|
|
subList: [], //接口返回的任务subList |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
itemEditInfo: {} |
|
|
itemEditInfo: {}, |
|
|
|
|
|
balance: {} //库存余额 |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
onLoad(option) { |
|
|
onLoad(option) { |
|
@ -305,13 +307,29 @@ |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
getScanResult(result) { |
|
|
//明盘 |
|
|
|
|
|
getOpenScanResult(result) { |
|
|
try { |
|
|
try { |
|
|
var packingNumber = result.balance.packingNumber; |
|
|
let label = result.label; |
|
|
var batch = result.balance.batch; |
|
|
this.balance = result.balance[0]; |
|
|
var balanceQty = result.balance.qty; |
|
|
//盘点了没有库存余额的数据,直接编辑盘点数量和盘点状态 |
|
|
var itemCode = result.balance.itemCode; |
|
|
if (result.balance.length == 0) { |
|
|
var inventoryStatus = result.balance.inventoryStatus; |
|
|
|
|
|
|
|
|
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 detail = this.detailSource.find(r => r.itemCode == itemCode); |
|
|
var itemEditInfo; |
|
|
var itemEditInfo; |
|
|
//检查物料号是否存在 |
|
|
//检查物料号是否存在 |
|
@ -320,7 +338,75 @@ |
|
|
this.addNewItemCodeToList(result) |
|
|
this.addNewItemCodeToList(result) |
|
|
} else { |
|
|
} 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 => { |
|
|
itemEditInfo = detail.subList.find(item => { |
|
|
if (item.packingNumber == packingNumber && |
|
|
if (item.packingNumber == packingNumber && |
|
|
item.batch == batch && |
|
|
item.batch == batch && |
|
@ -365,12 +451,14 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
addNewItemCodeToList(result) { |
|
|
addNewItemCodeToList(result) { |
|
|
this.$refs.comMessage.showSelectMessageModal("物料[" + result.balance.itemCode + "]不在列表中,是否添加到列表?", |
|
|
this.$refs.comMessage.showSelectMessageModal("物料[" + this.balance.itemCode + "]不在列表中,是否添加到列表?", |
|
|
res => { |
|
|
res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
var item = this.createAddItemInfo(result.balance, result.package); |
|
|
var item = this.createAddItemInfo(this.balance, result.package); |
|
|
let newDetail = this.createAddDetailInfo(result.balance, result.package); // |
|
|
let newDetail = this.createAddDetailInfo(this.balance, result.package); // |
|
|
item.subList.push(newDetail); |
|
|
item.subList.push(newDetail); |
|
|
this.detailSource.push(item) |
|
|
this.detailSource.push(item) |
|
|
this.updateData() |
|
|
this.updateData() |
|
@ -380,12 +468,12 @@ |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
addExistItemCodeToList(detail, result) { |
|
|
addExistItemCodeToList(detail, result) { |
|
|
this.$refs.comMessage.showSelectMessageModal("箱码[" + result.balance.packingNumber + |
|
|
this.$refs.comMessage.showSelectMessageModal("箱码[" + this.balance.packingNumber + |
|
|
"]不在列表中,是否添加到列表?", |
|
|
"]不在列表中,是否添加到列表?", |
|
|
res => { |
|
|
res => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
detail.qty = calc.add(detail.qty,detail.qty) |
|
|
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); |
|
|
detail.subList.push(newDetail); |
|
|
this.updateData() |
|
|
this.updateData() |
|
|
|
|
|
|
|
|