Explorar o código

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

li.shaoyi %!s(int64=4) %!d(string=hai) anos
pai
achega
248e280daa

+ 18 - 0
src/assets/styles/theme.css

@@ -72,6 +72,8 @@
     --m-grey64: #15202B;
     --m-grey65: #7a8a94;
     --m-grey66: #334C5C;
+    --m-grey67: #88A0AE;
+    --m-grey68: #7a8a94;
     /* --m-green1: #e8ffef; */
 
     --m-black0: #242a2e;
@@ -171,6 +173,10 @@
     --m-blue33: #3a87f7;
     --m-blue34: #102442;
     --m-blue35: #18345C;
+    --m-blue36: #0d2140;
+    --m-blue37: #0a162b;
+    --m-blue38: #133566;
+    --m-blue39: #74b5ff;
 
     --body-bg: #e9eef3;
     --m-white0: #ffffff;
@@ -287,6 +293,8 @@
     --m-grey64: #15202B;
     --m-grey65: #7a8a94;
     --m-grey66: #334C5C;
+    --m-grey67: #88A0AE;
+    --m-grey68: #7a8a94;
     /* --m-green1: #e8ffef; */
 
     --m-black0: #242a2e;
@@ -385,6 +393,10 @@
     --m-blue33: #3a87f7;
     --m-blue34: #102442;
     --m-blue35: #18345C;
+    --m-blue36: #0d2140;
+    --m-blue37: #0a162b;
+    --m-blue38: #133566;
+    --m-blue39: #74b5ff;
 
     --body-bg: #e9eef3;
     --m-white0: #ffffff;
@@ -499,6 +511,8 @@
     --m-grey64: #FFFFFF;
     --m-grey65: #333333;
     --m-grey66: #ACBBC5;
+    --m-grey67: #ffffff;
+    --m-grey68: #3A87F7;
 
     --m-black0: #F8FBFF;
     --m-black1: #ECF2F5;
@@ -596,6 +610,10 @@
     --m-blue33: #ffffff;
     --m-blue34: #ECF2F5;
     --m-blue35: #D2DAEF;
+    --m-blue36: #6FA6EA;
+    --m-blue37: #E4F5FF;
+    --m-blue38: #5179E2;
+    --m-blue39: #FFFFFF;
 
     --body-bg: #FFFFFF;
     --m-white0: #ffffff;

+ 6 - 0
src/assets/styles/variables.less

@@ -80,6 +80,8 @@
 @m-grey64: var(--m-grey64);
 @m-grey65: var(--m-grey65);
 @m-grey66: var(--m-grey66);
+@m-grey67: var(--m-grey67);
+@m-grey68: var(--m-grey68);
 
 @m-black: #000000;
 @m-black0: var(--m-black0);
@@ -180,6 +182,10 @@
 @m-blue33: var(--m-blue33);
 @m-blue34: var(--m-blue34);
 @m-blue35: var(--m-blue35);
+@m-blue36: var(--m-blue36);
+@m-blue37: var(--m-blue37);
+@m-blue38: var(--m-blue38);
+@m-blue39: var(--m-blue39);
 
 @body-bg: #e9eef3;
 @m-white0: var(--m-white0);

+ 111 - 0
src/common/components/drawer/index.vue

@@ -20,6 +20,61 @@
                 <!-- <Trade></Trade> -->
             </div>
         </div>
