Bläddra i källkod

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 år sedan
förälder
incheckning
6f54a2c723

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

@@ -89,6 +89,7 @@ export default defineComponent({
             delete item.width;
             return columns;
         }
+        function handleBtnList() {}
         return {
             ...handleComposeTable<WrOrderQuoteDetail>(param),
             queryTableAction,

+ 49 - 65
src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/components/choose-finance/index.vue

@@ -1,52 +1,50 @@
 <template>
-    <!-- 仓单贸易&仓单预售 融资-->
+  <!-- 仓单贸易&仓单预售 融资-->
 
-    <Drawer
-        :title="'选择融资方案'"
-        :placement="'right'"
-        :visible="visible"
-        width="486px"
-        height="580px"
-        @cancel="update"
-        class="topHigh financing"
-    >
-        <div class="financingCont">
-            <a-row class="f-t">
-                <a-col :span="7">融出方/名称</a-col>
-                <a-col :span="10">天数/保证金/利息</a-col>
-                <a-col :span="7">结息/起息天数</a-col>
+  <Drawer :title="'选择融资方案'"
+          :placement="'right'"
+          :visible="visible"
+          width="486px"
+          height="580px"
+          @cancel="update"
+          class="top financing">
+    <div class="financingCont">
+      <a-row class="f-t">
+        <a-col :span="7">融出方/名称</a-col>
+        <a-col :span="10">天数/保证金/利息</a-col>
+        <a-col :span="7">结息/起息天数</a-col>
+      </a-row>
+      <div class="contBar"
+           v-for="(item, index) in list"
+           :key="index + 11"
+           @click="choose(item)">
+        <a-row class="firstRow">
+          <a-col :span="7">{{item.productname}}</a-col>
+          <a-col :span="17"
+                 v-if="item.isautoloan">放款快</a-col>
+        </a-row>
+        <a-row class="secondRow">
+          <a-col :span="7">{{item.username}}</a-col>
+          <a-col :span="10">
+            <a-row class="middle">
+              <a-col :span="7">{{item.financingdays}}天</a-col>
+              <a-col :span="10">{{item.marginratio * 100}}%</a-col>
+              <a-col :span="7">{{item.interestrate * 100}}%</a-col>
             </a-row>
-            <div
-                class="contBar"
-                v-for="(item, index) in list"
-                :key="index + 11"
-                @click="choose(item)"
-            >
-                <a-row class="firstRow">
-                    <a-col :span="7">{{item.productname}}</a-col>
-                    <a-col :span="17" v-if="item.isautoloan">放款快</a-col>
-                </a-row>
-                <a-row class="secondRow">
-                    <a-col :span="7">{{item.username}}</a-col>
-                    <a-col :span="10">
-                        <a-row class="middle">
-                            <a-col :span="7">{{item.financingdays}}天</a-col>
-                            <a-col :span="10">{{item.marginratio * 100}}%</a-col>
-                            <a-col :span="7">{{item.interestrate * 100}}%</a-col>
-                        </a-row>
-                    </a-col>
-                    <a-col :span="7">
-                        <div class="settle">
-                            <div>{{item.interestsettlemode === 1 ? '日' : '月'}}结</div>
-                            <div>{{item.interestminlen}}天起息</div>
-                        </div>
-                    </a-col>
-                </a-row>
-            </div>
-            <div class="noDataContBar" v-if="!list.length">
-                <div class="noData"></div>
+          </a-col>
+          <a-col :span="7">
+            <div class="settle">
+              <div>{{item.interestsettlemode === 1 ? '日' : '月'}}结</div>
+              <div>{{item.interestminlen}}天起息</div>
             </div>
-            <!-- <div class="contBar">
+          </a-col>
+        </a-row>
+      </div>
+      <div class="noDataContBar"
+           v-if="!list.length">
+        <div class="noData"></div>
+      </div>
+      <!-- <div class="contBar">
         <a-row class="firstRow">
           <a-col :span="7">铜供应链金融</a-col>
           <a-col :span="17">放款快</a-col>
@@ -90,26 +88,18 @@
           </a-col>
         </a-row>
             </div>-->
-        </div>
-    </Drawer>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
 import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
-import { defineComponent, PropType, ref } from 'vue';
+import { defineComponent, PropType } from 'vue';
 import Drawer from '@/common/components/drawer/index.vue';
-import { WrFAProductDetail, WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
-import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import { HdWRDealOrder } from '@/services/proto/warehousetrade';
-import { v4 as uuidv4 } from 'uuid';
-import moment from 'moment';
+import { WrFAProductDetail, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
-import { HdWRDealOrderReq } from '@/services/proto/warehousetrade/interface';
 import { _closeModal } from '@/common/setup/modal/modal';
-import { validateAction } from '@/common/setup/form';
-import { EnumRouterName } from '@/common/constants/enumRouterName';
-import { queryFaProductDetail } from '@/services/go/wrtrade';
+import { getFinacingList } from '../../../../setup';
 export default defineComponent({
     name: ModalEnum.spot_trade_warehouse_delisting,
     components: { Drawer, PlusOutlined, MinusOutlined },
@@ -123,12 +113,7 @@ export default defineComponent({
 
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
-        const list = ref<WrFAProductDetail[]>([]);
-        const loading = ref<boolean>(false);
-        queryResultLoadingAndInfo(queryFaProductDetail, loading, { wrfactortypeid: props.selectedRow.wrtradeorderid }).then((res) => {
-            list.value = res;
-        });
-        queryFaProductDetail;
+        const list = getFinacingList();
         function update() {
             cancel();
             context.emit('cancel');
@@ -141,7 +126,6 @@ export default defineComponent({
             visible,
             update,
             choose,
-            loading,
             list,
         };
     },

+ 2 - 1
src/views/market/spot_trade/components/buy-sell-market/components/financing_delisting/setup.ts

@@ -67,4 +67,5 @@ export function handleSpotWarrant(enumName: EnumRouterName, buyOrSell: BuyOrSell
         }
     }
     return { wrHoldList }
-}
+}
+

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

@@ -67,14 +67,14 @@
         <Sell :enumName="enumName"
               ref="sellRef"
               :parantSelectedRow="selectedRow"
-              :btnList="sellMarket.btnList" />
+              :btnList="handleBtnList(sellMarket.btnList)" />
       </a-col>
       <a-col :span="12"
              v-if="buyMarket.isMarket">
         <Buy :enumName="enumName"
              ref="buy"
              :parantSelectedRow="selectedRow"
-             :btnList="buyMarket.btnList" />
+             :btnList="handleBtnList(buyMarket.btnList)" />
       </a-col>
     </a-row>
     <component :is="componentId"
@@ -91,7 +91,7 @@ import { defineAsyncComponent, defineComponent, BtnList, ModalEnum } from '@/com
 import { _closeModal } from '@/common/setup/modal/modal';
 import { WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { LeftOutlined } from '@ant-design/icons-vue';
-import { handleChildComponentMethod } from './setup';
+import { handleChildComponentMethod, handleFinacing } from './setup';
 import Buy from './components/buy/index.vue';
 import Sell from './components/sell/index.vue';
 import { LineChartOutlined } from '@ant-design/icons-vue';
@@ -103,6 +103,7 @@ import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/sock
 import Bus from '@/utils/eventBus/index';
 import { getQuoteDayInfoByCode } from '@/services/bus/goods';
 import TimerUtils from '@/utils/timer/timerUtil';
+import { BtnList as BtnListType } from '@/common/components/btnList/interface';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -127,6 +128,7 @@ export default defineComponent({
         [ModalEnum.spot_trade_warehouse_post_buying]: defineAsyncComponent(() => import('../post_buying/index.vue')),
     },
     setup(props, context) {
+        const loading = ref<boolean>(false);
         const { visible, cancel } = _closeModal(context);
         // 买卖大厅 配置数据
         // 表格操作按钮列表
@@ -159,6 +161,14 @@ export default defineComponent({
             loadSellData();
         };
         const { componentId, closeComponent, openComponent } = handleModalComponent(queryFn, ref({}));
+        const { hasFinacing } = handleFinacing(loading, props.selectedRow.wrfactortypeid);
+        function handleBtnList(list: BtnListType[]) {
+            if (!hasFinacing()) {
+                return list.filter((e) => e.code !== 'spot_trade_warehouse_financing_delisting');
+            } else {
+                return list;
+            }
+        }
         TimerUtils.setInterval(
             () => {
                 loadBuyData();
@@ -188,6 +198,7 @@ export default defineComponent({
             closeComponent,
             openComponent,
             enumName: props.enumName,
+            handleBtnList,
             temp,
         };
     },

+ 22 - 2
src/views/market/spot_trade/components/buy-sell-market/setup.ts

@@ -1,8 +1,10 @@
 import { EnumRouterName } from '@/common/constants/enumRouterName';
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { TableKey } from '@/common/methods/table/interface';
 import { getTableColumns, getTableEvent, queryTableList } from "@/common/setup/table";
-import { WrMarketTradeConfig } from "@/services/go/wrtrade/interface";
-import { ref } from 'vue';
+import { queryFaProductDetail } from '@/services/go/wrtrade';
+import { WrFAProductDetail, WrMarketTradeConfig } from "@/services/go/wrtrade/interface";
+import { Ref, ref } from 'vue';
 
 
 export function handleBuyAndSellList<T>(menuType: EnumRouterName, isDetail: boolean, tableName: keyof TableKey) {
@@ -84,6 +86,24 @@ export function handleChildComponentMethod() {
     return { childRef, loadChildComponentData }
 }
 
+
+const list = ref<WrFAProductDetail[]>([]);
+// 获取融资摘牌
+export function handleFinacing(loading: Ref<boolean>, id: number) {
+    queryResultLoadingAndInfo(queryFaProductDetail, loading, { wrfactortypeid: id }).then((res) => {
+        list.value = res;
+        return res
+    });
+    function hasFinacing(): boolean {
+        return list.value.length > 0
+    }
+    return { hasFinacing }
+}
+
+export function getFinacingList(): WrFAProductDetail[] {
+    return list.value
+}
+
 export enum WrTradePriceEnum {
     OnePriceDeListBuy,   // 一口价 摘牌买入
     OnePriceDeListSale,  // 一口价 摘牌卖出