diff --git a/src/api/request2.js b/src/api/request2.js index 7ba5f0b3..b483df7f 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -386,12 +386,12 @@ export function getBalanceByContainerNumber(params) { * @param {*} header version * 获取标签设置信息 */ -export function getLabelByHeader(header, version) { +export async function getLabelByHeader(header, version) { var params = { header: header, version: version, } - return request({ + return await request({ url: baseApi + "/wms/labeltype/getDetailsByHeader", method: "get", data: params, diff --git a/src/mycomponents/qty/countQtyEdit.vue b/src/mycomponents/qty/countQtyEdit.vue index dff58d3d..b2529e2c 100644 --- a/src/mycomponents/qty/countQtyEdit.vue +++ b/src/mycomponents/qty/countQtyEdit.vue @@ -187,7 +187,7 @@ // this.allQty = Number(this.dataContent.qty) // this.stdCount = Math.ceil(this.allQty / this.dataContent.packQty); // this.detailList = detailList - this.showConfirmCountdown = false; + this.c = false; this.mode = 'edit'; setTimeout(res => { this.$refs.popup.open('bottom') @@ -198,12 +198,12 @@ //新增时弹出 openEditPopupShowSeconds(item, detailList) { this.initData(item, detailList); - this.showConfirmCountdown = true; + this.showConfirmCountdown = false; this.mode = 'add'; setTimeout(res => { this.$refs.popup.open('bottom') }, 500) - this.startTimer() + clearInterval(this.timer) }, initData(item, detailList) { diff --git a/src/pages/count/job/countLightDetail.vue b/src/pages/count/job/countLightDetail.vue index 58f9c0cd..c5aad2ca 100644 --- a/src/pages/count/job/countLightDetail.vue +++ b/src/pages/count/job/countLightDetail.vue @@ -17,28 +17,27 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + - + @@ -49,12 +48,12 @@ + :isHavePackNumber="true" :pdaCountBalanceQuery="true" :isShowHistory="false" + @getCountScanResult='getCountScanResult'> + :allowEditStatus="false" :isShowBalance="true" > @@ -125,6 +124,7 @@ jobContent: {}, //任务内容 subList: [], //接口返回的任务subList detailSource: [], //绑定在页面上的数据源 + showDataList: [], balance: {}, //库存余额 currentEditItem: {}, mainItem: {}, @@ -134,14 +134,27 @@ dataList: [], managementList: [], isOpen: false, - manageMode: "" - + manageMode: "", + pageSize: 10, + currentPage: 1, + timer:null, + loadingType:'loading' }; }, - onLoad(option) { + async onLoad(option) { this.id = option.id; if (this.id) { - this.getDetail(); + await this.getDetail(); + this.timer = setInterval(()=>{ + if (this.showDataList.length == this.dataList.length) { + + this.loadingType='loadingType' + return + } + console.log(22) + this.currentPage += 1; + },1000) + } uni.$on('refreshData', (data) => { // 调用刷新数据的方法 @@ -154,6 +167,11 @@ goHome(); } }, + onUnload(){ + if(this.timer){ + clearInterval(this.timer) + } + }, //拦截返回按钮事件 onBackPress(e) { //已经接收但是没提交任务 @@ -162,13 +180,29 @@ return true; } }, - + onReachBottom() { + + }, mounted() { }, - computed() {}, + computed: { + showTableData() { + if (this.dataList.length > this.pageSize) { + const array = this.dataList.slice( + (this.currentPage - 1) * this.pageSize, + this.currentPage * this.pageSize + ) + this.showDataList = this.showDataList.concat(array) + return this.showDataList + } else { + clearInterval(this.timer) + return this.dataList + } + } + }, methods: { filterList(originalList) { var resultList = [] @@ -200,13 +234,13 @@ } return manageMode }, - getDetail() { + async getDetail() { var that = this; uni.showLoading({ title: "加载中....", mask: true }); - getCountJobDetail(that.id).then(async res => { + await getCountJobDetail(that.id).then(async res => { uni.hideLoading(); if (res.data == null) { that.showMessage('未获取到详情'); @@ -229,7 +263,16 @@ this.showErrorMessage(error) }) }, + // 用假分页处理渲染卡顿问题 + // showTableData (){ + + // }, + scrolltolower() { + this.currentPage += 1; + console.log(this.currentPage) + console.log(this.showTableData) + }, refreshData(returnData) { if (returnData.recordList.length == 0) { if (this.manageMode == "BY_BATCH") {