+
+        <div class="gpDetail" style="display: none">
+            <div class="title">挂牌详情</div>
+            <div class="content">
+                <div class="item">
+                    <div class="left">交易账户</div>
+                    <div class="right">3237545143</div>
+                </div>
+                <div class="item">
+                    <div class="left">挂牌方式</div>
+                    <div class="right">贸易圈</div>
+                </div>
+                <div class="item">
+                    <div class="left">挂牌价格</div>
+                    <div class="right">
+                        <span>1680.00</span>
+                        <span class="grey">(可议价)</span>
+                    </div>
+                </div>
+                <div class="item">
+                    <div class="left">现货仓单</div>
+                    <div class="right">335999666555222222</div>
+                </div>
+                <div class="item">
+                    <div class="left">挂牌数量</div>
+                    <div class="right">
+                        <span>30吨</span>
+                        <span class="grey">整单</span>
+                    </div>
+                </div>
+                <div class="item">
+                    <div class="left">起摘数量</div>
+                    <div class="right">2吨</div>
+                </div>
+                <div
+                    class="someItems"
+                >1000 江**业、1201 *融、1123 南**业、1000 江**业、1201 *融、1123 南**业、1000 江**业、1201 *融、1123 南**业</div>
+                <div class="item">
+                    <div class="left">现货仓单</div>
+                    <div class="right">335999666555222222</div>
+                </div>
+                <div class="item">
+                    <div class="left">指定朋友</div>
+                    <div class="right">1000 江**业、1201 *融、1123 南...</div>
+                </div>
+                <div class="item">
+                    <div class="left">挂牌金额</div>
+                    <div class="right">50400.00</div>
+                </div>
+                <div class="item">
+                    <div class="left">履约保证金</div>
+                    <div class="right">5040.00</div>
+                </div>
+            </div>
+        </div>
     </a-drawer>
 </template>
 
@@ -72,6 +127,62 @@ export default defineComponent({
 </script>
 
 <style lang="less">
+.gpDetail {
+    width: 400px;
+    height: 450px;
+    .position(fixed, auto, 486px, 0, auto);
+    z-index: 10000;
+    font-size: 16px;
+    .title {
+        width: 100%;
+        height: 38px;
+        line-height: 38px;
+        background: @m-blue36;
+        text-align: center;
+        color: @m-grey67;
+        .rounded-corners(5px);
+    }
+    .content {
+        padding: 0 30px 0 20px;
+        width: 100%;
+        height: 412px;
+        overflow-y: auto;
+        background: @m-blue37;
+        .flex;
+        flex-direction: column;
+        .item {
+            display: inline-flex;
+            height: 40px;
+            line-height: 40px;
+            .left {
+                width: 80px;
+                color: @m-grey2;
+            }
+            .right {
+                width: calc(100% - 85px);
+                flex: 1;
+                padding-left: 5px;
+                color: @m-white6;
+                white-space: nowrap;
+                overflow: hidden;
+                text-overflow: ellipsis;
+                .grey {
+                    color: @m-grey68;
+                    margin-left: 5px;
+                }
+            }
+        }
+        .someItems {
+            line-height: 24px;
+            box-shadow: 0px 10px 10px 0px @m-black18;
+            background: @m-blue38;
+            .rounded-corners(5px);
+            padding: 10px 15px;
+            font-size: 14px;
+            color: @m-blue39;
+        }
+    }
+}
 .bottom {
     .position(fixed, auto, 0, -2px, auto);
     width: 100%;

+ 3 - 2
src/common/setup/trade/index.ts

@@ -92,8 +92,9 @@ export function useFloatPriceMoney<T extends CommomTradeForm>(formState: T, good
 }
 
 // 获取 挂牌 的 最大可挂数量,金额,保证金
-export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formState, goodscode, isFloat, canUseMoney }: ListingTradeNumAndPrice<T>) {
-    const agreeunit = getGoodsAgreeunitByGoodsCode(goodscode)
+export function useListingTradeNumAndPrice<T extends CommomTradeForm>({ formState, goodscode, isFloat, canUseMoney }: ListingTradeNumAndPrice<T>, agreeunitParam?: number) {
+    const agreeunit = agreeunitParam || getGoodsAgreeunitByGoodsCode(goodscode)
+    console.log('agreeunit', agreeunit)
     function getMaxNum(value: number, isBuy: boolean) {
         // 可用资金
         const money = canUseMoney() > 0 ? canUseMoney() : 0

+ 15 - 1
src/hooks/margin.ts

@@ -30,5 +30,19 @@ export const useTodayMargin = () => {
         }
         return result
     }
-    return { findTodayMarginByMarketId, getReckonMarginValueByTradeMode }
+    // 获取 保证金值 方式
+    function getReckonMarginTypeAndValueByTradeMode(trademode: TradeMode) {
+        const result = [0, 0]
+        const marketInfo = getMarketByTradeMode(trademode)
+        if (marketInfo) {
+            const temp = findTodayMarginByMarketId(marketInfo.marketid)?.infoc
+            if (temp) {
+                result[0] = temp.MarginAlgorithm
+                result[1] = temp.ReckonMarginValue
+            }
+        }
+        return result
+    }
+
+    return { findTodayMarginByMarketId, getReckonMarginValueByTradeMode, getReckonMarginTypeAndValueByTradeMode }
 }

+ 2 - 1
src/services/bus/goods.ts

@@ -9,13 +9,14 @@ import { getMarketByTradeMode } from './market';
 
 // 获取全部商品信息
 export function getGoodsList(): Goods[] {
+    console.log('APP.get', APP.get('Goods'))
     return APP.get('Goods')
 }
 
 // 获取全部上市 商品信息
 export function getIPOGoodsList(): Goods[] {
     //商品状态- 1:待审核 2:未上市 3:上市 4:已注销 5:审核拒绝 6:退市 7:待退市
-    return getGoodsList().filter(e => e.goodsstatus === 1)
+    return getGoodsList().filter(e => e.goodsstatus === 3)
 }
 
 // 通过trademode 获取商品

+ 1 - 1
src/services/go/Tjmd/interface.ts

@@ -29,7 +29,7 @@ export interface GoodsMarginCfgStruct {
     GoodsID: number;//商品ID
     IsDefault: number;//是否默认标志位
     LockMarginValue: number;//锁仓保证金
-    MarginAlgorithm: number;//保证金计算方式
+    MarginAlgorithm: number;//保证金计算方式 指定保证金方式 1:比率 2:固定
     MarketMarginValue: number;//即市保证金值
     RealMarginAlgorithm: number;//实付保证金计算方式
     RealMarginValue: number;//实付比例

+ 2 - 13
src/views/market/spot_trade/components/filter/index.vue

@@ -144,6 +144,8 @@ export default defineComponent({
                         if (el.key === id) {
                             //  品种id
                             result.deliverygoodsid = +(item.key as string).replace('--', '');
+                            result.enumdicname = el.enumdicname;
+                            result.minivalue = el.minivalue;
                         }
                     });
                 });
@@ -207,19 +209,6 @@ export default defineComponent({
                 }
                 const result = search(false);
 
-                const obj = {
-                    enumdicname: '',
-                    minivalue: 0,
-                };
-                FtDeliveryGoods.value.forEach((el) => {
-                    el.children?.forEach((e) => {
-                        e.key === selectedFT.value;
-                        obj.enumdicname = e.enumdicname;
-                        obj.minivalue = e.minivalue;
-                    });
-                });
-                Object.assign(result, obj);
-
                 context.emit('buy', result, selectedGoods.value);
             }
         }

