Commit 48e94c3e315c61aab8abdbbb795cff26a777ae58
1 parent
9ae47f05
Exists in
master
and in
1 other branch
fix: 货源管理
Showing
1 changed file
with
13 additions
and
13 deletions
Show diff stats
pages/goodSource/index.vue
| ... | ... | @@ -49,7 +49,7 @@ |
| 49 | 49 | <Empty tips="暂无数据" /> |
| 50 | 50 | </template> |
| 51 | 51 | </List> |
| 52 | - <view v-if="$permission('/freightGoodsSource/add')" class="add-order" @tap="toAddPage('')"> | |
| 52 | + <view v-if="$permission('/freightGoodsSource/add')" class="add-order" @tap="toAddPage"> | |
| 53 | 53 | <zui-icon name="add" color="#fff" size="30px"></zui-icon> |
| 54 | 54 | </view> |
| 55 | 55 | </template> |
| ... | ... | @@ -119,9 +119,6 @@ export default { |
| 119 | 119 | onPullDownRefresh() { |
| 120 | 120 | this.onSearch(); |
| 121 | 121 | }, |
| 122 | - onLoad() { | |
| 123 | - this.getAllowDriverSeeFreightAmount(); | |
| 124 | - }, | |
| 125 | 122 | computed: { |
| 126 | 123 | tabList() { |
| 127 | 124 | let list = [ |
| ... | ... | @@ -138,9 +135,7 @@ export default { |
| 138 | 135 | }, |
| 139 | 136 | methods: { |
| 140 | 137 | getAllowDriverSeeFreightAmount() { |
| 141 | - uni.$u.api.freightOrder.currentFreight({}).then(en => { | |
| 142 | - this.currentFreight = en?.result || {}; | |
| 143 | - }); | |
| 138 | + return uni.$u.api.freightOrder.currentFreight({}); | |
| 144 | 139 | }, |
| 145 | 140 | onTabChange({ index }) { |
| 146 | 141 | if (this.loading) { |
| ... | ... | @@ -202,7 +197,8 @@ export default { |
| 202 | 197 | // 修改货源 |
| 203 | 198 | modifySource(code) { |
| 204 | 199 | this.currentCode = code; |
| 205 | - this.toAddPage('?code=' + code); | |
| 200 | + let param = '?code=' + code; | |
| 201 | + this.jump2Add(param); | |
| 206 | 202 | }, |
| 207 | 203 | // 取消货源 |
| 208 | 204 | cancelSource(code) { |
| ... | ... | @@ -263,13 +259,17 @@ export default { |
| 263 | 259 | } |
| 264 | 260 | }); |
| 265 | 261 | }, |
| 266 | - toAddPage(param) { | |
| 267 | - if (!param) { | |
| 268 | - if (!this.currentFreight.goodsSourcePermissionFlag) { | |
| 262 | + toAddPage() { | |
| 263 | + this.getAllowDriverSeeFreightAmount().then(res => { | |
| 264 | + if (res.result && res.result.goodsSourcePermissionFlag) { | |
| 265 | + this.jump2Add(''); | |
| 266 | + } else { | |
| 269 | 267 | this.noAddAutoShow = true; |
| 270 | - return; | |
| 271 | 268 | } |
| 272 | - } | |
| 269 | + }); | |
| 270 | + }, | |
| 271 | + // 跳转到新增修改页面 | |
| 272 | + jump2Add(param) { | |
| 273 | 273 | uni.navigateTo({ |
| 274 | 274 | url: '/pages/goodSource/add' + param, |
| 275 | 275 | events: { | ... | ... |