Bladeren bron

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

marymelisa 4 jaren geleden
bovenliggende
commit
75563d44d1

+ 36 - 28
src/views/market/spot_trade/components/detail/index.vue

@@ -1,27 +1,35 @@
 <template>
-    <!-- 买卖大厅详情 -->
-    <Drawer :title="'详情'" :placement="'right'" :visible="visible" class="top" @cancel="cancel">
-        <div class="detailCont">
-            <div class="rows">
-                <div class="row" v-for="item in lstitem" :key="item.name">
-                    <div class="left">{{item.name}}</div>
-                    <div class="right">{{item.value}}</div>
-                </div>
-            </div>
-            <div class="ruleTitle">履约规则:</div>
-            <div class="rulesCont">
-                <a-row>
-                    <a-col :span="12" v-for="item in lststep" :key="item.autoid">
-                        <div class="line">
-                            <div class="no">{{item.autoid}}</div>
-                            <div class="name">{{item.steptypename}}</div>
-                            <div class="time">T+{{item.stepvalue}}</div>
-                        </div>
-                    </a-col>
-                </a-row>
-            </div>
+  <!-- 买卖大厅详情 -->
+  <Drawer :title="'详情'"
+          :placement="'right'"
+          :visible="visible"
+          class="top"
+          @cancel="cancel">
+    <div class="detailCont">
+      <div class="rows">
+        <div class="row"
+             v-for="item in lstitem"
+             :key="item.name">
+          <div class="left">{{item.name}}</div>
+          <div class="right">{{item.value}}</div>
         </div>
-    </Drawer>
+      </div>
+      <div class="ruleTitle">履约规则:</div>
+      <div class="rulesCont">
+        <a-row>
+          <a-col :span="24"
+                 v-for="(item, index) in lststep"
+                 :key="item.autoid">
+            <div class="line">
+              <div class="no">{{index + 1}}</div>
+              <div class="name">{{item.steptypename}}</div>
+              <div class="time">{{item.stepdate}}</div>
+            </div>
+          </a-col>
+        </a-row>
+      </div>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -163,11 +171,11 @@ export default defineComponent({
             margin-right: 8px;
         }
     }
-    .ant-col:nth-child(even) {
-        padding-left: 10px !important;
-    }
-    .ant-col:nth-child(odd) {
-        padding-right: 10px !important;
-    }
+    // .ant-col:nth-child(even) {
+    //     padding-left: 10px !important;
+    // }
+    // .ant-col:nth-child(odd) {
+    //     padding-right: 10px !important;
+    // }
 }
 </style>

+ 15 - 16
src/views/market/spot_trade/components/post_buying/index.vue

@@ -48,7 +48,7 @@
                    v-if="isFloat()">
               <a-form-item label="估算价"
                            name="PriceMove">
-                <span>估算价估算价</span>
+                <span class="white">{{getPrice()}}</span>
               </a-form-item>
             </a-col>
 
@@ -76,12 +76,12 @@
             <a-col :span="24"
                    class="mt-10">
               <a-form-item>
-                <a-slider ::min="0"
+                <a-slider :min="0"
                           v-model:value="formState.OrderQty"
-                          :max="99999999"
+                          :max="getMaxNum()"
                           class="formSlider" />
                 <div class="unit">
-                  <span>{{selectedRow.minivalue}}</span>
+                  <span>{{getMaxNum() ? selectedRow.minivalue : 0}}</span>
                   <span>{{getMaxNum()}}{{selectedRow.enumdicname}}</span>
                 </div>
               </a-form-item>
@@ -149,7 +149,7 @@ import Drawer from '@/common/components/drawer/index.vue';
 import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
 import { hdWROrder } from '@/services/proto/warehousetrade';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
