li.shaoyi il y a 4 ans
Parent
commit
a1ee872034

+ 69 - 0
src/common/constants/enumsName.ts

@@ -1398,4 +1398,73 @@ export function gerWareHouseStatusName(status: number): string {
             break
     }
     return result
+}
+
+/**
+ * 关联记录 业务类型名称 | 投机套保标志
+ * @param status
+ */
+export function geHedgeFlagName(status: number): string {
+    switch (status) {
+        case 0:
+            return '无';
+        case 1:
+            return '投机';
+        case 2:
+            return '套保';
+        case 3:
+            return '套利';
+        case 4:
+            return '套期保值';
+        case 5:
+            return '单边';
+        case 6:
+            return '移仓';
+        case 7:
+            return '错单处理';
+        case 8:
+            return '跨期套利';
+        case 9:
+            return '套期保值';
+        case 10:
+            return '套利';
+        case 11:
+            return '换月';
+        case 12:
+            return '交割';
+        default:
+            return '--'
+    }
+}
+
+/**
+ * 关联记录 关联状态
+ * @param status
+ */
+export function geLinkStatusName(status: number): string {
+    switch (status) {
+        case 1:
+            return '成功';
+        case 2:
+            return '失败';
+        default:
+            return '--'
+    }
+}
+
+/**
+ * 关联记录 关联方式
+ * @param status
+ */
+export function geRelatedModeName(status: number): string {
+    switch (status) {
+        case 1:
+            return '自动关联';
+        case 2:
+            return '手动关联';
+        case 3:
+            return '解绑关联';
+        default:
+            return '--'
+    }
 }

+ 3 - 68
src/views/information/spot-contract/components/detail/index.vue

@@ -88,6 +88,7 @@ import { InOutTypeName } from '@/views/manage/inventory-review/setup';
 import { kxtypeName } from '@/views/manage/finance-review/setup';
 import { _closeModal } from '@/common/setup/modal/modal';
 import { formatValue } from '@/common/methods';
+import { columnsPaTradeLink } from './setup';
 
 export default defineComponent({
     name: 'spot-contract-detail',
@@ -178,74 +179,8 @@ export default defineComponent({
                     });
                     break;
                 case 9: //// 关联记录
-                    columns.value = [
-                        {
-                            title: '关联时间',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                            // customRender: ({ text, record }: { text: Number; record: Ermcp3SpotGoodsPrice }) => {
-                            //     return `${text + record.currencyname}/${record.gbenumdicname}`;
-                            // },
-                        },
-                        {
-                            title: '成交时间',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '业务类型',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '订单类型',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '套保品种',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '现货关联数量',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '关联方式',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '关联状态',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                        {
-                            title: '期货单号',
-                            dataIndex: 'spotgoodsprice',
-                            key: 'spotgoodsprice',
-                            align: 'center',
-                            width: 120,
-                        },
-                    ];
+                    columns.value.length = 0;
+                    columns.value.push(...columnsPaTradeLink);
                     queryResultLoadingAndInfo(QueryPaTradeLinkDetail, loading).then((res) => {
                         tableList.value = res;
                     });

+ 80 - 1
src/views/information/spot-contract/components/detail/setup.ts

@@ -1,3 +1,6 @@
+import { ColumnType } from '@/common/methods/table';
+import { Ermcp3PaTradeLinkDetailReqRsp } from '@/services/go/ermcp/patrade-link/interface';
+import { getChannelBuildName, getBuyOrSellTypeName, geHedgeFlagName, geLinkStatusName, geRelatedModeName } from '@/common/constants/enumsName'
 
 export const columnsPointPrice = [
     { title: '序号', dataIndex: 'index', key: 'index', align: 'center', },
@@ -55,4 +58,80 @@ export const columnsInWarehouse = [
     { title: '数量', dataIndex: 'applystatus', key: 'applystatus', align: 'center' },
 ];
 
-
+// 关联记录表头
+export const columnsPaTradeLink: ColumnType[] = [
+    {
+        title: '关联时间',
+        dataIndex: 'createtime',
+        key: 'createtime',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '成交时间',
+        dataIndex: 'tradetime',
+        key: 'tradetime',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '业务类型',
+        dataIndex: 'hedgeflag',
+        key: 'hedgeflag',
+        align: 'center',
+        customRender: ({ text }: { text: number }) => {
+            return geHedgeFlagName(text);
+        },
+    },
+    {
+        title: '订单类型',
+        dataIndex: 'buyorsell || channelbuildtype',
+        key: 'buyorsell',
+        align: 'center',
+        width: 120,
+        customRender: ({ record }: { record: Ermcp3PaTradeLinkDetailReqRsp }) => {
+            return getBuyOrSellTypeName(record.buyorsell) + getChannelBuildName(record.channelbuildtype);
+        },
+    },
+    {
+        title: '套保品种',
+        dataIndex: 'middlegoodsname',
+        key: 'middlegoodsname',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '现货关联数量',
+        dataIndex: 'relatedqty',
+        key: 'relatedqty',
+        align: 'center',
+        width: 120,
+    },
+    {
+        title: '关联方式',
+        dataIndex: 'relatedmode',
+        key: 'relatedmode',
+        align: 'center',
+        width: 120,
+        customRender: ({ text }: { text: number }) => {
+            return geRelatedModeName(text);
+        },
+    },
+    {
+        title: '关联状态',
+        dataIndex: 'linkstatus',
+        key: 'linkstatus',
+        align: 'center',
+        width: 120,
+        customRender: ({ text }: { text: number }) => {
+            return geLinkStatusName(text);
+        },
+    },
+    {
+        title: '期货单号',
+        dataIndex: 'tradeid',
+        key: 'tradeid',
+        align: 'center',
+        width: 120,
+    },
+];