diff --git a/pages/ProductManage/SboProcess.vue b/pages/ProductManage/SboProcess.vue index 34a53bc..6431e2d 100644 --- a/pages/ProductManage/SboProcess.vue +++ b/pages/ProductManage/SboProcess.vue @@ -59,13 +59,14 @@ + - + @@ -89,20 +90,57 @@ disabled1: false, disabled2: false, disabled3: false, - disabled4: false + disabled4: false, + reload: false, + status: 'more', + contentText: { + contentdown: '查看更多', + contentrefresh: '加载中', + contentnomore: '没有更多' + }, + totalCount: 0, + pageNum: 1, + pageSize: 10 }; }, created () { this._queryRawFoilList() }, methods: { + searchList () { + this.dataList = [] + this._queryRawFoilList() + }, handleChange (e) { // console.log(e) }, /** 初始化查询 */ async _queryRawFoilList () { - let res = await queryRawFoilList(this.val1, this.val2) - this.dataList = [...res.data] + let res = await queryRawFoilList(this.val1, this.val2, this.pageNum + '', this.pageSize + '') + this.totalCount = res.size + if (res.size > 0) { + const dataMap = res.data + this.dataList = this.reload ? dataMap : this.dataList.concat(dataMap) + this.reload = false + } else { + this.dataList = [] + } + if (this.totalCount == this.dataList.length) { + this.reload = false + this.status = 'noMore' + } + + }, + onReachBottom () { + if (this.totalCount > this.dataList.length) { + this.status = 'loading' + setTimeout(() => { + this.pageNum++ + this._queryRawFoilList() + }, 1000) + } else { //停止加载 + this.status = 'noMore' + } }, async _needEmptyAxis () { this.disabled1 = true diff --git a/utils/getData1.js b/utils/getData1.js index 801f1e2..6e30447 100644 --- a/utils/getData1.js +++ b/utils/getData1.js @@ -25,11 +25,13 @@ export const queryRawFoil = (pcode, cname, parea, page, size) => request({ * 生箔工序 */ // 1.1生箔工序初始化查询 -export const queryRawFoilList = (pcode, cname) => request({ +export const queryRawFoilList = (pcode, cname, page, size) => request({ url: 'api/pda/raw/queryRawFoilList', data: { point_code: pcode, - container_name: cname + container_name: cname, + page: page, + size: size } }) // 1.2呼叫空轴