|
|
@ -156,15 +156,155 @@ |
|
|
|
</view> |
|
|
|
</scroll-view> --> |
|
|
|
<view class="" v-if="allDetails.length>0"> |
|
|
|
<z-paging ref="paging" use-virtual-list use-compatibility-mode cell-height-mode="dynamic" @query="queryList" |
|
|
|
@openEditCount="openEditCount" |
|
|
|
@openEditCountDesc="openEditCountDesc" |
|
|
|
> |
|
|
|
<z-paging ref="paging" use-virtual-list cell-height-mode="dynamic" @query="queryList"> |
|
|
|
<template #top> |
|
|
|
<com-count-scan-detail :jobContent="datacontent" :allCount="allCount" :scanCount="scanCount" |
|
|
|
:newCount="newCount" :location="location"> |
|
|
|
</com-count-scan-detail> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template #cell="{item,index}"> |
|
|
|
<view> |
|
|
|
<uni-swipe-action> |
|
|
|
<uni-swipe-action-item :right-options="options" :auto-close="false" |
|
|
|
@click="swipeClick($event,item,index)"> |
|
|
|
<view class="detail-content common_card"> |
|
|
|
<view class="choose_main"> |
|
|
|
<view class="ljh_box"> |
|
|
|
<view class="ljh_info"> |
|
|
|
<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"> |
|
|
|
<view class="desc_ljh"> |
|
|
|
<view class="font_xs text_lightblue"> {{ item.itemName }}</view> |
|
|
|
<view class="font_xs text_lightblue">{{ item.itemDesc1 }} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="list_form"> |
|
|
|
<view> |
|
|
|
<uni-table style="overflow-x: hidden;"> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="100"></uni-th> |
|
|
|
<uni-th width="100" align="center">库存</uni-th> |
|
|
|
<uni-th width="100" align="center">盘点</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr> |
|
|
|
<uni-th width="100">数量({{item.uom}})</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<text class="text_black">{{item.inventoryQty}}</text> |
|
|
|
</uni-th> |
|
|
|
<uni-th width="100" align="center"> |
|
|
|
<!-- <com-number-box v-if="item.scaned && item.packingCode" |
|
|
|
v-model="item.countQty" :max="99999" :min="0" |
|
|
|
@change="qtyChanged($event,item)" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> |
|
|
|
<com-number-box v-if="item.packingCode==''" |
|
|
|
v-model="item.countQty" |
|
|
|
@change="qtyChanged($event,item)" :max="99999" |
|
|
|
:min="0" style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> --> |
|
|
|
<view class="flex" |
|
|
|
style="align-items: center;justify-content: center;" |
|
|
|
v-if="item.scaned && item.packingCode"> |
|
|
|
<text class="text_black">{{item.countQty}} </text> |
|
|
|
<view class="photo_btn fr" @click="openEditCount(item)"> |
|
|
|
<text class="fl font_xs">修改</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="flex" |
|
|
|
style="align-items: center;justify-content: center;" |
|
|
|
v-if="item.packingCode==''"> |
|
|
|
<text class="text_black">{{item.countQty}} </text> |
|
|
|
<view class="photo_btn fr" @click="openEditCount(item)"> |
|
|
|
<text class="fl font_xs">修改</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="" v-else-if="!item.scaned"> |
|
|
|
<text class="text_black">{{item.countQty}}</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <text class="text_black" v-if="item.packingCode" |
|
|
|
style="font-size: 1rem;">{{item.countQty}}</text> --> |
|
|
|
<!-- <com-number-box v-else v-model="item.countQty" |
|
|
|
:max="99999" :min="0" |
|
|
|
style='margin-right: 10px;padding: 2px;'> |
|
|
|
</com-number-box> --> |
|
|
|
|
|
|
|
</uni-th> |
|
|
|
</uni-tr> |
|
|
|
</uni-table> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="margin:0 20rpx 20rpx;"> |
|
|
|
<view class="uni-flex uni-row bot_card"> |
|
|
|
<view class="bot_card_item"> |
|
|
|
<label class="icon_bg icon_bg_kw" style="text-align: center;"> |
|
|
|
<text |
|
|
|
style=" display: block; color: white;text-align: center;font-size: 28rpx;">库</text> |
|
|
|
<!-- <image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_kw.svg"> --> |
|
|
|
</image> |
|
|
|
</label> |
|
|
|
<text>{{ item.locationCode }}</text> |
|
|
|
</view> |
|
|
|
<view class="bot_card_item"> |
|
|
|
<label class="icon_bg icon_bg_pc"> |
|
|
|
<text |
|
|
|
style=" display: block; color: white;text-align: center;font-size: 28rpx;">批</text> |
|
|
|
<!-- <image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_pc.svg"> |
|
|
|
</image> --> |
|
|
|
</label> |
|
|
|
<text>{{item.lot}}</text> |
|
|
|
</view> |
|
|
|
<view class="bot_card_item" style="width: 25%;"> |
|
|
|
<view class="uni-flex" v-if="item.isNew "> |
|
|
|
<!-- picker的index默认是0 --> |
|
|
|
<picker @change="bindPickerChange($event,item)" |
|
|
|
:value="item.status-1" :range="statusArray"> |
|
|
|
<view class="uni-flex " style="padding:5px 0px;"> |
|
|
|
<text class="state_point" |
|
|
|
:class="item.status | statusStyle">{{statusArray[item.status-1]}}</text> |
|
|
|
<image class="icon_normal" |
|
|
|
src="@/static/icons_ui/icon_down.svg"> |
|
|
|
</image> |
|
|
|
</view> |
|
|
|
</picker> |
|
|
|
</view> |
|
|
|
<text v-else class="state_point" :class="item.status | statusStyle"> |
|
|
|
{{ item.status | statusColor}} |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="uni-flex space-between" style="margin:0 20rpx 20rpx;" |
|
|
|
v-if="item.scaned || item.packingCode==''"> |
|
|
|
<text class="font_xs" |
|
|
|
style="padding: 5px 2px; text-overflow: ellipsis; overflow: hidden;">{{item.countDescription}}</text> |
|
|
|
<view class="photo_btn fr" @click="openEditCountDesc(item)"> |
|
|
|
<text class="fl font_xs" style="width:65px;">盘点描述</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view v-if="item.scaned" class="choose_marked_count" |
|
|
|
style="background-color: #5FCB94; opacity: 0.65"> |
|
|
|
<view class="" style="background-color: #5FCB94; width: 200rpx;height: 300rpx;"> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- <image src="@/static/image_marked.svg"></image> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</uni-swipe-action-item> |
|
|
|
</uni-swipe-action> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
</z-paging> |
|
|
|
</view> |
|
|
|
|
|
|
@ -265,22 +405,10 @@ |
|
|
|
ipage: 1, |
|
|
|
iSize: 20, |
|
|
|
testList: [], |
|
|
|
isload: false, |
|
|
|
isload: true, |
|
|
|
loadingType: "", |
|
|
|
currentPage:1, |
|
|
|
pageSize:10, |
|
|
|
extraData: { |
|
|
|
//给这个页面的虚拟列表取一个名字,这样在zp-virtual-cell中可以根据这个名字来区分不同页面的cell |
|
|
|
id: 'test1', |
|
|
|
//这边可以附加其他的当前页面需要传给cell的值 |
|
|
|
|
|
|
|
//这里示范了通过props传递方法回调来代替cell组件内部emit的场景,如果需要监听点击cell可以直接通过@innerCellClick监听 |
|
|
|
editCountCallBack: (title) => { |
|
|
|
//点击了标题 |
|
|
|
console.log('点击了标题' + title) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
currentPage: 0, |
|
|
|
pageSize: 20, |
|
|
|
// array: [{ |
|
|
|
// text: '待检', |
|
|
|
// value: 1 |
|
|
@ -333,24 +461,15 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
onReachBottom() { |
|
|
|
console.log("滑动底部") |
|
|
|
// this.ipage = this.ipage + 1; |
|
|
|
// this.refresh(); |
|
|
|
//避免多次触发 |
|
|
|
// if (this.loadingType == 'loading' || this.loadingType == 'nomore') { |
|
|
|
// return; |
|
|
|
// } |
|
|
|
// this.getList("more"); |
|
|
|
}, |
|
|
|
onReachBottom() {}, |
|
|
|
|
|
|
|
filters: { |
|
|
|
statusStyle: function(val) { |
|
|
|
return getJobStatuStyle(val); |
|
|
|
}, |
|
|
|
statusColor: function(val) { |
|
|
|
return getJobStatuDesc(val); |
|
|
|
}, |
|
|
|
// statusColor: function(val) { |
|
|
|
// return getJobStatuDesc(val); |
|
|
|
// }, |
|
|
|
statusStyle: function(val) { |
|
|
|
return getInventoryTypeStyle(val); |
|
|
|
}, |
|
|
@ -398,7 +517,7 @@ |
|
|
|
.then(async res => { |
|
|
|
that.datacontent = res; |
|
|
|
// var test = res.details[0] |
|
|
|
// for (var i = 0; i < 6000; i++) { |
|
|
|
// for (var i = 0; i < 10000; i++) { |
|
|
|
// var detail = {} |
|
|
|
// var detail = Object.assign(detail, test) |
|
|
|
// detail.id = i; |
|
|
@ -415,8 +534,6 @@ |
|
|
|
} |
|
|
|
that.allDetails = res.details; |
|
|
|
that.allCount = res.details.length |
|
|
|
// that.refresh(); |
|
|
|
// this.details =this.getDataPage() |
|
|
|
|
|
|
|
//查询库位信息 |
|
|
|
let locationCode = that.datacontent.locationCode; |
|
|
@ -430,59 +547,16 @@ |
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getDataPage(){ |
|
|
|
getDataPage(pageNo, pageSize) { |
|
|
|
//计算总页数 |
|
|
|
var totalPages= Math.ceil(this.allCount/this.pageSize); |
|
|
|
var totalPages = Math.ceil(this.allCount / pageSize); |
|
|
|
//当前页起始索引 |
|
|
|
const start = (this.currentPage-1)*this.pageSize; |
|
|
|
const end =start+this.pageSize;//当前页结束索引 |
|
|
|
return this.allDetails.slice(start,end) |
|
|
|
const start = (pageNo - 1) * pageSize; |
|
|
|
const end = start + pageSize; //当前页结束索引 |
|
|
|
return this.allDetails.slice(start, end) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//懒加载 |
|
|
|
// 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; |
|
|
@ -497,7 +571,7 @@ |
|
|
|
if (items.length === 0) { |
|
|
|
//按零件盘点,不能添加其他零件为明细 |
|
|
|
if (this.datacontent.countMethod === 2) { |
|
|
|
if (this.details[0].itemCode === itemCode) { |
|
|
|
if (this.allDetails[0].itemCode === itemCode) { |
|
|
|
this.addNewDetail(result); |
|
|
|
} else { |
|
|
|
this.showMessage('扫描的库存不在列表中'); |
|
|
@ -517,7 +591,7 @@ |
|
|
|
} else { |
|
|
|
this.showMessage('盘点数量异常,箱码【' + packingCode + '】的出现多条数据'); |
|
|
|
} |
|
|
|
this.scrollToTop(); |
|
|
|
// this.scrollToTop(); |
|
|
|
this.calcScanCount(); |
|
|
|
}, |
|
|
|
|
|
|
@ -534,7 +608,7 @@ |
|
|
|
if (confirm) { |
|
|
|
this.setDetailNoBalance(detail, result) |
|
|
|
this.allDetails.unshift(detail); |
|
|
|
this.details.unshift(detail); |
|
|
|
// this.details.unshift(detail); |
|
|
|
this.calcAllCount(); |
|
|
|
this.calcScanCount(); |
|
|
|
this.$forceUpdate(); |
|
|
@ -554,7 +628,7 @@ |
|
|
|
if (confirm) { |
|
|
|
this.setDetailByBalance(detail, balanceItem); |
|
|
|
this.allDetails.unshift(detail); |
|
|
|
this.details.unshift(detail); |
|
|
|
// this.details.unshift(detail); |
|
|
|
this.calcAllCount(); |
|
|
|
this.calcScanCount(); |
|
|
|
this.$forceUpdate(); |
|
|
@ -651,18 +725,8 @@ |
|
|
|
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); |
|
|
|
} |
|
|
|
// var list =[]; |
|
|
|
// var record ={} |
|
|
|
// list.push(Object.assign(record, item)) |
|
|
|
// this.$refs.paging.addDataFromTop(list); |
|
|
|
|
|
|
|
this.allDetails.sort(compare('countTime')); //按扫描信息排序 |
|
|
|
this.$refs.paging.setLocalPaging(this.allDetails); |
|
|
|
this.$refs.paging.reload(); |
|
|
|
this.scanPopupGetfocus(); |
|
|
|
this.$forceUpdate(); |
|
|
|
}, |
|
|
@ -681,7 +745,7 @@ |
|
|
|
content: '是否移除选择的行?', |
|
|
|
success: res => { |
|
|
|
if (res.confirm) { |
|
|
|
that.details.splice(index, 1); |
|
|
|
that.allDetails.splice(index, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -722,6 +786,8 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
submit() { |
|
|
|
// let params = JSON.stringify(this.allDetails); |
|
|
|
// console.log('params', params); |
|
|
|
let that = this; |
|
|
|
let unCheckedItems = that.allDetails.filter(r => { |
|
|
|
return r.scaned === false |
|
|
@ -742,15 +808,16 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
finish() { |
|
|
|
if (this.details.length == 0) { |
|
|
|
showConfirmMsg('还没有要盘点的任务详情,是否要继续提交?', confirm => { |
|
|
|
if (confirm) { |
|
|
|
this.finishJob(); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.finishJob(); |
|
|
|
} |
|
|
|
// if (this.details.length == 0) { |
|
|
|
// showConfirmMsg('还没有要盘点的任务详情,是否要继续提交?', confirm => { |
|
|
|
// if (confirm) { |
|
|
|
// this.finishJob(); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// this.finishJob(); |
|
|
|
// } |
|
|
|
}, |
|
|
|
|
|
|
|
finishJob() { |
|
|
@ -888,8 +955,10 @@ |
|
|
|
this.old.scrollTop = e.detail.scrollTop |
|
|
|
}, |
|
|
|
queryList(pageNo, pageSize) { |
|
|
|
console.log("queryList") |
|
|
|
this.$refs.paging.setLocalPaging(this.allDetails); |
|
|
|
var list = [] |
|
|
|
this.currentPage = pageNo |
|
|
|
list = this.getDataPage(pageNo, pageSize) |
|
|
|
this.$refs.paging.complete(list) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|