|
|
@@ -20,14 +20,16 @@
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="挂牌方式"
|
|
|
- name="WRPriceType">
|
|
|
+ name="marketid">
|
|
|
<a-select class="inlineFormSelect"
|
|
|
- default-value="1"
|
|
|
- v-model:value="formState.WRPriceType"
|
|
|
- style="width: 140px">
|
|
|
- <a-select-option :value="1">一口价</a-select-option>
|
|
|
+ v-model:value="formState.marketid"
|
|
|
+ @change="handleMarket"
|
|
|
+ style="width: 140px"
|
|
|
+ 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 :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-form-item>
|
|
|
</a-col>
|
|
|
@@ -138,7 +140,7 @@
|
|
|
</a-col>
|
|
|
<a-col :span="12"> </a-col>
|
|
|
</a-row>
|
|
|
- <template v-if="isBlocs()">
|
|
|
+
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="履约保证金"
|
|
|
@@ -167,14 +169,15 @@
|
|
|
class="inputIconBox">
|
|
|
<span :class="['clickBox', formState.permanceTempName ? 'white' : '']"
|
|
|
style="width: 140px"
|
|
|
- @click="openPermance">{{ formState.permanceTempName ? formState.permanceTempName : '选择履约模板' }}</span>
|
|
|
+ @click="handlePermance">{{ formState.permanceTempName ? formState.permanceTempName : '选择履约模板' }}</span>
|
|
|
<svg class="icon svg-icon"
|
|
|
aria-hidden="true"
|
|
|
- @click="openPermance">
|
|
|
+ @click="handlePermance">
|
|
|
<use xlink:href="#icon-moban" />
|
|
|
</svg>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ <template v-if="isBlocs()">
|
|
|
<a-col :span="12">
|
|
|
<a-form-item label="指定朋友"
|
|
|
class="inputIconBox">
|
|
|
@@ -191,8 +194,8 @@
|
|
|
@change="limiteFriends">不限</a-checkbox>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
+ </template>
|
|
|
</a-row>
|
|
|
- </template>
|
|
|
<a-row :gutter="24"
|
|
|
v-if="isFloat()">
|
|
|
<a-col :span="12">
|
|
|
@@ -281,6 +284,7 @@
|
|
|
<!-- 选择履约模板 -->
|
|
|
<Permance v-if="showPermance"
|
|
|
:position="'bottom'"
|
|
|
+ :marketid="formState.marketid"
|
|
|
@cancel="choosePermance"
|
|
|
@update="choosePermance" />
|
|
|
</template>
|
|
|
@@ -297,7 +301,7 @@ import { _closeModal } from '@/common/setup/modal/modal';
|
|
|
import { useBlocksAccount, useBlocksFriends, useBlocksMoney, useBlocksNumber, useBlocksPermaceTemp, useBlocksPrice } from '@/common/setup/warehouse_receipt_trade/listing';
|
|
|
import { getCanUseMoney, getInTaAccount, getUserId } from '@/services/bus/account';
|
|
|
import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
|
|
|
-import { getMarketRunByTradeMode } from '@/services/bus/market';
|
|
|
+import { getAllMarkets, getMarketRunByTradeMode } from '@/services/bus/market';
|
|
|
import { WrHoldLB } from '@/services/go/wrtrade/interface';
|
|
|
import { hdWROrder } from '@/services/proto/warehousetrade';
|
|
|
import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
|
|
|
@@ -308,7 +312,7 @@ import moment from 'moment';
|
|
|
import { v4 } from 'uuid';
|
|
|
import { defineComponent, onMounted, PropType, ref } from 'vue';
|
|
|
import { ListingForm } from './interface';
|
|
|
-import { handleForm, handleGoods, handleNumAndPrice } from './setup';
|
|
|
+import { handleForm, handleGoods, handleNumAndPrice, queryMarketSection } from './setup';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: ModalEnum.spot_warrant_spot_details_listed,
|
|
|
@@ -324,7 +328,7 @@ export default defineComponent({
|
|
|
const loading = ref<boolean>(false);
|
|
|
const { visible, cancel } = _closeModal(context);
|
|
|
const { rules, formState, formRef } = handleForm(props.selectedRow);
|
|
|
-
|
|
|
+
|
|
|
// 选择朋友
|
|
|
const { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends } = useBlocksFriends(formState);
|
|
|
// 履约模板
|
|
|
@@ -335,6 +339,36 @@ export default defineComponent({
|
|
|
const { numCheck, increaseNumber, decreaseNumber } = useBlocksNumber(formState);
|
|
|
|
|
|
const { goodsGroup, goodsList, groupsChange, findGoodsCode } = handleGoods();
|
|
|
+
|
|
|
+ // 获取仓单贸易市场
|
|
|
+ const { spotMarkets } = queryMarketSection(false)
|
|
|
+
|
|
|
+ // 切换市场
|
|
|
+ function handleMarket(value: number) {
|
|
|
+ const market = spotMarkets.value.find(item => item.marketid === value)
|
|
|
+ if (!market) return
|
|
|
+
|
|
|
+ // 判断所选择市场挂牌方式 1:一口价 2:浮动价 3:贸易圈 4:协议指定
|
|
|
+ if (market.listingmode === 1) {
|
|
|
+ formState.WRPriceType = 1
|
|
|
+ } else if (market.listingmode === 2) {
|
|
|
+ formState.WRPriceType = 2
|
|
|
+ } else {
|
|
|
+ formState.WRPriceType = 3
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 点选履约模板
|
|
|
+ function handlePermance() {
|
|
|
+ // 必须先选择市场再选择对应的履约模板
|
|
|
+ if (!formState.marketid) {
|
|
|
+ message.info('请先选择市场')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ openPermance()
|
|
|
+ }
|
|
|
+
|
|
|
// 切换商品组
|
|
|
function handleGoodsGroups(value: number) {
|
|
|
groupsChange(value);
|
|
|
@@ -370,7 +404,26 @@ export default defineComponent({
|
|
|
});
|
|
|
const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
|
|
|
function submit() {
|
|
|
- const marketInfo = getMarketRunByTradeMode(17);
|
|
|
+ debugger;
|
|
|
+ // 市场信息
|
|
|
+ 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.error('请选择履约模板')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const marketInfo = getMarketRunByTradeMode(market!.trademode)
|
|
|
if (marketInfo) {
|
|
|
validateAction<ListingForm>(formRef, formState).then((res) => {
|
|
|
const wrGoodsInfo: WRGoodsInfo = {
|
|
|
@@ -497,6 +550,9 @@ export default defineComponent({
|
|
|
getFriendLength,
|
|
|
limiteFriends,
|
|
|
getPrice,
|
|
|
+ spotMarkets,
|
|
|
+ handleMarket,
|
|
|
+ handlePermance,
|
|
|
};
|
|
|
},
|
|
|
});
|