|
@@ -1,145 +1,172 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <!-- 仓单贸易&仓单预售 买/卖 摘牌 -->
|
|
|
|
|
- <Drawer
|
|
|
|
|
- :title="'摘牌'"
|
|
|
|
|
- :placement="'right'"
|
|
|
|
|
- :visible="visible"
|
|
|
|
|
- width="486px"
|
|
|
|
|
- height="580px"
|
|
|
|
|
- @cancel="cancel"
|
|
|
|
|
- class="topHigh"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="delisting">
|
|
|
|
|
- <div class="formBar">
|
|
|
|
|
- <a-form
|
|
|
|
|
- class="inlineForm dialogForm"
|
|
|
|
|
- ref="formRef"
|
|
|
|
|
- :model="formState"
|
|
|
|
|
- :rules="rules"
|
|
|
|
|
- >
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24">
|
|
|
|
|
- <a-form-item label="交易账户" name="accountid">
|
|
|
|
|
- <a-select
|
|
|
|
|
- class="inlineFormSelect"
|
|
|
|
|
- style="width: 260px"
|
|
|
|
|
- v-model:value="formState.accountid"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- >
|
|
|
|
|
- <a-select-option
|
|
|
|
|
- v-for="item in accountList"
|
|
|
|
|
- :value="item.accountid"
|
|
|
|
|
- :key="item.accountid"
|
|
|
|
|
- >{{item.accountid}}</a-select-option>
|
|
|
|
|
- </a-select>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24">
|
|
|
|
|
- <a-form-item label="挂牌方">
|
|
|
|
|
- <span class="white">{{selectedRow.username}}</span>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24">
|
|
|
|
|
- <a-form-item label="基差" v-if="isFloat()">
|
|
|
|
|
- <span class="yellow">{{selectedRow.pricemove}}</span>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-form-item label="挂牌价格" v-if="!isFloat()">
|
|
|
|
|
- <span class="yellow">{{selectedRow.fixedprice}}</span>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24"></a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-form-item label="挂牌数量">
|
|
|
|
|
- <span
|
|
|
|
|
- class="white"
|
|
|
|
|
- >{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24">
|
|
|
|
|
- <a-form-item label="摘牌数量" name="num">
|
|
|
|
|
- <a-input-number
|
|
|
|
|
- class="dialogInput yellowInput"
|
|
|
|
|
- style="width: 260px"
|
|
|
|
|
- :min="0"
|
|
|
|
|
- v-model:value="formState.num"
|
|
|
|
|
- :suffix="selectedRow.enumdicname"
|
|
|
|
|
- />
|
|
|
|
|
- <span class="input-enumdicname">{{selectedRow.enumdicname}}</span>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24" class="mt-10">
|
|
|
|
|
- <a-form-item>
|
|
|
|
|
- <a-slider
|
|
|
|
|
- ::min="0"
|
|
|
|
|
- v-model:value="formState.num"
|
|
|
|
|
- :max="selectedRow.orderqty"
|
|
|
|
|
- class="formSlider"
|
|
|
|
|
- />
|
|
|
|
|
- <div class="unit">
|
|
|
|
|
- <span>0</span>
|
|
|
|
|
- <span>{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- <a-col :span="12"> </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24" class="mt-10">
|
|
|
|
|
- <a-form-item
|
|
|
|
|
- label="融资方案"
|
|
|
|
|
- @click="openComponent({code: 'ChooseFinance'})"
|
|
|
|
|
- name="case"
|
|
|
|
|
- >
|
|
|
|
|
- <div class="way">
|
|
|
|
|
- <div class="left">{{formState.case}}</div>
|
|
|
|
|
- <div class="right">
|
|
|
|
|
- <svg class="icon svg-icon" aria-hidden="true">
|
|
|
|
|
- <use xlink:href="#icon-fangan" />
|
|
|
|
|
- </svg>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
-
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24">
|
|
|
|
|
- <a-form-item label="挂牌金额">
|
|
|
|
|
- <span class="white">--</span>
|
|
|
|
|
- <span class="need">(需履约保证金5040.00)</span>
|
|
|
|
|
- <div class="tip">可用资金:10000.00</div>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-row :gutter="24">
|
|
|
|
|
- <a-col :span="24" class="mt25">
|
|
|
|
|
- <a-form-item class="tc">
|
|
|
|
|
- <a-button class="listedBtn" @click="submit">融资买入</a-button>
|
|
|
|
|
- <a-button class="ml10 cancelBtn" @click="cancel">取消</a-button>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- </a-form>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </Drawer>
|
|
|
|
|
- <!-- <ChooseFinance v-if="show"
|
|
|
|
|
- @cancel="showAction" />-->
|
|
|
|
|
- <component
|
|
|
|
|
- :is="componentId"
|
|
|
|
|
- v-if="componentId"
|
|
|
|
|
- :selectedRow="selectedRow"
|
|
|
|
|
- @update="choose"
|
|
|
|
|
- @cancel="closeComponent"
|
|
|
|
|
- ></component>
|
|
|
|
|
|
|
+ <!-- 仓单贸易&仓单预售 买/卖 摘牌 -->
|
|
|
|
|
+ <Drawer :title="'摘牌'"
|
|
|
|
|
+ :placement="'right'"
|
|
|
|
|
+ :visible="visible"
|
|
|
|
|
+ width="486px"
|
|
|
|
|
+ height="580px"
|
|
|
|
|
+ @cancel="cancel"
|
|
|
|
|
+ class="topHigh">
|
|
|
|
|
+ <div class="delisting">
|
|
|
|
|
+ <div class="formBar">
|
|
|
|
|
+ <a-form class="inlineForm dialogForm"
|
|
|
|
|
+ ref="formRef"
|
|
|
|
|
+ :model="formState"
|
|
|
|
|
+ :rules="rules">
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
|
+ <a-form-item label="交易账户"
|
|
|
|
|
+ name="accountid">
|
|
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
|
|
+ style="width: 260px"
|
|
|
|
|
+ v-model:value="formState.accountid"
|
|
|
|
|
+ placeholder="请选择">
|
|
|
|
|
+ <a-select-option v-for="item in accountList"
|
|
|
|
|
+ :value="item.accountid"
|
|
|
|
|
+ :key="item.accountid">{{item.accountid}}</a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
|
+ <a-form-item label="挂牌方">
|
|
|
|
|
+ <span class="white ml8">{{selectedRow.username}}</span>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
|
+ <a-form-item label="基差"
|
|
|
|
|
+ v-if="isFloat()">
|
|
|
|
|
+ <span class="yellow ml8">{{selectedRow.pricemove}}</span>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="挂牌价格"
|
|
|
|
|
+ v-if="!isFloat()">
|
|
|
|
|
+ <span class="yellow ml8">{{selectedRow.fixedprice}}</span>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24"></a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-form-item label="挂牌数量">
|
|
|
|
|
+ <span class="white ml8">{{selectedRow.orderqty}}{{selectedRow.enumdicname}}</span>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24"
|
|
|
|
|
+ class="mt-10">
|
|
|
|
|
+ <a-form-item label="融资方案"
|
|
|
|
|
+ @click="openComponent({code: 'ChooseFinance'})"
|
|
|
|
|
+ name="caseId">
|
|
|
|
|
+ <div class="way">
|
|
|
|
|
+ <div class="left">{{formState.case ? formState.case : '请选择'}}</div>
|
|
|
|
|
+ <div class="right">
|
|
|
|
|
+ <svg class="icon svg-icon"
|
|
|
|
|
+ aria-hidden="true">
|
|
|
|
|
+ <use xlink:href="#icon-fangan" />
|
|
|
|
|
+ </svg>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24"
|
|
|
|
|
+ v-if="isBuy() && isWR()">
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
|
+ <a-form-item label="现货仓单"
|
|
|
|
|
+ name="LadingBillId">
|
|
|
|
|
+ <a-select class="inlineFormSelect"
|
|
|
|
|
+ style="width: 260px"
|
|
|
|
|
+ v-model:value="formState.LadingBillId"
|
|
|
|
|
+ placeholder="请选择">
|
|
|
|
|
+ <a-select-option v-for="item in wrHoldList"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ :key="item.id">{{item.name}}</a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
|
+ <a-form-item label="摘牌数量"
|
|
|
|
|
+ class="relative"
|
|
|
|
|
+ name="num">
|
|
|
|
|
+ <a-input-number class="dialogInput yellowInput"
|
|
|
|
|
+ style="width: 260px"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :max="getMaxNum()"
|
|
|
|
|
+ v-model:value="formState.num" />
|
|
|
|
|
+ <span class="input-enumdicname-absolute">{{selectedRow.enumdicname}}</span>
|
|
|
|
|
+ <div class="labelTip">({{selectedRow.minivalue}}{{selectedRow.enumdicname}}起)</div>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24"
|
|
|
|
|
+ class="mt-20">
|
|
|
|
|
+ <a-form-item>
|
|
|
|
|
+ <a-slider ::min="0"
|
|
|
|
|
+ v-model:value="formState.num"
|
|
|
|
|
+ :max="selectedRow.orderqty"
|
|
|
|
|
+ class="formSlider" />
|
|
|
|
|
+ <div class="unit">
|
|
|
|
|
+ <span>0</span>
|
|
|
|
|
+ <span>{{getMaxNum()}}{{selectedRow.enumdicname}}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col :span="12"> </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24"
|
|
|
|
|
+ class="mt-20">
|
|
|
|
|
+ <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
|
|
|
|
|
+ <span class="white ml8">{{getMoney()}}</span>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24"
|
|
|
|
|
+ class="mt-20">
|
|
|
|
|
+ <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(getSelectedAccount())}}</span>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <a-row :gutter="24">
|
|
|
|
|
+ <a-col :span="24">
|
|
|
|
|
+ <a-form-item class="tc">
|
|
|
|
|
+ <a-button class="listedBtn"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ :disabled="loading"
|
|
|
|
|
+ @click="submit">{{isBuy() ? '卖出' : '买入'}}</a-button>
|
|
|
|
|
+ <a-button class="ml10 cancelBtn"
|
|
|
|
|
+ @click="cancel">取消</a-button>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ </a-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </Drawer>
|
|
|
|
|
+ <component :is="componentId"
|
|
|
|
|
+ v-if="componentId"
|
|
|
|
|
+ :selectedRow="selectedRow"
|
|
|
|
|
+ @update="choose"
|
|
|
|
|
+ @cancel="closeComponent"></component>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
@@ -149,12 +176,16 @@ import { WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interfac
|
|
|
import { getAccountTypeList } from '@/services/bus/account';
|
|
import { getAccountTypeList } from '@/services/bus/account';
|
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
-import { handleForm, handleIs, handleSpotWarrant } from './setup';
|
|
|
|
|
|
|
+import { handleForm, handleSpotWarrant } from './setup';
|
|
|
import { BuyOrSell } from '@/common/constants/enumCommon';
|
|
import { BuyOrSell } from '@/common/constants/enumCommon';
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
import { handleModalComponent } from '@/common/setup/asyncComponent';
|
|
|
import { WrFAProductDetail } from '@/services/go/wrtrade/interface';
|
|
import { WrFAProductDetail } from '@/services/go/wrtrade/interface';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
|
|
+import { handleNumAndMoney, getWrPosition, selecedFinance } from './setup';
|
|
|
|
|
+import { handleIs } from '../../setup';
|
|
|
|
|
+import { getCanUseMoney } from '@/services/bus/account';
|
|
|
|
|
+
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_trade_warehouse_delisting,
|
|
name: ModalEnum.spot_trade_warehouse_delisting,
|
|
|
components: { Drawer, ChooseFinance: defineAsyncComponent(() => import('./components/choose-finance/index.vue')) },
|
|
components: { Drawer, ChooseFinance: defineAsyncComponent(() => import('./components/choose-finance/index.vue')) },
|
|
@@ -180,14 +211,23 @@ export default defineComponent({
|
|
|
|
|
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
|
|
+ // 资金账号
|
|
|
const accountList = getAccountTypeList([2]);
|
|
const accountList = getAccountTypeList([2]);
|
|
|
const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
|
if (accountList.length) {
|
|
if (accountList.length) {
|
|
|
formState.accountid = accountList[0].accountid;
|
|
formState.accountid = accountList[0].accountid;
|
|
|
}
|
|
}
|
|
|
|
|
+ function getSelectedAccount() {
|
|
|
|
|
+ return accountList.find((e) => e.accountid === formState.accountid);
|
|
|
|
|
+ }
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
- const { isSale, isBuy, isFloat } = handleIs(props.enumName, props.buyOrSell);
|
|
|
|
|
|
|
+ // 判断
|
|
|
|
|
+ const { isWR, isBuy, isFloat } = handleIs(props.enumName, props.buyOrSell);
|
|
|
|
|
+ // 现货仓单
|
|
|
const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.parantSelectedRow, loading);
|
|
const { wrHoldList } = handleSpotWarrant(props.enumName, props.buyOrSell, props.parantSelectedRow, loading);
|
|
|
|
|
+ getWrPosition(props.enumName, props.buyOrSell, loading);
|
|
|
|
|
+ const { getMaxNum, getMoney, getMargin } = handleNumAndMoney(props.enumName, props.buyOrSell, props.selectedRow, props.parantSelectedRow, formState);
|
|
|
|
|
+
|
|
|
const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, ref({}));
|
|
const { componentId, closeComponent, openComponent } = handleModalComponent(() => {}, ref({}));
|
|
|
|
|
|
|
|
const show = ref<boolean>(false);
|
|
const show = ref<boolean>(false);
|
|
@@ -195,7 +235,9 @@ export default defineComponent({
|
|
|
show.value = !show.value;
|
|
show.value = !show.value;
|
|
|
}
|
|
}
|
|
|
function choose(item: WrFAProductDetail) {
|
|
function choose(item: WrFAProductDetail) {
|
|
|
- formState.case = `${item.productname}-${item.username}-${item.financingdays}天-${item.marginratio * 100}%-${item.interestratemode === 3 ? item.interestrate : item.interestrate * 10000}%-${item.interestsettlemode === 1 ? '按日结息' : '按月结息'}-${item.interestminlen}天起息`;
|
|
|
|
|
|
|
+ selecedFinance.value = item;
|
|
|
|
|
+ formState.caseId = item.productdetailid;
|
|
|
|
|
+ formState.case = `${item.productname}-${item.username}-${item.financingdays}天-${(item.marginratio * 100).toFixed(2)}%-${item.interestratemode === 3 ? item.interestrate : (item.interestrate * 10000).toFixed(2)}%-${item.interestsettlemode === 1 ? '按日结息' : '按月结息'}-${item.interestminlen}天起息`;
|
|
|
}
|
|
}
|
|
|
function submit() {
|
|
function submit() {
|
|
|
// validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
// validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
@@ -241,9 +283,12 @@ export default defineComponent({
|
|
|
accountList,
|
|
accountList,
|
|
|
wrHoldList,
|
|
wrHoldList,
|
|
|
submit,
|
|
submit,
|
|
|
- isSale,
|
|
|
|
|
|
|
+ getMaxNum,
|
|
|
|
|
+ getMoney,
|
|
|
|
|
+ getMargin,
|
|
|
isBuy,
|
|
isBuy,
|
|
|
isFloat,
|
|
isFloat,
|
|
|
|
|
+ isWR,
|
|
|
rules,
|
|
rules,
|
|
|
formState,
|
|
formState,
|
|
|
formRef,
|
|
formRef,
|
|
@@ -252,6 +297,8 @@ export default defineComponent({
|
|
|
componentId,
|
|
componentId,
|
|
|
closeComponent,
|
|
closeComponent,
|
|
|
openComponent,
|
|
openComponent,
|
|
|
|
|
+ getCanUseMoney,
|
|
|
|
|
+ getSelectedAccount,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|