diff --git a/pages.json b/pages.json
index 68b4571..dd3e26b 100644
--- a/pages.json
+++ b/pages.json
@@ -33,7 +33,9 @@
{
"path": "pages/modules/SemifinishedMaterSearch",
"style": {
- "navigationStyle": "custom"
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": true,
+ "onReachBottomDistance": 50
}
},
{
diff --git a/pages/modules/SemifinishedMaterSearch.vue b/pages/modules/SemifinishedMaterSearch.vue
index 64d3596..34680ae 100644
--- a/pages/modules/SemifinishedMaterSearch.vue
+++ b/pages/modules/SemifinishedMaterSearch.vue
@@ -40,10 +40,11 @@
+
-
+
@@ -62,17 +63,56 @@
val1: '',
dataList: [],
pkId: '',
- pkObj: {}
+ pkObj: {},
+ reload: false,
+ status: 'more',
+ contentText: {
+ contentdown: '查看更多',
+ contentrefresh: '加载中',
+ contentnomore: '没有更多'
+ },
+ totalCount: 0,
+ pageNum: 1,
+ pageSize: 30
};
},
methods: {
handleChange (e) {
+ this.dataList = []
+ this.pageNum = 1
this._getMaterial(e)
},
+ searchList () {
+ this.dataList = []
+ this.pageNum = 1
+ this._getMaterial(this.val1)
+ },
/** grid查询 */
async _getMaterial (e) {
- let res = await getMaterial(e)
- this.dataList = [...res.data]
+ let res = await getMaterial(e, 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._getMaterial(this.val1)
+ }, 1000)
+ } else { //停止加载
+ this.status = 'noMore'
+ }
},
toCheck (e) {
this.pkId = this.pkId === e.material_code ? '' : e.material_code
diff --git a/utils/getData2.js b/utils/getData2.js
index dc08da5..12cd192 100644
--- a/utils/getData2.js
+++ b/utils/getData2.js
@@ -80,10 +80,12 @@ export const authority = () => {
* 半成品入库
*/
// 1.1物料选择页面 -- 单选
-export const getMaterial = (sp) => request({
+export const getMaterial = (sp, page, size) => request({
url:'api/pda/hrBcp/iosIn/getMaterial',
data: {
- material_spec: sp
+ material_spec: sp,
+ page: page,
+ size: size
}
})
// 1.2工序下拉框