huangbin 4 éve
szülő
commit
21f2606474

+ 10 - 0
src/services/bus/index.ts

@@ -1,4 +1,5 @@
 import { isOemByEnum, OemType } from '@/common/config/projectName';
+import { TradeMode } from '@/common/constants/enumCommon';
 import APP from '@/services';
 import { isAllEnum } from '@/services/bus/allEnum';
 import { isLogin } from '@/services/bus/login';
@@ -13,6 +14,8 @@ import { message } from 'ant-design-vue';
 import { queryMarketRun } from '../go/commonMarket';
 import { GetErmcpGoods, QueryDeliveryGoodsDetail } from '../go/ermcp/goodsInfo';
 import { getTaAccount } from '../go/TaAccount';
+import { queryWrMarketTradeConfig } from '../go/wrtrade';
+import { getMarketByTradeMode } from './market';
 
 /**
  * 全局数据刷新
@@ -38,6 +41,13 @@ export async function globalDataRefresh(): Promise<string> {
                 // token校验成功 马上轮询
                 checkTokenLoop();
                 await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount(), queryMarketRun()])
+                const marketInfo = getMarketByTradeMode(TradeMode.WarehouseReceiptTrade);
+                if (marketInfo) {
+                    if (isOemByEnum(OemType.wrspot)) {
+                        // 仓单贸易交易规则
+                        await queryWrMarketTradeConfig({ marketid: marketInfo.marketid })
+                    }
+                }
             }
         } else {
             // 重置数据中心数据

+ 12 - 0
src/services/bus/login.ts

@@ -1,3 +1,5 @@
+import { isOemByEnum, OemType } from '@/common/config/projectName';
+import { TradeMode } from '@/common/constants/enumCommon';
 import APP from '@/services';
 import { isAllEnum } from '@/services/bus/allEnum';
 import { checkTokenLoop } from '@/services/bus/token';
@@ -9,9 +11,11 @@ import { sessionStorageUtil } from '@/utils/storage/index';
 import Long from 'long';
 import { queryMarketRun } from '../go/commonMarket';
 import { getTaAccount } from '../go/TaAccount';
+import { queryWrMarketTradeConfig } from '../go/wrtrade';
 import { logoutResponse } from '../socket/login';
 import { loginAction } from '../socket/login/index';
 import { LoginResponse, LongType } from '../socket/login/interface/index';
+import { getMarketByTradeMode } from './market';
 
 export const logout = (): void => {
     // removeLoginData();
@@ -27,6 +31,14 @@ export const login = async (logidCode: string, password: string, byteArr: Uint8A
         // localstorage 缓存登录信息,处理页面刷新
         setLoginData(loginData);
         await Promise.all([GetErmcpGoods(), GetPCMenus(), QueryTableDefine(), getServerTime(), LoginQuery(), QueryDeliveryGoodsDetail(), getTaAccount(), queryMarketRun()])
+        const marketInfo = getMarketByTradeMode(TradeMode.WarehouseReceiptTrade);
+        if (marketInfo) {
+            if (isOemByEnum(OemType.wrspot)) {
+                // 仓单贸易交易规则
+                await queryWrMarketTradeConfig({ marketid: marketInfo.marketid })
+            }
+        }
+
         // await GetPCMenus();
         // await QueryTableDefine();
         // 获取服务时间

+ 8 - 0
src/services/bus/rules.ts

@@ -0,0 +1,8 @@
+import APP from '@/services';
+import { WrMarketTradeConfig } from '../go/wrtrade/interface';
+
+export function getRules(): WrMarketTradeConfig[] {
+    return APP.get('rules')
+}
+
+export { };

+ 1 - 0
src/services/dataCenter/index.ts

@@ -28,6 +28,7 @@ const needClearSourceData: NeedClearSourceDataType = {
     selectedAccount: new SelectedAccountModel(),
     quoteDayInfo: [],
     RootUser: [],
+    rules: [],
 };
 
 /**

+ 2 - 0
src/services/dataCenter/interface.ts

@@ -3,6 +3,7 @@ import { ErmcpDeliveryGoodsDetailEx, Goods } from '@/services/go/ermcp/goodsInfo
 import * as advert from '@/services/go/quote/interface';
 import * as useInfo from '@/services/go/useInfo/interface';
 import { Marketrun } from '../go/commonMarket/interface';
+import { WrMarketTradeConfig } from '../go/wrtrade/interface';
 import { AccountListItem } from './interafce/account';
 
 /**
@@ -42,6 +43,7 @@ export interface NeedClearSourceDataType {
     selectedAccount: AccountListItem; // 当前选中的资金账号
     quoteDayInfo: advert.QueryQuoteDayRsp[]; // 行情盘面信息
     RootUser: useInfo.Ermcp3RootUserAccount[],
+    rules: WrMarketTradeConfig[],
 }
 
 export { advert };

+ 7 - 6
src/services/go/wrtrade/index.ts

@@ -1,6 +1,6 @@
 /** ================================= 仓单贸易v2 ================================**/
 /* 更新全部接口 20210803 */
