diff --git a/pages/goodSource/index.vue b/pages/goodSource/index.vue index f4c29c5..be6cf62 100644 --- a/pages/goodSource/index.vue +++ b/pages/goodSource/index.vue @@ -49,7 +49,7 @@ - + @@ -119,9 +119,6 @@ export default { onPullDownRefresh() { this.onSearch(); }, - onLoad() { - this.getAllowDriverSeeFreightAmount(); - }, computed: { tabList() { let list = [ @@ -138,9 +135,7 @@ export default { }, methods: { getAllowDriverSeeFreightAmount() { - uni.$u.api.freightOrder.currentFreight({}).then(en => { - this.currentFreight = en?.result || {}; - }); + return uni.$u.api.freightOrder.currentFreight({}); }, onTabChange({ index }) { if (this.loading) { @@ -202,7 +197,8 @@ export default { // 修改货源 modifySource(code) { this.currentCode = code; - this.toAddPage('?code=' + code); + let param = '?code=' + code; + this.jump2Add(param); }, // 取消货源 cancelSource(code) { @@ -263,13 +259,17 @@ export default { } }); }, - toAddPage(param) { - if (!param) { - if (!this.currentFreight.goodsSourcePermissionFlag) { + toAddPage() { + this.getAllowDriverSeeFreightAmount().then(res => { + if (res.result && res.result.goodsSourcePermissionFlag) { + this.jump2Add(''); + } else { this.noAddAutoShow = true; - return; } - } + }); + }, + // 跳转到新增修改页面 + jump2Add(param) { uni.navigateTo({ url: '/pages/goodSource/add' + param, events: { -- libgit2 0.21.0