| | |
| | | </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; "> |
| | |
| | | </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> |
| | |
| | | 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æ¡ï¼è¿éå¯ä»¥ä¸ä¼ épageSizeï¼ä¿æä¸å端ä¸è´ |
| | | 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 { |