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,7 +49,7 @@ | ||
| 49 | <Empty tips="暂无数据" /> | 49 | <Empty tips="暂无数据" /> |
| 50 | </template> | 50 | </template> |
| 51 | </List> | 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 | <zui-icon name="add" color="#fff" size="30px"></zui-icon> | 53 | <zui-icon name="add" color="#fff" size="30px"></zui-icon> |
| 54 | </view> | 54 | </view> |
| 55 | </template> | 55 | </template> |
| @@ -119,9 +119,6 @@ export default { | @@ -119,9 +119,6 @@ export default { | ||
| 119 | onPullDownRefresh() { | 119 | onPullDownRefresh() { |
| 120 | this.onSearch(); | 120 | this.onSearch(); |
| 121 | }, | 121 | }, |
| 122 | - onLoad() { | ||
| 123 | - this.getAllowDriverSeeFreightAmount(); | ||
| 124 | - }, | ||
| 125 | computed: { | 122 | computed: { |
| 126 | tabList() { | 123 | tabList() { |
| 127 | let list = [ | 124 | let list = [ |
| @@ -138,9 +135,7 @@ export default { | @@ -138,9 +135,7 @@ export default { | ||
| 138 | }, | 135 | }, |
| 139 | methods: { | 136 | methods: { |
| 140 | getAllowDriverSeeFreightAmount() { | 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 | onTabChange({ index }) { | 140 | onTabChange({ index }) { |
| 146 | if (this.loading) { | 141 | if (this.loading) { |
| @@ -202,7 +197,8 @@ export default { | @@ -202,7 +197,8 @@ export default { | ||
| 202 | // 修改货源 | 197 | // 修改货源 |
| 203 | modifySource(code) { | 198 | modifySource(code) { |
| 204 | this.currentCode = code; | 199 | this.currentCode = code; |
| 205 | - this.toAddPage('?code=' + code); | 200 | + let param = '?code=' + code; |
| 201 | + this.jump2Add(param); | ||
| 206 | }, | 202 | }, |
| 207 | // 取消货源 | 203 | // 取消货源 |
| 208 | cancelSource(code) { | 204 | cancelSource(code) { |
| @@ -263,13 +259,17 @@ export default { | @@ -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 | this.noAddAutoShow = true; | 267 | this.noAddAutoShow = true; |
| 270 | - return; | ||
| 271 | } | 268 | } |
| 272 | - } | 269 | + }); |
| 270 | + }, | ||
| 271 | + // 跳转到新增修改页面 | ||
| 272 | + jump2Add(param) { | ||
| 273 | uni.navigateTo({ | 273 | uni.navigateTo({ |
| 274 | url: '/pages/goodSource/add' + param, | 274 | url: '/pages/goodSource/add' + param, |
| 275 | events: { | 275 | events: { |