|
|
@@ -32,12 +32,12 @@
|
|
|
<a-col :span="24">
|
|
|
<a-form-item label="挂牌价格"
|
|
|
class="relative"
|
|
|
- name="price">
|
|
|
+ name="FixedPrice">
|
|
|
<a-input-number class="dialogInput yellowInput"
|
|
|
style="width: 260px"
|
|
|
:min="0"
|
|
|
:max="99999"
|
|
|
- v-model:value="formState.price" />
|
|
|
+ v-model:value="formState.FixedPrice" />
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
@@ -49,8 +49,8 @@
|
|
|
<a-input-number class="dialogInput yellowInput"
|
|
|
style="width: 260px"
|
|
|
:min="0"
|
|
|
- :max="99999"
|
|
|
- v-model:value="formState.num" />
|
|
|
+ :max="getListingBuyMaxNum()"
|
|
|
+ v-model:value="formState.OrderQty" />
|
|
|
<span class="input-enumdicname-absolute">{{deliverGoods.enumdicname}}</span>
|
|
|
<!-- <div class="labelTip">({{selectedRow.delistminqty}}{{selectedRow.enumdicname}}起)</div> -->
|
|
|
</a-form-item>
|
|
|
@@ -61,13 +61,13 @@
|
|
|
class="mt-20">
|
|
|
<a-form-item>
|
|
|
<a-slider :min="0"
|
|
|
- v-model:value="formState.num"
|
|
|
+ v-model:value="formState.OrderQty"
|
|
|
:max="deliverGoods.orderqty"
|
|
|
class="formSlider"
|
|
|
style="width: 260px" />
|
|
|
<div class="unit">
|
|
|
<span>0</span>
|
|
|
- <span>99999{{deliverGoods.enumdicname}}</span>
|
|
|
+ <span>{{getListingBuyMaxNum()}}{{deliverGoods.enumdicname}}</span>
|
|
|
</div>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
@@ -108,26 +108,27 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
|
|
|
-import { defineComponent, PropType, ref } from 'vue';
|
|
|
import Drawer from '@/common/components/drawer/index.vue';
|
|
|
-import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
|
|
|
-import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
+import { DelistingType, PriceType } from '@/common/constants/enumCommon';
|
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
-import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
-import { handleForm } from './setup';
|
|
|
+import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
-import { FormState } from './interface';
|
|
|
-import { getCanUseMoney } from '@/services/bus/account';
|
|
|
+import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
+import { useListingTradeNumAndPrice } from '@/common/setup/trade';
|
|
|
+import { ListingTradeNumAndPrice } from '@/common/setup/trade/interface';
|
|
|
+import { getCanUseMoney, getSelectedAccountId } from '@/services/bus/account';
|
|
|
+import { geLoginID_number } from '@/services/bus/login';
|
|
|
import { QueryDeliveryRelationRsp } from '@/services/go/delivery/interface';
|
|
|
-import { OrderReq } from '@/services/socket/order/interface';
|
|
|
import { Order } from '@/services/socket/order';
|
|
|
-import { DelistingType, PriceType } from '@/common/constants/enumCommon';
|
|
|
-import { geLoginID_number } from '@/services/bus/login';
|
|
|
-import { LongType } from '@/services/socket/login/interface';
|
|
|
-import { v4 as uuidv4 } from 'uuid';
|
|
|
+import { OrderReq } from '@/services/socket/order/interface';
|
|
|
+import { MinusOutlined, PlusOutlined } from '@ant-design/icons-vue';
|
|
|
import moment from 'moment';
|
|
|
-import Long from 'long';
|
|
|
+import { v4 as uuidv4 } from 'uuid';
|
|
|
+import { defineComponent, PropType, ref } from 'vue';
|
|
|
+import { useBlocksAccount } from '../../spot_trade_order_transaction_swap/components/setup';
|
|
|
+import { FormState } from './interface';
|
|
|
+import { handleForm } from './setup';
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_trade_warehouse_financing_delisting,
|
|
|
components: { Drawer, PlusOutlined, MinusOutlined },
|
|
|
@@ -142,19 +143,22 @@ export default defineComponent({
|
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
// 资金账号
|
|
|
- const accountList = getAccountTypeList([2]);
|
|
|
const { rules, formState, formRef } = handleForm();
|
|
|
- if (accountList.length) {
|
|
|
- formState.accountid = accountList[0].accountid;
|
|
|
- }
|
|
|
- function getSelectedAccount() {
|
|
|
- return accountList.find((e) => e.accountid === formState.accountid);
|
|
|
- }
|
|
|
+
|
|
|
const loading = ref<boolean>(false);
|
|
|
- function getMoney() {
|
|
|
- return (formState.price * formState.num).toFixed(2);
|
|
|
- }
|
|
|
- // const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.deliverGoods, formState);
|
|
|
+ const { canUseMoney, getSelectedAccount, accountList } = useBlocksAccount(formState);
|
|
|
+
|
|
|
+ // 金额 数量 保证金
|
|
|
+ const param: ListingTradeNumAndPrice<FormState> = {
|
|
|
+ formState,
|
|
|
+ goodscode: props.deliverGoods.goodscode,
|
|
|
+ isFloat: () => {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ canUseMoney,
|
|
|
+ };
|
|
|
+ const { getMoney, getListingBuyMaxNum } = useListingTradeNumAndPrice<FormState>(param);
|
|
|
+
|
|
|
function submit() {
|
|
|
validateAction<FormState>(formRef, formState).then((res) => {
|
|
|
// 挂牌请求 通过挂牌求购进行挂牌
|
|
|
@@ -169,10 +173,10 @@ export default defineComponent({
|
|
|
ValidType: 1, // 校验类型 当日有效
|
|
|
OperateType: 1, // 操作类型: 申请
|
|
|
OrderSrc: 1, // 单据来源: 客户端下单
|
|
|
- OrderPrice: res.price, // 委托价格
|
|
|
+ OrderPrice: res.FixedPrice, // 委托价格
|
|
|
OperatorID: Number(geLoginID_number()),
|
|
|
// MarketMaxSub: number // 市价允许最大偏差(做市)
|
|
|
- OrderQty: res.num, // 委托数量
|
|
|
+ OrderQty: res.OrderQty, // 委托数量
|
|
|
BuyOrSell: 0, // 买卖方向 0 买 1 卖
|
|
|
BuildType: 1, // 下单类型 1 建 2 平
|
|
|
// CurtQuotePrice: 0, // 保留,计算冻结金额使用
|
|
|
@@ -213,6 +217,7 @@ export default defineComponent({
|
|
|
getCanUseMoney,
|
|
|
getSelectedAccount,
|
|
|
getMoney,
|
|
|
+ getListingBuyMaxNum,
|
|
|
};
|
|
|
},
|
|
|
});
|