li.shaoyi 3 سال پیش
والد
کامیت
d6ecf205ed

+ 7 - 1
src/services/bus/rules.ts

@@ -5,4 +5,10 @@ export function getRules(): WrMarketTradeConfig[] {
     return APP.get('rules')
 }
 
-export { };
+/**
+ * 根据市场ID查询交易参数配置
+ */
+export function getRulesByMarketid(marketid: number) {
+    const rules = getRules();
+    return rules.find((e) => e.marketid === marketid);
+}

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

@@ -20,12 +20,16 @@ export interface QueryOrderQuoteReq {
  * 查询大厅行情列表返回
  */
 export interface WrOrderQuote {
+    bannerpicurl: string;//Banner图
     buyprice: number;//买价
     buypricemove: number;//买升贴水(基差)
     buyqty: number;//买量
     deliverygoodscode: string;//品种代码
     deliverygoodsid: number;//品种id
     deliverygoodsname: string;//品种名称
+    enumdicname: string;//单位名称
+    pictureurls: string;//详情图片(逗号分隔)
+    thumurls: string;//缩略图片(1:1)(逗号分隔)
     goodscode: string;//商品合约(浮动价列表才有)
     goodsid: number;//商品id(浮动价列表才有)
     sellprice: number;//卖价
@@ -590,6 +594,8 @@ export interface WrMarketTradeConfig {
     sellmarginvalue2: number;//卖方保证金设置值(无仓单)
     sellreleaseratio: number;//卖方释放比率[2:分步履约]
     updatetime: string;//更新时间
+    nowrquotaflag: number; //是否校验无仓单额度(仓单贸易) - 0:否 1:是
+    listingmode: number; //挂牌方式 - 1:一口价 2:浮动价 3:贸易圈 4:协议指定
 }
 
 /**

+ 28 - 7
src/views/market/spot_trade/components/buy-sell-market/components/delisting/index.vue

@@ -36,9 +36,9 @@
               </a-form-item>
             </a-col>
           </a-row>
-          <a-row :gutter="24" v-if="isBuy()">
+          <a-row :gutter="24" v-if="isBuy() && isWR()">
             <a-col :span="24">
-              <a-form-item :label="isWR() ? '现货仓单' : '预售仓单'" name="LadingBillId">
+              <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>
@@ -115,7 +115,7 @@
 import { PlusOutlined, MinusOutlined } from '@ant-design/icons-vue';
 import { defineComponent, PropType, ref } from 'vue';
 import Drawer from '@/common/components/drawer/index.vue';
-import { WrOrderQuote, WrOrderQuoteDetail } from '@/services/go/wrtrade/interface';
+import { WrOrderQuote } from '@/services/go/wrtrade/interface';
 import { getAccountTypeList, getSelectedAccountId, getUserId } from '@/services/bus/account';
 import { requestResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { HdWRDealOrder } from '@/services/proto/warehousetrade';
@@ -124,7 +124,7 @@ import moment from 'moment';
 import { ModalEnum } from '@/common/constants/modalNameEnum';
 import { HdWRDealOrderReq } from '@/services/proto/warehousetrade/interface';
 import { _closeModal } from '@/common/setup/modal/modal';
-import { handleForm, handleNumAndMoney, handleSpotWarrant, getWrPosition } from './setup';
+import { handleForm, handleNumAndMoney, handleSpotWarrant, getWrPosition, wrPostion } from './setup';
 import { handleIs } from '../../setup';
 import { validateAction } from '@/common/setup/form';
 import { ListingForm, TempWrOrderQuoteDetail } from './interface';
@@ -132,7 +132,9 @@ import { BuyOrSell } from '@/common/constants/enumCommon';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getCanUseMoney } from '@/services/bus/account';
 import { getQuoteDayInfoByCodeFindPrice } from '@/services/bus/goods';
+import { getRulesByMarketid } from '@/services/bus/rules';
 import { message } from 'ant-design-vue';
+
 export default defineComponent({
   name: ModalEnum.spot_trade_warehouse_financing_delisting,
   components: { Drawer, PlusOutlined, MinusOutlined },
@@ -186,10 +188,29 @@ export default defineComponent({
       return result;
     }
     function submit() {
-      if (getMaxNum() === 0) {
-        message.error('没有可用的预售仓单头寸');
-        return;
+      if (isWR()) {
+        if (getMaxNum() === 0) {
+          message.error('没有可用的现货仓单头寸');
+          return;
+        }
+      } else {
+        // 仓单预售市场,任务 #3687
+        const marketConfig = getRulesByMarketid(17202);
+        if (marketConfig) {
+          // 是否效验无仓单额度
+          if (marketConfig.nowrquotaflag) {
+            const item = wrPostion.value.find((e) => e.wrfactortypeid === props.parantSelectedRow.wrfactortypeid);
+            if (!item || item.creditenableqty <= 0) {
+              message.error('没有可用的预售仓单头寸');
+              return;
+            }
+          }
+        } else {
+          message.error('市场参数未配置')
+          return;
+        }
       }
+
       validateAction<ListingForm>(formRef, formState).then((res) => {
         // 首先确定  这是仓单贸易的有仓单挂摘牌 HasWr = 1
         // 其次判断  摘牌 1。摘买 (需要通过自己的仓单进行摘买)  2。摘卖 (不需要通过仓单)

+ 13 - 35
src/views/market/spot_trade/components/buy-sell-market/components/delisting/setup.ts

@@ -7,7 +7,7 @@ import { getRules } from '@/services/bus/rules';
 import { AccountListItem } from "@/services/dataCenter/interafce/account";
 import { queryHoldLB, queryWrPosition } from '@/services/go/wrtrade';
 import { QueryWrPositionReq, WrHoldLB, WrOrderQuote, WrOrderQuoteDetail, WrPosition } from "@/services/go/wrtrade/interface";
-import { reactive, Ref, ref, UnwrapRef, watch } from "vue";
+import { reactive, Ref, ref, UnwrapRef } from "vue";
 import { handleIs } from "../../setup";
 import { ListingForm, Wrhold } from "./interface";
 
@@ -28,7 +28,8 @@ export function handleForm(data: WrOrderQuoteDetail) {
 }
 
 // 预售仓单汇总
-const wrPostion = ref<WrPosition[]>([])
+export const wrPostion = ref<WrPosition[]>([]);
+
 export function getWrPosition(enumName: EnumRouterName, buyOrSell: BuyOrSell, loading: Ref<boolean>) {
     const { isWR, isBuy } = handleIs(enumName, buyOrSell)
     if (isBuy() && !isWR()) {
@@ -47,41 +48,18 @@ const allWR = ref<WrHoldLB[]>([])
 export function handleSpotWarrant(enumName: EnumRouterName, buyOrSell: BuyOrSell, selectedRow: WrOrderQuote, loading: Ref<boolean>) {
     const { isWR, isBuy } = handleIs(enumName, buyOrSell)
     const wrHoldList = ref<Wrhold[]>([])
-    if (isBuy()) {
+    if (isBuy() && isWR()) {
         queryResultLoadingAndInfo(queryHoldLB, loading).then(res => {
             allWR.value = res;
-            if (isWR()) {
-                // 有仓单
-                res.forEach((e) => {
-                    if (e.wrfactortypeid === String(selectedRow.wrfactortypeid)) {
-                        wrHoldList.value.push({
-                            id: e.ladingbillid,
-                            name: `${e.wrholdeno}(${e.enableqty}${e.enumdicname})`,
-                            subnum: e.subnum
-                        })
-                    }
-                })
-            } else {
-                // 无仓单
-                watch(wrPostion, (value) => {
-                    res.forEach((e) => {
-                        if (e.wrfactortypeid === String(selectedRow.wrfactortypeid)) {
-                            const result: Wrhold = {
-                                id: e.ladingbillid,
-                                name: `${e.wrholdeno}(0${e.enumdicname})`,
-                                subnum: e.subnum
-                            }
-
-                            const item = value.find((p) => p.wrfactortypeid === selectedRow.wrfactortypeid);
-                            if (item) {
-                                result.name = `${e.wrholdeno}(${item.creditenableqty}${e.enumdicname})`;
-                            }
-
-                            wrHoldList.value.push(result);
-                        }
+            res.forEach((e) => {
+                if (e.wrfactortypeid === String(selectedRow.wrfactortypeid)) {
+                    wrHoldList.value.push({
+                        id: e.ladingbillid,
+                        name: `${e.wrholdeno}(${e.enableqty}${e.enumdicname})`,
+                        subnum: e.subnum
                     })
-                })
-            }
+                }
+            })
         })
     }
     return { wrHoldList }
@@ -138,7 +116,7 @@ export function handleNumAndMoney(enumName: EnumRouterName, buyOrSell: BuyOrSell
                     }
                 } else {
                     // 获取头寸
-                    const item = wrPostion.value.find(e => String(e.wrfactortypeid) === String(parantSelectedRow.wrfactortypeid))
+                    const item = wrPostion.value.find(e => e.wrfactortypeid === parantSelectedRow.wrfactortypeid)
                     if (item) {
                         result = Math.min(item.creditenableqty, selectedRow.orderqty)
                     }

+ 13 - 1
src/views/market/spot_trade/components/buy-sell-market/index.vue

@@ -67,7 +67,7 @@
         历史走势
         <LineChartOutlined />
       </a-button>
-      <BtnList :btnList="firstBtn" :record="selectedRow" @click="openComponent" />
+      <BtnList :btnList="handleFirstBtnList(firstBtn)" :record="selectedRow" @click="openComponent" />
     </div>
     <a-row class="buySellHall">
       <a-col :span="12" v-if="sellMarket.isMarket">
@@ -172,6 +172,16 @@ export default defineComponent({
     };
     const { componentId, closeComponent, openComponent } = handleModalComponent(queryFn, ref({}));
     const { hasFinacing } = handleFinacing(loading, props.selectedRow.wrfactortypeid);
+
+    function handleFirstBtnList(list: BtnListType[]) {
+      list.forEach((e) => {
+        if (props.enumName === EnumRouterName.warehouse_pre_sale_price && e.lable === '挂牌求购') {
+          e.lable = '挂牌';
+        }
+      })
+      return list;
+    }
+
     function handleBtnList(list: BtnListType[]) {
       console.log('list', list);
       if (!hasFinacing()) {
@@ -180,6 +190,7 @@ export default defineComponent({
         return list;
       }
     }
+
     function timeChange() {
       TimerUtils.setTimeout(
         () => {
@@ -228,6 +239,7 @@ export default defineComponent({
       closeComponent,
       openComponent,
       enumName: props.enumName,
+      handleFirstBtnList,
       handleBtnList,
       isWR,
       timeChange,

+ 8 - 4
src/views/market/spot_trade/components/filter/index.vue

@@ -14,7 +14,10 @@
         </a-select-option>
       </a-select>
       <a-button class="btnDeafault" @click="search(true)" style="width: 80px">筛选</a-button>
-      <a-button class="operBtn" @click="listingAction">挂牌求购</a-button>
+      <a-button class="operBtn" @click="listingAction">
+        <template v-if="enumName === EnumRouterName.warehouse_pre_sale_price">挂牌</template>
+        <template v-else>挂牌求购</template>
+      </a-button>
     </div>
   </div>
 </template>
@@ -156,7 +159,7 @@ export default defineComponent({
     }
     function listingAction() {
       if (!selectedFT.value) {
-        message.warn('请选商品!');
+        message.warn('请选商品!');
         return;
       }
       let flag = true;
@@ -171,13 +174,13 @@ export default defineComponent({
       if (flag) {
         if (!isWR()) {
           if (!time.value) {
-            message.warn('请选交收月!');
+            message.warn('请选交收月!');
             return;
           }
         }
         if (isFloat()) {
           if (!selectedGoods.value) {
-            message.warn('请选期货合约!');
+            message.warn('请选期货合约!');
             return;
           }
           const result = getQuoteDayInfoByCodeFindPrice(selectedGoods.value.goodscode);
@@ -189,6 +192,7 @@ export default defineComponent({
       }
     }
     return {
+      EnumRouterName,
       FtDeliveryGoods,
       selectedFT,
       wrLsit,

+ 114 - 74
src/views/market/spot_trade/components/post_buying/index.vue

@@ -1,9 +1,19 @@
 <template>
   <!-- 挂牌求购 -->
-  <Drawer :title="'挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top">
+  <Drawer :title="enumName === EnumRouterName.warehouse_pre_sale_price ? '挂牌' : '挂牌求购'" :placement="'right'" :visible="visible" @cancel="cancel" class="top">
     <div class="post_buying">
       <a-form class="inlineForm dialogForm" ref="formRef" :model="formState" :rules="rules">
         <div class="formBar">
+          <a-row :gutter="24" v-if="showListingType">
+            <a-col :span="24">
+              <a-form-item label="挂牌方式">
+                <a-radio-group class="commonRadioGroup" v-model:value="listingType">
+                  <a-radio value="buy">求购</a-radio>
+                  <a-radio value="sell">出售</a-radio>
+                </a-radio-group>
+              </a-form-item>
+            </a-col>
+          </a-row>
           <a-row :gutter="24">
             <a-col :span="24">
               <a-form-item label="交易账户" name="accountid">
@@ -128,8 +138,10 @@ import { BuyOrSell } from '@/common/constants/enumCommon';
 import { getCanUseMoney } from '@/services/bus/account';
 import { message } from 'ant-design-vue';
 import Permance from '@/common/components/permanceTemp/choosePermancePlanTmp.vue';
-import { QueryPermancePlanTmpRsp } from '@/services/go/wrtrade/interface';
+import { queryWrPosition } from '@/services/go/wrtrade';
+import { QueryPermancePlanTmpRsp, WrPosition } from '@/services/go/wrtrade/interface';
 import APP from '@/services';
+import { getRulesByMarketid } from '@/services/bus/rules';
 
 export default defineComponent({
   emits: ['cancel', 'update'],
@@ -161,6 +173,9 @@ export default defineComponent({
     const { rules, formState, formRef } = handleForm(props.selectedRow);
     const loading = ref<boolean>(false);
     const accountList = getAccountTypeList([2]);
+    const listingType = ref<'buy' | 'sell'>('buy'); // 挂牌方式
+    const showListingType = ref(false); // 是否显示挂牌方式
+
     if (accountList.length) {
       formState.accountid = accountList[0].accountid;
     }
@@ -171,13 +186,38 @@ export default defineComponent({
 
     switch (props.enumName) {
       // 仓单贸易
-      case 'warehouse_receipt_trade_price': {
+      case EnumRouterName.warehouse_receipt_trade_price: {
         formState.marketid = 17201;
         break;
       }
       // 仓单预售
-      case 'warehouse_pre_sale_price': {
+      case EnumRouterName.warehouse_pre_sale_price: {
         formState.marketid = 17202;
+        // 仓单预售市场 任务 #3687
+        const marketConfig = getRulesByMarketid(17202);
+        if (marketConfig) {
+          // 是否效验无仓单额度
+          if (marketConfig.nowrquotaflag) {
+            // 获取持仓头寸
+            queryWrPosition({ haswr: 0, querytype: 2, }).then((res) => {
+              const { wrfactortypeid, wrstandardid, warehouseid, dgitemname } = props.selectedRow;
+              let wrPosition: WrPosition | undefined = undefined;
+
+              if (wrfactortypeid) {
+                // 根据仓单要素id查询头寸
+                wrPosition = res.find((e) => e.wrfactortypeid === wrfactortypeid);
+              } else {
+                // 根据商品、仓库、品牌查询持仓头寸
+                wrPosition = res.find((e) => e.wrstandardid === wrstandardid && e.warehouseid === warehouseid && e.wrtypename.includes(dgitemname));
+              }
+
+              // 卖方需要有仓单头寸 “预售可用额度”
+              if (wrPosition && wrPosition?.creditenableqty > 0) {
+                showListingType.value = true;
+              }
+            })
+          }
+        }
         break;
       }
       default: {
@@ -214,80 +254,78 @@ export default defineComponent({
     }
 
     function submit() {
-      const marketInfo = APP.get('marketRun').find(({ marketid }: { marketid: number }) => marketid === formState.marketid)
-      if (marketInfo) {
-        validateAction<FormParam>(formRef, formState).then((res) => {
-          // 现在增加一种挂牌求购的情况
-          // 这种求购模式会生成一种仓单贸易商品
+      validateAction<FormParam>(formRef, formState).then((res) => {
+        // 现在增加一种挂牌求购的情况
+        // 这种求购模式会生成一种仓单贸易商品
 
-          const wrGoodsInfo: WRGoodsInfo = {
-            GoodsID: props.selectedRow.goodsid, // uint32 配置商品ID
-            GoodsCode: props.selectedRow.goodscode, // string 配置商品代码
-            PriceFactor: 1, // double 商品价格系数
-            PriceMove: 0, // double 商品升贴水值
-            WeightRatio: 1, // double 商品重量系数
-          };
-          const param = {
-            OrderSrc: 1, // 1=客户端
-            AccountID: res.accountid, // 默认内部资金账号第一个
-            ClientSerialNo: uuidv4(), // 客户端流水号
-            // OperateSrc: 2,
-            ClientType: 4,
-            MarketID: res.marketid,
-            // MarketID: marketInfo.marketid,
-            LadingBillId: 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-            // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
-            TradeDate: moment(marketInfo.tradedate).format('YYYYMMDD'), // 交易日 string
-            // SubNum: '0', // 提单子单号
-            SubNum: 0,
-            // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-            WRFactorTypeId: props.selectedRow.wrfactortypeid ? props.selectedRow.wrfactortypeid : 0, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
-            IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
-            // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
-            OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
-            DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID  // 有仓单求购
-            WRPriceType: isFloat() ? 2 : 1, // 价格方式 1:固定价 2:浮动价
-            FixedPrice: res.FixedPrice, // 固定价格
-            PriceFactor: 1, // 价格系数(浮动价时填写)
-            PriceMove: res.PriceMove ? res.PriceMove : 0, // 升贴水(浮动价时填写)
-            TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
-            // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
-            ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
-            FirstRatio: 0, // 首付比例
-            PerformanceTemplateID: res.permaceTempId, // 履约计划模板ID
-            UserID: getUserId(),
-            OperatorID: getUserId(), // 操作员账号ID
-            BuyOrSell: 0, // 买卖方向 0买1卖
-            PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
-            CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
-            Attachment1: '', // 附件1
-            Attachment2: '', // 附件2
-            Remark: '', // 备注
-            ApplyID: 0, // 申请ID
-            WRTradeGoods: isFloat() ? [wrGoodsInfo] : [],
-            CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
-            WRStandardID: props.selectedRow.wrstandardid,
-            HasWr: isWR(), // 无仓单挂牌  是否有无仓单
-            DelistMinQty: res.DelistMinQty, // 起摘数量
-            DeliveryMonth: isWR() ? '' : moment(res.DeliveryMonth).format('YYYY-MM'),
-            FactoryItems:
-              props.selectedRow.wrResult != undefined
-                ? props.selectedRow.wrResult.flatMap((it) => {
-                  return {
-                    DGFactoryItemTypeID: it.dgfactoryitemtypeid, // uint64 要素项类型ID
-                    DGFactoryItemID: it.dgfactoryitemid, // uint64 预约要素项类型值
-                    ItemTypeMode: 1, // uint32 要素项类型模式
-                  };
-                })
-                : [], // DGFactoryItems 要素类型明细集合(没有仓单要素ID填写)
-          };
-          requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
-            cancel(true);
-          });
+        const wrGoodsInfo: WRGoodsInfo = {
+          GoodsID: props.selectedRow.goodsid, // uint32 配置商品ID
+          GoodsCode: props.selectedRow.goodscode, // string 配置商品代码
+          PriceFactor: 1, // double 商品价格系数
+          PriceMove: 0, // double 商品升贴水值
+          WeightRatio: 1, // double 商品重量系数
+        };
+        const param = {
+          OrderSrc: 1, // 1=客户端
+          AccountID: res.accountid, // 默认内部资金账号第一个
+          ClientSerialNo: uuidv4(), // 客户端流水号
+          // OperateSrc: 2,
+          ClientType: 4,
+          MarketID: res.marketid,
+          // MarketID: marketInfo.marketid,
+          LadingBillId: 0, // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+          // LadingBillId: 'uint642081626946446000001', // 提单id(wrholdlb的LadingBillId字段),卖的时候填写 uint64
+          TradeDate: moment().format('YYYYMMDD'), // 交易日 string
+          // SubNum: '0', // 提单子单号
+          SubNum: 0,
+          // WRFactorTypeId: '2121626946446000001', // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+          WRFactorTypeId: props.selectedRow.wrfactortypeid ? props.selectedRow.wrfactortypeid : 0, // 仓单要素ID(wrholdlb的WRFactorTypeId字段),卖的时候填写 uint64
+          IsSpecified: 0, // 是否指定对手 0:不指定 1:指定 uint32
+          // MatchUserIDs: 0, // 仓单贸易对手资金账号ID集合(指定对手时填写) uint32
+          OrderQty: res.OrderQty, // 委托数量(可挂部分数据量) ======
+          DeliveryGoodsID: props.selectedRow.deliverygoodsid, // 交割商品商品ID  // 有仓单求购
+          WRPriceType: isFloat() ? 2 : 1, // 价格方式 1:固定价 2:浮动价
+          FixedPrice: res.FixedPrice, // 固定价格
+          PriceFactor: 1, // 价格系数(浮动价时填写)
+          PriceMove: res.PriceMove ? res.PriceMove : 0, // 升贴水(浮动价时填写)
+          TimevalidType: 4, // 时间有效类型 1:当日有效 2:本周有效 3:指定时间有效 4:一直有效
+          // ValidTime: moment('2021-08-25 00:00:00').format('YYYY-MM-DD HH:mm:ss'), // 有效期限
+          ClientOrderTime: moment().format('YYYY-MM-DD HH:mm:ss'),
+          FirstRatio: 0, // 首付比例
+          PerformanceTemplateID: res.permaceTempId, // 履约计划模板ID
+          UserID: getUserId(),
+          OperatorID: getUserId(), // 操作员账号ID
+          BuyOrSell: 0, // 买卖方向 0买1卖
+          PriceDisplayMode: 1, // 浮动价显示方式 1:合并显示 2:分开显示
+          CanBargain: 0, // 挂牌是否可议价0:不可1:可-摘牌是否议价
+          Attachment1: '', // 附件1
+          Attachment2: '', // 附件2
+          Remark: '', // 备注
+          ApplyID: 0, // 申请ID
+          WRTradeGoods: isFloat() ? [wrGoodsInfo] : [],
+          CanPart: 1, // 是否允许部份摘牌0:不允许;1:允许
+          WRStandardID: props.selectedRow.wrstandardid,
+          HasWr: isWR(), // 无仓单挂牌  是否有无仓单
+          DelistMinQty: res.DelistMinQty, // 起摘数量
+          DeliveryMonth: isWR() ? '' : moment(res.DeliveryMonth).format('YYYY-MM'),
+          FactoryItems:
+            props.selectedRow.wrResult != undefined
+              ? props.selectedRow.wrResult.flatMap((it) => {
+                return {
+                  DGFactoryItemTypeID: it.dgfactoryitemtypeid, // uint64 要素项类型ID
+                  DGFactoryItemID: it.dgfactoryitemid, // uint64 预约要素项类型值
+                  ItemTypeMode: 1, // uint32 要素项类型模式
+                };
+              })
+              : [], // DGFactoryItems 要素类型明细集合(没有仓单要素ID填写)
+        };
+        requestResultLoadingAndInfo(hdWROrder, param, loading, ['求购成功', '求购失败:']).then(() => {
+          cancel(true);
         });
-      }
+      });
     }
     return {
+      EnumRouterName,
       submit,
       cancel,
       loading,
@@ -296,6 +334,8 @@ export default defineComponent({
       rules,
       formState,
       formRef,
+      listingType,
+      showListingType,
       isFloat,
       isWR,
       getMaxNum,

+ 8 - 4
src/views/market/spot_trade/components/post_buying/interface.ts

@@ -8,12 +8,16 @@ export interface FormParam {
     PriceMove: number,
     DeliveryMonth: Moment,
     DelistMinQty: number,
-    permanceTempName:string;
-    permaceTempId:number;
-    marketid:number | undefined;
+    permanceTempName: string;
+    permaceTempId: number;
+    marketid: number | undefined;
 }
 
 
 export interface TempWrOrderQuoteDetail extends WrOrderQuote {
-    wrResult: { dgfactoryitemtypeid: number; dgfactoryitemid: number }[]
+    dgitemname: string,
+    wrResult: {
+        dgfactoryitemtypeid: number;
+        dgfactoryitemid: number
+    }[]
 }

+ 1 - 1
src/views/market/spot_trade/components/post_buying/setup.ts

@@ -40,7 +40,7 @@ export function handleForm(selectedRow: TempWrOrderQuoteDetail) {
         OrderQty: [{ required: true, validator: v_num, trigger: 'change', type: 'number' }],
         PriceMove: [{ required: true, validator: v_basis, trigger: 'blur', type: 'number', }],
         DelistMinQty: [{ required: true, validator: v_beginDelistingNum, trigger: 'blur', type: 'number', }],
-        accountid: [{ required: true, message: '请输入交易账号' }],
+        accountid: [{ required: true, type: 'number', message: '请输入交易账号' }],
     }
     onBeforeUnmount(() => {
         Object.assign(formState, initFormData())