From 22fd33c839969a5c14de0d994701876407385d7f Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 06 一月 2026 14:00:00 +0800
Subject: [PATCH] 1.页面优化
---
pages/scgl/scbg.vue | 162 +++++++++++++++++++++++++++++++++++++-----------------
1 files changed, 111 insertions(+), 51 deletions(-)
diff --git a/pages/scgl/scbg.vue b/pages/scgl/scbg.vue
index cd15dce..68cf44d 100644
--- a/pages/scgl/scbg.vue
+++ b/pages/scgl/scbg.vue
@@ -34,19 +34,22 @@
</view>
- <u-alert :title="alertTitle" type="info"></u-alert>
+ <u-alert :title="'宸ュ崟鏁伴噺锛�'+total+'锛�'" type="info"></u-alert>
<!-- 鎶樺彔闈㈡澘 -->
<!-- <u-collapse @change="change" @close="close" @open="open"> -->
<!-- @change="collapseChange" -->
- <u-collapse style="max-height: 590px;overflow: auto;">
+
+
+ <u-collapse style="max-height: 62vh;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'
- v-if='item.children.length!==0' :value='parseFloat(item.ordergoodqty)+"/"+parseFloat(item.orderqty)'
+ v-if='item.children.length!==0'
+ :value='parseFloat(item.ordergoodqty)+parseFloat(item.orderngqty)+parseFloat(item.orderlaborbadqty)+parseFloat(item.ordermaterielbadqty)+"/"+parseFloat(item.orderqty)'
:label="item.children.length===0?'鏈淳鍙�':''" :disabled='item.children.length===0'
- v-for="item in collapseArr" :key="item.ordercode">
+ v-for="(item,index) in collapseArr" :key="item.ordercode+index">
<view style="position: absolute;left: 30rpx;top:34px;font-size: 24rpx;color: #999;">
@@ -54,10 +57,11 @@
</view>
<!-- <view style="position: absolute;width: 26%;left: 44%;top:16px;"> -->
- <view style="position: absolute;width: 120px;left: 44%;top:16px;color:#0659ff"
- @click="progressClick(item.ordercode)">
+ <view style="position: absolute;width: 120px;left: 44%;top:16px;color:#0659ff">
+ <!-- @click="progressClick(item.ordercode)" -->
<!-- {{item.partname}}{{item.partspec}} -->
- <u-line-progress :percentage="parseFloat((item.ordergoodqty*100/item.orderqty).toFixed(2))"
+ <u-line-progress
+ :percentage="parseFloat(((parseFloat(item.ordergoodqty)+parseFloat(item.orderngqty)+parseFloat(item.orderlaborbadqty)+parseFloat(item.ordermaterielbadqty))*100/item.orderqty).toFixed(2))"
inactiveColor="#d1d6f5" height="10" activeColor="#0659ff"></u-line-progress>
</view>
@@ -97,18 +101,22 @@
<!-- <u--text class="u-collapse-content"> -->
<u-steps :current="-1" inactiveColor='#0659FF' direction="column">
<view v-for="(it,ind) in item.children" :key="item.ordercode+it.name+ind"
- @click="gotoPage(item.ordercode,it.code)" style="display: flex;align-items: center;">
+ @click="gotoPage(item.ordercode,it.code,it)" style="display: flex;align-items: center;">
<!-- <u-steps-item :title="it.code+'/'+it.name+it.spec"></u-steps-item> -->
<u-steps-item :title="it.code+'/'+it.name"></u-steps-item>
<view class="" style="width: 100px;">
- <u-line-progress :percentage="parseFloat((it.goodqty*100/it.planqty).toFixed(2))"
+ <u-line-progress
+ :percentage="parseFloat(((parseFloat(it.goodqty)+parseFloat(it.ngqty)+parseFloat(it.laborbadqty)+parseFloat(it.materielbadqty))*100/it.planqty).toFixed(2))"
inactiveColor="#d1d6f5" height="10" activeColor="#0659ff"></u-line-progress>
</view>
<view style="width: 30%;text-align: right;">
<view class="" style="display: flex;justify-content: flex-end;">
<view style="color: #0659ff;">
{{parseFloat(it.goodqty)}}
+ </view>
+ <view style="color: #ff0000;">
+ +{{parseFloat(it.ngqty)+parseFloat(it.laborbadqty)+parseFloat(it.materielbadqty)}}
</view>
<view>
/{{ parseFloat(it.planqty)}}
@@ -124,6 +132,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>
<!-- 寮瑰嚭灞� -->
@@ -205,9 +221,13 @@
<!-- 鎮诞鐞� -->
- <view @click="scan2">
+ <!-- <view @click="scan2">
<drag-ball :x='300' :y="600"></drag-ball>
- </view>
+ </view> -->
+
+
+ <scan-code></scan-code>
+
</view>
</template>
@@ -216,7 +236,12 @@
import {
ProductOrderSearch
} from '../../config/api.js';
+ import scanCode from '@/components/scan-code/scan-code.vue'
+
export default {
+ components: {
+ scanCode
+ },
onLoad(option) {
const _this = this
uni.$off('scancodedate') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
@@ -224,9 +249,6 @@
console.log("鎵弿鍒扮殑鍐呭涓�:", content)
_this.getCheckScanDeviceQrCodeData(content)
})
-
-
- console.log(option, 8)
},
onPullDownRefresh() {
@@ -295,7 +317,10 @@
// },
], //宸查�変腑鐨勪骇鍝佹爣绛�
order: '', //鍗曞彿
- placeholder2: '鐢熶骇璁㈠崟'
+ placeholder2: '鐢熶骇璁㈠崟',
+ total: 0,
+ currentpage: 1, //绗嚑椤�
+ pageSize: 10, //姣忛〉鏄剧ず澶氬皯鏉�
}
},
@@ -304,7 +329,7 @@
let that = this
uni.startPullDownRefresh({
success() {
- that.getProductOrderSearch()
+ that.getProductOrderSearch(that.currentpage)
uni.showToast({
title: "涓嬫媺鍒锋柊",
icon: 'none'
@@ -321,13 +346,19 @@
mounted() {
this.init()
- this.getProductOrderSearch()
+ this.getProductOrderSearch(1)
},
methods: {
init() {
uni.stopPullDownRefresh();
},
- gotoPage(p1, p2) {
+ gotoPage(p1, p2, it) {
+
+ if (parseFloat(it.goodqty) + parseFloat(it.ngqty) + parseFloat(it.laborbadqty) + parseFloat(it
+ .materielbadqty) === parseFloat(it.planqty)) {
+ return uni.$u.toast('褰撳墠宸ュ簭鏃犲彲鎶ユ暟閲忥紒')
+ }
+
let orderstep = null
if (p1) {
@@ -338,7 +369,7 @@
uni.navigateTo({
- url: './scbg2?orderstep=' + orderstep
+ url: './scbg2?orderstep=' + orderstep + '¤tpage=' + this.currentpage
})
},
@@ -353,23 +384,31 @@
})
},
+ // 椤垫暟鏀瑰彉鏃� 鍒嗛〉瑙﹀彂
+ pageChange(e) {
+ this.currentpage = e.current
+ this.getProductOrderSearch(e.current)
+ },
+
// 鎺ュ彛鑾峰彇
- async getProductOrderSearch() {
+ async getProductOrderSearch(current) {
let ordertype = '' // SO锛氶攢鍞鍗� MO锛氱敓浜ц鍗� PO锛氱敓浜у伐鍗�
switch (this.radiovalue) {
case '鐢熶骇宸ュ崟':
- this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
- this.placeholder = '璇疯緭鍏ュ伐鍗曚俊鎭�'
+ // this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
+ // this.placeholder = '璇疯緭鍏ュ伐鍗曚俊鎭�'
ordertype = 'PO'
break
case '鐢熶骇璁㈠崟':
- this.alertTitle = '鐢熶骇璁㈠崟鏁伴噺锛堝叡/涓級'
- this.placeholder = '璇疯緭鍏ョ敓浜ц鍗曚俊鎭�'
+ // this.alertTitle = '鐢熶骇璁㈠崟鏁伴噺锛堝叡/涓級'
+ // this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
+ // this.placeholder = '璇疯緭鍏ョ敓浜ц鍗曚俊鎭�'
ordertype = 'MO'
break
case '閿�鍞鍗�':
- this.alertTitle = '閿�鍞鍗曟暟閲忥紙鍏�/涓級'
- this.placeholder = '璇疯緭鍏ラ攢鍞鍗曚俊鎭�'
+ // this.alertTitle = '閿�鍞鍗曟暟閲忥紙鍏�/涓級'
+ // this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
+ // this.placeholder = '璇疯緭鍏ラ攢鍞鍗曚俊鎭�'
ordertype = 'SO'
break
}
@@ -382,15 +421,20 @@
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('/')[
- 1]
+ }
+ 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]
},
loadMore() {
@@ -399,24 +443,30 @@
//杈撳叆妗嗗洖杞︾‘璁や簨浠�
confirmInputBoxValue(val) {
- this.collapseArr = this.collapseArrAll.filter((p) => {
- return p.ordercode.indexOf(val) !== -1
- })
+ this.order = val
+ this.currentpage = 1
+ this.getProductOrderSearch(1)
+ // this.collapseArr = this.collapseArrAll.filter((p) => {
+ // return p.ordercode.indexOf(val) !== -1
+ // })
- switch (this.radiovalue) {
- case '鐢熶骇宸ュ崟':
- this.alertTitle = '宸ュ崟鏁伴噺锛堝叡/涓級'
- break
- case '鐢熶骇璁㈠崟':
- this.alertTitle = '鐢熶骇璁㈠崟鏁伴噺锛堝叡/涓級'
- break
- case '閿�鍞鍗�':
- this.alertTitle = '閿�鍞鍗曟暟閲忥紙鍏�/涓級'
- break
- }
- this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
- 1]
+ // switch (this.radiovalue) {
+ // case '鐢熶骇宸ュ崟':
+ // this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
+ // break
+ // case '鐢熶骇璁㈠崟':
+ // this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
+ // break
+ // case '閿�鍞鍗�':
+ // this.alertTitle = '宸ュ崟鏁伴噺锛堝叡' + this.total + '涓級'
+ // break
+ // }
+
+
+
+ // this.alertTitle = this.alertTitle.split('/')[0] + this.collapseArr.length + this.alertTitle.split('/')[
+ // 1]
},
@@ -487,7 +537,7 @@
// 寮瑰嚭灞傛敹璧�
popupClose() {
- this.getProductOrderSearch()
+ this.getProductOrderSearch(1)
this.popupShow = false
},
@@ -665,4 +715,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