From a21dbebd61e8d52ba66d9fe18b60e6d333aea04b Mon Sep 17 00:00:00 2001 From: caill <815519168@qq.com> Date: Sat, 10 Dec 2022 13:47:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 4 +- pages/ProductManage/SlittingFeeding.vue | 57 +++++++++++++++---- pages/WarehouseManage/SemifinishedInStore.vue | 5 +- utils/getData2.js | 6 +- 4 files changed, 56 insertions(+), 16 deletions(-) diff --git a/pages.json b/pages.json index 7709910..cdd52a3 100644 --- a/pages.json +++ b/pages.json @@ -203,7 +203,9 @@ ,{ "path" : "pages/ProductManage/SlittingFeeding", "style": { - "navigationStyle": "custom" + "navigationStyle": "custom", + "enablePullDownRefresh": true, + "onReachBottomDistance": 50 } } ], diff --git a/pages/ProductManage/SlittingFeeding.vue b/pages/ProductManage/SlittingFeeding.vue index 1c82988..b4031b8 100644 --- a/pages/ProductManage/SlittingFeeding.vue +++ b/pages/ProductManage/SlittingFeeding.vue @@ -42,7 +42,7 @@ - + {{Number(i) + 1}} {{e.mfg_order_name}} {{e.container_name}} @@ -62,10 +62,11 @@ + - + @@ -87,14 +88,28 @@ dataList: [], disabled: false, pkId: '', - pkObj: {} + pkObj: {}, + reload: false, + status: 'more', + contentText: { + contentdown: '查看更多', + contentrefresh: '加载中', + contentnomore: '没有更多' + }, + totalCount: 0, + pageNum: 1, + pageSize: 10 }; }, created () { this._queryProductArea() - this._feedingQueryMaterialInfo() }, methods: { + searchList () { + this.dataList = [] + this.pageNum = 1 + this._feedingQueryMaterialInfo() + }, /** 选择器 */ selectChange(e) { this.index = e @@ -106,8 +121,30 @@ }, /** 初始化查询 */ async _feedingQueryMaterialInfo () { - let res = await feedingQueryMaterialInfo(this.index, this.val1) - this.dataList = [...res.data] + let res = await feedingQueryMaterialInfo(this.index, this.val1, 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._feedingQueryMaterialInfo() + }, 1000) + } else { //停止加载 + this.status = 'noMore' + } }, /** 确认 */ async toSure () { @@ -117,10 +154,10 @@ return } try { - let res = await feedingConfirm([this.pkObj]) + let res = await feedingConfirm(this.pkObj) this.disabled = false this.pkId = '' - this._feedingQueryMaterialInfo() + this.searchList() uni.showToast({ title: res.message, icon: 'none' @@ -130,8 +167,8 @@ } }, toCheck (e) { - this.pkId = this.pkId === e.mfg_order_name ? '' : e.mfg_order_name - this.pkObj = this.pkId === e.mfg_order_name ? e : {} + this.pkId = this.pkId === e.container_name ? '' : e.container_name + this.pkObj = this.pkId === e.container_name ? e : {} } } } diff --git a/pages/WarehouseManage/SemifinishedInStore.vue b/pages/WarehouseManage/SemifinishedInStore.vue index d2f0990..3ca76de 100644 --- a/pages/WarehouseManage/SemifinishedInStore.vue +++ b/pages/WarehouseManage/SemifinishedInStore.vue @@ -115,6 +115,7 @@ methods: { searchList () { this.dataList = [] + this.pageNum = 1 this._coolIOQuery() }, /** 选择器 */ @@ -141,7 +142,6 @@ this.reload = false this.status = 'noMore' } - }, onReachBottom () { if (this.totalCount > this.dataList.length) { @@ -166,8 +166,7 @@ this.disabled = false this.pkId = '' this.pkObj = {} - this.dataList = [] - this._coolIOQuery() + this.searchList() uni.showToast({ title: res.message, icon: 'none' diff --git a/utils/getData2.js b/utils/getData2.js index 669b822..e9fd450 100644 --- a/utils/getData2.js +++ b/utils/getData2.js @@ -342,11 +342,13 @@ export const virtualprintType = (url) => request1({ * 分切上料 */ // 1.1分切计划初始化查询 -export const feedingQueryMaterialInfo = (area, code) => request({ +export const feedingQueryMaterialInfo = (area, code, page, size) => request({ url:'api/pda/feeding/queryMaterialInfo', data: { product_area: area, - device_code: code + device_code: code, + page: page, + size: size } }) // 1.2呼叫