Преглед изворни кода

企业风管8期-套期项目

li.shaoyi пре 3 година
родитељ
комит
a4ccfe6c26

+ 2 - 2
src/@next/constants/enum/index.ts

@@ -1,5 +1,5 @@
-import { sessionStorageUtil } from '@/utils/storage';
-import { AllEnums } from "@/services/go/commonService/interface";
+import { sessionStorageUtil } from '@/utils/storage'
+import { AllEnums } from "@/services/go/commonService/interface"
 
 /**
  * 获取所有枚举

+ 37 - 0
src/@next/constants/enum/orderType.ts

@@ -0,0 +1,37 @@
+import { getEnumTypeList, getEnumTypeName } from './index'
+
+/**
+ * 单据类型
+ */
+export enum OrderType {
+    Futures = 1, // 期货单
+    CallOption = 2, // 看涨期权单
+    PutOption = 3, // 看跌期权单
+}
+
+/**
+ * 获取类型列表
+ * @returns 
+ */
+export function getOrderTypeList() {
+    return getEnumTypeList('ordertype');
+}
+
+/**
+ * 获取枚举名称
+ * @param value 
+ * @returns 
+ */
+export function getOrderTypeName(value: number) {
+    return getEnumTypeName(getOrderTypeList(), value);
+}
+
+/**
+ * 判断类型是否相同
+ * @param key 
+ * @param value 
+ * @returns 
+ */
+export function isEqualOrderType(key: keyof typeof OrderType, value: number) {
+    return OrderType[key] === value;
+}

+ 37 - 0
src/@next/constants/enum/priceType.ts

@@ -0,0 +1,37 @@
+import { getEnumTypeList, getEnumTypeName } from './index'
+
+/**
+ * 定价类型
+ */
+export enum PriceType {
+    Fixed = 1, // 一口价
+    Pricing = 2, // 点价
+    Temporary = 3, // 暂定价
+}
+
+/**
+ * 获取类型列表
+ * @returns 
+ */
+export function getPriceTypeList() {
+    return getEnumTypeList('pricetype');
+}
+
+/**
+ * 获取枚举名称
+ * @param value 
+ * @returns 
+ */
+export function getPriceTypeName(value: number) {
+    return getEnumTypeName(getPriceTypeList(), value);
+}
+
+/**
+ * 判断类型是否相同
+ * @param key 
+ * @param value 
+ * @returns 
+ */
+export function isEqualPriceType(key: keyof typeof PriceType, value: number) {
+    return PriceType[key] === value;
+}

+ 36 - 0
src/@next/constants/enum/spotContractType.ts

@@ -0,0 +1,36 @@
+import { getEnumTypeList, getEnumTypeName } from './index'
+
+/**
+ * 合同类型
+ */
+export enum SpotContractType {
+    Buy = 1, // 采购
+    Sell = -1, // 销售
+}
+
+/**
+ * 获取类型列表
+ * @returns 
+ */
+export function getSpotContractTypeList() {
+    return getEnumTypeList('spotContractType');
+}
+
+/**
+ * 获取枚举名称
+ * @param value 
+ * @returns 
+ */
+export function getSpotContractTypeName(value: number) {
+    return getEnumTypeName(getSpotContractTypeList(), value);
+}
+
+/**
+ * 判断类型是否相同
+ * @param key 
+ * @param value 
+ * @returns 
+ */
+export function isEqualSpotContractType(key: keyof typeof SpotContractType, value: number) {
+    return SpotContractType[key] === value;
+}

+ 1 - 1
src/services/go/ermcp/hedgedItem/interface.ts

