| | |
| | | v-for="item in allReceivingOrders" :key="item.locationCode"> |
| | | <template v-slot:body> |
| | | <uni-group margin-top="20"> |
| | | <view> åæ®ç¼å·:{{orderNo}} </view> |
| | | <!-- <view> åæ®ç¼å·:{{orderNo}} </view> |
| | | <view> æ¹å·:{{item.batchNo}} </view> |
| | | <view> ç©æç¼å·:{{item.materielCode}} </view> |
| | | <view> ç©æç¼å·:{{item.materielCode}} </view> --> |
| | | <!-- <view> ç©æåç§°:{{item.materielName}} </view> --> |
| | | <!-- <view> è´§ä½ç¼å·:{{item.locationCode}} </view> |
| | | <view> è´¦é¢æ°é:{{item.stockQuantity}} </view> --> |
| | | |
| | | <view> ç©æåç§°:{{item.materielName}} </view> |
| | | <view> åå/éç¨å:{{item.item || ''}} </view> |
| | | <view> ç©æç¼å·:{{item.materielCode}} </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, |
| | | checkTask: false, |
| | | warehouseId: "" |
| | | warehouseId: "", |
| | | hasDataLoaded: false, // æ°æ®æ¯å¦å·²å è½½è¿ |
| | | shouldRefreshFromC: false, // ä»C页é¢è¿åæ¶éè¦å·æ°çæ å¿ |
| | | } |
| | | }, |
| | | // æ·»å è¿ä¸ªçå½å¨æ |
| | | onHide() { |
| | | // 页é¢éèæ¶ä¸åä»»ä½æä½ |
| | | }, |
| | | |
| | | onLoad(res) { |
| | | this.warehouseId = res.warehouseId; |
| | | this.orderNo = res.orderNo; |
| | | this.allReceivingOrders = res.detail; |
| | | if(res.detail&&res.detail.length>0){ |
| | | this.allReceivingOrders = res.detail; |
| | | } |
| | | this.page = this.page + "orderNo=" + this.orderNo + "&warehouseId=" + this.warehouseId + "&locationCode="; |
| | | // this.getData(); |
| | | }, |
| | | onReachBottom() { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | // åªæå¨è¿ææ´å¤æ°æ®æ¶æå è½½ä¸ä¸é¡µ |
| | | if (this.status === 'more') { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | } |
| | | }, |
| | | onShow() { |
| | | // this.checkTask = uni.getStorageSync('checkTask'); |
| | | // if (this.checkTask) { |
| | | // uni.removeStorageSync('checkTask'); |
| | | this.pageNo = 1; |
| | | this.allReceivingOrders = []; |
| | | // ä»å
¶ä»é¡µé¢è¿åæ¶å·æ° |
| | | this.getData(); |
| | | // } |
| | | // æ£æ¥æ¯å¦éè¦å·æ° |
| | | const needRefresh = uni.getStorageSync('needRefreshCheck'); |
| | | if (needRefresh) { |
| | | uni.removeStorageSync('needRefreshCheck'); |
| | | 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: { |
| | | warehouseId: this.warehouseId, |
| | | locationCode: this.searchValue, |
| | | orderNo: this.orderNo, |
| | | pageNo: this.pageNo, |
| | | isCheck: true, |
| | | }, |
| | | getData() { |
| | | var postData = { |
| | | MainData: { |
| | | warehouseId: this.warehouseId, |
| | | locationCode: this.searchValue, |
| | | orderNo: this.orderNo, |
| | | pageNo: this.pageNo, |
| | | isCheck: true, |
| | | }, |
| | | } |
| | | |
| | | // 妿æ¯ç¬¬ä¸é¡µææç´¢ï¼æ¸
ç©ºæ°æ® |
| | | 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]; |
| | | |
| | | // 妿è¿åçæ°æ®å°äº5æ¡ï¼è¯´ææ²¡ææ´å¤æ°æ®äº |
| | | 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) => { |
| | | // uni.getStorageSync('ischeck',true) |
| | | // if (res.confirm) { |
| | | // // ç¨æ·ç¹å»ç¡®å® |
| | | setTimeout(() => { |
| | | uni.navigateBack({ |
| | | delta: 1 |
| | | }); |
| | | }, 300); |
| | | // } 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> |