li.shaoyi před 4 roky
rodič
revize
d115d641c8

+ 50 - 45
src/services/go/ermcp/report/interface.ts

@@ -294,6 +294,11 @@ export interface Ermcp3ArealSumPL {
     sumactualpl: number;//实际损益 = (ActualPL + FutureActualPL)
     sumpl: number;//汇总损益
     updatetime: string;//更新时间
+    totalspotqty: number;//现货头寸总量
+    totalfutureqty: number;//期货头寸总量
+    totalneedhedgeqty: number;//应套保总量
+    futurespotratio: number;//期现比例 = 期货头寸总量 / 现货头寸总量
+    hedgeexposurepl: number;//套保敞口损益
 }
 
 /**
@@ -314,51 +319,51 @@ export interface QryTaFutureDataReportReq {
  * 查询期货报表返回
  */
 export interface Ermcp3TaFutuReDataReport {
-    accountid       :number;//交易账户
-    accountname     :string;//交易账号名称
-    begindate       :string;//开始交易日
-    buyorsell       :number;//持仓方向
-    charge  :number;//手续费
-    closeavgprice   :number;//平仓均价
-    closepl :number;//平仓损益
-    currencyid      :number;//结算币种ID
-    cycletime       :string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
-//)【原值】
-    cycletype       :number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
-    enddate :string;//结束交易日
-    enumdicname     :string;//单位名称
-    floatpl :number;//浮动损益
-    goodscode       :string;//交易合约代码
-    goodsgroupid    :number;//交易品种
-    goodsgroupname  :string;//交易品种名称
-    goodsgroupspotqty       :number;//交易品种期末量 (= 期末持仓量  合约乘数)
-    goodsid :number;//交易合约
-    goodsname       :string;//交易合约名称
-    goodunitid      :number;//交易合约单位id
-    holdamount      :number;//期末持仓额
-    holdqty :number;//期末持仓量
-    lastholdamount  :number;//当前持仓额
-    lastprice       :number;//最新价
-    middlegoodsqty  :number;//套保品种期末量 (=交易品种期末量  期货品种折算系数)
-    openamount      :number;//期末开仓额
-    openavgprice    :number;//开仓均价
-    oriholdamount   :number;//期初持仓额
-    oriholdqty      :number;//期初持仓量
-    oriopenamount   :number;//期初开仓额
-    outergroupcode  :string;//交易品种代码
-    reckondate      :string;//日照时期(yyyyMMdd)
-    reckonholdamount        :number;//结算持仓额
-    reckonpl        :number;//结算损益
-    reckonpl2       :number;//结算逐笔盈亏
-    reckonprice     :number;//结算价
-    relateduserid   :number;//账户关联用户ID
-    todaycloseamount        :number;//今平仓额
-    todaycloseqty   :number;//今平仓量
-    todaygoodsgroupspotqty  :number;//交易品种变化量 (=(期末持仓量 - 期初持仓量) 合约乘数)
-    todaymiddlegoodsqty     :number;//套保品种变化量 (= 交易品种变化量期货品种折算系数)
-    todayopenamount :number;//今开仓额
-    todayopenqty    :number;//今开仓量
-    userid  :number;//账户所属用户ID
+    accountid: number;//交易账户
+    accountname: string;//交易账号名称
+    begindate: string;//开始交易日
+    buyorsell: number;//持仓方向
+    charge: number;//手续费
+    closeavgprice: number;//平仓均价
+    closepl: number;//平仓损益
+    currencyid: number;//结算币种ID
+    cycletime: string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+    //)【原值】
+    cycletype: number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    enddate: string;//结束交易日
+    enumdicname: string;//单位名称
+    floatpl: number;//浮动损益
+    goodscode: string;//交易合约代码
+    goodsgroupid: number;//交易品种
+    goodsgroupname: string;//交易品种名称
+    goodsgroupspotqty: number;//交易品种期末量 (= 期末持仓量  合约乘数)
+    goodsid: number;//交易合约
+    goodsname: string;//交易合约名称
+    goodunitid: number;//交易合约单位id
+    holdamount: number;//期末持仓额
+    holdqty: number;//期末持仓量
+    lastholdamount: number;//当前持仓额
+    lastprice: number;//最新价
+    middlegoodsqty: number;//套保品种期末量 (=交易品种期末量  期货品种折算系数)
+    openamount: number;//期末开仓额
+    openavgprice: number;//开仓均价
+    oriholdamount: number;//期初持仓额
+    oriholdqty: number;//期初持仓量
+    oriopenamount: number;//期初开仓额
+    outergroupcode: string;//交易品种代码
+    reckondate: string;//日照时期(yyyyMMdd)
+    reckonholdamount: number;//结算持仓额
+    reckonpl: number;//结算损益
+    reckonpl2: number;//结算逐笔盈亏
+    reckonprice: number;//结算价
+    relateduserid: number;//账户关联用户ID
+    todaycloseamount: number;//今平仓额
+    todaycloseqty: number;//今平仓量
+    todaygoodsgroupspotqty: number;//交易品种变化量 (=(期末持仓量 - 期初持仓量) 合约乘数)
+    todaymiddlegoodsqty: number;//套保品种变化量 (= 交易品种变化量期货品种折算系数)
+    todayopenamount: number;//今开仓额
+    todayopenqty: number;//今开仓量
+    userid: number;//账户所属用户ID
 
 }
 

