| | |
| | | onLoad(res) { |
| | | this.warehouseId = res.warehouseId; |
| | | this.page = this.page + "warehouseId=" + this.warehouseId + "&orderNo="; |
| | | this.getData(); |
| | | // this.getData(); |
| | | }, |
| | | onReachBottom() { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | this.ischeck=true; |
| | | // åªæå¨è¿ææ´å¤æ°æ®æ¶æå è½½ä¸ä¸é¡µ |
| | | if (this.status === 'more') { |
| | | this.pageNo += 1; |
| | | this.getData(); |
| | | this.ischeck = true; |
| | | } |
| | | }, |
| | | onShow() { |
| | | // this.ischeck = uni.getStorageSync('ischeck'); |
| | |
| | | }, |
| | | methods: { |
| | | search(res) { |
| | | this.pageNo = 1; // æç´¢æ¶é置为第ä¸é¡µ |
| | | this.getData(); |
| | | }, |
| | | groupClick() { |
| | | |
| | | }, |
| | | getData() { |
| | | var postData = { |
| | | MainData: { |
| | | warehouseId: this.warehouseId, |
| | | orderNo: this.searchValue, |
| | | pageNo: this.pageNo |
| | | }, |
| | | var postData = { |
| | | MainData: { |
| | | warehouseId: this.warehouseId, |
| | | orderNo: this.searchValue, |
| | | pageNo: this.pageNo |
| | | }, |
| | | } |
| | | |
| | | // 妿æ¯ç¬¬ä¸é¡µææç´¢ï¼æ¸
ç©ºæ°æ® |
| | | if (this.pageNo === 1 || this.searchValue !== '') { |
| | | this.allReceivingOrders = []; |
| | | this.status = "more"; |
| | | } |
| | | |
| | | this.$u.post('/api/DeliveryOrder/GetCheckOrders', postData).then((res) => { |
| | | if (res.status) { |
| | | if (res.data && res.data.length > 0) { |
| | | const newData = res.data.map(i => ({ |
| | | ...i, |
| | | InboundOrderStatus: i.outStatus.label, |
| | | SumQty: i.details.map(item => item.order_qty).reduce((prev, next) => prev + next, 0), |
| | | OverQty: i.details.map(item => item.order_Outqty).reduce((prev, next) => prev + next, 0) |
| | | })); |
| | | |
| | | // å
³é®ä¿®æ¹ï¼è¿½å æ°æ®è䏿¯æ¿æ¢ |
| | | this.allReceivingOrders = [...this.allReceivingOrders, ...newData]; |
| | | |
| | | // 妿è¿åçæ°æ®å°äº5æ¡ï¼è¯´ææ²¡ææ´å¤æ°æ®äº |
| | | if (res.data.length < 5) { |
| | | this.status = 'noMore'; |
| | | } else { |
| | | this.status = 'more'; |
| | | } |
| | | this.$u.post('/api/DeliveryOrder/GetCheckOrders', postData).then((res) => { |
| | | if (res.status) { |
| | | if (res.data.length > 0) { |
| | | if (this.searchValue == '') { |
| | | this.allReceivingOrders = res.data.map(i => ({ |
| | | ...i, |
| | | InboundOrderStatus: i.outStatus.label, |
| | | SumQty: i.details.map(item => item.order_qty).reduce((prev, next) => prev + next, 0), |
| | | OverQty: i.details.map(item => item.order_Outqty).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: i.outStatus.label, |
| | | SumQty: i.details.map(item => item.order_qty).reduce((prev, next) => prev + next, 0), |
| | | OverQty: i.details.map(item => item.order_Outqty).reduce((prev, next) => prev + next, 0) |
| | | })); |
| | | if (this.allReceivingOrders.length > 3) { |
| | | this.loadVisible = true; |
| | | } else { |
| | | this.loadVisible = false; |
| | | } |
| | | } |
| | | } else { |
| | | this.status = 'noMore'; |
| | | //this.allReceivingOrders = []; |
| | | this.loadVisible = true; |
| | | } |
| | | } |
| | | }) |
| | | |
| | | // æ§å¶å è½½æç¤ºæ¾ç¤º |
| | | this.loadVisible = this.allReceivingOrders.length > 0; |
| | | |
| | | } else { |
| | | // æ²¡ææ°æ® |
| | | this.status = 'noMore'; |
| | | this.loadVisible = this.allReceivingOrders.length > 0; |
| | | |
| | | // 妿æ¯ç¬¬ä¸é¡µä¸æ²¡ææ°æ®ï¼æ¾ç¤ºç©ºç¶æ |
| | | if (this.pageNo === 1) { |
| | | this.allReceivingOrders = []; |
| | | } |
| | | } |
| | | } |
| | | }).catch(err => { |
| | | console.error('请æ±å¤±è´¥:', err); |
| | | this.status = 'noMore'; |
| | | }) |
| | | } |
| | | } |
| | | } |