Browse Source

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

huangbin 4 years ago
parent
commit
2c3745163e

+ 8 - 1
src/services/go/Tjmd/index.ts

@@ -37,5 +37,12 @@ export function queryTjmdTransferApply(req: type.QueryTjmdTransferApplyReq): Pro
     });
 }
 
-
+/**
+ * /Tjmd/QueryTjmdMarketSection 查询市场板块
+ */
+export function queryTjmdMarketSection(): Promise<type.TjmdMarketSection[]> {
+    return commonSearch_go('/Tjmd/QueryTjmdMarketSection', {}).catch((err) => {
+        throw new Error(`查询市场板块 : ${err}`);
+    });
+}
 

+ 11 - 0
src/services/go/Tjmd/interface.ts

@@ -90,6 +90,7 @@ export interface QueryTjmdTransferApplyRsp {
     transferprice: number;//转让价格(协议价格)
 }
 
+// TjmdMarketSectionConfig 市场板块设置
 export interface TjmdMarketSectionConfig {
     marketsectionid: number;         // 市场版块ID(SEQ_MARKETSECTION)
     orderindex: number;        // 排序
@@ -144,3 +145,13 @@ export interface TjmdMarketSectionConfig {
     financemarketid: number;     // 融资回购市场ID [仓单贸易]
 }
 
+// TjmdMarketSection 市场板块
+export interface TjmdMarketSection {
+    marketsectionid: number; // 市场版块ID(SEQ_MARKETSECTION)
+    marketsectionname: string; // 市场版块名称
+    orderindex: number; // 排序
+    remark: string; // 备注
+    pictureurl: string; // 图片url, 规格(90*90)
+
+    mlist: TjmdMarketSectionConfig[]; // 市场列表(板块下面有多少个市场)
+}

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

@@ -324,7 +324,7 @@ export default defineComponent({
         const loading = ref<boolean>(false);
         const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleForm(props.selectedRow);
-
+        
         // 选择朋友
         const { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends } = useBlocksFriends(formState);
         // 履约模板

+ 25 - 0
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -10,6 +10,9 @@ import { RuleObject } from 'ant-design-vue/lib/form/interface';
 import moment from 'moment';
 import { onBeforeUnmount, reactive, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
+import { queryTjmdMarketSection } from "@/services/go/Tjmd"
+import { TjmdMarketSection, TjmdMarketSectionConfig } from '@/services/go/Tjmd/interface';
+import { getAllMarkets } from '@/services/bus/market';
 
 function initFormData(): ListingForm {
     return {
@@ -125,3 +128,25 @@ export function handleNumAndPrice() {
     }
     return { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs }
 }
+
+/**
+ * 查询市场板块,用于挂牌时挂牌方式选择,替代之前的“一口价、浮动价和贸易圈”
+ */
+export function queryMarketSection(isPre: boolean) {
+    const spotMarkets = ref<TjmdMarketSectionConfig[]>([]); 
+    queryTjmdMarketSection().then(res => {
+        let resMarkets: TjmdMarketSectionConfig[] = []
+        res.forEach(item => { resMarkets.push(...item.mlist) })
+        // 根据有无仓单过滤出仓单市场
+        resMarkets = resMarkets.filter(item => {
+            item.auctionwrtype === (!isPre ? 2 : 1) && item.trademode === TradeMode.WarehouseReceiptTrade
+        })
+        // 过滤掉没有权限的市场
+        const markets = getAllMarkets()
+        resMarkets = resMarkets.filter(item => {
+            markets.findIndex(m => m.marketid == item.marketid) !== -1
+        })
+
+        spotMarkets.value = resMarkets
+    })
+}

+ 2 - 2
src/views/order/spot_warran/components/spot_warrant_spot_details/index.vue

@@ -41,8 +41,8 @@ export default defineComponent({
     name: enumOrderComponents.spot_warrant_spot_details,
     components: {
         BtnList,
-        [ModalEnum.spot_warrant_spot_details_listed]: defineAsyncComponent(() => import('./components/listing/index.vue')),
-        [ModalEnum.spot_warrant_spot_details_pick_up]: defineAsyncComponent(() => import('./components/pick_up/index.vue')),
+        [ModalEnum.spot_warrant_spot_details_listed]: defineAsyncComponent(() => import('./components/listing/index.vue')), // 挂牌
+        [ModalEnum.spot_warrant_spot_details_pick_up]: defineAsyncComponent(() => import('./components/pick_up/index.vue')), // 摘牌
     },
     setup() {
         // 表格列表数据