huangbin %!s(int64=4) %!d(string=hai) anos
pai
achega
493d1ffa3f

+ 1 - 1
public/config/app.config.json

@@ -1,3 +1,3 @@
 {
 {
-    "apiUrl": "http://192.168.31.176:8080/cfg?key=test_176"
+    "apiUrl": "http://192.168.31.204:8080/cfg?key=test_204"
 }
 }

+ 7 - 1
src/common/components/permanceTemp/choosePermancePlanTmp.vue

@@ -76,6 +76,11 @@ export default defineComponent({
             type: String,
             type: String,
             default: 'top',
             default: 'top',
         },
         },
+        // 新版本仓单贸易挂牌时,都需要选择履约模板,查询时增加marketID参数
+        marketid: {
+            type: Number,
+            default: undefined,
+        }
     },
     },
     setup(props, context) {
     setup(props, context) {
         const { visible, cancel } = _closeModal(context);
         const { visible, cancel } = _closeModal(context);
@@ -83,9 +88,10 @@ export default defineComponent({
         const { show, close, open } = hanldeOpenAndCloseComponent();
         const { show, close, open } = hanldeOpenAndCloseComponent();
 
 
         const param: QueryPermancePlanTmpReq = {
         const param: QueryPermancePlanTmpReq = {
-            userid: getUsrId(),
+            // userid: getUsrId(), // 新版本不用传userid
             tmptype: '0,2',
             tmptype: '0,2',
         };
         };
+        if (props.marketid) { param.marketid = props.marketid }
         const { loading, tableList, queryTable } = queryTableList<QueryPermancePlanTmpRsp>();
         const { loading, tableList, queryTable } = queryTableList<QueryPermancePlanTmpRsp>();
         queryTable(queryQueryPermancePlanTmp, param);
         queryTable(queryQueryPermancePlanTmp, param);
 
 

+ 1 - 0
src/services/go/wrtrade/interface.ts

@@ -1163,6 +1163,7 @@ export interface QueryPermancePlanTmpReq {
     userid?: number; // 用户id
     userid?: number; // 用户id
     tmptype?: string; // 模板类型(逗号隔开), 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
     tmptype?: string; // 模板类型(逗号隔开), 0:通用 1:交割 2:仓单贸易 3:预售集采 7:竞拍-竞价式 8:竞拍-大宗式 9:荷兰式–失效枚举:4:竞拍-降价式 (无仓单) 5:挂牌期权 6:竞拍-降价式
     includepub?: number; // 是否包含公共模板(用户id为空的) 1-包含
     includepub?: number; // 是否包含公共模板(用户id为空的) 1-包含
+    marketid?: number; // 市场id(天津麦顿指定此参数,其它不用)
 }
 }
 export interface QueryPermancePlanTmpRsp {
 export interface QueryPermancePlanTmpRsp {
     autoid: number;//AutoID 模板id
     autoid: number;//AutoID 模板id

+ 70 - 14
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/index.vue

@@ -20,14 +20,16 @@
           <a-row :gutter="24">
           <a-row :gutter="24">
             <a-col :span="12">
             <a-col :span="12">
               <a-form-item label="挂牌方式"
               <a-form-item label="挂牌方式"
-                           name="WRPriceType">
+                           name="marketid">
                 <a-select class="inlineFormSelect"
                 <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="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-select>
               </a-form-item>
               </a-form-item>
             </a-col>
             </a-col>
@@ -138,7 +140,7 @@
             </a-col>
             </a-col>
             <a-col :span="12">&nbsp;</a-col>
             <a-col :span="12">&nbsp;</a-col>
           </a-row>
           </a-row>
-          <template v-if="isBlocs()">
+          
             <a-row :gutter="24">
             <a-row :gutter="24">
               <a-col :span="12">
               <a-col :span="12">
                 <a-form-item label="履约保证金"
                 <a-form-item label="履约保证金"
@@ -167,14 +169,15 @@
                              class="inputIconBox">
                              class="inputIconBox">
                   <span :class="['clickBox', formState.permanceTempName ? 'white' : '']"
                   <span :class="['clickBox', formState.permanceTempName ? 'white' : '']"
                         style="width: 140px"
                         style="width: 140px"
-                        @click="openPermance">{{ formState.permanceTempName ? formState.permanceTempName : '选择履约模板' }}</span>
+                        @click="handlePermance">{{ formState.permanceTempName ? formState.permanceTempName : '选择履约模板' }}</span>
                   <svg class="icon svg-icon"
                   <svg class="icon svg-icon"
                        aria-hidden="true"
                        aria-hidden="true"
-                       @click="openPermance">
+                       @click="handlePermance">
                     <use xlink:href="#icon-moban" />
                     <use xlink:href="#icon-moban" />
                   </svg>
                   </svg>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
+              <template v-if="isBlocs()">
               <a-col :span="12">
               <a-col :span="12">
                 <a-form-item label="指定朋友"
                 <a-form-item label="指定朋友"
                              class="inputIconBox">
                              class="inputIconBox">
@@ -191,8 +194,8 @@
                               @change="limiteFriends">不限</a-checkbox>
                               @change="limiteFriends">不限</a-checkbox>
                 </a-form-item>
                 </a-form-item>
               </a-col>
               </a-col>
+              </template>
             </a-row>
             </a-row>
-          </template>
           <a-row :gutter="24"
           <a-row :gutter="24"
                  v-if="isFloat()">
                  v-if="isFloat()">
             <a-col :span="12">
             <a-col :span="12">
@@ -281,6 +284,7 @@
   <!-- 选择履约模板 -->
   <!-- 选择履约模板 -->
   <Permance v-if="showPermance"
   <Permance v-if="showPermance"
             :position="'bottom'"
             :position="'bottom'"
+            :marketid="formState.marketid"
             @cancel="choosePermance"
             @cancel="choosePermance"
             @update="choosePermance" />
             @update="choosePermance" />
 </template>
 </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 { useBlocksAccount, useBlocksFriends, useBlocksMoney, useBlocksNumber, useBlocksPermaceTemp, useBlocksPrice } from '@/common/setup/warehouse_receipt_trade/listing';
 import { getCanUseMoney, getInTaAccount, getUserId } from '@/services/bus/account';
 import { getCanUseMoney, getInTaAccount, getUserId } from '@/services/bus/account';
 import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
 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 { WrHoldLB } from '@/services/go/wrtrade/interface';
 import { hdWROrder } from '@/services/proto/warehousetrade';
 import { hdWROrder } from '@/services/proto/warehousetrade';
 import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
 import { WRGoodsInfo } from '@/services/proto/warehousetrade/interface';
@@ -308,7 +312,7 @@ import moment from 'moment';
 import { v4 } from 'uuid';
 import { v4 } from 'uuid';
 import { defineComponent, onMounted, PropType, ref } from 'vue';
 import { defineComponent, onMounted, 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,
@@ -324,7 +328,7 @@ export default defineComponent({
         const loading = ref<boolean>(false);
         const loading = ref<boolean>(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);
-        
+
         // 选择朋友
         // 选择朋友
         const { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends } = useBlocksFriends(formState);
         const { friendCheck, showFriend, chooseFriend, openFriend, getFriendLength, limiteFriends } = useBlocksFriends(formState);
         // 履约模板
         // 履约模板
@@ -335,6 +339,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) {
+          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) {
         function handleGoodsGroups(value: number) {
             groupsChange(value);
             groupsChange(value);
@@ -370,7 +404,26 @@ export default defineComponent({
         });
         });
         const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
         const { getWrMoney, getWrMargin, isFloat, isFixed, isBlocs } = handleNumAndPrice();
         function submit() {
         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) {
             if (marketInfo) {
                 validateAction<ListingForm>(formRef, formState).then((res) => {
                 validateAction<ListingForm>(formRef, formState).then((res) => {
                     const wrGoodsInfo: WRGoodsInfo = {
                     const wrGoodsInfo: WRGoodsInfo = {
@@ -497,6 +550,9 @@ export default defineComponent({
             getFriendLength,
             getFriendLength,
             limiteFriends,
             limiteFriends,
             getPrice,
             getPrice,
+            spotMarkets,
+            handleMarket,
+            handlePermance,
         };
         };
     },
     },
 });
 });

+ 1 - 0
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/interface.ts

@@ -7,4 +7,5 @@ export interface ListingForm extends BlocsListingForm {
     PriceMove: number,// 升贴水(浮动价时填写)
     PriceMove: number,// 升贴水(浮动价时填写)
     goodsgroupid: number | undefined,
     goodsgroupid: number | undefined,
     goodsid: number | undefined,
     goodsid: number | undefined,
+    marketid: number | undefined,   // 当前选择挂牌市场ID
 }
 }

+ 10 - 7
src/views/order/spot_warran/components/spot_warrant_spot_details/components/listing/setup.ts

@@ -31,6 +31,7 @@ function initFormData(): ListingForm {
         friends: [],
         friends: [],
         permanceTempName: '',
         permanceTempName: '',
         permaceTempId: 0,
         permaceTempId: 0,
+        marketid: undefined,
     }
     }
 }
 }
 
 
@@ -61,6 +62,7 @@ export function handleForm(data: WrHoldLB) {
         OrderQty: [{ required: true, validator: v_num, trigger: 'blur', type: 'number' }],
         OrderQty: [{ required: true, validator: v_num, trigger: 'blur', type: 'number' }],
         PriceMove: [{ required: true, validator: v_basis, trigger: 'blur', type: 'number', }],
         PriceMove: [{ required: true, validator: v_basis, trigger: 'blur', type: 'number', }],
         goodsid: [{ required: true, validator: v_group, }],
         goodsid: [{ required: true, validator: v_group, }],
+        marketid: [{ required: true, message: '请选择挂牌市场', }]
     }
     }
     Object.assign(rules, rule)
     Object.assign(rules, rule)
     onBeforeUnmount(() => {
     onBeforeUnmount(() => {
@@ -135,18 +137,19 @@ export function handleNumAndPrice() {
 export function queryMarketSection(isPre: boolean) {
 export function queryMarketSection(isPre: boolean) {
     const spotMarkets = ref<TjmdMarketSectionConfig[]>([]); 
     const spotMarkets = ref<TjmdMarketSectionConfig[]>([]); 
     queryTjmdMarketSection().then(res => {
     queryTjmdMarketSection().then(res => {
+        debugger;
         let resMarkets: TjmdMarketSectionConfig[] = []
         let resMarkets: TjmdMarketSectionConfig[] = []
         res.forEach(item => { resMarkets.push(...item.mlist) })
         res.forEach(item => { resMarkets.push(...item.mlist) })
         // 根据有无仓单过滤出仓单市场
         // 根据有无仓单过滤出仓单市场
-        resMarkets = resMarkets.filter(item => {
-            item.auctionwrtype === (!isPre ? 2 : 1) && item.trademode === TradeMode.WarehouseReceiptTrade
-        })
         // 过滤掉没有权限的市场
         // 过滤掉没有权限的市场
         const markets = getAllMarkets()
         const markets = getAllMarkets()
-        resMarkets = resMarkets.filter(item => {
-            markets.findIndex(m => m.marketid == item.marketid) !== -1
-        })
-
+        resMarkets = resMarkets.filter(item => 
+            item.auctionwrtype === (isPre ? 1 : 2) && (item.trademode === TradeMode.WarehouseReceiptTrade)
+        ).filter(item => 
+            markets.findIndex(m => m.marketid === item.marketid) !== -1
+        )
         spotMarkets.value = resMarkets
         spotMarkets.value = resMarkets
     })
     })
+
+    return { spotMarkets };
 }
 }