|
@@ -54,7 +54,7 @@
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
<a-row :gutter="24"
|
|
<a-row :gutter="24"
|
|
|
- v-if="isBuy() && !isSale()">
|
|
|
|
|
|
|
+ v-if="isBuy() && isWR()">
|
|
|
<a-col :span="24">
|
|
<a-col :span="24">
|
|
|
<a-form-item label="现货仓单"
|
|
<a-form-item label="现货仓单"
|
|
|
name="LadingBillId">
|
|
name="LadingBillId">
|
|
@@ -75,9 +75,9 @@
|
|
|
class="relative"
|
|
class="relative"
|
|
|
name="num">
|
|
name="num">
|
|
|
<a-input-number class="dialogInput yellowInput"
|
|
<a-input-number class="dialogInput yellowInput"
|
|
|
- @change="numChange"
|
|
|
|
|
style="width: 260px"
|
|
style="width: 260px"
|
|
|
:min="0"
|
|
:min="0"
|
|
|
|
|
+ :max="getMaxNum()"
|
|
|
v-model:value="formState.num" />
|
|
v-model:value="formState.num" />
|
|
|
<span class="input-enumdicname-absolute">{{selectedRow.enumdicname}}</span>
|
|
<span class="input-enumdicname-absolute">{{selectedRow.enumdicname}}</span>
|
|
|
<div class="labelTip">({{selectedRow.minivalue}}{{selectedRow.enumdicname}}起)</div>
|
|
<div class="labelTip">({{selectedRow.minivalue}}{{selectedRow.enumdicname}}起)</div>
|
|
@@ -94,7 +94,7 @@
|
|
|
class="formSlider" />
|
|
class="formSlider" />
|
|
|
<div class="unit">
|
|
<div class="unit">
|
|
|
<span>0</span>
|
|
<span>0</span>
|
|
|
- <span>{{uiParam.maxNum}}{{selectedRow.enumdicname}}</span>
|
|
|
|
|
|
|
+ <span>{{getMaxNum()}}{{selectedRow.enumdicname}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
@@ -103,20 +103,22 @@
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="24"
|
|
<a-col :span="24"
|
|
|
class="mt-20">
|
|
class="mt-20">
|
|
|
- <a-form-item label="摘牌金额">
|
|
|
|
|
- <span class="white ml8">{{uiParam.amount}}</span>
|
|
|
|
|
|
|
+ <a-form-item :label="isFloat() ? '估算金额' : '摘牌金额'">
|
|
|
|
|
+ <span class="white ml8">{{getMoney()}}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
<a-row :gutter="24">
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="24"
|
|
<a-col :span="24"
|
|
|
class="mt-20">
|
|
class="mt-20">
|
|
|
- <a-form-item label="履约保证金">
|
|
|
|
|
|
|
+ <a-form-item :label="getMargin() ? '履约保证金' : ''">
|
|
|
<a-row>
|
|
<a-row>
|
|
|
- <a-col :span="8">
|
|
|
|
|
- <span class="white ml8">{{uiParam.marginPrice}}</span>
|
|
|
|
|
|
|
+ <a-col :span="8"
|
|
|
|
|
+ v-if="getMargin()">
|
|
|
|
|
+ <span class="white ml8">{{getMargin()}}</span>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
- <a-col :span="4" class="tr">
|
|
|
|
|
|
|
+ <a-col :span="4"
|
|
|
|
|
+ class="tr">
|
|
|
<span class="grey1">可用资金</span>
|
|
<span class="grey1">可用资金</span>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="12">
|
|
<a-col :span="12">
|
|
@@ -157,14 +159,13 @@ import moment from 'moment';
|
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
import { HdWRDealOrderReq } from '@/services/proto/warehousetrade/interface';
|
|
import { HdWRDealOrderReq } from '@/services/proto/warehousetrade/interface';
|
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
-import { handleForm, handleIs, handleSpotWarrant } from './setup';
|
|
|
|
|
|
|
+import { handleForm, handleNumAndMoney, handleSpotWarrant, getWrPosition } from './setup';
|
|
|
|
|
+import { handleIs } from '../../setup';
|
|
|
import { validateAction } from '@/common/setup/form';
|
|
import { validateAction } from '@/common/setup/form';
|
|
|
import { ListingForm } from './interface';
|
|
import { ListingForm } from './interface';
|
|
|
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 { ListedViewModel, WrParam } from '../../setup';
|
|
|
|
|
-import { getAllTaAccount, getCanUseMoney, getFreeze, getSelectedAccount, setSelectedAccount } from '@/services/bus/account';
|
|
|
|
|
-import { AccountListItem } from '@/services/dataCenter/interafce/account';
|
|
|
|
|
|
|
+import { getCanUseMoney } from '@/services/bus/account';
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_trade_warehouse_financing_delisting,
|
|
name: ModalEnum.spot_trade_warehouse_financing_delisting,
|
|
|
components: { Drawer, PlusOutlined, MinusOutlined },
|
|
components: { Drawer, PlusOutlined, MinusOutlined },
|
|
@@ -186,14 +187,9 @@ export default defineComponent({
|
|
|
type: Number as PropType<BuyOrSell>,
|
|
type: Number as PropType<BuyOrSell>,
|
|
|
default: BuyOrSell.buy,
|
|
default: BuyOrSell.buy,
|
|
|
},
|
|
},
|
|
|
- goodsPrice: {
|
|
|
|
|
- type: Object as PropType<Number | String>,
|
|
|
|
|
- default: '--',
|
|
|
|
|
- },
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
- console.log('props', props);
|
|
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
// 资金账号
|
|
// 资金账号
|
|
|
const accountList = getAccountTypeList([2]);
|
|
const accountList = getAccountTypeList([2]);
|
|
@@ -206,36 +202,11 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
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, allWR } = handleSpotWarrant(props.enumName, props.buyOrSell, props.parantSelectedRow, loading);
|
|
|
|
|
- // 获取计算额与最大值
|
|
|
|
|
- const { getCalculate, uiParam } = ListedViewModel(props.enumName);
|
|
|
|
|
- function action() {
|
|
|
|
|
- // 价格
|
|
|
|
|
- let orderPrice = 0;
|
|
|
|
|
- if (isFloat()) {
|
|
|
|
|
- if (props.goodsPrice !== '--') {
|
|
|
|
|
- orderPrice = (props.goodsPrice as number) + props.selectedRow.pricemove;
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- orderPrice = props.selectedRow.fixedprice;
|
|
|
|
|
- }
|
|
|
|
|
- const param: WrParam = {
|
|
|
|
|
- orderPrice,
|
|
|
|
|
- availableFunds: Number(getCanUseMoney(getSelectedAccount() as AccountListItem)),
|
|
|
|
|
- deListNum: formState.num,
|
|
|
|
|
- listedNum: props.selectedRow.orderqty,
|
|
|
|
|
- };
|
|
|
|
|
- if (isBuy() && !isSale()) {
|
|
|
|
|
- param.availableFunds = allWR.value.find((e) => e.ladingbillid === formState.LadingBillId)?.enableqty;
|
|
|
|
|
- }
|
|
|
|
|
- getCalculate(param);
|
|
|
|
|
- }
|
|
|
|
|
- action();
|
|
|
|
|
- function numChange() {
|
|
|
|
|
- action();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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);
|
|
|
function submit() {
|
|
function submit() {
|
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
|
// 首先确定 这是仓单贸易的有仓单挂摘牌 HasWr = 1
|
|
// 首先确定 这是仓单贸易的有仓单挂摘牌 HasWr = 1
|
|
@@ -258,7 +229,7 @@ export default defineComponent({
|
|
|
WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
|
|
WRFactorTypeId: props.parantSelectedRow.wrfactortypeid, // uint64 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写
|
|
|
TradeDate: moment().format('YYYYMMDD'), // string 交易日
|
|
TradeDate: moment().format('YYYYMMDD'), // string 交易日
|
|
|
DeliveryMonth: '', // string 交收月
|
|
DeliveryMonth: '', // string 交收月
|
|
|
- HasWr: isSale() ? 0 : 1, // uint32 是否有仓单-0:没有仓单 1:有仓单
|
|
|
|
|
|
|
+ HasWr: isWR(), // uint32 是否有仓单-0:没有仓单 1:有仓单
|
|
|
IsFinancing: 0, // uint32 是否融资购买(买摘牌时有效)-0:否 1:是
|
|
IsFinancing: 0, // uint32 是否融资购买(买摘牌时有效)-0:否 1:是
|
|
|
ProductDetailID: 0, // uint64 金融机构产品组合ID(融资购买时有效)
|
|
ProductDetailID: 0, // uint64 金融机构产品组合ID(融资购买时有效)
|
|
|
};
|
|
};
|
|
@@ -283,16 +254,17 @@ export default defineComponent({
|
|
|
wrHoldList,
|
|
wrHoldList,
|
|
|
loading,
|
|
loading,
|
|
|
submit,
|
|
submit,
|
|
|
- isSale,
|
|
|
|
|
|
|
+ isWR,
|
|
|
isBuy,
|
|
isBuy,
|
|
|
isFloat,
|
|
isFloat,
|
|
|
- numChange,
|
|
|
|
|
rules,
|
|
rules,
|
|
|
formState,
|
|
formState,
|
|
|
formRef,
|
|
formRef,
|
|
|
- uiParam,
|
|
|
|
|
getCanUseMoney,
|
|
getCanUseMoney,
|
|
|
getSelectedAccount,
|
|
getSelectedAccount,
|
|
|
|
|
+ getMaxNum,
|
|
|
|
|
+ getMoney,
|
|
|
|
|
+ getMargin,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|