| | |
| | | v-for="item in allReceivingOrders" :key="item.locationCode"> |
| | | <template v-slot:body> |
| | | <uni-group margin-top="20"> |
| | | <view> åæ®ç¼å·:{{orderNo}} </view> |
| | | <view> æ¹å·:{{item.batchNo}} </view> |
| | | <view> ç©æåç§°:{{item.materielName}} </view> |
| | | <view> åå/éç¨å:{{item.item || ''}} </view> |
| | | <view> ç©æç¼å·:{{item.materielCode}} </view> |
| | | <!-- <view> ç©æåç§°:{{item.materielName}} </view> --> |
| | | <view> ç©æè§æ ¼:{{item.materielSpec}} </view> |
| | | <view> ç产åå®¶:{{item.factory || ''}} </view> |
| | | <view> åºæ¬åä½:{{item.materielUnit}} </view> |
| | | <view> ææ:{{item.modifier || ''}} </view> |
| | | <view> æ¹å·:{{item.batchNo}} </view> |
| | | <view> åæ®ç¼å·:{{orderNo}} </view> |
| | | <view> è´§ä½ç¼å·:{{item.locationCode}} </view> |
| | | <view> æ°é:{{item.stockQuantity}} </view> |
| | | </uni-group> |
| | |
| | | pageNo: 1, |
| | | scrollTop: 0, |
| | | outTask: false, |
| | | warehouseId: "" |
| | | warehouseId: "", |
| | | hasDataLoaded: false, // æ°æ®æ¯å¦å·²å è½½è¿ |
| | | shouldRefreshFromC: false, // å
³é®ï¼ä»C页é¢è¿åæ¶éè¦å·æ°çæ å¿ |
| | | } |
| | | }, |
| | | onLoad(res) { |
| | | this.warehouseId = res.warehouseId; |
| | | this.orderNo = res.orderNo; |
| | | this.allReceivingOrders = res.detail; |
| | | this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode="; |
| | | this.getData(); |
| | | }, |
| | | onReachBottom() { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | }, |
| | | onShow() { |
| | | this.outTask = uni.getStorageSync('outTask'); |
| | | if (this.outTask) { |
| | | uni.removeStorageSync('outTask'); |
| | | // ç嬿¥èªC页é¢çå·æ°äºä»¶ |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | if (eventChannel) { |
| | | eventChannel.on('refreshData', (data) => { |
| | | if (data.refresh) { |
| | | this.pageNo = 1; |
| | | // ä»å
¶ä»é¡µé¢è¿åæ¶å·æ° |
| | | this.allReceivingOrders = []; |
| | | this.getData(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // ä¿åä¼ å
¥çåå§æ°æ® |
| | | if (res.detail && res.detail.length > 0) { |
| | | this.allReceivingOrders = res.detail; |
| | | } |
| | | this.warehouseId = res.warehouseId; |
| | | this.orderNo = res.orderNo; |
| | | this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode="; |
| | | }, |
| | | onReachBottom() { |
| | | // åªæå¨è¿ææ´å¤æ°æ®æ¶æå è½½ä¸ä¸é¡µ |
| | | if (this.status === 'more') { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | } |
| | | }, |
| | | // æ·»å è¿ä¸ªçå½å¨æ |
| | | onHide() { |
| | | // 页é¢éèæ¶ä¸åä»»ä½æä½ |
| | | }, |
| | | |
| | | |
| | | |
| | | onShow() { |
| | | // æ£æ¥æ¯å¦éè¦å·æ° |
| | | const needRefresh = uni.getStorageSync('needRefreshOutbound'); |
| | | if (needRefresh) { |
| | | uni.removeStorageSync('needRefreshOutbound'); |
| | | this.pageNo = 1; |
| | | this.allReceivingOrders = []; |
| | | this.getData(); |
| | | return; |
| | | } |
| | | |
| | | // å¦æè¿æ²¡æå è½½è¿æ°æ®ï¼å è½½æ°æ® |
| | | if (!this.hasDataLoaded) { |
| | | this.pageNo = 1; |
| | | this.allReceivingOrders = []; |
| | | this.getData(); |
| | | this.hasDataLoaded = true; |
| | | } |
| | | }, |
| | | onPageScroll(e) { |
| | | this.scrollTop = e.scrollTop; |
| | | }, |
| | | methods: { |
| | | // æ·»å å·æ°æ¹æ³ä¾å
¶ä»é¡µé¢è°ç¨ |
| | | // refreshData() { |
| | | // console.log('æ¶å°å·æ°è¯·æ±'); |
| | | // this.pageNo = 1; |
| | | // this.allReceivingOrders = []; |
| | | // this.getData(); |
| | | // }, |
| | | search(res) { |
| | | this.pageNo = 1; |
| | | this.getData(); |
| | |
| | | groupClick() { |
| | | |
| | | }, |
| | | |
| | | // getData() { |
| | | // var postData = { |
| | | // MainData: { |
| | |
| | | // }, |
| | | // } |
| | | // if (this.pageNo == 1) this.allReceivingOrders = []; |
| | | // this.$u.post('/api/DeliveryOrder/GetCheckOutTasks',postData).then(( |
| | | // this.$u.post('/api/DeliveryOrder/CheckOutTasks',postData).then(( |
| | | // res) => { |
| | | // if (res.status) { |
| | | // if (res.data.length > 0) { |
| | |
| | | // } |
| | | // }) |
| | | // } |
| | | getData() { |
| | | var postData = { |
| | | MainData: { |
| | | warehouseId: this.warehouseId, |
| | | locationCode: this.searchValue, |
| | | orderNo: this.orderNo, |
| | | pageNo: this.pageNo, |
| | | isCheck: false, |
| | | }, |
| | | getData() { |
| | | var postData = { |
| | | MainData: { |
| | | warehouseId: this.warehouseId, |
| | | locationCode: this.searchValue, |
| | | orderNo: this.orderNo, |
| | | pageNo: this.pageNo, |
| | | isCheck: false, |
| | | }, |
| | | } |
| | | |
| | | // 妿æ¯ç¬¬ä¸é¡µææç´¢ï¼æ¸
ç©ºæ°æ® |
| | | if (this.pageNo === 1 || this.searchValue !== '') { |
| | | this.allReceivingOrders = []; |
| | | this.status = "more"; |
| | | } |
| | | |
| | | this.$u.post('/api/DeliveryOrder/CheckOutTasks', postData).then((res) => { |
| | | if (res.status) { |
| | | if (res.data && res.data.length > 0) { |
| | | // è¿½å æ°æ® |
| | | this.allReceivingOrders = [...this.allReceivingOrders, ...res.data]; |
| | | |
| | | // å页é»è¾ |
| | | if (res.data.length < 5) { |
| | | this.status = 'noMore'; |
| | | } else { |
| | | this.status = 'more'; |
| | | } |
| | | if (this.pageNo == 1) this.allReceivingOrders = []; |
| | | this.$u.post('/api/DeliveryOrder/GetCheckOutTasks', postData).then(( |
| | | res) => { |
| | | if (res.status) { |
| | | if (res.data.length > 0) { |
| | | if (this.searchValue == '') { |
| | | this.allReceivingOrders = this.allReceivingOrders.concat(res.data); |
| | | // this.allReceivingOrders = res.data; |
| | | if (this.allReceivingOrders.length > 3) { |
| | | this.loadVisible = true; |
| | | } else { |
| | | this.loadVisible = false; |
| | | } |
| | | } else { |
| | | this.allReceivingOrders = res.data; |
| | | if (this.allReceivingOrders.length > 3) { |
| | | this.loadVisible = true; |
| | | } else { |
| | | this.loadVisible = false; |
| | | } |
| | | } |
| | | } else { |
| | | this.status = 'noMore'; |
| | | //this.allReceivingOrders = []; |
| | | this.loadVisible = true; |
| | | if (this.allReceivingOrders.length < 1) { |
| | | uni.showModal({ |
| | | title: 'æç¤º', |
| | | content: 'åºåºå·²å®æï¼æ¯å¦è¿åé¦é¡µï¼', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | uni.getStorageSync('isLoaded',true) |
| | | // ç¨æ·ç¹å»ç¡®å® |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 2 |
| | | }); |
| | | }, 500); |
| | | } else { |
| | | // ç¨æ·ç¹å»åæ¶ï¼å¯ä»¥åçå¨å½åé¡µé¢ |
| | | // æè
æ§è¡å
¶ä»æä½ |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | this.loadVisible = this.allReceivingOrders.length > 0; |
| | | |
| | | } else { |
| | | this.status = 'noMore'; |
| | | this.loadVisible = this.allReceivingOrders.length > 0; |
| | | |
| | | if (this.pageNo === 1) { |
| | | this.allReceivingOrders = []; |
| | | } |
| | | |
| | | // ç´æ¥è¿åA页é¢ï¼ä¸éè¦æç¤º |
| | | if (this.allReceivingOrders.length === 0 && this.pageNo === 1) { |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 // è¿åAé¡µé¢ |
| | | }); |
| | | }, 300); // ç¨å¾®å»¶è¿ä¸ä¸ï¼è®©ç¨æ·çå°"æ²¡ææ°æ®"çç¶æ |
| | | } |
| | | } |
| | | } |
| | | }).catch(err => { |
| | | console.error('请æ±å¤±è´¥:', err); |
| | | this.status = 'noMore'; |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | </script> |
| | | |
| | | |
| | | |
| | | <style lang="scss"> |
| | | @import '@/common/uni-ui.scss'; |