Przeglądaj źródła

采购与跳转优化

shish 2 lat temu
rodzic
commit
23864fe852

+ 2 - 2
ghsApp/src/pagesPurchase/components/pageSuccess.vue

@@ -133,7 +133,7 @@ export default {
 						if(res.data.status == 4){
 							that.$msg(res.msg)
 							setTimeout(function(){
-								that.pageTo({url: '/pagesPurchase/info?orderSn='+that.info.orderSn,type:2})
+								that.pageTo({url: '/pagesPurchase/info?orderSn='+that.info.orderSn+'&refresh=1',type:2})
 							},1100)
 						}
 					}
@@ -239,7 +239,7 @@ export default {
 				if(res.code == 1){
 					that.$msg(res.msg)
 					setTimeout(function(){
-						that.pageTo({url: '/pagesPurchase/info?orderSn='+that.info.orderSn,type:2})
+						that.pageTo({url: '/pagesPurchase/info?orderSn='+that.info.orderSn+'&refresh=1',type:2})
 					},1100)
 				}
 			})

+ 2 - 2
ghsApp/src/pagesPurchase/details.vue

@@ -506,8 +506,8 @@ export default {
 					}else{
 						that.$msg('入库成功')
 						setTimeout(function(){
-							that.$util.pageTo({url: "/pagesPurchase/info?orderSn="+res.data.orderSn,type:2})
-						},1000)
+							that.$util.pageTo({url: "/pagesPurchase/info?orderSn="+res.data.orderSn+'&refresh=1',type:2})
+						},900)
 					}
 				}
 			})

+ 10 - 0
ghsApp/src/pagesPurchase/info.vue

@@ -289,6 +289,16 @@ export default {
 			uni.stopPullDownRefresh()
 		})
 	},
+	onLoad(){
+		if(this.option.refresh && this.option.refresh == 1){
+			//采购入库之后去的详情页返回列表需要刷新
+		}else{
+			//返回上一页时不需要刷新
+			let pages = getCurrentPages();
+			let prevPage = pages[ pages.length - 2 ];
+			prevPage.$vm.needRefresh = 0
+		}
+	},
 	methods: {
 		updateEntryTime(e){
 			let that = this

+ 14 - 4
ghsApp/src/pagesPurchase/order.vue

@@ -38,6 +38,7 @@ export default {
 			tabIndex: 0,
 			lsFhNum:0,
 			lsShNum:0,
+			needRefresh:0,
 			tabs: [
 				{
 					name: "全部",
@@ -70,16 +71,25 @@ export default {
 	},
 	onReachBottom() {
 		if (!this.list.finished) {
-		this.getCgList().then((res) => {
-			uni.stopPullDownRefresh();
-		});
+			this.getCgList().then((res) => {
+				uni.stopPullDownRefresh();
+			});
 		} else {
-		uni.stopPullDownRefresh();
+			uni.stopPullDownRefresh();
 		}
 	},
 	onLoad(){
 		this.getCgList()
 	},
+	onShow() {
+		//采购成功之后的订单详情页过来不刷新
+		if(this.needRefresh == 0){
+			this.needRefresh = 1
+		}else{
+			this.resetList()
+			this.getCgList()
+		}
+  	},
 	methods: {
 		init(){
 

+ 10 - 0
ghsApp/src/pagesPurchase/wcOrder.vue

@@ -34,6 +34,7 @@ export default {
 	data() {
 		return {
 			tabIndex: 0,
+			needRefresh:0,
 			tabs: [
 				{
 					name: "全部",
@@ -76,6 +77,15 @@ export default {
 	onLoad(){
 		this.getCgList()
 	},
+	onShow() {
+		//采购成功之后的订单详情页过来不刷新
+		if(this.needRefresh == 0){
+			this.needRefresh = 1
+		}else{
+			this.resetList()
+			this.getCgList()
+		}
+  	},
 	methods: {
 		init(){