@@ -432,7 +432,7 @@ export interface UnLinkErmcpHedgePlanRsp {
     currencyid: number; // 结算币种ID - 作废
     deliverygoodsid: number; // 现货品种ID
     enumdicname: string; // 结算币种
-    hedgeplanid: number; // 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
+    hedgeplanid: string; // 套保计划ID(601+Unix秒时间戳(10位)+xxxxxx)
     hedgeplanno: string; // [计划编号]套保计划编号,模糊查询
     hedgeplanstatus: number; // [状态]套保计划状态 - 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
     isrelated: number; // 是否已关联计划项目 - 0:否 1:是

+ 55 - 52
src/views/business/sell/components/detail/index.vue

@@ -1,6 +1,7 @@
 <template>
   <!-- 采购详情-->
-  <a-modal class="add-custom custom-detail" title="详情" v-model:visible="visible" @cancel="cancel" centered width="890px">
+  <a-modal class="add-custom custom-detail" title="详情" v-model:visible="visible" @cancel="cancel" centered
+    width="890px">
     <template #footer>
       <a-button key="submit" type="primary" :loading="loading" @click="submit">关闭</a-button>
     </template>
@@ -212,67 +213,69 @@ export default defineComponent({
 
 <style lang="less">
 .custom-detail {
-    .ant-modal-content {
-        .ant-modal-body {
-            padding-top: 0;
-            padding-left: 0;
-            padding-right: 0;
+  .ant-modal-content {
+    .ant-modal-body {
+      padding-top: 0;
+      padding-left: 0;
+      padding-right: 0;
 
-            .ant-tabs {
-                background: @m-black11;
-                width: 100%;
-                padding: 0 24px;
+      .ant-tabs {
+        background: @m-black11;
+        width: 100%;
+        padding: 0 24px;
+
+        .ant-tabs-bar {
+          margin-bottom: 0;
+          border-bottom: 0;
+        }
 
-                .ant-tabs-bar {
-                    margin-bottom: 0;
-                    border-bottom: 0;
-                }
-                .anticon {
-                    color: @m-grey2;
-                }
-                .ant-tabs-nav-container {
-                    .ant-tabs-nav-wrap {
-                        .ant-tabs-nav {
-                            .ant-tabs-tab {
-                                width: 70px;
-                                margin-right: 43px;
-                                text-align: center;
-                                font-size: 16px;
-                                color: @m-grey2;
-                                padding: 0;
-                                line-height: 45px;
-                            }
+        .anticon {
+          color: @m-grey2;
+        }
+
+        .ant-tabs-nav-container {
+          .ant-tabs-nav-wrap {
+            .ant-tabs-nav {
+              .ant-tabs-tab {
+                width: 70px;
+                margin-right: 43px;
+                text-align: center;
+                font-size: 16px;
+                color: @m-grey2;
+                padding: 0;
+                line-height: 45px;
+              }
 
-                            .ant-tabs-tab-active.ant-tabs-tab {
-                                color: @m-blue0;
-                            }
+              .ant-tabs-tab-active.ant-tabs-tab {
+                color: @m-blue0;
+              }
 
-                            .ant-tabs-ink-bar {
-                                width: 70px !important;
-                                background: @m-blue0;
-                                .rounded-corners(1px);
-                            }
-                        }
-                    }
-                }
+              .ant-tabs-ink-bar {
+                width: 70px !important;
+                background: @m-blue0;
+                .rounded-corners(1px);
+              }
             }
+          }
         }
+      }
     }
+  }
 
-    .tableDatas {
-        margin-top: 26px;
-        padding: 0 24px;
-        overflow: hidden;
+  .tableDatas {
+    margin-top: 26px;
+    padding: 0 24px;
+    overflow: hidden;
 
-        .dialogTable {
-            width: 100%;
-            overflow: overlay;
-        }
+    .dialogTable {
+      width: 100%;
+      overflow: overlay;
     }
+  }
 
-    .ant-form.inlineForm {
-        margin-top: 20px;
-        padding: 0 24px;
-    }
+  .ant-form.inlineForm {
+    margin-top: 20px;
+    padding: 0 24px;
+  }
 }
 </style>

+ 14 - 1
src/views/hedgeditem/exposure/components/futures/index.vue

@@ -3,13 +3,24 @@
     <mtp-table-scroll>
         <template #default="{ scroll }">
             <a-table :columns="columns" class="srcollYTable" :pagination="false" :rowKey="(record, index) => index"
-                :data-source="tableList" :scroll="scroll"></a-table>
+                :data-source="tableList" :scroll="scroll">
+                <!-- 套期工具 -->
+                <template #ordertype="{ text }">
+                    <span>{{ getOrderTypeName(text) }}</span>
+                </template>
+                <!-- 方向 -->
+                <template #buyorsell="{ text }">
+                    <span>{{ getBuyOrSellName(text) }}</span>
+                </template>
+            </a-table>
         </template>
     </mtp-table-scroll>
 </template>
 
 <script lang="ts">
 import { PropType, watch } from 'vue'
+import { getOrderTypeName } from '@/@next/constants/enum/orderType'
+import { getBuyOrSellName } from '@/common/constants/enumsName'
 import { queryTableList, defineComponent, handleComposeTable } from '@/common/export/commonTable';
 import { Ermcp2AreaExposureRsp, PatradeLinkDetailReq, PatradeLinkDetailRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { queryPatradeLinkDetail } from '@/services/go/ermcp/hedgedItem'
@@ -53,6 +64,8 @@ export default defineComponent({
             ...composeTable,
             loading,
             tableList,
+            getBuyOrSellName,
+            getOrderTypeName,
         }
     }
 })

+ 8 - 1
src/views/hedgeditem/exposure/components/position/index.vue

@@ -3,13 +3,19 @@
     <mtp-table-scroll>
         <template #default="{ scroll }">
             <a-table :columns="columns" class="srcollYTable" :pagination="false" :rowKey="(record, index) => index"
-                :data-source="tableList" :scroll="scroll"></a-table>
+                :data-source="tableList" :scroll="scroll">
+                <!-- 套期工具 -->
+                <template #ordertype="{ text }">
+                    <span>{{ getOrderTypeName(text) }}</span>
+                </template>
+            </a-table>
         </template>
     </mtp-table-scroll>
 </template>
 
 <script lang="ts">
 import { PropType, watch } from 'vue'
+import { getOrderTypeName } from '@/@next/constants/enum/orderType'
 import { queryTableList, defineComponent, handleComposeTable } from '@/common/export/commonTable'
 import { Ermcp2AreaExposureRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { ErmcpExposurePostion } from '@/services/go/ermcp/exposure/interface'
@@ -49,6 +55,7 @@ export default defineComponent({
             ...composeTable,
             loading,
             tableList,
+            getOrderTypeName,
         }
     }
 })

+ 0 - 2
src/views/hedgeditem/futures/finish/index.vue

@@ -1,2 +0,0 @@
-<template>
-</template>

+ 2 - 1
src/views/hedgeditem/futures/in/components/bind/index.vue

@@ -131,7 +131,8 @@ export default defineComponent({
 
         .dialogTable {
             width: 100%;
-            overflow-x: auto;
+            max-height: 230px;
+            overflow-x: auto !important;
         }
     }
 

+ 0 - 49
src/views/hedgeditem/futures/out/index.vue

@@ -1,49 +0,0 @@
-<template>
-    <!-- 套期交易-期货成交关联-外部未成交单 -->
-    <mtp-table-scroll>
-        <template #default="{ scroll }">
-            <a-table :columns="columns" class="srcollYTable" :pagination="false" :expandedRowKeys="expandedRowKeys"
-                :customRow="Rowclick" :rowKey="(record, index) => index" :data-source="tableList" :scroll="scroll">
-            </a-table>
-        </template>
-    </mtp-table-scroll>
-    <mtp-tab-component class="table-detail" :options="{ selectedRow }" />
-    <component :is="componentId" v-if="componentId" v-bind="{ selectedRow }" @cancel="closeComponent"></component>
-</template>
-
-<script lang="ts">
-import { queryTableList, MtpTableButton, defineComponent, handleComposeTable } from '@/common/export/commonTable'
-import { Ermcp2HedgedItemRsp } from '@/services/go/ermcp/hedgedItem/interface'
-import { queryErmcp2HedgedItem } from '@/services/go/ermcp/hedgedItem'
-import MtpTableScroll from '@/common/components/tableScroll/index.vue'
-import MtpTabComponent from '@/@next/components/base/tab-component/index.vue'
-
-export default defineComponent({
-    components: {
-        MtpTabComponent,
-        MtpTableButton,
-        MtpTableScroll,
-    },
-    setup() {
-        const { loading, tableList, queryTable } = queryTableList<Ermcp2HedgedItemRsp>(true, 2); // 表格列表数据
-
-        const queryFn = () => queryTable(queryErmcp2HedgedItem, { hedgeditemstatus: 3 }).then((res) => {
-            if (res.length) {
-                composeTable.selectedRow.value = res[0];
-            }
-        })
-
-        // 表格通用逻辑
-        const composeTable = handleComposeTable<Ermcp2HedgedItemRsp>({
-            queryFn,
-            tableName: 'table_pcweb_hedgeditem_exposure',
-        })
-
-        return {
-            ...composeTable,
-            loading,
-            tableList,
-        }
-    }
-})
-</script>

+ 2 - 0
src/views/hedgeditem/spot/contract/components/bind/form.ts

@@ -3,6 +3,7 @@ import { v4 } from 'uuid'
 import Long from 'long'
 import { message } from 'ant-design-vue'
 import { queryTableList, handleComposeTable } from '@/common/export/commonTable'
+import { PriceType } from '@/@next/constants/enum/priceType'
 import { Ermcp8EnableHedgeditemReq, Ermcp8EnableHedgeditemRsp, UnLinkSpotContractRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { queryErmcp8EnableHedgeditem } from '@/services/go/ermcp/hedgedItem'
 import { ContractRelatedHedgedItemRsp } from '@/services/proto/hedgedItem/interface'
@@ -28,6 +29,7 @@ export function useForm(selectedRow: UnLinkSpotContractRsp) {
     // 自定义表格选择项
     const rowSelection = computed(() => ({
         columnTitle: '选择',
+        type: selectedRow.pricetype === PriceType.Fixed ? 'checkbox' : 'radio',
         selectedRowKeys: selectedRowKeys.value,
         onChange: (keys: number[]) => {
             selectedRowKeys.value = keys;

+ 4 - 3
src/views/hedgeditem/spot/contract/components/bind/index.vue

@@ -8,7 +8,7 @@
                 <a-row :gutter="24">
                     <a-col :span="12">
                         <a-form-item label="合同编号">
-                            <span class="white">{{ selectedRow.contractno }}</span>
+                            <span class="white">{{ formatValue(selectedRow.contractno) }}</span>
                         </a-form-item>
                     </a-col>
                     <a-col :span="12">
@@ -79,8 +79,8 @@
 <script lang="ts">
 import { defineComponent, PropType } from 'vue'
 import { _closeModal } from '@/common/setup/modal/modal'
+import { getPriceTypeName } from '@/@next/constants/enum/priceType'
 import { formatValue } from '@/common/methods'
-import { getPriceTypeName } from '@/common/constants/enumsName'
 import { UnLinkSpotContractRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { getHedgedTypeName } from '@/@next/constants/enum/hedgedType'
 import { useForm } from './form'
@@ -130,7 +130,8 @@ export default defineComponent({
 
         .dialogTable {
             width: 100%;
-            overflow-x: auto;
+            max-height: 230px;
+            overflow-x: auto !important;
         }
     }
 

+ 6 - 5
src/views/hedgeditem/spot/contract/index.vue

@@ -12,7 +12,7 @@
                 </template>
                 <!-- 合同类型 -->
                 <template #contracttype="{ text }">
-                    <span>{{ getContractTypeName(text) }}</span>
+                    <span>{{ getSpotContractTypeName(text) }}</span>
                 </template>
                 <!-- 定价类型 -->
                 <template #pricetype="{ text }">
@@ -31,7 +31,8 @@ import { queryTableList, contextMenu, defineComponent, MtpTableButton, defineAsy
 import { UnLinkSpotContractReq, UnLinkSpotContractRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { queryUnLinkSpotContract } from '@/services/go/ermcp/hedgedItem'
 import { useMenu } from '@/@next/hooks/common'
-import { getPriceTypeName, getContractTypeName } from '@/common/constants/enumsName';
+import { getPriceTypeName } from '@/@next/constants/enum/priceType'
+import { SpotContractType, getSpotContractTypeName } from '@/@next/constants/enum/spotContractType'
 import { getUserId } from '@/services/bus/user'
 import MtpTableScroll from '@/common/components/tableScroll/index.vue'
 import Filter from './components/filter/index.vue';
@@ -57,12 +58,12 @@ export default defineComponent({
             switch (route.name) {
                 // 采购合同
                 case 'hedgeditem_spot_purchase': {
-                    param.contracttype = 1;
+                    param.contracttype = SpotContractType.Buy;
                     break;
                 }
                 // 销售合同
                 case 'hedgeditem_spot_sell': {
-                    param.contracttype = -1;
+                    param.contracttype = SpotContractType.Sell;
                     break;
                 }
             }
@@ -80,7 +81,7 @@ export default defineComponent({
             loading,
             tableList,
             auth,
-            getContractTypeName,
+            getSpotContractTypeName,
             getPriceTypeName,
         }
     }

+ 1 - 1
src/views/hedgeditem/spot/plan/components/bind/form.ts

@@ -65,7 +65,7 @@ export function useForm(selectedRow: UnLinkErmcpHedgePlanRsp) {
                     result.push(hedgedItemRelatedPlan({
                         HedgedItemID: Long.fromString(e.hedgeditemid),
                         RelatedHedgePlanInfos: {
-                            HedgePlanID: hedgeplanid,
+                            HedgePlanID: Long.fromString(hedgeplanid),
                             OriAvgPrice: oriAvgPrice
                         },
                         ClientTicket: v4(),

+ 2 - 1
src/views/hedgeditem/spot/plan/components/bind/index.vue

@@ -117,7 +117,8 @@ export default defineComponent({
 
         .dialogTable {
             width: 100%;
-            overflow-x: auto;
+            max-height: 230px;
+            overflow-x: auto !important;
         }
     }
 

+ 12 - 0
src/views/hedgeditem/spot/plan/index.vue

@@ -10,6 +10,14 @@
                 <template #expandedRowRender="{ record }">
                     <mtp-table-button class="btn-list-sticky" :buttons="auth" :record="record" @click="openComponent" />
                 </template>
+                <!-- 类型 -->
+                <template #contracttype="{ text }">
+                    <a>{{ getPlanContractType(text) }}</a>
+                </template>
+                <!-- 状态 -->
+                <template #hedgeplanstatus="{ text }">
+                    <a>{{ getPlanStatusName(text) }}</a>
+                </template>
             </a-table>
         </template>
     </mtp-table-scroll>
@@ -22,6 +30,8 @@
 import { queryTableList, contextMenu, defineComponent, MtpTableButton, defineAsyncComponent, handleComposeTable } from '@/common/export/commonTable'
 import { UnLinkErmcpHedgePlanReq, UnLinkErmcpHedgePlanRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { queryUnLinkErmcpHedgePlan } from '@/services/go/ermcp/hedgedItem'
+import { getPlanStatusName } from '@/views/business/plan/setup'
+import { getPlanContractType } from '@/views/business/plan/setup'
 import { useMenu } from '@/@next/hooks/common'
 import { getAreaUserId } from '@/services/bus/user'
 import MtpTableScroll from '@/common/components/tableScroll/index.vue'
@@ -58,6 +68,8 @@ export default defineComponent({
             loading,
             tableList,
             auth,
+            getPlanStatusName,
+            getPlanContractType,
         }
     }
 })

+ 1 - 1
src/views/hedgeditem/trade/components/add/form.ts

@@ -33,7 +33,7 @@ export function useForm() {
         //PlanStartDate: [{ required: true, message: '请选择开始时间' }],
         //PlanEndDate: [{ required: true, message: '请选择结束时间' }],
         HedgedType: [{ required: true, type: 'number', message: '请选择套期类型' }],
-        TradeUserID: [{ required: true, type: 'number', message: '请选择交易主体' }],
+        TradeUserID: [{ required: true, type: 'number', message: '请选择套期主体' }],
     }
 
     // 禁选开始日期

+ 16 - 3
src/views/hedgeditem/trade/components/futures/index.vue

@@ -3,17 +3,28 @@
     <mtp-table-scroll>
         <template #default="{ scroll }">
             <a-table :columns="columns" class="srcollYTable" :pagination="false" :rowKey="(record, index) => index"
-                :data-source="tableList" :scroll="scroll"></a-table>
+                :data-source="tableList" :scroll="scroll">
+                <!-- 套期工具 -->
+                <template #ordertype="{ text }">
+                    <span>{{ getOrderTypeName(text) }}</span>
+                </template>
+                <!-- 方向 -->
+                <template #buyorsell="{ text }">
+                    <span>{{ getBuyOrSellName(text) }}</span>
+                </template>
+            </a-table>
         </template>
     </mtp-table-scroll>
 </template>
 
 <script lang="ts">
 import { PropType, watch } from 'vue'
-import { queryTableList, defineComponent, handleComposeTable } from '@/common/export/commonTable';
+import { getOrderTypeName } from '@/@next/constants/enum/orderType'
+import { getBuyOrSellName } from '@/common/constants/enumsName'
+import { queryTableList, defineComponent, handleComposeTable } from '@/common/export/commonTable'
 import { Ermcp2HedgedItemRsp, ERMCPPatradeLinkDetailRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { queryERMCPPatradeLinkDetail } from '@/services/go/ermcp/hedgedItem'
-import MtpTableScroll from '@/common/components/tableScroll/index.vue';
+import MtpTableScroll from '@/common/components/tableScroll/index.vue'
 
 export default defineComponent({
     components: {
@@ -48,6 +59,8 @@ export default defineComponent({
             ...composeTable,
             loading,
             tableList,
+            getBuyOrSellName,
+            getOrderTypeName,
         }
     }
 })

+ 8 - 1
src/views/hedgeditem/trade/components/position/index.vue

@@ -3,13 +3,19 @@
     <mtp-table-scroll>
         <template #default="{ scroll }">
             <a-table :columns="columns" class="srcollYTable" :pagination="false" :rowKey="(record, index) => index"
-                :data-source="tableList" :scroll="scroll"></a-table>
+                :data-source="tableList" :scroll="scroll">
+                <!-- 套期工具 -->
+                <template #ordertype="{ text }">
+                    <span>{{ getOrderTypeName(text) }}</span>
+                </template>
+            </a-table>
         </template>
     </mtp-table-scroll>
 </template>
 
 <script lang="ts">
 import { PropType, watch } from 'vue'
+import { getOrderTypeName } from '@/@next/constants/enum/orderType'
 import { queryTableList, defineComponent, handleComposeTable } from '@/common/export/commonTable';
 import { ERMCPJRLinkPosRsp, Ermcp2HedgedItemRsp } from '@/services/go/ermcp/hedgedItem/interface'
 import { queryERMCPJRLinkPos } from '@/services/go/ermcp/hedgedItem'
@@ -48,6 +54,7 @@ export default defineComponent({
             ...composeTable,
             loading,
             tableList,
+            getOrderTypeName,
         }
     }
 })

+ 36 - 26
src/views/market/futures/compoments/futures-trade/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 期货交易、套保交易 -->
-  <Drawer class="top dialog-trade" :title="(isSpotContract | isHedgePlan) ? '套保交易' : '期货交易'" placement="right"
+  <Drawer class="top dialog-trade" :title="(isSpotContract || isHedgePlan) ? '套保交易' : '期货交易'" placement="right"
     :visible="visible" @cancel="cancel">
     <div class="futures_trade">
       <div class="futures_trade__left">
@@ -123,6 +123,7 @@ import { queryErmcp3ContractMiddleGoodsCfg } from '@/services/go/ermcp/spot-cont
 import { QueryErmcp3ContractMiddleGoodsCfgRsp } from '@/services/go/ermcp/spot-contract/interface';
 import { queryRelatedTaAccount } from '@/services/go/TaAccount';
 import { QueryRelatedTaAccountRsp } from "@/services/go/TaAccount/interface";
+import { Ermcp2HedgedItemRsp } from '@/services/go/ermcp/hedgedItem/interface'
 
 export default defineComponent({
   emits: ['cancel', 'update'],
@@ -130,13 +131,13 @@ export default defineComponent({
   components: { Des, Drawer, PlusOutlined, MinusOutlined },
   props: {
     selectedRow: {
-      type: Object as PropType<GoodsQuote & QueryErmcpTradePositionRsp & Ermcp3SellBuyContract & Ermcp3HedgePlan & ErmcpRealExposureModel>,
+      type: Object as PropType<GoodsQuote & QueryErmcpTradePositionRsp & Ermcp3SellBuyContract & Ermcp3HedgePlan & ErmcpRealExposureModel & Ermcp2HedgedItemRsp>,
       default: () => ({}),
     },
   },
   setup(props, context) {
     const { visible, cancel } = _closeModal(context);
-    const { tradeuserid, goodsid, spotcontractid, hedgeplanid, deliverygoodsid, goodsgroupid, MiddleGoodsID } = props.selectedRow;
+    const { tradeuserid, goodsid, spotcontractid, hedgeplanid, deliverygoodsid, wrstandardid, goodsgroupid, MiddleGoodsID, hedgeditemid } = props.selectedRow;
     const { rules, formData } = handleForm();
     const formRef = ref();
     const loading = ref<boolean>(false);
@@ -159,6 +160,8 @@ export default defineComponent({
     const isHedgePlan = Boolean(hedgeplanid);
     // 是否实时敞口 (根据参数 MiddleGoodsID 来判断)
     const isExposure = Boolean(MiddleGoodsID);
+    // 是否套期项目 (根据参数 hedgeditemid 来判断)
+    const isHedgedItem = Boolean(hedgeditemid);
 
     // 现货合同
     if (isSpotContract) {
@@ -187,30 +190,32 @@ export default defineComponent({
         goodsList.value = [];
       })
     } else {
-      // 购销计划
-      if (isHedgePlan) {
-        GetDeliveryGoodsDetail(deliverygoodsid).then((res) => {
-          const ids: number[] = [];
-          const deliveryGoodsList = res.filter((e) => e.isvalid);
-
-          deliveryGoodsList.forEach((dg) => {
-            dg.wdlst.forEach((wd) => {
-              wd.mglst.forEach((mg) => {
-                mg.GPLST.forEach((gp) => {
-                  ids.push(...gp.GDLST.map((e) => e.goodsid));
+      // 购销计划、套期项目
+      if (isHedgePlan || isHedgedItem) {
+        if (deliverygoodsid) {
+          GetDeliveryGoodsDetail(deliverygoodsid).then((res) => {
+            const ids: number[] = [];
+            const deliveryGoodsList = res.filter((e) => e.isvalid);
+
+            deliveryGoodsList.forEach((dg) => {
+              const wd = dg.wdlst.find((e) => e.wrstandardid === wrstandardid);
+              if (wd) {
+                wd.mglst.forEach((mg) => {
+                  mg.GPLST.forEach((gp) => {
+                    ids.push(...gp.GDLST.map((e) => e.goodsid));
+                  })
                 })
-              })
+              }
             })
-          })
 
-          goodsList.value = goodsList.value.filter((e) => ids.includes(e.goodsid));
-          if (goodsList.value.length) {
-            formData.GoodsID = goodsList.value[0].goodsid;
-            goodsChange(formData.GoodsID); // 默认选中第一个
-          }
-        }).catch(() => {
-          goodsList.value = [];
-        })
+            const tmpList = goodsList.value.filter((e) => ids.includes(e.goodsid));
+            if (tmpList.length) {
+              goodsList.value = tmpList;
+              formData.GoodsID = tmpList[0].goodsid;
+              goodsChange(formData.GoodsID); // 默认选中第一个
+            }
+          })
+        }
       } else {
         const item = goodsList.value.find((e) => e.goodsid === goodsid);
         if (!item) {
@@ -401,7 +406,7 @@ export default defineComponent({
 
       // 判断是否现货合同交易
       if (isSpotContract) {
-        const { saleuserid, spotcontractid, bizsubjectid } = props.selectedRow;
+        const { saleuserid, bizsubjectid } = props.selectedRow;
         formData.HedgeFlag = 4;
         formData.SaleUserID = saleuserid;
         formData.SpotContractID = spotcontractid;
@@ -410,11 +415,16 @@ export default defineComponent({
 
       // 判断是否购销计划交易,任务 #3645
       if (isHedgePlan) {
-        const { hedgeplanid } = props.selectedRow;
         formData.HedgeFlag = 9;
         formData.SpotContractID = hedgeplanid;
       }
 
+      // 判断是否套期项目
+      if (isHedgedItem) {
+        formData.HedgeFlag = 13;
+        formData.SpotContractID = hedgeditemid;
+      }
+
       // 按钮提交类型
       switch (submitType) {
         case 'buy': {