|
@@ -11,14 +11,15 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="mtp-modal__container form-row">
|
|
<div class="mtp-modal__container form-row">
|
|
|
<a-form ref="formRef" :model="formState" :rules="rules">
|
|
<a-form ref="formRef" :model="formState" :rules="rules">
|
|
|
- <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-option :value="3">贸易圈</a-select-option>
|
|
|
|
|
|
|
+ <a-form-item label="挂牌方式" name="marketid">
|
|
|
|
|
+ <a-select class="inlineFormSelect" v-model:value="formState.marketid" @change="handleMarket" placeholder="请选择挂牌方式">
|
|
|
|
|
+ <!-- <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-option v-for="item in spotMarkets" :key="item.marketid" :value="item.marketid">{{ item.marketname }}</a-select-option>
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item ref="FixedPrice" label="挂牌价格" name="FixedPrice" :autoLink="false" v-if="isFixed() || isBlocs()">
|
|
|
|
|
|
|
+ <a-form-item ref="FixedPrice" label="挂牌价格" name="FixedPrice" :autoLink="false" v-if="!isFloat()">
|
|
|
<div class="block">
|
|
<div class="block">
|
|
|
<div class="block-content">
|
|
<div class="block-content">
|
|
|
<a-input-number class="block-content__input dialogInput" :min="0" v-model:value="formState.FixedPrice" @blur="() => $refs.FixedPrice.onFieldBlur()" />
|
|
<a-input-number class="block-content__input dialogInput" :min="0" v-model:value="formState.FixedPrice" @blur="() => $refs.FixedPrice.onFieldBlur()" />
|
|
@@ -91,6 +92,18 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
|
|
+ <a-form-item label="指定用户" v-if="isAgreemt()">
|
|
|
|
|
+ <div class="block">
|
|
|
|
|
+ <div class="block-content">
|
|
|
|
|
+ <div class="block-content">
|
|
|
|
|
+ <span :class="['clickBox', getFriendLength() ? 'white' : '']" @click="showUser = true">{{ getFriendLength() ? `已选${getFriendLength()}人` : '选择用户' }}</span>
|
|
|
|
|
+ <svg class="block-content__suffix icon svg-icon" aria-hidden="true" @click="showUser = true">
|
|
|
|
|
+ <use xlink:href="#icon-pengyou1" />
|
|
|
|
|
+ </svg>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </a-form-item>
|
|
|
<a-form-item label="指定朋友" v-if="isBlocs()">
|
|
<a-form-item label="指定朋友" v-if="isBlocs()">
|
|
|
<div class="block">
|
|
<div class="block">
|
|
|
<div class="block-content">
|
|
<div class="block-content">
|
|
@@ -117,12 +130,9 @@
|
|
|
<a-form-item label="估算金额" style="width:100%" v-if="isFloat()">
|
|
<a-form-item label="估算金额" style="width:100%" v-if="isFloat()">
|
|
|
<span class="white ml8">{{ getWrMoney() }}</span>
|
|
<span class="white ml8">{{ getWrMoney() }}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item label="挂牌金额" style="width:100%" v-if="isFixed()">
|
|
|
|
|
|
|
+ <a-form-item label="挂牌金额" style="width:100%" v-else>
|
|
|
<span class="white ml8">{{ getWrMoney() }}</span>
|
|
<span class="white ml8">{{ getWrMoney() }}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
|
- <a-form-item label="挂牌金额" style="width:100%" v-if="isBlocs()">
|
|
|
|
|
- <span class="white ml8">{{ getMoney() }}</span>
|
|
|
|
|
- </a-form-item>
|
|
|
|
|
<a-form-item label="履约保证金" style="width:100%" v-if="isBlocs()">
|
|
<a-form-item label="履约保证金" style="width:100%" v-if="isBlocs()">
|
|
|
<span class="white ml8">{{ getMargin() }}</span>
|
|
<span class="white ml8">{{ getMargin() }}</span>
|
|
|
</a-form-item>
|
|
</a-form-item>
|
|
@@ -142,14 +152,14 @@
|
|
|
</Drawer>
|
|
</Drawer>
|
|
|
<!-- 选择朋友 -->
|
|
<!-- 选择朋友 -->
|
|
|
<Friend v-if="showFriend" :friends="formState.friends" :position="'bottom'" @cancel="chooseFriend" @update="chooseFriend" />
|
|
<Friend v-if="showFriend" :friends="formState.friends" :position="'bottom'" @cancel="chooseFriend" @update="chooseFriend" />
|
|
|
|
|
+ <!-- 选择用户 -->
|
|
|
|
|
+ <SearchUser v-model:visible="showUser" v-model:selectedValue="formState.friends" :position="'bottom'" />
|
|
|
<!-- 选择履约模板 -->
|
|
<!-- 选择履约模板 -->
|
|
|
<Permance v-if="showPermance" :position="'bottom'" @cancel="choosePermance" @update="choosePermance" />
|
|
<Permance v-if="showPermance" :position="'bottom'" @cancel="choosePermance" @update="choosePermance" />
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
|
import Drawer from '@/common/components/drawer/index.vue';
|
|
import Drawer from '@/common/components/drawer/index.vue';
|
|
|
-import Friend from '@/common/components/friends/index.vue';
|
|
|
|
|
-import Permance from '@/common/components/permanceTemp/choosePermancePlanTmp.vue';
|
|
|
|
|
import { BuyOrSell } from '@/common/constants/enumCommon';
|
|
import { BuyOrSell } from '@/common/constants/enumCommon';
|
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
import { ModalEnum } from '@/common/constants/modalNameEnum';
|
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
@@ -169,13 +179,18 @@ import { getGoodsPrice } from '@/views/market/market-spot/components/buy-sell-ma
|
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
import { v4 as uuidv4, v4 } from 'uuid';
|
|
import { v4 as uuidv4, v4 } from 'uuid';
|
|
|
-import { defineComponent, onBeforeUnmount, PropType, ref } from 'vue';
|
|
|
|
|
|
|
+import { defineComponent, defineAsyncComponent, onBeforeUnmount, PropType, ref } from 'vue';
|
|
|
import { ListingForm } from './interface';
|
|
import { ListingForm } from './interface';
|
|
|
-import { handleForm, handleGoods, handleNumAndPrice } from './setup';
|
|
|
|
|
|
|
+import { handleForm, handleGoods, handleNumAndPrice, queryMarketSection } from './setup';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_warrant_spot_details_listed,
|
|
name: ModalEnum.spot_warrant_spot_details_listed,
|
|
|
- components: { Drawer, Friend, Permance },
|
|
|
|
|
|
|
+ components: {
|
|
|
|
|
+ Drawer,
|
|
|
|
|
+ Friend: defineAsyncComponent(() => import('@/common/components/friends/index.vue')), // 选择朋友
|
|
|
|
|
+ Permance: defineAsyncComponent(() => import('@/common/components/permanceTemp/choosePermancePlanTmp.vue')), // 选择履约模板
|
|
|
|
|
+ SearchUser: defineAsyncComponent(() => import('@/common/components/searchUser/index.vue')), // 选择用户
|
|
|
|
|
+ },
|
|
|
emits: ['cancel', 'update'],
|
|
emits: ['cancel', 'update'],
|
|
|
props: {
|
|
props: {
|
|
|
selectedRow: {
|
|
selectedRow: {
|
|
@@ -185,6 +200,7 @@ export default defineComponent({
|
|
|
},
|
|
},
|
|
|
setup(props, context) {
|
|
setup(props, context) {
|
|
|
const loading = ref<boolean>(false);
|
|
const loading = ref<boolean>(false);
|
|
|
|
|
+ const showUser = ref(false);
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
|
|
|
|
|
@@ -198,6 +214,36 @@ export default defineComponent({
|
|
|
const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
|
|
const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
|
|
|
|
|
|
|
|
const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();
|
|
const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();
|
|
|
|
|
+
|
|
|
|
|
+ // 获取仓单贸易市场
|
|
|
|
|
+ const { spotMarkets } = queryMarketSection(false)
|
|
|
|
|
+
|
|
|
|
|
+ // 切换市场
|
|
|
|
|
+ function handleMarket(value: number) {
|
|
|
|
|
+ formState.friends = [];
|
|
|
|
|
+ const market = spotMarkets.value.find((e) => e.marketid === value);
|
|
|
|
|
+ if (market) {
|
|
|
|
|
+ switch (market.listingmode) {
|
|
|
|
|
+ // 浮动价
|
|
|
|
|
+ case 2: {
|
|
|
|
|
+ formState.WRPriceType = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 贸易圈
|
|
|
|
|
+ case 3: {
|
|
|
|
|
+ formState.isSpecified = 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 指定价
|
|
|
|
|
+ case 4: {
|
|
|
|
|
+ formState.isSpecified = 2;
|
|
|
|
|
+ }
|
|
|
|
|
+ default: {
|
|
|
|
|
+ formState.WRPriceType = 1;
|
|
|
|
|
+ formState.isSpecified = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 切换商品组
|
|
// 切换商品组
|
|
|
function handleGoodsGroups(value: number) {
|
|
function handleGoodsGroups(value: number) {
|
|
|
groupsChange(value);
|
|
groupsChange(value);
|
|
@@ -218,7 +264,7 @@ export default defineComponent({
|
|
|
// 估算价
|
|
// 估算价
|
|
|
function getPrice() {
|
|
function getPrice() {
|
|
|
let result = '--';
|
|
let result = '--';
|
|
|
- if (goodsCode.value) {
|
|
|
|
|
|
|
+ if (goodsCode.value && typeof formState.PriceMove === 'number') {
|
|
|
const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
|
|
const goodsPrice = getQuoteDayInfoByCodeFindPrice(goodsCode.value);
|
|
|
if (goodsPrice && goodsPrice !== '--') {
|
|
if (goodsPrice && goodsPrice !== '--') {
|
|
|
// 有实时行情价格
|
|
// 有实时行情价格
|
|
@@ -231,7 +277,7 @@ export default defineComponent({
|
|
|
onBeforeUnmount(() => {
|
|
onBeforeUnmount(() => {
|
|
|
removeSubscribeQuotation(uuid);
|
|
removeSubscribeQuotation(uuid);
|
|
|
});
|
|
});
|
|
|
- const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
|
|
|
|
|
|
|
+ const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs, isAgreemt } = handleNumAndPrice();
|
|
|
// 处理内部资金账号
|
|
// 处理内部资金账号
|
|
|
function handleSelectedAccount() {
|
|
function handleSelectedAccount() {
|
|
|
const item = getSelectedAccount();
|
|
const item = getSelectedAccount();
|
|
@@ -239,7 +285,25 @@ export default defineComponent({
|
|
|
return item.taaccounttype === 2 ? item : list[0];
|
|
return item.taaccounttype === 2 ? item : list[0];
|
|
|
}
|
|
}
|
|
|
function submit() {
|
|
function submit() {
|
|
|
- const marketInfo = getMarketRunByTradeMode(17);
|
|
|
|
|
|
|
+ // 市场信息
|
|
|
|
|
+ if (!formState.marketid) {
|
|
|
|
|
+ message.info("请选择市场")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // const marketInfo = getMarketRunByTradeMode(17);
|
|
|
|
|
+ const market = spotMarkets.value.find(item => item.marketid === formState.marketid)
|
|
|
|
|
+ if (!market) {
|
|
|
|
|
+ message.info("市场信息异常,请稍后重试")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 履约模板
|
|
|
|
|
+ if (!formState.permanceTempName) {
|
|
|
|
|
+ message.info('请选择履约模板')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const marketInfo = getMarketRunByTradeMode(market!.trademode);
|
|
|
if (marketInfo) {
|
|
if (marketInfo) {
|
|
|
// 无仓单挂牌
|
|
// 无仓单挂牌
|
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
@@ -255,7 +319,7 @@ export default defineComponent({
|
|
|
ClientSerialNo: uuidv4(), // 客户端流水号
|
|
ClientSerialNo: uuidv4(), // 客户端流水号
|
|
|
// OperateSrc: 2,
|
|
// OperateSrc: 2,
|
|
|
ClientType: 4,
|
|
ClientType: 4,
|
|
|
- // MarketID: 17201,
|
|
|
|
|
|
|
+ MarketID: formState.marketid,
|
|
|
LadingBillId: props.selectedRow.ladingbillid ? props.selectedRow.ladingbillid : 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
|
|
LadingBillId: props.selectedRow.ladingbillid ? props.selectedRow.ladingbillid : 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
|
|
|
// LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
|
|
// LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
|
|
|
TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
|
|
TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
|
|
@@ -263,7 +327,7 @@ export default defineComponent({
|
|
|
SubNum: props.selectedRow.subnum ? props.selectedRow.subnum : 0,
|
|
SubNum: props.selectedRow.subnum ? props.selectedRow.subnum : 0,
|
|
|
// WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
|
|
// WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
|
|
|
WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
|
|
WRFactorTypeId: props.selectedRow.wrfactortypeid, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
|
|
|
- IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
|
|
|
|
|
|
|
+ IsSpecified: res.isSpecified, // 是否指定对手 0:不指定 1:指定 uint32
|
|
|
MatchAccIDs: [], // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
|
|
MatchAccIDs: [], // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
|
|
|
OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
|
|
OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
|
|
|
DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID
|
|
DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID
|
|
@@ -295,10 +359,10 @@ export default defineComponent({
|
|
|
};
|
|
};
|
|
|
if (isBlocs()) {
|
|
if (isBlocs()) {
|
|
|
// 贸易圈 是后加的, 处理贸易圈
|
|
// 贸易圈 是后加的, 处理贸易圈
|
|
|
- if (!formState.permanceTempName) {
|
|
|
|
|
- message.error('请选择履约模板');
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (!formState.permanceTempName) {
|
|
|
|
|
+ // message.error('请选择履约模板');
|
|
|
|
|
+ // return;
|
|
|
|
|
+ // }
|
|
|
if (!friendCheck.value) {
|
|
if (!friendCheck.value) {
|
|
|
if (formState.friends.length === 0) {
|
|
if (formState.friends.length === 0) {
|
|
|
message.error('请选择朋友');
|
|
message.error('请选择朋友');
|
|
@@ -306,9 +370,7 @@ export default defineComponent({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const obj = {
|
|
const obj = {
|
|
|
- IsSpecified: 1,
|
|
|
|
|
MatchAccIDs: res.friends,
|
|
MatchAccIDs: res.friends,
|
|
|
- WRPriceType: 1,
|
|
|
|
|
TimevalidType: 3, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
|
|
TimevalidType: 3, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
|
|
|
MarginFlag: 1, // 挂牌是否指定保证金 0:否 1:是
|
|
MarginFlag: 1, // 挂牌是否指定保证金 0:否 1:是
|
|
|
MarginAlgorithm: 1, // 指定保证金方式 1:比率 2:固定
|
|
MarginAlgorithm: 1, // 指定保证金方式 1:比率 2:固定
|
|
@@ -349,6 +411,7 @@ export default defineComponent({
|
|
|
decreasePrice,
|
|
decreasePrice,
|
|
|
...useBlocksAccount(formState),
|
|
...useBlocksAccount(formState),
|
|
|
...useBlocksMoney(formState),
|
|
...useBlocksMoney(formState),
|
|
|
|
|
+ showUser,
|
|
|
showPermance,
|
|
showPermance,
|
|
|
choosePermance,
|
|
choosePermance,
|
|
|
openPermance,
|
|
openPermance,
|
|
@@ -362,6 +425,10 @@ export default defineComponent({
|
|
|
getFriendLength,
|
|
getFriendLength,
|
|
|
limiteFriends,
|
|
limiteFriends,
|
|
|
getPrice,
|
|
getPrice,
|
|
|
|
|
+ isAgreemt,
|
|
|
|
|
+ handleMarket,
|
|
|
|
|
+ spotMarkets,
|
|
|
|
|
+ handleSelectedAccount,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|