|
|
@ -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() { |
|
|
|
setTimeout(r => { |
|
|
|
this.isShowScanPopup = true; |
|
|
|
this.$refs.scanPopup.openScanPopup(); |
|
|
|
}, 0) |
|
|
|
}, |
|
|
|
|
|
|
|
closeScanPopup() { |
|
|
|