From e85057e243138f5ddf8a2b7c427fdefdec2c6879 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 31 十二月 2025 11:14:33 +0800
Subject: [PATCH] 1.工单列表新增分页功能
---
pages/scgl/scbg.vue | 71 +++++++++++++++++++++++++++--------
1 files changed, 54 insertions(+), 17 deletions(-)
diff --git a/pages/scgl/scbg.vue b/pages/scgl/scbg.vue
index aadcb02..e5e99c3 100644
--- a/pages/scgl/scbg.vue
+++ b/pages/scgl/scbg.vue
@@ -40,7 +40,9 @@
<!-- 鎶樺彔闈㈡澘 -->
<!-- <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'
@@ -124,6 +126,14 @@
</u-collapse-item>
</scroll-view>
</u-collapse>
+
+
+
+
+ <view class="uni-pagination-box">
+ <uni-pagination show-icon :page-size="pageSize" :current="currentpage" :total="total"
+ @change="pageChange" />
+ </view>
<!-- 寮瑰嚭灞� -->
@@ -295,7 +305,10 @@
// },
], //宸查�変腑鐨勪骇鍝佹爣绛�
order: '', //鍗曞彿
- placeholder2: '鐢熶骇璁㈠崟'
+ placeholder2: '鐢熶骇璁㈠崟',
+ total: 10,
+ currentpage: 1, //绗嚑椤�
+ pageSize: 10, //姣忛〉鏄剧ず澶氬皯鏉�
}
},
@@ -321,7 +334,7 @@
mounted() {
this.init()
- this.getProductOrderSearch()
+ this.getProductOrderSearch(1)
},
methods: {
init() {
@@ -353,8 +366,14 @@
})
},
+ // 椤垫暟鏀瑰彉鏃� 鍒嗛〉瑙﹀彂
+ pageChange(e) {
+
+ this.getProductOrderSearch(e.current)
+ },
+
// 鎺ュ彛鑾峰彇
- async getProductOrderSearch() {
+ async getProductOrderSearch(current) {
let ordertype = '' // SO锛氶攢鍞鍗� MO锛氱敓浜ц鍗� PO锛氱敓浜у伐鍗�
switch (this.radiovalue) {
case '鐢熶骇宸ュ崟':
@@ -384,14 +403,19 @@
Ratetime: '',
// Ratetime: this.calendarRange,
- }
- const {
- data: res
- } = await ProductOrderSearch(data)
+ page: current,
+ rows: this.pageSize,
+ prop: 'lm_date',
+ sortorder: 'desc'
- 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]
},
@@ -408,17 +432,20 @@
switch (this.radiovalue) {
case '鐢熶骇宸ュ崟':
- this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
+ this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
break
case '鐢熶骇璁㈠崟':
- this.alertTitle = '鐢熶骇璁㈠崟鏁伴噺锛堝叡/涓級'
+ this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
break
case '閿�鍞鍗�':
- 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]
},
@@ -489,7 +516,7 @@
// 寮瑰嚭灞傛敹璧�
popupClose() {
- this.getProductOrderSearch()
+ this.getProductOrderSearch(1)
this.popupShow = false
},
@@ -667,4 +694,14 @@
::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