huangbin пре 4 година
родитељ
комит
2388defdfc

+ 4 - 3
src/common/methods/request/resultInfo.ts

@@ -47,11 +47,12 @@ export async function controlLoading(fn: Function, loading: Ref<boolean>, param?
     console.log('请求接口参数: ', param);
     loading.value = true;
     try {
-        return await param ? fn(param) : fn()
+        const result = await param ? fn(param) : fn()
+        loading.value = false;
+        return result;
     } catch (err) {
-        Promise.resolve(err)
-    } finally {
         loading.value = false;
+        Promise.resolve(err)
     }
 }
 

+ 3 - 0
src/views/market/spot_trade/components/buy-sell-market/components/delisting/index.vue

@@ -113,6 +113,8 @@
             <a-col :span="24">
               <a-form-item class="tc">
                 <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
                           @click="submit">{{isBuy() ? '卖出' : '买入'}}</a-button>
                 <a-button class="ml10 cancelBtn"
                           @click="cancel">取消</a-button>
@@ -220,6 +222,7 @@ export default defineComponent({
             cancel,
             accountList,
             wrHoldList,
+            loading,
             submit,
             isSale,
             isBuy,

+ 3 - 0
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -136,6 +136,8 @@
             <a-col :span="24">
               <a-form-item class="tc">
                 <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
                           @click="submit">卖出</a-button>
                 <a-button class="ml10 cancelBtn"
                           @click="cancel">取消</a-button>
@@ -253,6 +255,7 @@ export default defineComponent({
             submit,
             visible,
             cancel,
+            loading,
             rules,
             formState,
             formRef,

+ 3 - 0
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -123,6 +123,8 @@
             <a-col :span="24">
               <a-form-item class="tc">
                 <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
                           @click="submit">卖出</a-button>
                 <a-button class="ml10 cancelBtn"
                           @click="cancel">取消</a-button>
@@ -245,6 +247,7 @@ export default defineComponent({
             submit,
             visible,
             cancel,
+            loading,
             rules,
             formState,
             formRef,

+ 4 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/pick_up/index.vue

@@ -85,6 +85,8 @@
             <a-col :span="24">
               <a-form-item class="tc">
                 <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
                           @click="submit">提货</a-button>
                 <a-button class="ml10 cancelBtn"
                           @click="cancel">取消</a-button>
@@ -105,7 +107,7 @@ import { getSelectedAccountId, getUserId } from '@/services/bus/account';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { wROutApply } from '@/services/proto/warehousetrade';
 import { v4 as uuidv4 } from 'uuid';
-import moment, {Moment} from 'moment';
+import moment, { Moment } from 'moment';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { WROutInDetail } from '@/services/proto/warehousetrade/interface';
@@ -163,6 +165,7 @@ export default defineComponent({
             visible,
             cancel,
             submit,
+            loading,
             rules,
             formState,
             formRef,