-
+import APP from '@/services';
 import { getSelectedAccountId } from "@/services/bus/account";
 import { getUsrId } from "@/services/bus/user";
 import { commonSearch_go } from "@/services/go";
@@ -24,9 +24,7 @@ import {
     WrFinanceBuyApply,
     WrFtDeliveryGoods,
     WrGoodsInfo,
-    WrHoldLB,
-    WrMarketTradeConfig,
-    WrOrderDetail,
+    WrHoldLB, WrOrderDetail,
     WrOrderQuote,
     WrOrderQuoteDetail, WrOutInApply,
     WrPerformancePlan,
@@ -148,8 +146,11 @@ export function queryWrGoodsInfo(req: QueryWrGoodsInfoReq): Promise<WrGoodsInfo[
  * 查询市场交易参数配置 /WrTrade2/QueryWrMarketTradeConfig
  * @param req
  */
-export function queryWrMarketTradeConfig(req: QueryWrMarketTradeConfigReq): Promise<WrMarketTradeConfig[]> {
-    return commonSearch_go('/WrTrade2/QueryWrMarketTradeConfig', req).catch((err) => {
+export function queryWrMarketTradeConfig(req: QueryWrMarketTradeConfigReq): Promise<string> {
+    return commonSearch_go('/WrTrade2/QueryWrMarketTradeConfig', req).then(res => {
+        APP.set('rules', res)
+        return 'ok'
+    }).catch((err) => {
         throw new Error(`查询市场交易参数配置: ${err}`);
     });
 }

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

@@ -2,11 +2,12 @@ import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
+import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { queryHoldLB, queryWrPosition } from '@/services/go/wrtrade';
 import { QueryWrPositionReq, WrHoldLB, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from "@/services/go/wrtrade/interface";
 import { reactive, Ref, ref, UnwrapRef } from "vue";
-import { getGoodsPrice, getRules, handleIs } from "../../setup";
+import { getGoodsPrice, handleIs } from "../../setup";
 import { ListingForm, Wrhold } from "./interface";
 
 export function handleForm(data: WrOrderQuoteDetail) {
@@ -66,7 +67,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
     // 获取选中的资金账号
     const getSelectedAccount = () => accountList.find((e) => e.accountid === formState.accountid);
     // 交易规则
-    const rules = getRules().value
+    const rules = getRules()
     // 是否有规则
     const hasRule = () => rules.length > 0;
     //保证金模式 1: 比率 2: 固定

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

@@ -2,11 +2,12 @@ import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { queryResultLoadingAndInfo } from "@/common/methods/request/resultInfo";
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
+import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { queryHoldLB, queryWrPosition } from '@/services/go/wrtrade';
 import { QueryWrPositionReq, WrFAProductDetail, WrHoldLB, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from "@/services/go/wrtrade/interface";
 import { reactive, Ref, ref, UnwrapRef } from "vue";
-import { getGoodsPrice, getRules, handleIs } from "../../setup";
+import { getGoodsPrice, handleIs } from "../../setup";
 import { ListingForm, Wrhold } from "./interface";
 
 export const selecedFinance = ref<WrFAProductDetail>()
@@ -88,7 +89,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
     // 获取选中的资金账号
     const getSelectedAccount = () => accountList.find((e) => e.accountid === formState.accountid);
     // 交易规则
-    const rules = getRules().value
+    const rules = getRules()
     // 是否有规则
     const hasRule = () => rules.length > 0;
     //保证金模式 1: 比率 2: 固定

+ 5 - 11
src/views/market/spot_trade/components/buy-sell-market/index.vue

@@ -107,22 +107,21 @@ 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 { handleFinacing, handlePriceRule, handleIs, setGoodsPrice } from './setup';
+import { handleFinacing, handleIs, setGoodsPrice } from './setup';
 import Buy from './components/buy/index.vue';
 import Sell from './components/sell/index.vue';
 import { LineChartOutlined, DownOutlined } from '@ant-design/icons-vue';
 import { handleModalComponent } from '@/common/setup/asyncComponent';
-import { onMounted, PropType, ref, provide } from 'vue';
+import { onMounted, PropType, ref } from 'vue';
 import { handleSpotBtnList } from '../../setup';
 import { v4 } from 'uuid';
 import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
 import Bus from '@/utils/eventBus/index';
-import { getGoodsByCode, getQuoteDayInfoByCode, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import TimerUtils from '@/utils/timer/timerUtil';
 import { BtnList as BtnListType } from '@/common/components/btnList/interface';
 import moment, { Moment } from 'moment';
-import { getMarketByTradeMode } from '@/services/bus/market';
-import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 
 export default defineComponent({
     emits: ['cancel', 'update'],
@@ -151,12 +150,7 @@ export default defineComponent({
         const time = ref<Moment>(moment(props.selectedRow.deliverymonth)); // string 交收月
         const loading = ref<boolean>(false);
         const { visible, cancel } = _closeModal(context);
-        //
-        const marketInfo = getMarketByTradeMode(TradeMode.WarehouseReceiptTrade);
-        if (marketInfo) {
-            // 获取计算规则
-            handlePriceRule(loading, marketInfo.marketid);
-        }
+
         const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
         // 买卖大厅 配置数据
         // 表格操作按钮列表

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

@@ -3,8 +3,8 @@ 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 { queryFaProductDetail, queryWrMarketTradeConfig } from '@/services/go/wrtrade';
-import { WrFAProductDetail, WrMarketTradeConfig } from "@/services/go/wrtrade/interface";
+import { queryFaProductDetail } from '@/services/go/wrtrade';
+import { WrFAProductDetail } from "@/services/go/wrtrade/interface";
 import { Ref, ref } from 'vue';
 
 
@@ -108,18 +108,6 @@ export function handleIs(enumName: EnumRouterName, buyOrSell: BuyOrSell) {
     return { isWR, isBuy, isFloat }
 }
 
-// 获取金额计算规则
-const rules = ref<WrMarketTradeConfig[]>([])
-export function handlePriceRule(loading: Ref<boolean>, marketid: number) {
-    if (rules.value.length) return
-    queryResultLoadingAndInfo(queryWrMarketTradeConfig, loading, { marketid }).then(res => {
-        rules.value = res;
-    })
-}
-export function getRules() {
-    return rules
-}
-
 const list = ref<WrFAProductDetail[]>([]);
 // 获取融资摘牌
 export function handleFinacing(loading: Ref<boolean>, id: number) {

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

@@ -54,7 +54,7 @@ import FilterOption from '@/common/components/filter/index.vue';
 import { defineComponent, onMounted, PropType } from 'vue';
 import { ref } from 'vue';
 import { initData } from '@/common/methods';
-import { handleFtDeliveryGoods, handleWarehouse } from '../../setup';
+import { handleFtDeliveryGoods } from '../../setup';
 import { queryWrStandardFactoryItem } from '@/services/go/wrtrade';
 import { WrStandardFactoryItemEx } from '@/services/go/wrtrade/interface';
 import { message, TreeSelect } from 'ant-design-vue';
@@ -66,9 +66,7 @@ import { v4 } from 'uuid';
 import { getGoodsList, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 import { Goods } from '@/services/go/ermcp/goodsInfo/interface';
 import { handleIs, setGoodsPrice } from '../buy-sell-market/setup';
-import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
-import { getMarketByTradeMode } from '@/services/bus/market';
-import { handlePriceRule } from '@/views/market/spot_trade/components/buy-sell-market/setup';
+import { BuyOrSell } from '@/common/constants/enumCommon';
 
 const ALL = TreeSelect.SHOW_ALL;
 
@@ -88,11 +86,6 @@ export default defineComponent({
     setup(props, context) {
         const { isWR, isFloat } = handleIs(props.enumName, BuyOrSell.buy);
         const loading = ref<boolean>(false);
-        const marketInfo = getMarketByTradeMode(TradeMode.WarehouseReceiptTrade);
-        if (marketInfo) {
-            // 获取计算规则
-            handlePriceRule(loading, marketInfo.marketid);
-        }
         // 商品
         const { FtDeliveryGoods } = handleFtDeliveryGoods();
         const selectedFT = ref<number>();

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

@@ -1,11 +1,12 @@
 import { BuyOrSell } from "@/common/constants/enumCommon";
 import { EnumRouterName } from "@/common/constants/enumRouterName";
 import { getAccountTypeList, getCanUseMoney } from "@/services/bus/account";
+import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { WrOrderQuote } from "@/services/go/wrtrade/interface";
 import moment from "moment";
 import { reactive, ref, UnwrapRef } from "vue";
-import { getGoodsPrice, getRules, handleIs } from "../buy-sell-market/setup";
+import { getGoodsPrice, handleIs } from "../buy-sell-market/setup";
 import { FormParam } from "./interface";
 
 const formState: UnwrapRef<FormParam> = reactive({
@@ -34,7 +35,7 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
     // 获取选中的资金账号
     const getSelectedAccount = () => accountList.find((e) => e.accountid === formState.accountid);
     // 交易规则
-    const rules = getRules().value
+    const rules = getRules()
     // 挂牌最大数量
     function getMaxNum() {
         // 可用资金

+ 4 - 13
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/index.vue

@@ -185,9 +185,8 @@
 
 <script lang="ts">
 import { defineComponent, onMounted, PropType, ref } from 'vue';
-import { enumOrderComponents } from '@/common/constants/enumOrderComponents';
 import Drawer from '@/common/components/drawer/index.vue';
-import { QueryWrPositionReq, WrHoldLB, WrPosition } from '@/services/go/wrtrade/interface';
+import { WrPosition } from '@/services/go/wrtrade/interface';
 import { getAccountTypeList, getInTaAccount, getSelectedAccount, getUserId } from '@/services/bus/account';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { hdWROrder } from '@/services/proto/warehousetrade';
@@ -197,13 +196,10 @@ import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
-import { getMarketByTradeMode, getMarketRunByTradeMode } from '@/services/bus/market';
-import { message } from 'ant-design-vue';
-import { getGoodsGroupsByTradeMode } from '@/services/bus/goods';
-import { BuyOrSell, TradeMode } from '@/common/constants/enumCommon';
-import { HdWROrderReq, WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
+import { getMarketRunByTradeMode } from '@/services/bus/market';
+import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
 import Bus from '@/utils/eventBus';
-import { handleGoods, handleForm, handleNumAndPrice, handlePriceRule } from './setup';
+import { handleGoods, handleForm, handleNumAndPrice } from './setup';
 import { addSubscribeQuotation, removeSubscribeQuotation } from '@/services/socket/quota';
 import { getCanUseMoney } from '@/services/bus/account';
 
@@ -219,11 +215,6 @@ export default defineComponent({
     },
     setup(props, context) {
         const loading = ref<boolean>(false);
-        const marketInfo = getMarketByTradeMode(TradeMode.WarehouseReceiptTrade);
-        if (marketInfo) {
-            // 获取计算规则
-            handlePriceRule(loading, marketInfo.marketid);
-        }
         const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleForm(props.selectedRow);
         const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();

+ 5 - 14
src/views/order/pre_sale_warehouse_receipt/components/pre_sale_warehouse_receipt_order_summary/components/listed/setup.ts

@@ -1,12 +1,11 @@
 import { TradeMode } from '@/common/constants/enumCommon';
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { validateCommon } from '@/common/setup/validate';
 import { getGoodsGroupsByTradeMode, getGoodsList, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { getRules } from '@/services/bus/rules';
 import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
-import { queryWrMarketTradeConfig } from '@/services/go/wrtrade';
-import { WrMarketTradeConfig, WrPosition } from "@/services/go/wrtrade/interface";
+import { WrPosition } from "@/services/go/wrtrade/interface";
 import { RuleObject } from 'ant-design-vue/lib/form/interface';
-import { reactive, Ref, ref, UnwrapRef } from "vue";
+import { reactive, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
 
 const formState: UnwrapRef<ListingForm> = reactive({
@@ -66,20 +65,12 @@ export function handleGoods() {
 }
 
 
-// 获取金额计算规则
-const rules = ref<WrMarketTradeConfig[]>([])
-export function handlePriceRule(loading: Ref<boolean>, marketid: number) {
-    queryResultLoadingAndInfo(queryWrMarketTradeConfig, loading, { marketid }).then(res => {
-        rules.value = res;
-    })
-}
-
 export function handleNumAndPrice() {
     function isFloat() {
         return formState.WRPriceType === 2;
     }
     // 获取选中的资金账号
-    const hasRules = () => rules.value.length > 0
+    const hasRules = () => getRules().length > 0
     //  摘牌金额
     function getMoney() {
         let result = 0
@@ -101,7 +92,7 @@ export function handleNumAndPrice() {
     // 履约保证金
     function getMargin() {
         if (hasRules()) {
-            const { sellmarginvalue } = rules.value[0]
+            const { sellmarginvalue } = getRules()[0]
             // 浮动价 履约保证金=估算总额*买方履约保证金比例
             // 一口价 履约保证金=挂牌金额*买方履约保证金比例
             return Number((getMoney() * sellmarginvalue).toFixed(2))

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

@@ -1,187 +1,175 @@
 <template>
-    <!-- 现货仓单 现货明细 挂牌 -->
-    <Drawer
-        :title="'挂牌'"
-        :placement="'right'"
-        class="delistingBottom"
-        :visible="visible"
-        @cancel="cancel"
-    >
-        <div class="listing">
-            <div class="condition">
-                <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
-                <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
-                <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
-            </div>
-            <div class="formBar">
-                <a-form
-                    class="inlineForm dialogForm"
-                    ref="formRef"
-                    :model="formState"
-                    :rules="rules"
-                >
-                    <a-row :gutter="24">
-                        <a-col :span="12">
-                            <a-form-item label="挂牌方式" name="WRPriceType">
-                                <a-select
-                                    class="inlineFormSelect"
-                                    default-value="1"
-                                    v-model:value="formState.WRPriceType"
-                                    style="width: 140px"
-                                >
-                                    <a-select-option :value="1">一口价</a-select-option>
-                                    <a-select-option :value="2">浮动价</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12" v-if="!isFloat()">
-                            <a-form-item label="挂牌价" name="FixedPrice">
-                                <a-input-number
-                                    class="dialogInput"
-                                    :min="0"
-                                    style="width: 140px"
-                                    v-model:value="formState.FixedPrice"
-                                    placeholder="请输入挂牌价"
-                                />
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12" v-if="isFloat()">
-                            <a-form-item label="基差" name="PriceMove">
-                                <a-input-number
-                                    class="commonInput"
-                                    :min="0"
-                                    v-model:value="formState.PriceMove"
-                                    style="width: 140px"
-                                />
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="12">
-                            <a-form-item label="挂牌数量" name="OrderQty">
-                                <a-input-number
-                                    class="dialogInput"
-                                    style="width: 140px"
-                                    :min="0"
-                                    v-model:value="formState.OrderQty"
-                                    placeholder="请输入挂牌数量"
-                                />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">
-                            <a-form-item label="起摘数量" class="relative" name="DelistMinQty">
-                                <a-input-number
-                                    class="commonInput"
-                                    :min="0"
-                                    v-model:value="formState.DelistMinQty"
-                                    style="width: 140px"
-                                />
-                                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
-                                <div class="tip">最小单位:1{{selectedRow.enumdicname}}</div>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="12" class="mt-20">
-                            <a-form-item>
-                                <a-slider
-                                    v-model:value="formState.OrderQty"
-                                    ::min="0"
-                                    :max="selectedRow.enableqty"
-                                    class="formSlider"
-                                />
-                                <div class="unit">
-                                    <span>0</span>
-                                    <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
-                                </div>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="12">&nbsp;</a-col>
-                    </a-row>
-                    <a-row :gutter="24" v-if="isFloat()">
-                        <a-col :span="24">
-                            <a-form-item label="行情商品" name="goodsid">
-                                <!-- <a-select class="inlineFormSelect"
+  <!-- 现货仓单 现货明细 挂牌 -->
+  <Drawer :title="'挂牌'"
+          :placement="'right'"
+          class="delistingBottom"
+          :visible="visible"
+          @cancel="cancel">
+    <div class="listing">
+      <div class="condition">
+        <a-button class="conditionBtn">{{selectedRow.deliverygoodsname}}</a-button>
+        <a-button class="conditionBtn">{{selectedRow.wrtypename}}</a-button>
+        <a-button class="conditionBtn">{{selectedRow.warehousename}}</a-button>
+      </div>
+      <div class="formBar">
+        <a-form class="inlineForm dialogForm"
+                ref="formRef"
+                :model="formState"
+                :rules="rules">
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="挂牌方式"
+                           name="WRPriceType">
+                <a-select class="inlineFormSelect"
+                          default-value="1"
+                          v-model:value="formState.WRPriceType"
+                          style="width: 140px">
+                  <a-select-option :value="1">一口价</a-select-option>
+                  <a-select-option :value="2">浮动价</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12"
+                   v-if="!isFloat()">
+              <a-form-item label="挂牌价"
+                           name="FixedPrice">
+                <a-input-number class="dialogInput"
+                                :min="0"
+                                style="width: 140px"
+                                v-model:value="formState.FixedPrice"
+                                placeholder="请输入挂牌价" />
+              </a-form-item>
+            </a-col>
+            <a-col :span="12"
+                   v-if="isFloat()">
+              <a-form-item label="基差"
+                           name="PriceMove">
+                <a-input-number class="commonInput"
+                                :min="0"
+                                v-model:value="formState.PriceMove"
+                                style="width: 140px" />
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12">
+              <a-form-item label="挂牌数量"
+                           name="OrderQty">
+                <a-input-number class="dialogInput"
+                                style="width: 140px"
+                                :min="0"
+                                v-model:value="formState.OrderQty"
+                                placeholder="请输入挂牌数量" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">
+              <a-form-item label="起摘数量"
+                           class="relative"
+                           name="DelistMinQty">
+                <a-input-number class="commonInput"
+                                :min="0"
+                                v-model:value="formState.DelistMinQty"
+                                style="width: 140px" />
+                <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
+                <div class="tip">最小单位:1{{selectedRow.enumdicname}}</div>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="12"
+                   class="mt-20">
+              <a-form-item>
+                <a-slider v-model:value="formState.OrderQty"
+                          ::min="0"
+                          :max="selectedRow.enableqty"
+                          class="formSlider" />
+                <div class="unit">
+                  <span>0</span>
+                  <span>{{selectedRow.enableqty}}{{selectedRow.enumdicname}}</span>
+                </div>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12">&nbsp;</a-col>
+          </a-row>
+          <a-row :gutter="24"
+                 v-if="isFloat()">
+            <a-col :span="24">
+              <a-form-item label="行情商品"
+                           name="goodsid">
+                <!-- <a-select class="inlineFormSelect"
                           style="width: 135px"
                           placeholder="请择交易所">
                                 </a-select>-->
-                                <a-select
-                                    class="inlineFormSelect ml5"
-                                    @change="handleGoodsGroups"
-                                    style="width: 135px"
-                                    v-model:value="formState.goodsgroupid"
-                                    placeholder="请选择商品"
-                                >
-                                    <a-select-option
-                                        v-for="item in goodsGroup"
-                                        :value="item.goodsgroupid"
-                                        :key="item.goodsgroupid"
-                                    >{{item.goodsgroupname}}</a-select-option>
-                                </a-select>
-                                <a-select
-                                    class="inlineFormSelect ml5"
-                                    style="width: 135px"
-                                    @change="handleGoodsChange"
-                                    v-model:value="formState.goodsid"
-                                    placeholder="请选择合约"
-                                >
-                                    <a-select-option
-                                        v-for="item in goodsList"
-                                        :value="item.goodsid"
-                                        :key="item.goodsid"
-                                    >{{item.goodsname}}</a-select-option>
-                                </a-select>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                    <a-row :gutter="24">
-                        <a-col :span="24" class="relative">
-                            <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
-                                <span class="white ml8">{{getMoney()}}</span>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :span="24" class="relative">
-                            <a-form-item :label="getMargin() ? '履约保证金' : ''">
-                                <a-row>
-                                    <a-col :span="8" v-if="getMargin()">
-                                        <span class="white ml8">{{getMargin()}}</span>
-                                    </a-col>
-                                    <a-col :span="4" class="tr">
-                                        <span class="grey1">可用资金</span>
-                                    </a-col>
-                                    <a-col :span="12">
-                                        <span
-                                            class="white ml8"
-                                        >{{getCanUseMoney(handleSelectedAccount())}}</span>
-                                    </a-col>
-                                </a-row>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
+                <a-select class="inlineFormSelect ml5"
+                          @change="handleGoodsGroups"
+                          style="width: 135px"
+                          v-model:value="formState.goodsgroupid"
+                          placeholder="请选择商品">
+                  <a-select-option v-for="item in goodsGroup"
+                                   :value="item.goodsgroupid"
+                                   :key="item.goodsgroupid">{{item.goodsgroupname}}
+                  </a-select-option>
+                </a-select>
+                <a-select class="inlineFormSelect ml5"
+                          style="width: 135px"
+                          @change="handleGoodsChange"
+                          v-model:value="formState.goodsid"
+                          placeholder="请选择合约">
+                  <a-select-option v-for="item in goodsList"
+                                   :value="item.goodsid"
+                                   :key="item.goodsid">{{item.goodsname}}</a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+          </a-row>
+          <a-row :gutter="24">
+            <a-col :span="24"
+                   class="relative">
+              <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   class="relative">
+              <a-form-item :label="getMargin() ? '履约保证金' : ''">
+                <a-row>
+                  <a-col :span="8"
+                         v-if="getMargin()">
+                    <span class="white ml8">{{getMargin()}}</span>
+                  </a-col>
+                  <a-col :span="4"
+                         class="tr">
+                    <span class="grey1">可用资金</span>
+                  </a-col>
+                  <a-col :span="12">
+                    <span class="white ml8">{{getCanUseMoney(handleSelectedAccount())}}</span>
+                  </a-col>
+                </a-row>
+              </a-form-item>
+            </a-col>
+          </a-row>
 
-                    <a-row :gutter="24" type="flex" justify="center">
-                        <a-col :span="24">
-                            <a-form-item class="tc">
-                                <a-button
-                                    class="listedBtn"
-                                    :loading="loading"
-                                    :disabled="loading"
-                                    @click="submit"
-                                >卖出</a-button>
-                                <a-button
-                                    class="ml10 cancelBtn"
-                                    :loading="loading"
-                                    :disabled="loading"
-                                    @click="cancel"
-                                >取消</a-button>
-                            </a-form-item>
-                        </a-col>
-                    </a-row>
-                </a-form>
-            </div>
-        </div>
-    </Drawer>
+          <a-row :gutter="24"
+                 type="flex"
+                 justify="center">
+            <a-col :span="24">
+              <a-form-item class="tc">
+                <a-button class="listedBtn"
+                          :loading="loading"
+                          :disabled="loading"
+                          @click="submit">卖出</a-button>
+                <a-button class="ml10 cancelBtn"
+                          :loading="loading"
+                          :disabled="loading"
+                          @click="cancel">取消</a-button>
+              </a-form-item>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
+    </div>
+  </Drawer>
 </template>
 
 <script lang="ts">
@@ -196,7 +184,7 @@ import { v4 } from 'uuid';
 import moment from 'moment';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { _closeModal } from '@/common/setup/modal/modal';
-import { handleGoods, handleForm, handleNumAndPrice, handlePriceRule } from './setup';
+import { handleGoods, handleForm, handleNumAndPrice } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
 import { getMarketByTradeMode, getMarketRunByTradeMode } from '@/services/bus/market';
@@ -221,11 +209,6 @@ export default defineComponent({
     },
     setup(props, context) {
         const loading = ref<boolean>(false);
-        const marketInfo = getMarketByTradeMode(TradeMode.WarehouseReceiptTrade);
-        if (marketInfo) {
-            // 获取计算规则
-            handlePriceRule(loading, marketInfo.marketid);
-        }
         const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleForm(props.selectedRow);
 

+ 5 - 13
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -1,12 +1,11 @@
 import { TradeMode } from '@/common/constants/enumCommon';
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { validateCommon } from '@/common/setup/validate';
 import { getGoodsGroupsByTradeMode, getGoodsList, getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { getRules } from '@/services/bus/rules';
 import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
-import { queryWrMarketTradeConfig } from '@/services/go/wrtrade';
-import { WrHoldLB, WrMarketTradeConfig } from "@/services/go/wrtrade/interface";
+import { WrHoldLB } from "@/services/go/wrtrade/interface";
 import { RuleObject } from 'ant-design-vue/lib/form/interface';
-import { reactive, Ref, ref, UnwrapRef } from "vue";
+import { reactive, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
 
 const formState: UnwrapRef<ListingForm> = reactive({
@@ -64,20 +63,13 @@ export function handleGoods() {
     return { goodsGroup, goodsList, groupsChange, findGoodsCode }
 }
 
-// 获取金额计算规则
-const rules = ref<WrMarketTradeConfig[]>([])
-export function handlePriceRule(loading: Ref<boolean>, marketid: number) {
-    queryResultLoadingAndInfo(queryWrMarketTradeConfig, loading, { marketid }).then(res => {
-        rules.value = res;
-    })
-}
 
 export function handleNumAndPrice() {
     function isFloat() {
         return formState.WRPriceType === 2;
     }
     // 获取选中的资金账号
-    const hasRules = () => rules.value.length > 0
+    const hasRules = () => getRules().length > 0
     //  摘牌金额
     function getMoney() {
         let result = 0
@@ -99,7 +91,7 @@ export function handleNumAndPrice() {
     // 履约保证金
     function getMargin() {
         if (hasRules()) {
-            const { sellmarginvalue } = rules.value[0]
+            const { sellmarginvalue } = getRules()[0]
             // 浮动价 履约保证金=估算总额*买方履约保证金比例
             // 一口价 履约保证金=挂牌金额*买方履约保证金比例
             return Number((getMoney() * sellmarginvalue).toFixed(2))