Commit 76ea3b9f7db7d365dfceb69c0f8f020e41f94905
1 parent
203e9ef1
feat: 订货单-申请发货 点击的时候调用接口,通过了 才能进行申请发货,否则提示为什么不能申请发货
Showing
2 changed files
with
21 additions
and
3 deletions
| ... | ... | @@ -58,7 +58,7 @@ |
| 58 | 58 | </template> |
| 59 | 59 | |
| 60 | 60 | <script> |
| 61 | -import { getDetailApi, cancelApi } from '@/api/order_list.js' | |
| 61 | +import { getDetailApi, cancelApi, checkApi } from '@/api/order_list.js' | |
| 62 | 62 | import Product from './product.vue' |
| 63 | 63 | import DetailButtons from '@/components/detail-buttons/index.vue' |
| 64 | 64 | import { |
| ... | ... | @@ -162,8 +162,16 @@ export default { |
| 162 | 162 | }, |
| 163 | 163 | onShipmentApply() { |
| 164 | 164 | const id = this.getBusinessId() |
| 165 | - const query = id ? ('?id=' + encodeURIComponent(id)) : '' | |
| 166 | - uni.navigateTo({ url: '/pages/order_list/shipment_apply' + query }) | |
| 165 | + const query = id ? ('?id=' + encodeURIComponent(id)) : ''; | |
| 166 | + checkApi({ id }).then(res => { | |
| 167 | + if (res.code === 200) { | |
| 168 | + uni.navigateTo({ url: '/pages/order_list/shipment_apply' + query }) | |
| 169 | + } else { | |
| 170 | + uni.showToast({ title: res.msg || '失败', icon: 'none' }) | |
| 171 | + } | |
| 172 | + }).catch((e) => { | |
| 173 | + uni.showToast({ title: '失败', icon: 'none' }) | |
| 174 | + }) | |
| 167 | 175 | }, |
| 168 | 176 | onCancel() { |
| 169 | 177 | const id = this.getBusinessId() | ... | ... |