Commit 76ea3b9f7db7d365dfceb69c0f8f020e41f94905

Authored by 史婷婷
1 parent 203e9ef1

feat: 订货单-申请发货 点击的时候调用接口,通过了 才能进行申请发货,否则提示为什么不能申请发货

... ... @@ -65,3 +65,13 @@ export function listCanRevokeOrChangeOrderInfo(params) {
65 65 })
66 66 }
67 67
  68 +// 申请发货-检查数据是否规范
  69 +export function checkApi(params) {
  70 + return request({
  71 + url: `${baseUrl}/check`,
  72 + method: 'get',
  73 + params: {
  74 + ...params,
  75 + },
  76 + })
  77 +}
... ...
... ... @@ -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()
... ...