From 9181f3dce9e6f617b34fa80b7bb72bb490be788b Mon Sep 17 00:00:00 2001
From: yangpeixing <yangpeixing@hnkhzn.com>
Date: 星期四, 12 三月 2026 10:03:21 +0800
Subject: [PATCH] 1
---
吉安PDA/pages/stash/YSinboundorder.vue | 354 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 196 insertions(+), 158 deletions(-)
diff --git "a/\345\220\211\345\256\211PDA/pages/stash/YSinboundorder.vue" "b/\345\220\211\345\256\211PDA/pages/stash/YSinboundorder.vue"
index e954e64..40529f2 100644
--- "a/\345\220\211\345\256\211PDA/pages/stash/YSinboundorder.vue"
+++ "b/\345\220\211\345\256\211PDA/pages/stash/YSinboundorder.vue"
@@ -2,43 +2,66 @@
<view>
<u-sticky>
<view style="background-color: #ffffff;">
- <uni-search-bar @confirm="search" v-model="searchValue"></uni-search-bar>
+ <uni-search-bar @confirm="search" v-model="searchValue" @input="handleSearchInput"></uni-search-bar>
</view>
</u-sticky>
- <uni-list :border="true">
- <uni-list-item direction="column" clickable @click="groupClick(item.orderNo)" link
- :to="page+item.orderNo" 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;">
- 鍏ュ簱鍗曞彿 {{item.orderNo}}
- </view>
- <view style="margin-top: 10rpx;line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;">
- 鍒涘缓浜哄憳 {{item.creater}}
- </view>
- <view style="margin-top: 10rpx;line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;">
- 鍒涘缓鏃ユ湡 {{item.createDate}}
- </view>
- <view
- style="margin-top: 10rpx;display: flex;align-items: center; ">
- <view style="text-align: center;line-height: 40rpx;border-radius: 8rpx; width: 238rpx;height: 40rpx;font-size: 22rpx;background-color:rgba(22,127,247,0.18);color: #1F63FF;">
- 璁㈠崟鐘舵�� {{item.InboundOrderStatus}}
+
+ <!-- 浼樺寲锛氭粴鍔ㄥ鍣ㄩ珮搴﹁绠楁洿绮惧噯锛屾坊鍔爎ef鐢ㄤ簬婊氬姩鎺у埗 -->
+ <view ref="scrollContainer" style="height: calc(100vh - 50px); overflow-y: auto; padding-bottom: 20rpx;">
+ <uni-list :border="true">
+ <uni-list-item
+ direction="column"
+ v-for="item in allReceivingOrders"
+ :key="item.orderNo"
+ clickable
+ @click="groupClick(item.orderNo)"
+ link
+ :to="page+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;">
+ 鍏ュ簱鍗曞彿锛� {{item.orderNo}}
</view>
- <view style="text-align: center;line-height: 40rpx;border-radius: 8rpx; width: 158rpx;height: 40rpx;font-size: 22rpx;color: #F56C6C;">
- 鎬婚噺 {{item.SumQty}}
+ <view style="margin-top: 10rpx;line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;">
+ 鍒涘缓浜哄憳锛� {{item.creater}}
</view>
- <view style="text-align: center;line-height: 40rpx;border-radius: 8rpx; width: 158rpx;height: 40rpx;font-size: 22rpx;color: #F56C6C;">
- 宸插叆 {{item.OverQty}}
+ <view style="margin-top: 10rpx;line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: space-between;">
+ 鍒涘缓鏃ユ湡锛� {{item.createDate}}
</view>
- </view>
- </uni-group>
- </template>
- </uni-list-item>
+ <view style="margin-top: 10rpx;line-height: 17px;color: #596671;font-size: 14px;text-align: center;display: flex;justify-content: left;">
+ 鐗╂枡鏂欏彿锛�
+ <view class="container">
+ <view v-for="(materielCode, index) in getUniqueMaterielCodes(item.details)" :key="index">
+ {{materielCode}}
+ <u-line color="blue" v-if="index < getUniqueMaterielCodes(item.details).length - 1" />
+ </view>
+ </view>
+ </view>
+ <view style="margin-top: 10rpx;display: flex;align-items: center; ">
+ <view style="text-align: center;line-height: 40rpx;border-radius: 8rpx; width: 238rpx;height: 40rpx;font-size: 22rpx;background-color:rgba(22,127,247,0.18);color: #1F63FF;">
+ 璁㈠崟鐘舵�侊細 {{item.InboundOrderStatus}}
+ </view>
+ <view style="text-align: center;line-height: 40rpx;border-radius: 8rpx; width: 158rpx;height: 40rpx;font-size: 22rpx;color: #F56C6C;">
+ 鎬婚噺锛� {{item.SumQty}}
+ </view>
+ <view style="text-align: center;line-height: 40rpx;border-radius: 8rpx; width: 158rpx;height: 40rpx;font-size: 22rpx;color: #F56C6C;">
+ 宸插叆锛� {{item.OverQty}}
+ </view>
+ </view>
+ </uni-group>
+ </template>
+ </uni-list-item>
+ </uni-list>
+ <!-- 浼樺寲锛氫粎褰撴湁鏁版嵁涓旈渶瑕佸姞杞芥洿澶氭椂鏄剧ず鍔犺浇缁勪欢 -->
+ <uni-load-more :status="status" v-if="loadVisible && allReceivingOrders.length > 0"></uni-load-more>
+ <!-- 绌烘暟鎹彁绀� -->
+ <view v-if="allReceivingOrders.length === 0 && !isLoading" style="text-align: center; padding: 100rpx 0; color: #999;">
+ 鏆傛棤鍏ュ簱璁㈠崟鏁版嵁
+ </view>
- </uni-list>
- <uni-load-more :status="status" v-if="loadVisible"></uni-load-more>
-
- <u-back-top :scroll-top="scrollTop" top="400"></u-back-top>
+ <u-back-top :scroll-top="scrollTop" top="400"></u-back-top>
+ </view>
</view>
</template>
@@ -50,167 +73,182 @@
page: "/pages/stash/YSraworderboxing?",
loadVisible: false,
searchValue: "",
- status: "more",
- allReceivingOrders: [],
- pageNo: 1,
+ status: "more", // more:鍔犺浇鏇村, noMore:娌℃湁鏇村, loading:鍔犺浇涓�
+ allReceivingOrders: [], // 鎵�鏈夋暟鎹紙鍏ㄩ儴鍔犺浇鐢ㄤ簬鍓嶇绛涢�夛級
+ originalOrders: [], // 瀛樺偍鍘熷鏁版嵁
+ pageNo: 1, // 褰撳墠椤电爜
+ pageSize: 100, // 澧炲ぇ姣忛〉鏉℃暟锛屼竴娆℃�у姞杞芥洿澶氭暟鎹敤浜庡墠绔瓫閫�
scrollTop: 0,
warehouseId: "",
- isLoaded:false
+ isLoaded: false, // 鏄惁浠庤鎯呴〉杩斿洖
+ isLoading: false, // 闃叉閲嶅璇锋眰
+ hasMore: true, // 鏄惁杩樻湁鏇村鏁版嵁
}
},
onLoad(res) {
this.warehouseId = res.warehouseId;
this.page = this.page + "warehouseId=" + this.warehouseId + "&orderNo=";
+ // 鍒濆鍖栧姞杞芥暟鎹�
+ this.resetPageData();
this.getData();
},
+ // 浼樺寲锛氫笂鎷夊姞杞戒笅涓�椤碉紙浠呭綋鏈夋洿澶氭暟鎹笖鏈姞杞戒腑鏃惰Е鍙戯級
onReachBottom() {
- this.pageNo += 1;
- this.getData();
- this.isLoaded=true;
+ if (this.hasMore && !this.isLoading && !this.searchValue) {
+ this.pageNo += 1;
+ this.getData();
+ }
},
+ // 浼樺寲锛氳繑鍥為〉闈㈡椂浠呭埛鏂版暟鎹紝涓嶉噸缃垎椤碉紙淇濈暀婊氬姩浣嶇疆锛�
onShow() {
if (this.isLoaded) {
- // 浠庡叾浠栭〉闈㈣繑鍥炴椂鍒锋柊
- this.getData();
+ // 鍒锋柊褰撳墠椤垫暟鎹紝淇濈暀鍒嗛〉鍜屾粴鍔ㄤ綅缃�
+ this.refreshCurrentPage();
+ this.isLoaded = false; // 閲嶇疆鐘舵��
}
},
onPageScroll(e) {
this.scrollTop = e.scrollTop;
},
methods: {
- search(res) {
+ // 鐗╂枡鏂欏彿鍘婚噸锛堜繚鐣欏師鏈夊姛鑳斤級
+ getUniqueMaterielCodes(details) {
+ if (!details || !Array.isArray(details)) return [];
+ const uniqueCodes = [...new Set(details.map(item => item.materielCode))];
+ return uniqueCodes;
+ },
+
+ // 鎼滅储杈撳叆澶勭悊
+ handleSearchInput() {
+ // 濡傛灉鎼滅储鍊间负绌猴紝鏄剧ず鎵�鏈夋暟鎹�
+ if (this.searchValue === "") {
+ this.allReceivingOrders = [...this.originalOrders];
+ return;
+ }
+
+ // 妯$硦鏌ヨ
+ const searchText = this.searchValue.toLowerCase().trim();
+
+ // 鍚屾椂鍖归厤鍏ュ簱鍗曞彿鍜岀墿鏂欐枡鍙�
+ this.allReceivingOrders = this.originalOrders.filter(item => {
+ // 1. 鍖归厤鍏ュ簱鍗曞彿
+ if (item.orderNo && item.orderNo.toLowerCase().includes(searchText)) {
+ return true;
+ }
+
+ // 2. 鍖归厤鐗╂枡鏂欏彿
+ if (item.details && item.details.length > 0) {
+ return item.details.some(detail =>
+ detail.materielCode && detail.materielCode.toLowerCase().includes(searchText)
+ );
+ }
+
+ return false;
+ });
+ },
+
+ // 鎼滅储鏂规硶锛堝墠绔瓫閫夛級
+ search() {
+ this.handleSearchInput();
+ },
+
+ // 鐐瑰嚮鍒楄〃椤癸紙鏍囪涓哄凡鍔犺浇锛岃繑鍥炴椂鍒锋柊锛�
+ groupClick() {
+ this.isLoaded = true;
+ },
+
+ // 閲嶇疆鍒嗛〉鏁版嵁锛堟悳绱�/鍒濆鍖栨椂璋冪敤锛�
+ resetPageData() {
+ this.pageNo = 1;
+ this.allReceivingOrders = [];
+ this.originalOrders = [];
+ this.hasMore = true;
+ this.status = "more";
+ this.loadVisible = false;
+ },
+
+ // 鍒锋柊褰撳墠椤垫暟鎹紙杩斿洖璇︽儏椤垫椂璋冪敤锛屼繚鐣欐粴鍔ㄤ綅缃級
+ refreshCurrentPage() {
+ const currentPage = this.pageNo;
+ this.resetPageData();
+ this.pageNo = currentPage;
this.getData();
},
- groupClick() {
-
- },
+
+ // 鏍稿績锛氳幏鍙栨暟鎹紙鍓嶇绛涢�夋柟妗堬級
getData() {
+ // 闃叉閲嶅璇锋眰
+ if (this.isLoading) return;
+ this.isLoading = true;
+ this.status = "loading"; // 鏄剧ず鍔犺浇涓�
+
var postData = {
MainData: {
warehouseId: this.warehouseId,
- orderNo: this.searchValue,
- pageNo: this.pageNo
+ orderNo: "", // 鎼滅储鏃剁暀绌猴紝鍏ㄩ儴鍔犺浇
+ pageNo: this.pageNo,
+ pageSize: this.pageSize // 澧炲ぇ姣忛〉鏉℃暟
},
}
+
this.$u.post('/api/InboundOrder/GetInboundOrders', postData).then((res) => {
+ this.isLoading = false; // 閲嶇疆鍔犺浇鐘舵��
+
if (res.status) {
- if (res.data.length > 0) {
- if (this.searchValue == '') {
- this.allReceivingOrders = res.data.map(i => ({
- ...i,
- InboundOrderStatus: InboundOrderStatus.find(item => item.value == i
- .orderStatus).label,
- SumQty: i.details.map(item => item.orderQuantity).reduce((prev, next) => prev + next, 0),
- OverQty: i.details.map(item => item.overInQuantity).reduce((prev, next) => prev + next, 0)
- }));
- // this.allReceivingOrders = res.data;
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
- } else {
- this.allReceivingOrders = res.data.map(i => ({
- ...i,
- InboundOrderStatus: InboundOrderStatus.find(item => item.value == i
- .orderStatus).label,
- SumQty: i.details.map(item => item.orderQuantity).reduce((prev, next) => prev + next, 0),
- OverQty: i.details.map(item => item.overInQuantity).reduce((prev, next) => prev + next, 0)
- }));
- if (this.allReceivingOrders.length > 3) {
- this.loadVisible = true;
- } else {
- this.loadVisible = false;
- }
- }
+ const newData = res.data.map(i => ({
+ ...i,
+ InboundOrderStatus: InboundOrderStatus.find(item => item.value == i.orderStatus)?.label || "鏈煡鐘舵��",
+ SumQty: i.details?.map(item => item.orderQuantity).reduce((prev, next) => prev + next, 0) || 0,
+ OverQty: i.details?.map(item => item.overInQuantity).reduce((prev, next) => prev + next, 0) || 0
+ }));
+
+ // 瀛樺偍鍒板師濮嬫暟鎹�
+ this.originalOrders = [...this.originalOrders, ...newData];
+
+ // 濡傛灉鏈夋悳绱㈠�硷紝搴旂敤绛涢��
+ if (this.searchValue) {
+ this.handleSearchInput();
} else {
- this.status = 'noMore';
- //this.allReceivingOrders = [];
- this.loadVisible = true;
+ // 娌℃湁鎼滅储鍊兼椂鏄剧ず鎵�鏈夋暟鎹�
+ this.allReceivingOrders = [...this.originalOrders];
}
+
+ // 鍒ゆ柇鏄惁杩樻湁鏇村鏁版嵁
+ if (newData.length < this.pageSize) {
+ this.hasMore = false;
+ this.status = "noMore"; // 鏄剧ず"娌℃湁鏇村"
+ } else {
+ this.hasMore = true;
+ this.status = "more"; // 鏄剧ず"鍔犺浇鏇村"
+ }
+
+ // 鎺у埗鍔犺浇缁勪欢鏄剧ず锛堟悳绱㈡椂涓嶆樉绀哄姞杞芥洿澶氾級
+ this.loadVisible = this.originalOrders.length > 0 && this.hasMore && !this.searchValue;
+ } else {
+ // 鎺ュ彛璇锋眰澶辫触
+ this.status = "noMore";
+ this.loadVisible = false;
+ this.$u.toast("鏁版嵁鍔犺浇澶辫触锛岃閲嶈瘯");
}
+ }).catch((err) => {
+ this.isLoading = false;
+ this.status = "noMore";
+ this.loadVisible = false;
+ this.$u.toast("缃戠粶寮傚父锛岃妫�鏌ョ綉缁�");
})
- }
- }
+ },
+ },
}
</script>
-<style lang="scss">
- @import '@/common/uni-ui.scss';
-
- page {
- display: flex;
- flex-direction: column;
- box-sizing: border-box;
- background-color: #efeff4;
- min-height: 100%;
- height: auto;
- }
-
- .tips {
- color: #67c23a;
- font-size: 14px;
- line-height: 40px;
- text-align: center;
- background-color: #f0f9eb;
- height: 0;
- opacity: 0;
- transform: translateY(-100%);
- transition: all 0.3s;
- }
-
- .tips-ani {
- transform: translateY(0);
- height: 40px;
- opacity: 1;
- }
-
- .content {
- width: 100%;
- display: flex;
- }
-
- .list-picture {
- width: 100%;
- height: 145px;
- }
-
- .thumb-image {
- width: 100%;
- height: 100%;
- }
-
- .ellipsis {
- display: flex;
- overflow: hidden;
- }
-
- .uni-ellipsis-1 {
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
-
- .uni-ellipsis-2 {
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
-
- .customcss {
- display: flex;
- position: fixed;
- width: 100%;
- top: 10px;
- text-align: center;
- z-index: 999;
- left: 30px;
- height: 20%;
- }
-
- .footer {
- padding-top: 50%;
- }
+<style scoped>
+/* 浼樺寲锛氱墿鏂欐枡鍙锋崲琛屾樉绀猴紝闃叉妯悜婧㈠嚭 */
+.container {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10rpx;
+}
+.container view {
+ white-space: nowrap;
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3