huangbin 4 vuotta sitten
vanhempi
commit
988d6017aa

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

@@ -161,7 +161,7 @@
             </a-col>
           </a-row>
           <a-row :gutter="24"
-                 v-if="isSale() && !isSale()">
+                 v-if="isBuy() && !isSale()">
             <a-col :span="24">
               <a-form-item label="现货仓单"
                            name="LadingBillId">
@@ -217,7 +217,7 @@
             <a-col :span="24">
               <a-form-item class="tc">
                 <a-button class="listedBtn"
-                          @click="submit">卖出</a-button>
+                          @click="submit">{{isBuy() ? '买' : ''}}出</a-button>
                 <a-button class="ml10 cancelBtn"
                           @click="cancel">取消</a-button>
               </a-form-item>
@@ -276,7 +276,7 @@ export default defineComponent({
         const { rules, formState, formRef } = handleForm(props.selectedRow);
         const loading = ref<boolean>(false);
         const { isSale, isBuy } = handleIs(props.enumName, props.buyOrSell);
-        const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.selectedRow);
+        const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.selectedRow, loading);
 
         function submit() {
             validateAction<ListingForm>(formRef, formState).then((res) => {
@@ -324,6 +324,7 @@ export default defineComponent({
             wrHoldList,
             submit,
             isSale,
+            isBuy,
             rules,
             formState,
             formRef,

+ 8 - 9
src/views/market/spot_trade/components/buy-sell-market/components/delisting/setup.ts

@@ -1,9 +1,9 @@
 import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
-import { queryTableList } from '@/common/export/commonTable';
+import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
 import { queryHoldLB } from '@/services/go/wrtrade';
 import { WrHoldLB, WrOrderQuoteDetail } from "@/services/go/wrtrade/interface";
-import { reactive, ref, UnwrapRef } from "vue";
+import { reactive, Ref, ref, UnwrapRef } from "vue";
 import { ListingForm, Wrhold } from "./interface";
 
 export function handleForm(data: WrOrderQuoteDetail) {
@@ -29,8 +29,8 @@ export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
      * @returns true => 仓单预售; false => 仓单贸易
      */
     function isSale(): boolean {
-        return enumName === EnumRouterName.warehouse_receipt_trade_price ||
-            enumName === EnumRouterName.warehouse_receipt_trade_floating_price
+        return enumName === EnumRouterName.warehouse_pre_sale_price ||
+            enumName === EnumRouterName.warehouse_pre_sale_floating_price
     }
     /**
      *
@@ -43,14 +43,13 @@ export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
 }
 
 // 处理现货仓单
-export function handleSpotWarrant(enumName: EnumRouterName, buyOrSell: BuyOrSell, selectedRow: WrOrderQuoteDetail) {
+export function handleSpotWarrant(enumName: EnumRouterName, buyOrSell: BuyOrSell, selectedRow: WrOrderQuoteDetail, loading: Ref<boolean>) {
     const { isSale, isBuy } = handleIs(enumName, buyOrSell)
     const wrHoldList = ref<Wrhold[]>([])
     if (isBuy()) {
-        if (isSale()) {
-            const { queryTable } = queryTableList<WrHoldLB>();
-            queryTable(queryHoldLB).then(res => {
-                wrHoldList.value = res.filter(e => e.wrfactortypeid === selectedRow.wrtradeorderid).map(e => {
+        if (!isSale()) {
+            queryResultLoadingAndInfo(queryHoldLB, loading).then(res => {
+                wrHoldList.value = res.filter((e: WrHoldLB) => e.wrfactortypeid === selectedRow.wrtradeorderid).map((e: WrHoldLB) => {
                     const { wrholdeno, enableqty, ladingbillid } = e
                     return { id: ladingbillid, name: `${wrholdeno}(${enableqty})` }
                 })