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 {
overflow: hidden;
padding-bottom: 60px;
height: 480px;
height: 100%;
/* 没有高度不可以回到顶部 */
/* background-color: #ffffff; */
}

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

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

Loading…
Cancel
Save