Browse Source

修改盘点明细加载功能

dev_pda
聂喜婷 2 years ago
parent
commit
d8f34bfb42
  1. 91
      fe/PDA/pages/task/count_detail.vue

91
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="item.id">
<view class="detail-list" v-for="(item, index) in details" :key="index">
<uni-swipe-action>
<uni-swipe-action-item :right-options="options" :auto-close="false"
@click="swipeClick($event,item,index)">
@ -17,7 +17,7 @@
<view class="choose_main">
<view class="ljh_box">
<view class="ljh_info">
<view class="tit_ljh">{{ item.itemCode }}</view>
<view class="tit_ljh">{{index+1+'.'+item.itemCode }}</view>
<view class="label_xm font_sm fr">{{ item.packingCode }}</view>
</view>
<view class="desc_card uni-flex space-between">
@ -134,6 +134,7 @@
<win-inventory-status ref="statusPopup"></win-inventory-status>
<!-- com-message必须放在最下层 -->
<com-message ref="comMessage" @afterCloseCommitMessage='closeCommitMessage()'></com-message>
<!-- <uni-load-more :status="loadingType" v-if="details.length>0"></uni-load-more> -->
</view>
</template>
@ -192,7 +193,8 @@
type: '',
id: '',
datacontent: {},
details: {},
details: [],
allDetails: [], //
currentItem: {},
editDescItem: {},
scrollTop: 0,
@ -208,7 +210,9 @@
topItem: '',
isShowScanPopup: false,
statusArray: [],
allStatusArray: []
allStatusArray: [],
ipage: 1,
iSize: 50,
// array: [{
// text: '',
// value: 1
@ -246,7 +250,7 @@
onNavigationBarButtonTap(e) {
if (e.index === 0) {
goHome();
}else if(e.index === 1){
} else if (e.index === 1) {
window.location.reload();
}
},
@ -261,6 +265,16 @@
});
}
},
onReachBottom() {
this.ipage = this.ipage + 1;
this.refresh();
//
// if (this.loadingType == 'loading' || this.loadingType == 'nomore') {
// return;
// }
// this.getList("more");
},
filters: {
statusStyle: function(val) {
return getJobStatuStyle(val);
@ -314,7 +328,7 @@
getCountJobDetail(params)
.then(async res => {
that.datacontent = res;
that.allCount = res.details.length
if (res.details != null) {
res.details.forEach(r => {
r.scaned = false
@ -323,7 +337,9 @@
r.countQty = 0;
})
}
that.details = res.details;
that.allDetails = res.details;
that.allCount = res.details.length
that.refresh();
//
let locationCode = that.datacontent.locationCode;
let location = await locationsAsync(locationCode);
@ -336,6 +352,49 @@
uni.hideLoading();
},
refresh() {
let allPageSize = this.allDetails.length / this.iSize;
if (allPageSize + 1 > this.ipage) {
for (var i = (this.ipage - 1) * this.iSize; i < this.ipage * this.iSize; i++) {
if (i < this.allDetails.length) {
let item = this.allDetails[i];
//
let data = this.details.find(r => r.id == item.id);
if (data == null || data == undefined) {
this.details.push(item)
}
} else {
return;
}
}
}
},
//
// this.navdelay(allData, this.ipage, 0);
navdelay(data, ipage, istart) {
//
if (istart != 0) {
istart++
}
for (let i = istart; i < data.length; i++) {
this.details.push(data[i]);
istart = i
console.log(istart)
if (i != 0 && i % ipage == 0) {
break
}
}
if (this.details == data.length) {
return
}
setTimeout(() => {
this.navdelay(data, ipage, istart)
}, 200)
},
getScanResult(result) {
let that = this;
this.scanResult = result;
@ -345,7 +404,7 @@
let lot = result.data.lot === null ? '' : result.data.lot;
// let items = this.details.filter(r => r.itemCode === itemCode &&
// r.packingCode === packingCode && r.lot === lot)
let items = this.details.filter(r =>
let items = this.allDetails.filter(r =>
r.packingCode === packingCode)
if (items.length === 0) {
//
@ -479,7 +538,15 @@
item.countQty = Number(qty);
item.countTime = new Date();
item.countOperator = localStorage.userId;
//
let data = this.details.find(r => r.id == item.id);
if (data == null || data == undefined) {
this.details.push(item);
}
this.details.sort(compare('countTime')); //
this.scanPopupGetfocus();
this.$forceUpdate();
},
@ -570,7 +637,7 @@
},
finishJob() {
let that=this;
let that = this;
uni.showLoading({
title: "提交中...",
mask: true
@ -630,8 +697,10 @@
},
openScanPopup() {
this.isShowScanPopup = true;
this.$refs.scanPopup.openScanPopup();
setTimeout(r => {
this.isShowScanPopup = true;
this.$refs.scanPopup.openScanPopup();
}, 0)
},
closeScanPopup() {

Loading…
Cancel
Save