huangbin 4 tahun lalu
induk
melakukan
8b925d0b83

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
-    "apiUrl": "http://103.40.249.123:28280/cfg?key=mtp_20"
+    "apiUrl": "http://192.168.31.139:8080/cfg?key=test_139"
 }

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

@@ -70,7 +70,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
     const rules = getRules()
     // 是否有规则
     const hasRule = () => rules.length > 0;
-    const { buymarginvalue, buymarginalgorithm } = rules[0]
+    const { buymarginvalue, buymarginalgorithm } = rules.length ? rules[0] : { buymarginvalue: 0, buymarginalgorithm: 1 }
     //保证金模式 1: 比率 2: 固定
     const marginMethod = () => buymarginalgorithm === 1
     const { fixedprice, orderqty, pricemove } = selectedRow;

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

@@ -93,7 +93,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
     // 是否有规则
     const hasRule = () => rules.length > 0;
     //保证金模式 1: 比率 2: 固定
-    const { buymarginvalue, buymarginalgorithm } = rules[0]
+    const { buymarginvalue, buymarginalgorithm } = rules.length ? rules[0] : { buymarginvalue: 0, buymarginalgorithm: 1 }
     const marginMethod = () => buymarginalgorithm === 1
     const { fixedprice, orderqty, pricemove } = selectedRow;
     // 获取摘牌最大可摘量

+ 1 - 4
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -36,15 +36,13 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
     const getSelectedAccount = () => accountList.find((e) => e.accountid === formState.accountid);
     // 交易规则
     const rules = getRules()
