Browse Source

修改盘点任务数量刷新

dev_pda
李俊城 2 years ago
parent
commit
a398fdbf89
  1. 2
      fe/PDA/common/pdabasic.css
  2. 68
      fe/PDA/pages/task/count_detail.vue

2
fe/PDA/common/pdabasic.css

@ -167,7 +167,7 @@
.scroll-detail { .scroll-detail {
overflow: hidden; overflow: hidden;
padding-bottom: 60px; padding-bottom: 60px;
height: 480px; height: 100%;
/* 没有高度不可以回到顶部 */ /* 没有高度不可以回到顶部 */
/* background-color: #ffffff; */ /* background-color: #ffffff; */
} }

68
fe/PDA/pages/task/count_detail.vue

@ -9,7 +9,7 @@
:newCount="newCount" :location="location"> :newCount="newCount" :location="location">
</com-count-scan-detail> </com-count-scan-detail>
</view> </view>
<view class="detail-list" v-for="(item, index) in details" :key="index"> <view class="detail-list" v-for="(item, index) in details" :key="item.id">
<uni-swipe-action> <uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false" <uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,item,index)"> @click="swipeClick($event,item,index)">
@ -212,7 +212,7 @@
statusArray: [], statusArray: [],
allStatusArray: [], allStatusArray: [],
ipage: 1, ipage: 1,
iSize: 50, iSize: 20,
// array: [{ // array: [{
// text: '', // text: '',
// value: 1 // value: 1
@ -328,7 +328,6 @@
getCountJobDetail(params) getCountJobDetail(params)
.then(async res => { .then(async res => {
that.datacontent = res; that.datacontent = res;
if (res.details != null) { if (res.details != null) {
res.details.forEach(r => { res.details.forEach(r => {
r.scaned = false r.scaned = false
@ -433,28 +432,49 @@
this.calcScanCount(); this.calcScanCount();
}, },
addNewDetail(result) { async addNewDetail(result) {
if (this.location == null) { if (this.location == null) {
this.showMessage('未查找到库位信息,不可以添加为任务明细'); this.showMessage('未查找到库位信息,不可以添加为任务明细');
return; return;
} }
showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => { let balanceItem = await this.getBalanceAsync(result);
if (confirm) { let detail = this.creatDetail(result);
let balanceItem = await this.getBalanceAsync(result); if (balanceItem == null||balanceItem == undefined) {
let detail = this.creatDetail(result); setTimeout(res=>{
if (balanceItem != null) { showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => {
this.setDetailByBalance(detail, balanceItem); if (confirm) {
} else { this.setDetailNoBalance(detail, result)
this.setDetailNoBalance(detail, result) this.allDetails.unshift(detail);
} this.details.unshift(detail);
this.details.unshift(detail); this.calcAllCount();
this.calcAllCount(); this.calcScanCount();
this.calcScanCount(); this.$forceUpdate();
this.$forceUpdate(); } else {
} else { this.scanPopupGetfocus();
this.scanPopupGetfocus(); }
});
},100)
} else {
if(balanceItem.locationCode!=this.location.code){
this.showMessage("箱码【"+result.data.code+"】在库位【"+balanceItem.locationCode+"】不在库位【"+this.location.code+ "】不可以添加为任务明细");
}else {
setTimeout(res=>{
showConfirmMsg('扫描的库存在任务中不存在,是否要添加为任务明细?', async confirm => {
if (confirm) {
this.setDetailByBalance(detail, balanceItem);
this.allDetails.unshift(detail);
this.details.unshift(detail);
this.calcAllCount();
this.calcScanCount();
this.$forceUpdate();
} else {
this.scanPopupGetfocus();
}
});
},100)
} }
}); }
}, },
async getBalanceAsync(result) { async getBalanceAsync(result) {
@ -521,6 +541,7 @@
setDetailByBalance(detail, balanceItem) { setDetailByBalance(detail, balanceItem) {
detail.InventoryLocationCode = balanceItem.locationCode; detail.InventoryLocationCode = balanceItem.locationCode;
detail.inventoryQty = balanceItem.qty;
detail.countQty = balanceItem.qty; detail.countQty = balanceItem.qty;
detail.status = balanceItem.status; detail.status = balanceItem.status;
return detail; return detail;
@ -528,6 +549,7 @@
setDetailNoBalance(detail, result) { setDetailNoBalance(detail, result) {
detail.InventoryLocationCode = ""; detail.InventoryLocationCode = "";
detail.inventoryQty = 0;
detail.countQty = result.data.qty; detail.countQty = result.data.qty;
detail.status = 2; detail.status = 2;
return detail; return detail;
@ -677,12 +699,12 @@
}, },
calcAllCount() { calcAllCount() {
this.allCount = this.details.length; this.allCount = this.allDetails.length;
this.newCount = this.details.filter(r => r.isNew).length; this.newCount = this.allDetails.filter(r => r.isNew).length;
}, },
calcScanCount() { calcScanCount() {
this.scanCount = this.details.filter(r => r.scaned === true).length; this.scanCount = this.allDetails.filter(r => r.scaned === true).length;
}, },
bindPickerChange(e, item) { bindPickerChange(e, item) {

Loading…
Cancel
Save