+ 17 - 2
src/views/report/spot-report/list/spot_report/index.vue

@@ -86,6 +86,7 @@ import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
 import { TabList } from '@/common/components/description/interface';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getTableButton } from '@/common/setup/table/button';
+import { columns } from './setup';
 
 export default defineComponent({
     name: 'spot-report',
@@ -118,7 +119,6 @@ export default defineComponent({
         const {
             visible,
             closeDrawer, // 控制 drawer 组件是否显示
-            columns,
             updateColumn, //  表头数据
             columnsDetail,
             registerColumnDetail,
@@ -172,7 +172,22 @@ export default defineComponent({
             queryTable(QryAreaSpotplReport, obj);
         }
 
-        return { loading, tableList, visible, closeDrawer, columns, updateColumn, search, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab };
+        return {
+            loading,
+            tableList,
+            visible,
+            closeDrawer,
+            columns,
+            updateColumn,
+            search,
+            columnsDetail,
+            detailTableList,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            tabList,
+            changeTab,
+        };
     },
 });
 </script>

+ 198 - 0
src/views/report/spot-report/list/spot_report/setup.ts

@@ -0,0 +1,198 @@
+import { ColumnType } from '@/common/methods/table';
+
+/**
+ * 表头对应字段
+ */
+export const columns: ColumnType[] = [
+    {
+        "key": "0th",
+        "dataIndex": "accountname",
+        "title": "交易用户",
+        "align": "center",
+        "slots": {
+            "customRender": "accountname"
+        },
+        "width": 120
+    },
+    {
+        "key": "1th",
+        "dataIndex": "currencyname",
+        "title": "结算币种",
+        "align": "center",
+        "slots": {
+            "customRender": "currencyname"
+        },
+        "width": 120
+    },
+    {
+        "key": "2th",
+        "dataIndex": "deliverygoodsname",
+        "title": "现货品种",
+        "align": "center",
+        "slots": {
+            "customRender": "deliverygoodsname"
+        },
+        "width": 120,
+        "filteredValue": null
+    },
+    {
+        "key": "5th",
+        "dataIndex": "oriqty",
+        "title": "期初量",
+        "align": "center",
+        "slots": {
+            "customRender": "oriqty"
+        },
+        "width": 120
+    },
+    {
+        "key": "6th",
+        "dataIndex": "oriamount",
+        "title": "期初额",
+        "align": "center",
+        "slots": {
+            "customRender": "oriamount"
+        },
+        "width": 120
+    },
+    {
+        "key": "7th",
+        "dataIndex": "oriaverageprice",
+        "title": "期初均价",
+        "align": "center",
+        "slots": {
+            "customRender": "oriaverageprice"
+        },
+        "width": 120
+    },
+    {
+        "key": "8th",
+        "dataIndex": "todaybuyqty",
+        "title": "今采购量",
+        "align": "center",
+        "slots": {
+            "customRender": "todaybuyqty"
+        },
+        "width": 120
+    },
+    {
+        "key": "9th",
+        "dataIndex": "todaybuyamount",
+        "title": "今采购额",
+        "align": "center",
+        "slots": {
+            "customRender": "todaybuyamount"
+        },
+        "width": 120
+    },
+    {
+        "key": "10th",
+        "dataIndex": "todaybuyaverageprice",
+        "title": "采购均价",
+        "align": "center",
+        "slots": {
+            "customRender": "todaybuyaverageprice"
+        },
+        "width": 120
+    },
+    {
+        "key": "11th",
+        "dataIndex": "todaysellqty",
+        "title": "今销售量",
+        "align": "center",
+        "slots": {
+            "customRender": "todaysellqty"
+        },
+        "width": 120
+    },
+    {
+        "key": "12th",
+        "dataIndex": "todaysellamount",
+        "title": "今销售额",
+        "align": "center",
+        "slots": {
+            "customRender": "todaysellamount"
+        },
+        "width": 120
+    },
+    {
+        "key": "13th",
+        "dataIndex": "todaysellaverageprice",
+        "title": "销售均价",
+        "align": "center",
+        "slots": {
+            "customRender": "todaysellaverageprice"
+        },
+        "width": 120
+    },
+    {
+        "key": "14th",
+        "dataIndex": "curqty",
+        "title": "期末量",
+        "align": "center",
+        "slots": {
+            "customRender": "curqty"
+        },
+        "width": 120
+    },
+    {
+        "key": "15th",
+        "dataIndex": "curamount",
+        "title": "期末额",
+        "align": "center",
+        "slots": {
+            "customRender": "curamount"
+        },
+        "width": 120
+    },
+    {
+        "key": "16th",
+        "dataIndex": "curaverageprice",
+        "title": "期末均价",
+        "align": "center",
+        "slots": {
+            "customRender": "curaverageprice"
+        },
+        "width": 120
+    },
+    {
+        "key": "17th",
+        "dataIndex": "actualpl",
+        "title": "现货损益",
+        "align": "center",
+        "slots": {
+            "customRender": "actualpl"
+        },
+        "width": 120
+    },
+    {
+        "key": "18th",
+        "dataIndex": "curspotprice",
+        "title": "最新价",
+        "align": "center",
+        "slots": {
+            "customRender": "curspotprice"
+        },
+        "width": 120
+    },
+    {
+        "key": "19th",
+        "dataIndex": "curmarketvalue",
+        "title": "期末市值",
+        "align": "center",
+        "slots": {
+            "customRender": "curmarketvalue"
+        },
+        "width": 120
+    },
+    {
+        "key": "20th",
+        "dataIndex": "floatpl",
+        "title": "浮动损益",
+        "align": "center",
+        "slots": {
+            "customRender": "floatpl"
+        },
+        "width": 120
+    }
+];

+ 30 - 3
src/views/report/sum_pl_report/list/sum_pl_report/index.vue

@@ -2,7 +2,7 @@
     <!-- 汇总损益报表 -->
     <div class="table-detail-container table-height" :loading="loading">
         <Filter @update="search"></Filter>
-        <a-table :columns="columns" class="topOrderTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="Rowclick" rowKey="key" :data-source="tableList">
+        <a-table :columns="columns" class="topOrderTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="customRow" rowKey="key" :data-source="tableList">
             <!-- 出现浮点失真  强行处理-->
             <template #spotactualpl="{ record }">
                 <span>{{ record.spotactualpl.toFixed(2) }}</span>
@@ -58,6 +58,7 @@ import { qryAreaSumPL } from '@/services/go/ermcp/report';
 import { TabList } from '@/common/components/description/interface';
 import { EnumRouterName } from '@/common/constants/enumRouterName';
 import { getTableButton } from '@/common/setup/table/button';
+import { columns } from './setup';
 
 export default defineComponent({
     name: 'sum_pl_report',
@@ -67,6 +68,8 @@ export default defineComponent({
     },
     setup() {
         let cycletime = '';
+        // 周期类型
+        const cycletype = ref(0);
         // 表格列表数据
         const { loading, tableList, queryTable } = queryTableList<Ermcp3ArealSumPL>();
         // 获取列表数据
@@ -90,7 +93,6 @@ export default defineComponent({
         const {
             visible,
             closeDrawer, // 控制 drawer 组件是否显示
-            columns,
             updateColumn, //  表头数据
             columnsDetail,
             registerColumnDetail,
@@ -104,6 +106,15 @@ export default defineComponent({
         // 底部明细标签
         const tabList = getTableButton();
 
+        // 自定义表格事件
+        const customRow = (record: Ermcp3ArealSumPL, index: number) => {
+            // 日报表不显示“损益明细“标签页
+            if (cycletype.value === 0) {
+                return {};
+            }
+            return Rowclick(record, index);
+        };
+
         // 切换明细
         function changeTab(index: number, current: TabList) {
             const { code, lable } = current;
@@ -138,13 +149,29 @@ export default defineComponent({
         });
 
         function search(value: TypeAndTime) {
+            cycletype.value = value.cycletype;
             chaceSearchValue.value = value;
             cycletime = value.cycletime;
             const obj = Object.assign(value, { querytype: 1 });
             queryTable(qryAreaSumPL, obj);
         }
 
-        return { loading, tableList, visible, closeDrawer, columns, updateColumn, search, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab };
+        return {
+            loading,
+            tableList,
+            visible,
+            closeDrawer,
+            columns,
+            updateColumn,
+            search,
+            columnsDetail,
+            detailTableList,
+            expandedRowKeys,
+            selectedRow,
+            customRow,
+            tabList,
+            changeTab,
+        };
     },
 });
 </script>

+ 147 - 0
src/views/report/sum_pl_report/list/sum_pl_report/setup.ts

@@ -0,0 +1,147 @@
+import { ColumnType } from '@/common/methods/table';
+
+/**
+ * 表头对应字段
+ */
+export const columns: ColumnType[] = [
+    {
+        "key": "0th",
+        "dataIndex": "currencyname",
+        "title": "结算币种",
+        "align": "center",
+        "slots": {
+            "customRender": "currencyname"
+        },
+        "width": 120
+    },
+    {
+        "key": "1th",
+        "dataIndex": "accountname",
+        "title": "交易用户",
+        "align": "center",
+        "slots": {
+            "customRender": "accountname"
+        },
+        "width": 120
+    },
+    {
+        "key": "2th",
+        "dataIndex": "middlegoodsname",
+        "title": "套保品种",
+        "align": "center",
+        "slots": {
+            "customRender": "middlegoodsname"
+        },
+        "width": 120
+    },
+    {
+        "key": "3th",
+        "dataIndex": "enumdicname",
+        "title": "单位",
+        "align": "center",
+        "slots": {
+            "customRender": "enumdicname"
+        },
+        "width": 140
+    },
+    {
+        "key": "4th",
+        "dataIndex": "totalspotqty",
+        "title": "现货总量",
+        "align": "center",
+        "width": 120,
+        customRender: ({ text }: { text: number }) => {
+            return text.toFixed(2);
+        }
+    },
+    {
+        "key": "5th",
+        "dataIndex": "totalneedhedgeqty",
+        "title": "计划套保量",
+        "align": "center",
+        "width": 120,
+        customRender: ({ text }: { text: number }) => {
+            return text.toFixed(2);
+        }
+    },
+    {
+        "key": "6th",
+        "dataIndex": "totalfutureqty",
+        "title": "期货持仓量",
+        "align": "center",
+        "slots": {
+            "customRender": "totalfutureqty"
+        },
+        "width": 120
+    },
+    {
+        "key": "7th",
+        "dataIndex": "futurespotratio",
+        "title": "期现比例",
+        "align": "center",
+        "slots": {
+            "customRender": "futurespotratio"
+        },
+        "width": 120
+    },
+    {
+        "key": "8th",
+        "dataIndex": "spotactualpl",
+        "title": "现货损益",
+        "align": "center",
+        "slots": {
+            "customRender": "spotactualpl"
+        },
+        "width": 120
+    },
+    {
+        "key": "9th",
+        "dataIndex": "spotfloatpl",
+        "title": "现货浮动损益",
+        "align": "center",
+        "slots": {
+            "customRender": "spotfloatpl"
+        },
+        "width": 120
+    },
+    {
+        "key": "10th",
+        "dataIndex": "futureactualpl",
+        "title": "期货损益",
+        "align": "center",
+        "slots": {
+            "customRender": "futureactualpl"
+        },
+        "width": 120
+    },
+    {
+        "key": "11th",
+        "dataIndex": "futurefloatpl",
+        "title": "期货浮动损益",
+        "align": "center",
+        "slots": {
+            "customRender": "futurefloatpl"
+        },
+        "width": 120
+    },
+    {
+        "key": "12th",
+        "dataIndex": "sumpl",
+        "title": "总敞口损益",
+        "align": "center",
+        "slots": {
+            "customRender": "sumpl"
+        },
+        "width": 120
+    },
+    {
+        "key": "13th",
+        "dataIndex": "hedgeexposurepl",
+        "title": "套保敞口损益",
+        "align": "center",
+        "slots": {
+            "customRender": "hedgeexposurepl"
+        },
+        "width": 120
+    }
+];