|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
supplierList: [],
|
|
|
tabIndex: 0,
|
|
|
status: '0',
|
|
|
- refreshPage:1,
|
|
|
+ refreshPage:0,
|
|
|
searchContent:'',
|
|
|
searchTime:'',
|
|
|
startTime:'',
|
|
|
@@ -105,8 +105,7 @@ export default {
|
|
|
if(this.refreshPage == 1){
|
|
|
this.resetList()
|
|
|
this.getMyPurchase()
|
|
|
- }else{
|
|
|
- this.refreshPage = 1
|
|
|
+ this.refreshPage = 0
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -130,15 +129,16 @@ export default {
|
|
|
this.getMyPurchase()
|
|
|
},
|
|
|
change(e) {
|
|
|
- if (this.tabIndex == e.index) {
|
|
|
- return false;
|
|
|
- } else {
|
|
|
- this.resetList()
|
|
|
- this.tabIndex = e.index;
|
|
|
- this.status = e.item.key
|
|
|
- this.getMyPurchase()
|
|
|
- }
|
|
|
- },
|
|
|
+ if (this.tabIndex != e.index) {
|
|
|
+ this.resetList();
|
|
|
+ this.list.finished = true;
|
|
|
+ this.tabIndex = e.index;
|
|
|
+ this.status = e.item.key;
|
|
|
+ this.getMyPurchase().then(() => {
|
|
|
+ this.list.finished = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
init() {
|
|
|
if(this.option.ghsId){
|
|
|
this.ghsId = this.option.ghsId?this.option.ghsId:0
|
|
|
@@ -149,11 +149,14 @@ export default {
|
|
|
getMyPurchase () {
|
|
|
return purchaseList({ status: this.status,page: this.list.page,searchTime: this.searchTime,startTime: this.startTime,endTime: this.endTime,ghsId:this.ghsId}).then(res => {
|
|
|
this.completes(res)
|
|
|
- this.tabs[0].value = res.data.shop.totalPurchaseOrder // 全部
|
|
|
- this.tabs[1].value = res.data.shop.cgUnPay // 待付款
|
|
|
- this.tabs[2].value = res.data.shop.cgUnSend // 待发货
|
|
|
- this.tabs[3].value = res.data.shop.cgSending // 待收货
|
|
|
- this.tabs[4].value = res.data.shop.cgFinish // 已完成
|
|
|
+ if (this.$util.isEmpty(res.data)){
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.tabs[0].value = res.data.shop.totalPurchaseOrder
|
|
|
+ this.tabs[1].value = res.data.shop.cgUnPay
|
|
|
+ this.tabs[2].value = res.data.shop.cgUnSend
|
|
|
+ this.tabs[3].value = res.data.shop.cgSending
|
|
|
+ this.tabs[4].value = res.data.shop.cgFinish
|
|
|
})
|
|
|
},
|
|
|
goToDetail (val) {
|