From e85057e243138f5ddf8a2b7c427fdefdec2c6879 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 31 十二月 2025 11:14:33 +0800
Subject: [PATCH] 1.工单列表新增分页功能
---
pages/zlgl/xjjy.vue | 63 +++++++++++++++++++++----------
1 files changed, 42 insertions(+), 21 deletions(-)
diff --git a/pages/zlgl/xjjy.vue b/pages/zlgl/xjjy.vue
index 77032ca..e44890b 100644
--- a/pages/zlgl/xjjy.vue
+++ b/pages/zlgl/xjjy.vue
@@ -40,7 +40,7 @@
<!-- 鎶樺彔闈㈡澘 -->
<!-- <u-collapse @change="change" @close="close" @open="open"> -->
<!-- @change="collapseChange" -->
- <u-collapse style="max-height: 590px;overflow: auto;">
+ <u-collapse style="max-height: 65vh;overflow: auto;">
<!-- :value='parseFloat(item.ordergoodqty)+"/"+parseFloat(item.orderqty)' -->
<scroll-view scroll-y :style="{height: 590 + 'px'}" @scrolltolower="loadMore">
<u-collapse-item style="position: relative;" :title="item.ordercode" :name='item.ordercode'
@@ -125,6 +125,10 @@
</scroll-view>
</u-collapse>
+ <view class="uni-pagination-box">
+ <uni-pagination show-icon :page-size="pageSize" :current="currentpage" :total="total"
+ @change="pageChange" />
+ </view>
<!-- 寮瑰嚭灞� -->
<!-- closeIconPos='top-left' closeOnClickOverlay closeable='true' -->
@@ -295,7 +299,10 @@
// },
], //宸查�変腑鐨勪骇鍝佹爣绛�
order: '', //鍗曞彿
- placeholder2: '鐢熶骇璁㈠崟'
+ placeholder2: '鐢熶骇璁㈠崟',
+ total: 10,
+ currentpage: 1, //绗嚑椤�
+ pageSize: 10, //姣忛〉鏄剧ず澶氬皯鏉�
}
},
@@ -321,11 +328,15 @@
mounted() {
this.init()
- this.getProductOrderSearch()
+ this.getProductOrderSearch(1)
},
methods: {
init() {
uni.stopPullDownRefresh();
+ },
+ // 椤垫暟鏀瑰彉鏃� 鍒嗛〉瑙﹀彂
+ pageChange(e) {
+ this.getProductOrderSearch(e.current)
},
gotoPage(p1, p2) {
let orderstep = null
@@ -354,7 +365,7 @@
},
// 鎺ュ彛鑾峰彇
- async getProductOrderSearch() {
+ async getProductOrderSearch(current) {
let ordertype = '' // SO锛氶攢鍞鍗� MO锛氱敓浜ц鍗� PO锛氱敓浜у伐鍗�
switch (this.radiovalue) {
case '鐢熶骇宸ュ崟':
@@ -383,15 +394,16 @@
ordercode: this.order,
Ratetime: '',
// Ratetime: this.calendarRange,
-
+ page: current,
+ rows: this.pageSize,
+ prop: 'lm_date',
+ sortorder: 'desc'
}
- const {
- data: res
- } = await ProductOrderSearch(data)
-
- this.collapseArr = res
- this.collapseArrAll = res
- this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
+ const res = await ProductOrderSearch(data)
+ this.total = res.count
+ this.collapseArr = res.data
+ this.collapseArrAll = res.data
+ this.alertTitle = this.alertTitle.split('/')[0] + this.total + this.alertTitle.split('/')[
1]
},
@@ -405,22 +417,20 @@
return p.ordercode.indexOf(val) !== -1
})
-
switch (this.radiovalue) {
case '鐢熶骇宸ュ崟':
- this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
+ this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
break
case '鐢熶骇璁㈠崟':
- this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
- // this.alertTitle = '鐢熶骇璁㈠崟鏁伴噺锛堝叡/涓級'
+ this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
break
case '閿�鍞鍗�':
- this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
- // this.alertTitle = '閿�鍞鍗曟暟閲忥紙鍏�/涓級'
+ this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
break
}
- this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
- 1]
+
+ // this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
+ // 1]
},
@@ -491,7 +501,7 @@
// 寮瑰嚭灞傛敹璧�
popupClose() {
- this.getProductOrderSearch()
+ this.getProductOrderSearch(1)
this.popupShow = false
},
@@ -669,4 +679,15 @@
::v-deep .u-cell__body {
padding-bottom: 40rpx;
}
+
+
+ .uni-pagination-box {
+ height: 4vh;
+ margin: 1vh 0;
+
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ // background-color: #fff;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3