From 67d4e9ca4267049cc67cff15828080d2d5dfce0b Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期三, 01 四月 2026 16:23:01 +0800
Subject: [PATCH] 1
---
吉安PDA/pages/stash/TakeStockOrder.vue | 143 +++++++++++++++++++++++++++++++----------------
1 files changed, 94 insertions(+), 49 deletions(-)
diff --git "a/\345\220\211\345\256\211PDA/pages/stash/TakeStockOrder.vue" "b/\345\220\211\345\256\211PDA/pages/stash/TakeStockOrder.vue"
index 93f88ed..bf2c0f6 100644
--- "a/\345\220\211\345\256\211PDA/pages/stash/TakeStockOrder.vue"
+++ "b/\345\220\211\345\256\211PDA/pages/stash/TakeStockOrder.vue"
@@ -6,16 +6,34 @@
</view>
</u-sticky>
<uni-list :border="true">
- <uni-list-item direction="column" clickable @click="groupClick(item.orderNo)" link
- :to="page+item.orderNo+'&warehouseId='+warehouseId+'&id='+item.id" v-for="item in allReceivingOrders"
- :key="item.orderNo">
+ <uni-list-item
+ direction="column"
+ clickable
+ @click="groupClick(item.orderNo)"
+ link
+ :to="`${page}${item.orderNo}&warehouseId=${warehouseId}&id=${item.id}`"
+ v-for="item in allReceivingOrders"
+ :key="item.orderNo"
+ >
<template v-slot:body>
<uni-group margin-top="20">
- <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;">
+ <view style="line-height: 17px;color: #596671;font-size: 14px;display: flex;justify-content: space-between;">
鐩樼偣鍗曞彿 {{item.orderNo}}
</view>
- <view style="line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;">
+ <view style="line-height: 17px;color: #596671;font-size: 14px;display: flex;justify-content: space-between;">
鍒涘缓鏃堕棿 {{item.createDate}}
+ </view>
+ <!-- 鎵樼洏缂栧彿灞曠ず鍖哄煙 -->
+ <view style="line-height: 17px;color: #596671;font-size: 14px;margin-top: 10rpx;">
+ 闇�鐩樼偣鐩樺彿锛�
+ <view style="display: inline-flex;flex-wrap: wrap;margin-left: 10rpx;">
+ <text
+ style="display: inline-block;background-color: #f5f5f5;padding: 2rpx 10rpx;border-radius: 4rpx;margin: 0 5rpx 5rpx 0;"
+ v-for="(detail, index) in item.details"
+ :key="index">
+ {{detail.takePalletCode}} ,鏂欏彿:{{detail.materielCode}}
+ </text>
+ </view>
</view>
<view
style="margin-top: 10rpx;display: flex;align-items: center; ">
@@ -26,9 +44,13 @@
</uni-group>
</template>
</uni-list-item>
-
</uni-list>
- <uni-load-more :status="status" v-if="loadVisible"></uni-load-more>
+ <!-- 鍔犺浇鏇村缁勪欢 -->
+ <uni-load-more
+ :status="status"
+ :show-icon="true"
+ v-if="allReceivingOrders.length > 0 || status === 'loading'"
+ ></uni-load-more>
<u-back-top :scroll-top="scrollTop" top="400"></u-back-top>
</view>
@@ -40,95 +62,118 @@
data() {
return {
page: "/pages/stash/TakeStock?orderNo=",
- loadVisible: false,
searchValue: "",
warehouseId: "",
- status: "more",
+ status: "more", // 鍔犺浇鐘舵�侊細more-鍙姞杞斤紝loading-鍔犺浇涓紝noMore-鏃犳洿澶�
allReceivingOrders: [],
pageNo: 1,
+ pageSize: 5, // 鍏抽敭淇锛氫笌鍚庣淇濇寔涓�鑷达紙姣忛〉5鏉★級
scrollTop: 0,
- isLoaded:false
+ isLoaded: false,
+ isLoading: false, // 闃叉閲嶅鍔犺浇鐨勯攣
+ hasMore: true // 鏄惁杩樻湁鏇村鏁版嵁
}
},
onLoad(res) {
this.warehouseId = res.warehouseId;
this.isLoaded = true;
- this.getData();
+ this.resetData(); // 閲嶇疆鏁版嵁骞跺姞杞界涓�椤�
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
onShow() {
if (this.isLoaded) {
- // 浠庡叾浠栭〉闈㈣繑鍥炴椂鍒锋柊
- this.getData();
+ this.resetData();
}
},
onReachBottom() {
- this.pageNo += 1;
- this.getData();
+ // 涓嬫媺鍒板簳閮ㄦ椂鍔犺浇鏇村
+ if (this.hasMore && !this.isLoading) {
+ this.pageNo += 1;
+ this.getData();
+ }
},
methods: {
- search(res) {
+ // 鎼滅储鏃堕噸缃暟鎹�
+ search() {
+ this.resetData();
+ },
+
+ // 閲嶇疆鏁版嵁鍒板垵濮嬬姸鎬�
+ resetData() {
this.pageNo = 1;
+ this.allReceivingOrders = [];
+ this.hasMore = true;
+ this.status = "more";
this.getData();
},
+
groupClick() {
-
+ // 鐐瑰嚮浜嬩欢澶勭悊
},
+
+ // 鑾峰彇鏁版嵁
getData() {
- var postData = {
+ if (this.isLoading || !this.hasMore) return;
+
+ this.isLoading = true;
+ this.status = "loading";
+
+ const postData = {
MainData: {
orderNo: this.searchValue,
pageNo: this.pageNo,
+ // 鍚庣鍥哄畾姣忛〉5鏉★紝杩欓噷鍙互涓嶄紶閫抪ageSize锛屼繚鎸佷笌鍚庣涓�鑷�
warehouseId: this.warehouseId,
},
}
- this.$u.post('/api/TakeStockOrder/GetTakeStockOrders', postData).then((res) => {
- if (res.status) {
- if (res.data.length > 0) {
- if (this.searchValue == '') {
- this.allReceivingOrders =res.data.map(i => ({
- ...i,
- takeStockStatus: TakeStockStatus.find(item => item.value == i
- .takeStockStatus).label
- }))
- // this.allReceivingOrders = res.data;
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
+
+ this.$u.post('/api/TakeStockOrder/GetTakeStockOrders', postData)
+ .then((res) => {
+ this.isLoading = false;
+
+ if (res.status) {
+ const processedData = res.data.map(item => ({
+ ...item,
+ takeStockStatus: TakeStockStatus.find(status => status.value === item.takeStockStatus)?.label || ''
+ }));
+
+ if (processedData.length > 0) {
+ if (this.pageNo === 1) {
+ this.allReceivingOrders = processedData;
} else {
- this.loadVisible = false;
+ this.allReceivingOrders = [...this.allReceivingOrders, ...processedData];
}
+
+ // 鍏抽敭淇锛氭牴鎹悗绔疄闄呰繑鍥炴暟閲忓垽鏂槸鍚﹁繕鏈夋洿澶�
+ // 鍚庣鍥哄畾姣忛〉5鏉★紝鎵�浠ュ綋杩斿洖5鏉℃椂璇存槑鍙兘杩樻湁鏇村锛屽皯浜�5鏉″垯璇存槑娌℃湁鏇村
+ this.hasMore = processedData.length === this.pageSize;
+ this.status = this.hasMore ? "more" : "noMore";
} else {
- // this.allReceivingOrders = res.data;
- if (postData.MainData.pageNo == 1) {
+ if (this.pageNo === 1) {
this.allReceivingOrders = [];
}
- this.allReceivingOrders =res.data.map(i => ({
- ...i,
- takeStockStatus: TakeStockStatus.find(item => item.value == i
- .takeStockStatus).label
- }))
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
+ this.hasMore = false;
+ this.status = "noMore";
}
} else {
- this.status = 'noMore';
- //this.allReceivingOrders = [];
- this.loadVisible = true;
+ this.status = this.pageNo > 1 ? "more" : "noMore";
+ this.$u.toast('鏁版嵁鍔犺浇澶辫触锛岃閲嶈瘯');
}
-
- }
- })
+ })
+ .catch(() => {
+ this.isLoading = false;
+ this.status = this.pageNo > 1 ? "more" : "noMore";
+ this.$u.toast('缃戠粶閿欒锛岃妫�鏌ョ綉缁�');
+ });
}
}
}
</script>
<style lang="scss">
+ /* 鏍峰紡淇濇寔涓嶅彉 */
@import '@/common/uni-ui.scss';
page {
--
Gitblit v1.9.3