-import {DGFactoryItems, WRGoodsInfo} from '@/services/proto/warehousetrade/interface';
+import { DGFactoryItems, WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
 import { getAccountTypeList, getUserId } from '@/services/bus/account';
 import { v4 as uuidv4 } from 'uuid';
 import moment, { Moment } from 'moment';
@@ -157,7 +157,7 @@ import { getMarketRunByTradeMode } from '@/services/bus/market';
 import { WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { handleForm, handleNumAndPrice } from './setup';
 import { validateAction } from '@/common/setup/form';
-import {FormParam, TempWrOrderQuoteDetail} from './interface';
+import { FormParam, TempWrOrderQuoteDetail } from './interface';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { handleIs } from '../buy-sell-market/setup';
 import { BuyOrSell } from '@/common/constants/enumCommon';
@@ -195,12 +195,11 @@ export default defineComponent({
         }
         formState.DeliveryMonth = props.selectedRow.deliverymonth ? moment(props.selectedRow.deliverymonth) : props.time;
 
-        const { getMaxNum, getMoney, getMargin } = handleNumAndPrice(props.enumName, props.selectedRow);
+        const { getMaxNum, getMoney, getMargin, getPrice } = handleNumAndPrice(props.enumName, props.selectedRow);
         function submit() {
             const marketInfo = getMarketRunByTradeMode(17);
             if (marketInfo) {
                 validateAction<FormParam>(formRef, formState).then((res) => {
-
                     // 现在增加一种挂牌求购的情况
                     // 这种求购模式会生成一种仓单贸易商品
 
@@ -253,15 +252,14 @@ export default defineComponent({
                         HasWr: isWR(), // 无仓单挂牌  是否有无仓单
                         DeliveryMonth: isWR() ? '' : moment(res.DeliveryMonth).format('YYYY-MM'),
                         FactoryItems: props.selectedRow.wrResult.flatMap((it) => {
-                                return {
-                                    DGFactoryItemTypeID: it.dgfactoryitemtypeid, // uint64 要素项类型ID
-                                    DGFactoryItemID: it.dgfactoryitemid, // uint64 预约要素项类型值
-                                    ItemTypeMode: 1, // uint32 要素项类型模式
-                                }
-                            }
-                        ) // DGFactoryItems 要素类型明细集合(没有仓单要素ID填写)
+                            return {
+                                DGFactoryItemTypeID: it.dgfactoryitemtypeid, // uint64 要素项类型ID
+                                DGFactoryItemID: it.dgfactoryitemid, // uint64 预约要素项类型值
+                                ItemTypeMode: 1, // uint32 要素项类型模式
+                            };
+                        }), // DGFactoryItems 要素类型明细集合(没有仓单要素ID填写)
                     };
-                    debugger
+                    debugger;
                     requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
                         cancel(true);
                     });
@@ -283,6 +281,7 @@ export default defineComponent({
             getMargin,
             getSelectedAccount,
             getCanUseMoney,
+            getPrice,
         };
     },
 });

+ 23 - 3
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -43,9 +43,21 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
     function getMaxNum() {
         // 可用资金
         const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
+        const { buymarginvalue } = rules[0]
         // 挂牌最大数量=可用资金/(买方履约保证金比例*挂牌价格)
-        const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
-        return Math.floor(canUseMoney / margin)
+        let result = 0
+        if (isFloat()) {
+            const price = getPrice()
+            if (price !== '--') {
+                result = canUseMoney / (Number(price) * buymarginvalue)
+            }
+        } else {
+            const margin = marginMethod() ? (buymarginvalue * formState.FixedPrice) : (buymarginvalue + formState.FixedPrice)
+            if (margin) {
+                result = Math.floor(canUseMoney / margin)
+            }
+        }
+        return +result.toFixed(0)
     }
     //  摘牌金额
     function getMoney() {
@@ -72,5 +84,13 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
         const margin = marginMethod() ? (buymarginvalue * getMoney()) : (buymarginvalue + getMoney())
         return Number((margin).toFixed(2))
     }
-    return { getMaxNum, getMoney, getMargin }
+    function getPrice() {
+        let result = '--'
+        const goodsPrice = getGoodsPrice()
+        if (goodsPrice.value && goodsPrice.value !== '--') {   // 有实时行情价格
+            result = ((goodsPrice.value as number) + formState.PriceMove).toFixed(2)
+        }
+        return result
+    }
+    return { getMaxNum, getMoney, getMargin, getPrice }
 }

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

@@ -13,12 +13,12 @@
              rowKey="key"
              :data-source="tableList">
       <!-- 额外的展开行 -->
-      <template #expandedRowRender="{ record }" >
+      <template #expandedRowRender="{ record }">
         <BtnList :btnList="btnList"
                  class="btn-list-sticky"
                  :record="record"
-                 @click="openComponent" 
-                 v-if="record.enalbeqty > 0"/>
+                 @click="openComponent"
+                 v-if="record.enalbeqty > 0" />
       </template>
     </a-table>
     <component :is="componentId"

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

@@ -18,7 +18,7 @@
                  :record="record"
                  class="btn-list-sticky"
                  @click="openComponent"
-                 v-if="record.enalbeqty > 0" />
+                 v-if="record.enableqty > 0" />
       </template>
     </a-table>
     <component :is="componentId"