-    debugger
-    const { buymarginvalue, buymarginalgorithm } = rules[0]
+    const { buymarginvalue, buymarginalgorithm } = rules.length ? rules[0] : { buymarginvalue: 0, buymarginalgorithm: 1 }
     //保证金模式 1: 比率 2: 固定
     const marginMethod = () => buymarginalgorithm === 1
     // 挂牌最大数量
     function getMaxNum() {
         // 可用资金
         const canUseMoney = Number(getCanUseMoney(getSelectedAccount() as AccountListItem))
-        const { buymarginvalue } = rules[0]
         // 挂牌最大数量=可用资金/(买方履约保证金比例*挂牌价格)
         let result = 0
         if (isFloat()) {
@@ -79,7 +77,6 @@ export function handleNumAndPrice(enumName: EnumRouterName, selectedRow: WrOrder
     }
     // 履约保证金
     function getMargin() {
-        const { buymarginvalue } = rules[0]
         // 浮动价 履约保证金=估算总额*买方履约保证金比例
         // 一口价 履约保证金=挂牌金额*买方履约保证金比例
         const margin = marginMethod() ? (buymarginvalue * getMoney()) : (buymarginvalue + getMoney())

+ 1 - 1
src/views/market/spot_trade/warehouse_pre_sale/warehouse_pre_sale_blocs/components/delisting/index.vue

@@ -225,7 +225,7 @@ export default defineComponent({
             if (isBuy()) {
                 // 交易规则
                 const rules = getRules();
-                const { buymarginvalue } = rules[0];
+                const { buymarginvalue } = rules.length ? rules[0] : {buymarginvalue: 0};
                 const canUseMoney = Number(getCanUseMoney(getSelectedAccount()));
                 if (canUseMoney && !isNaN(canUseMoney)) {
                     const num = +(canUseMoney / buymarginvalue).toFixed(0);

+ 1 - 1
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/delisting/index.vue

@@ -225,7 +225,7 @@ export default defineComponent({
             if (isBuy()) {
                 // 交易规则
                 const rules = getRules();
-                const { buymarginvalue } = rules[0];
+                const { buymarginvalue } = rules.length ? rules[0] : {buymarginvalue: 0};
                 const canUseMoney = Number(getCanUseMoney(getSelectedAccount()));
                 if (canUseMoney && !isNaN(canUseMoney)) {
                     const num = +(canUseMoney / buymarginvalue).toFixed(0);

+ 0 - 6
src/views/market/spot_trade/warehouse_receipt_trade/warehouse_receipt_trade_blocs/components/post-buying/index.vue

@@ -38,12 +38,6 @@
                 <a-checkbox class="commonCheckbox"
                             v-model:checked="priceCheck">可议价</a-checkbox>
               </a-form-item>
-              <!-- <a-form-item label="挂牌价格" name="FixedPrice" class="inputIconBox">
-                                <a-input-number class="commonInput" style="width: 260px" :min="0" v-model:value="formState.FixedPrice" />
-                                <MinusOutlined />
-                                <PlusOutlined  />
-                                <a-checkbox v-model:checked="priceCheck" class="commonCheckbox">可议价</a-checkbox>
-                            </a-form-item>-->
             </a-col>
             <a-col :span="24">
               <a-form-item label="挂牌数量"

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

@@ -27,11 +27,12 @@
                           style="width: 140px">
                   <a-select-option :value="1">一口价</a-select-option>
                   <a-select-option :value="2">浮动价</a-select-option>
+                  <!-- <a-select-option :value="3">贸易圈</a-select-option> -->
                 </a-select>
               </a-form-item>
             </a-col>
             <a-col :span="12"
-                   v-if="!isFloat()">
+                   v-if="isFixed()">
               <a-form-item label="挂牌价"
                            name="FixedPrice">
                 <a-input-number class="dialogInput"
@@ -42,6 +43,19 @@
               </a-form-item>
             </a-col>
             <a-col :span="12"
+                   v-if="isBlocs()">
+              <a-form-item label="挂牌价格"
+                           name="FixedPrice"
+                           class="inputIconBox">
+                <a-input-number class="commonInput"
+                                style="width: 140px"
+                                :min="0"
+                                v-model:value="formState.FixedPrice" />
+                <a-checkbox class="commonCheckbox"
+                            v-model:checked="priceCheck">可议价</a-checkbox>
+              </a-form-item>
+            </a-col>
+            <a-col :span="12"
                    v-if="isFloat()">
               <a-form-item label="基差"
                            name="PriceMove">
@@ -77,6 +91,35 @@
               </a-form-item>
             </a-col>
           </a-row>
+          <a-col :span="12"
+                 v-if="isBlocs()">
+            <a-form-item label="履约方式"
+                         class="inputIconBox">
+              <span class="clickBox"
+                    @click="openPermance">{{formState.permanceTempName ? formState.permanceTempName  : '选择履约模板'}}</span>
+              <svg class="icon svg-icon"
+                   aria-hidden="true"
+                   @click="openPermance">
+                <use xlink:href="#icon-moban" />
+              </svg>
+            </a-form-item>
+          </a-col>
+          <a-col :span="12"
+                 v-if="isBlocs()">
+            <a-form-item label="指定朋友"
+                         class="inputIconBox">
+              <span class="clickBox"
+                    @click="openFriend">{{getFriendLength() ? `已选${getFriendLength() }人` : '选择朋友'}}</span>
+              <svg class="icon svg-icon"
+                   aria-hidden="true"
+                   @click="openFriend">
+                <use xlink:href="#icon-pengyou1" />
+              </svg>
+              <a-checkbox class="commonCheckbox"
+                          v-model:checked="friendCheck"
+                          @change="limiteFriends">不限</a-checkbox>
+            </a-form-item>
+          </a-col>
           <a-row :gutter="24">
             <a-col :span="12"
                    class="mt-20">
@@ -127,27 +170,23 @@
           </a-row>
           <a-row :gutter="24">
             <a-col :span="24"
+                   v-if="isFloat()"
+                   class="relative">
+              <a-form-item :label="'估算金额'">
+                <span class="white ml8">{{getMoney()}}</span>
+              </a-form-item>
+            </a-col>
+            <a-col :span="24"
+                   v-if="isFixed()"
                    class="relative">
-              <a-form-item :label="isFloat() ? '估算金额' : '挂牌金额'">
+              <a-form-item :label="'挂牌金额'">
                 <span class="white ml8">{{getMoney()}}</span>
               </a-form-item>
             </a-col>
             <a-col :span="24"
                    v-if="getMargin()">
               <a-form-item :label="getMargin() ? '履约保证金' : ''">
-                <!-- <a-row>
-                                <a-col :span="8">-->
                 <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-col :span="24">
@@ -189,7 +228,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 } from './setup';
+import { handleGoods, handleForm, handleNumAndPrice, useMoney } from './setup';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm } from './interface';
 import { getMarketByTradeMode, getMarketRunByTradeMode } from '@/services/bus/market';
@@ -217,6 +256,8 @@ export default defineComponent({
         const { visible, cancel } = _closeModal(context);
         const { rules, formState, formRef } = handleForm(props.selectedRow);
 
+        const priceCheck = ref<boolean>(false); // 是否可议价
+
         const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();
         // 切换商品组
         function handleGoodsGroups(value: number) {
@@ -237,7 +278,7 @@ export default defineComponent({
         onMounted(() => {
             removeSubscribeQuotation(uuid);
         });
-        const { getMoney, getMargin, isFloat } = handleNumAndPrice();
+        const { getMoney, getMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
         // 处理内部资金账号
         function handleSelectedAccount() {
             const item = getSelectedAccount();
@@ -319,13 +360,17 @@ export default defineComponent({
             formRef,
             goodsGroup,
             goodsList,
+            ...useMoney(),
             handleGoodsGroups,
             handleGoodsChange,
             isFloat,
+            isFixed,
+            isBlocs,
             getMoney,
             getMargin,
             getCanUseMoney,
             handleSelectedAccount,
+            priceCheck,
         };
     },
 });

+ 10 - 1
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/interface.ts

@@ -1,9 +1,18 @@
+import { Moment } from "moment";
+
 export interface ListingForm {
-    WRPriceType: 1 | 2,// 价格方式 1:固定价 2:浮动价
+    WRPriceType: 1 | 2 | 3,// 价格方式 1:固定价 2:浮动价 3:贸易圈
     FixedPrice: number, // 固定价格
     OrderQty: number,
     DelistMinQty: number,
     PriceMove: number,// 升贴水(浮动价时填写)
     goodsgroupid: number | undefined,
     goodsid: number | undefined,
+
+    margin: number,
+    DeliveryMonth: Moment,
+    vidaliteTime: Moment,
+    friends: number[],
+    permanceTempName: string,
+    permaceTempId: number,
 }

+ 65 - 2
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -5,6 +5,7 @@ import { getRules } from '@/services/bus/rules';
 import { Goods } from "@/services/go/ermcp/goodsInfo/interface";
 import { WrHoldLB } from "@/services/go/wrtrade/interface";
 import { RuleObject } from 'ant-design-vue/lib/form/interface';
+import moment from 'moment';
 import { onBeforeUnmount, reactive, ref, UnwrapRef } from "vue";
 import { ListingForm } from "./interface";
 
@@ -16,6 +17,13 @@ const formState: UnwrapRef<ListingForm> = reactive({
     PriceMove: 1,
     goodsgroupid: undefined,
     goodsid: undefined,
+
+    margin: 0,
+    DeliveryMonth: moment(),
+    vidaliteTime: moment(),
+    friends: [],
+    permanceTempName: '',
+    permaceTempId: 0,
 })
 
 export function handleForm(data: WrHoldLB) {
@@ -71,6 +79,12 @@ export function handleNumAndPrice() {
     function isFloat() {
         return formState.WRPriceType === 2;
     }
+    function isFixed() {
+        return formState.WRPriceType === 1;
+    }
+    function isBlocs() {
+        return formState.WRPriceType === 3;
+    }
     // 获取选中的资金账号
     const hasRules = () => getRules().length > 0
     //  摘牌金额
@@ -104,5 +118,54 @@ export function handleNumAndPrice() {
         }
 
     }
-    return { getMoney, getMargin, isFloat }
-}
+    return { getMoney, getMargin, isFloat, isFixed, isBlocs }
+}
+
+
+// 金额
+export const useMoney = () => {
+    // 挂牌金额
+    function getMoney() {
+        let result = 0;
+        const { FixedPrice, OrderQty } = formState;
+        if (FixedPrice && OrderQty) {
+            result = FixedPrice * OrderQty;
+        }
+        return result ? result.toFixed(2) : '--';
+    }
+    // 履约保证金
+    function getMargin() {
+        let result = 0;
+        const { FixedPrice, OrderQty, margin } = formState;
+        if (FixedPrice && OrderQty && margin) {
+            result = (FixedPrice * OrderQty * margin) / 100;
+        }
+        return result ? result.toFixed(2) : '--';
+    }
+    return { getMoney, getMargin };
+};
+
+// 选择朋友
+export const useFriends = () => {
+    const friendCheck = ref<boolean>(false); // 是否不限好友
+    const showFriend = ref<boolean>(false);
+    function chooseFriend(value: number[] | false) {
+        if (value) {
+            formState.friends = value;
+        }
+        showFriend.value = false;
+    }
+    function openFriend() {
+        showFriend.value = true;
+    }
+    function getFriendLength() {
+        return formState.friends.length;
+    }
+    // 是否 不限好友
+    function limiteFriends() {
+        if (friendCheck.value) {
+            formState.friends.length = 0;
+        }
+    }
+    return { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends };
+};