+ 42 - 16
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/components/post_buying/index.vue

@@ -187,7 +187,7 @@ export default defineComponent({
         queryTable(queryTradePosition);
 
         // 获取保证金比例
-        const { getReckonMarginValueByTradeMode } = useTodayMargin();
+        const { getReckonMarginValueByTradeMode, getReckonMarginTypeAndValueByTradeMode } = useTodayMargin();
         // 控制弹窗
         const { visible, cancel } = _closeModal(context);
         // 表单
@@ -204,29 +204,55 @@ export default defineComponent({
             isFloat,
             canUseMoney,
         };
-        const { getFloatPrice, getMoney } = useListingTradeNumAndPrice<FormParam>(param);
+        // 挂牌金额
+        // function getMoney() {
+
+        // }
+        // 估算价
+        function getAppraise() {}
+        // 合约单位
+        const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
+        console.log();
+        console.log('合约单位', agreeunit);
+        const { getFloatPrice, getMoney } = useListingTradeNumAndPrice<FormParam>(param, agreeunit);
         // 保证金
         const getMargin = () => {
-            const marginvalue = getReckonMarginValueByTradeMode(TradeMode.DiaoQi);
-            return marginvalue ? marginvalue : '--';
+            let result = '--';
+            const [marginType, marginValue] = getReckonMarginTypeAndValueByTradeMode(TradeMode.DiaoQi);
+            if (marginType) {
+                // 保证金方式 1:比率 2:固定
+                if (marginType === 1) {
+                    if (getMoney()) {
+                        // 履约保证金=挂牌金额*保证金比例
+                        result = ((getMoney() * marginValue) / 100).toFixed(2);
+                    }
+                } else {
+                    if (formState.OrderQty) {
+                        // 履约保证金=挂牌数量*保证金固定值
+                        result = (formState.OrderQty * marginValue).toFixed(2);
+                    }
+                }
+            }
+            return result;
         };
         // 最大数量
         const getMaxNum = () => {
             let result = 0;
-            if (isBuy()) {
-                // 可用资金
-                const temp = +canUseMoney();
-
-                const money = temp > 0 ? temp : 0;
-                const agreeunit = getGoodsAgreeunitByGoodsCode(props.selectedRow.goodscode);
-                if (money && formState.FixedPrice) {
-                    result = +(money / (formState.FixedPrice * agreeunit)).toFixed(0);
+            const [marginType, marginValue] = getReckonMarginTypeAndValueByTradeMode(TradeMode.DiaoQi);
+            // 可用资金
+            const temp = +canUseMoney();
+            const money = temp > 0 ? temp : 0;
+            if (marginType && money && formState.FixedPrice) {
+                // 保证金方式 1:比率 2:固定
+                if (marginType === 1) {
+                    // 最大可挂牌数量=可用/(价格*合约单位*保证金比例
+                    result = money / (((formState.FixedPrice * marginValue) / 100) * agreeunit);
+                } else {
+                    // 最大可挂牌数量=可用/保证金固定值
+                    result = money / marginValue;
                 }
-            } else {
-                const temp = tableList.value.find((el) => el.goodscode === props.selectedRow.goodscode)?.enableqty;
-                result = temp ? temp : 0;
             }
-            return result;
+            return +result.toFixed(0);
         };
         // 估算价
         function getPrice() {

+ 1 - 0
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/interface.ts

@@ -3,5 +3,6 @@ import { QueryQuoteDayRsp } from "@/services/go/quote/interface";
 export interface RefGoodsList extends QueryQuoteDayRsp {
     refgoodsname: string
     goodsname: string
+    refgoodscode: string
     orderid: number
 }

+ 4 - 2
src/views/market/spot_trade/spot_trade_order_transaction/spot_trade_order_transaction_swap/setup.ts

@@ -41,13 +41,15 @@ export const useSwapList = () => {
                 if (quote) {
                     const result: RefGoodsList = {
                         ...quote,
-                        goodsname: el.goodsname, refgoodsname: el.refgoodsname
+                        goodsname: el.goodsname,
+                        refgoodsname: el.refgoodsname,
+                        refgoodscode: el.refgoodscode
                     }
                     goodsList.value.push(result)
                     allGoodsList.value.push(result)
                 }
             })
-            console.log(goodsList.value)
+            console.log('商品掉期', res)
         })
     })
     // 获取标记商品列表

+ 1 - 1
src/views/order/funding_information/components/funding_information_funding_summary/index.vue

@@ -35,7 +35,7 @@
         <span>{{hazardRates(record)}}</span>
       </template>
       <!-- 净值 -->
-      <template #currentbalance="{record}">
+      <template #netWorth="{record}">
         <span>{{netWorth(record)}}</span>
       </template>
       <template #tradestatus="{text}">

+ 3 - 3
src/views/order/funding_information/components/funding_information_funding_summary/setup.ts

@@ -19,11 +19,11 @@ export const tableColumns = [
     },
     {
         key: '1th',
-        dataIndex: 'currentbalance',
+        dataIndex: 'netWorth',
         title: '净值',
         align: 'center',
         slots: {
-            customRender: 'currentbalance',
+            customRender: 'netWorth',
         },
         width: 120,
     },
@@ -139,9 +139,9 @@ export const useHazardRates = (positions: Ref<QueryTradePositionRsp[]>) => {
         const { accountid, currentbalance, otherfreezemargin, outamountfreeze } = taaccount
         // 浮动盈亏
         const profitloss = handleProfitloss(taaccount, false) as number
+
         // 市值
         const price = getSystemParam('087', '1') ? handleHoldPrice(accountid) : 0
-
         // 风险净值	根据系统参数“087 风险净值是否加上市值 - 0:不加 1:加“
         // 0. 风险净值=期末余额+浮动盈亏(收益权)-其他冻结-出金冻结
         // 1. 风险净值=期末余额+市值+浮动盈亏(收益权)-其他冻结-出金冻结