Bläddra i källkod

Merge branch 'master' of http://47.101.159.18:3000/Muchinfo/MTP2.0_WEB

marymelisa 4 år sedan
förälder
incheckning
ea9165b7d8

+ 1 - 2
src/common/methods/table/interface.ts

@@ -15,6 +15,7 @@ export interface ColumnType {
     render?: Function;
 }
 export interface TableKey {
+    table_pcweb_aggregate_profit_and_loss: "string; // 报表-库存报表"
     table_pcweb_application_record: "string; // 库存查询-申请记录"
     table_pcweb_business_aduit_dj: "string; // 业务审核-点价"
     table_pcweb_business_aduit_js: "string; // 业务审核-交收"
@@ -36,11 +37,9 @@ export interface TableKey {
     table_pcweb_purchase_all: "string; // 采购_全部"
     table_pcweb_purchase_pointprice: "string; // 采购_待点价"
     table_pcweb_purchase_settle: "string; // 采购_履约交收"
-    table_pcweb_report_expose: "string; // 报表-敞口报表"
     table_pcweb_report_fincial_invoice_day: "string; // 报表-财务报表-发票-日报表"
     table_pcweb_report_fincial_month: "string; // 报表-财务报表-月报表"
     table_pcweb_report_fincial_payment_day: "string; // 报表-财务报表-款项-日报表"
-    table_pcweb_report_spot: "string; // 报表-现货报表"
     table_pcweb_report_spot_detail_day: "string; // 现货日报表-详情"
     table_pcweb_report_spot_detail_month: "string; // 现货月报表-详情"
     table_pcweb_sales_all: "string; // 销售_全部"

+ 6 - 2
src/common/setup/user/index.ts

@@ -13,9 +13,13 @@ import { Ref, ref } from "vue";
  */
 export function handlerManagerList(loading: Ref<boolean>, type: 1 | 2 | 3, isFilter = false) {
     const tableList = ref<ErmcpLoginUserEx[]>([]);
-    function queryTable() {
+    function queryTable(): Promise<ErmcpLoginUserEx[]> {
         return queryResultLoadingAndInfo(QueryAccMgrLoginUser, loading, type)
-            .then(res => tableList.value = isFilter ? res.filter((e: ErmcpLoginUserEx) => e.accountstatus === 4) : res)
+            .then(res => {
+                const result = isFilter ? res.filter((e: ErmcpLoginUserEx) => e.accountstatus === 4) : res
+                tableList.value = result
+                return result
+            })
     }
     /**
      * 根据code 查找业务员、跟单员对应的名字

+ 38 - 0
src/router/index.ts

@@ -591,6 +591,44 @@ const routes: Array<RouteRecordRaw> = [
                     },
                 ]
             },
+            {
+                path: '/sum_pl_report',
+                name: 'sum_pl_report',
+                component: Main,
+                meta: {
+                    requireAuth: true,
+                },
+                redirect: { name: 'sum_pl_report_sum_pl' },
+                children: [
+                    {
+                        path: '/sum_pl_report/sum_pl',
+                        name: 'sum_pl_report_sum_pl',
+                        component: () => import('@/views/report/sum_pl_report/list/sum_pl_report/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                ]
+            },
+            {
+                path: '/future_report',
+                name: 'future_report',
+                component: Main,
+                meta: {
+                    requireAuth: true,
+                },
+                redirect: { name: 'future_report_future' },
+                children: [
+                    {
+                        path: '/future_report/future',
+                        name: 'future_report_future',
+                        component: () => import('@/views/report/future_report/list/future_report/index.vue'),
+                        meta: {
+                            requireAuth: true,
+                        },
+                    },
+                ]
+            },
         ],
     },
     {

+ 41 - 7
src/services/go/ermcp/report/index.ts

@@ -3,8 +3,14 @@ import { getUserId } from "@/services/bus/account";
 import { commonSearch_go } from "@/services/go";
 import {
     AreaExpourseReportReq,
-    AreaSpotplReportReq, AreaStockReportReq, Ermcp3AreaSpotPLReport, Ermcp3AreaStockReport, Ermcp3ExpourseReport,
-    Ermcp3FinanceReport, FinanceReportReq
+    AreaSpotplReportReq,
+    AreaStockReportReq,
+    Ermcp3ArealSumPL,
+    Ermcp3AreaSpotPLReport,
+    Ermcp3AreaStockReport,
+    Ermcp3ExpourseReport,
+    Ermcp3FinanceReport, Ermcp3TaFutuReDataReport,
+    FinanceReportReq, QryAreaSumPLReq, QryTaFutureDataReportReq
 } from "@/services/go/ermcp/report/interface";
 
 /**
@@ -13,7 +19,9 @@ import {
  * @param req.querytype  查询类型 1-日报表 2-周期报表 3-日报表(指定时间段[开始交易日,结束交易日]) 4-日报表明细
  */
 export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp3ExpourseReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaExpourseReport', req).catch((err) => {
         throw new Error(`查询敞口报表: ${err.message}`);
     });
@@ -23,7 +31,9 @@ export function qryAreaExpourseReport(req: AreaExpourseReportReq): Promise<Ermcp
  *  查询现货报表 /Ermcp3/QryAreaSpotplReport
  */
 export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3AreaSpotPLReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaSpotplReport', req).catch((err) => {
         throw new Error(`查询现货报表: ${err.message}`);
     });
@@ -34,7 +44,9 @@ export function qryAreaSpotplReport(req: AreaSpotplReportReq): Promise<Ermcp3Are
  * @param req
  */
 export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaStockReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaStockReport', req).catch((err) => {
         throw new Error(`查询库存报表: ${err.message}`);
     });
@@ -45,8 +57,30 @@ export function qryAreaStockReport(req: AreaStockReportReq): Promise<Ermcp3AreaS
  * @param req
  */
 export function qryFinanceReport(req: FinanceReportReq): Promise<Ermcp3FinanceReport[]> {
-    req.userid = getUserId()
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryFinanceReport', req).catch((err) => {
         throw new Error(`查询财务报表: ${err.message}`);
     });
-}
+}
+
+/**
+ * 查询汇总损益表 /Ermcp3/QryAreaSumPL
+ */
+export function qryAreaSumPL(req: QryAreaSumPLReq): Promise<Ermcp3ArealSumPL[]> {
+    req.userid = getUserId()
+    return commonSearch_go('/Ermcp3/QryAreaSumPL', req).catch((err) => {
+        throw new Error(`查询汇总损益表: ${err.message}`);
+    });
+}
+
+/**
+ * 查询期货报表 /Ermcp3/QryTaFutureDataReport
+ */
+export function qryTaFutureDataReport(req: QryTaFutureDataReportReq): Promise<Ermcp3TaFutuReDataReport[]> {
+    req.userid = getUserId()
+    return commonSearch_go('/Ermcp3/QryTaFutureDataReport', req).catch((err) => {
+        throw new Error(`查询期货报表: ${err.message}`);
+    });
+}

+ 99 - 0
src/services/go/ermcp/report/interface.ts

@@ -256,5 +256,104 @@ export interface Ermcp3FinanceReport {
     wrstandardname: string;//品类名称
 }
 
+/**
+ * 查询汇总损益表请求
+ */
+export interface QryAreaSumPLReq {
+    userid: number // 用户ID
+    querytype: number // 查询类型 1-报表 2-报表明细
+    cycletype: number // 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+    cycletime: string // 周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+    currencyid?: number // 币种id(明细必填)
+}
 
+/**
+ * 查询汇总损益表返回
+ */
+export interface Ermcp3ArealSumPL {
+    accountname	:string;//机构名称
+    areauserid	:number;//所属机构\交易用户ID
+    begindate	:string;//开始交易日
+    currencyid	:number;//结算币种ID
+    currencyname	:string;//币种名称
+    cycletime	:string;//周期时间 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYIW) 全(number;
+//)【原值】
+    cycletype	:number;//周期类型 - 1:月 2:季 3:年 4:周 5:全报表【原值】
+    enddate	:string;//结束交易日
+    enumdicname	:string;//单位名称(套保品种)
+    futureactualpl	:number;//期货损益
+    futurefloatpl	:number;//期货浮动损益
+    goodsunitid	:number;//套保品种单位id
+    middlegoodscode	:string;//套保品种代码
+    middlegoodsid	:number;//套保品种ID(SEQ_ERMS_MIDDLEGOODS)
+    middlegoodsname	:string;//套保品种名称
+    reckondate	:string;//日照时期(yyyyMMdd)
+    spotactualpl	:number;//现货损益
+    spotfloatpl	:number;//现货浮动损益
+    sumactualpl	:number;//实际损益 = (ActualPL + FutureActualPL)
+    sumpl	:number;//汇总损益
+    updatetime	:string;//更新时间
+}
 
+/**
+ * 查询期货报表请求
+ */
+export interface QryTaFutureDataReportReq{
+    userid: number  //  用户ID
+    querytype: number // 查询类型 1-报表 2-报表明细
+    cycletype: number // 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
+    cycletime: string // 周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+    currencyid?: number // 币种id(查明细必填)
+    goodsgroupid?: number // 品种id(查明细必填)
+    goodsid?: number // 商品id(查明细必填)
+    buyorsell?: number // 买卖方向(查明细必填)
+}
+
+/**
+ * 查询期货报表返回
+ */
+export interface Ermcp3TaFutuReDataReport{
+    accountid	:number;//交易账户
+    accountname	:string;//交易账号名称
+    begindate	:string;//开始交易日
+    buyorsell	:number;//持仓方向
+    charge	: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;//期末开仓额
+    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
+}

+ 38 - 3
src/views/report/components/filter/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <!-- 过滤客户资料表格 -->
+  <!-- 报表通用过滤 -->
   <div class="filterTable">
     <div class="filter-custom-table">
       <a-select label-in-value
@@ -24,6 +24,17 @@
                        class="commonDatePicker"
                        :format="dateFormat" />
       </a-space>
+      <a-select label-in-value
+                class="conditionSelect"
+                style="width: 120px"
+                v-model:value="selectedUser"
+                @change="userChange"
+                placeholder="请选择报表类型">
+        <a-select-option v-for="item in userList"
+                         :key="item.value">
+          {{item.lable}}
+        </a-select-option>
+      </a-select>
       <slot></slot>
     </div>
   </div>
@@ -31,22 +42,46 @@
 
 <script lang="ts">
 import FilterOption from '@/common/components/filter/index.vue';
-import { defineComponent } from 'vue';
+import { initData } from '@/common/methods';
+import { SelectOption } from '@/common/setup/filter/interface';
+import { handlerManagerList } from '@/common/setup/user';
+import { getUserId } from '@/services/bus/account';
+import { getUserName } from '@/services/bus/user';
+import { defineComponent, ref } from 'vue';
 import { handleReprotType } from '../../setup';
 
 export default defineComponent({
     name: 'report-common-filter-table',
     components: { FilterOption },
     setup(props, context) {
-        const { selectedReportType, reportType, reportTypeChange, isMonth, timeChange, dateFormat, time } = handleReprotType(context);
+        const { selectedReportType, reportType, reportTypeChange, isMonth, timeChange, dateFormat, time, selectedUser, userChange } = handleReprotType(context);
+        const loading = ref<boolean>(false);
+        // 交易用户
+        const userList = ref<SelectOption[]>([]);
+        const { queryTable } = handlerManagerList(loading, 2);
+        initData(() => {
+            queryTable().then((res) => {
+                userList.value.length = 0;
+                userList.value.push({ value: getUserId(), lable: getUserName() });
+                res.forEach((e) => {
+                    e.userlist.forEach((el) => {
+                        // userList.value.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
+                        userList.value.push({ value: el.loginid, lable: el.loginname });
+                    });
+                });
+            });
+        });
         return {
             reportType,
             selectedReportType,
             dateFormat,
             timeChange,
             reportTypeChange,
+            selectedUser,
+            userChange,
             isMonth,
             time,
+            userList,
         };
     },
 });

+ 89 - 0
src/views/report/future_report/components/filterTable/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <Filter @update="update">
+    <!-- <FilterOption :selectList="selectList"
+                    :inputList="[]"
+                    :fixedBtnList="fixedBtnList" /> -->
+  </Filter>
+</template>
+
+<script lang="ts">
+import FilterOption from '@/common/components/filter/index.vue';
+import { defineComponent } from 'vue';
+import { ref } from 'vue';
+import { handleFilter, SelectList } from '@/common/setup/filter';
+import { handlerManagerList } from '@/common/setup/user';
+import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
+import { SelectOption } from '@/common/setup/filter/interface';
+import Filter from '../../../components/filter/index.vue';
+import { TypeAndTime } from '@/views/report/interface';
+
+export default defineComponent({
+    name: 'inventory-filter-table',
+    components: { FilterOption, Filter },
+    setup(props, context) {
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
+        }
+        const select: SelectList[] = [
+            {
+                value: undefined,
+                key: 'userId',
+                placeholder: '全部交易用户',
+                list: [],
+            },
+            {
+                value: undefined,
+                key: 'warehousetype',
+                placeholder: '全部套保品种',
+                list: [],
+            },
+        ];
+        const loading = ref<boolean>(false);
+        // 交易用户
+        const { tableList: userList, queryTable } = handlerManagerList(loading, 2);
+        const { selectList, inputList, fixedBtnList, updateSelected } = handleFilter(select, [], context);
+        // 获取交易用户
+        function getUserList() {
+            return queryTable().then(() => {
+                const result: SelectOption[] = [];
+                userList.value.forEach((e) => {
+                    e.userlist.forEach((el) => {
+                        result.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
+                    });
+                });
+                return result;
+            });
+        }
+        // 获取套保品种
+        function getTBList() {
+            return QueryMiddleGoodsDetail().then((res) => {
+                const result: SelectOption[] = [];
+                res.forEach((e) => {
+                    const { isvalid, middlegoodsname, middlegoodsid } = e.mg;
+                    if (isvalid) {
+                        result.push({ value: middlegoodsid, lable: middlegoodsname });
+                    }
+                });
+                return result;
+            });
+        }
+        // initData(() => {
+        //     Promise.all([getUserList(), getTBList()]).then((res) => {
+        //         select[0].list = res[0]; // 交易用户
+        //         select[1].list = res[1]; // 套保品种
+        //         updateSelected(select);
+        //     });
+        // });
+        return {
+            selectList,
+            inputList,
+            fixedBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;
+

+ 81 - 0
src/views/report/future_report/list/future_report/index.vue

@@ -0,0 +1,81 @@
+<template>
+  <!-- 库存报表(品类) -->
+  <div class="spot-report"
+       :loading="loading">
+    <Filter @update="update"></Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+      </a-table>
+    </contextMenu>
+  </div>
+</template>
+
+<script lang="ts">
+import Filter from '../../components/filterTable/index.vue';
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import { queryTableList } from '../../../setup';
+import { handleInitTypeAndTime } from '@/views/report/setup';
+import { qryAreaSpotplReport } from '@/services/go/ermcp/report';
+import { Ermcp3AreaSpotPLReport } from '@/services/go/ermcp/report/interface';
+import { TypeAndTime } from '@/views/report/interface';
+
+export default defineComponent({
+    name: 'inventory_report_inventory_category',
+    components: {
+        Filter,
+        contextMenu,
+        BtnList,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<any>({});
+        // // 表格操作按钮列表
+        // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3AreaSpotPLReport>(qryAreaSpotplReport);
+        initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
+            // 获取列表数据
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_warehouse_category_report', []);
+        });
+        function update(value: TypeAndTime) {
+            queryTable(value);
+        }
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            btnClick,
+            update,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.spot-report {
+}
+</style>;

+ 1 - 0
src/views/report/interface.ts

@@ -8,4 +8,5 @@ export interface Value {
 export interface TypeAndTime {
     cycletype: number//      周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string//      周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
+    userid?: number// 
 }

+ 9 - 2
src/views/report/setup.ts

@@ -1,4 +1,5 @@
 import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo'
+import { getUsrId } from '@/services/bus/user'
 import { FinanceReportReq } from "@/services/go/ermcp/report/interface"
 import moment, { Moment } from "moment"
 import { ref, SetupContext } from "vue"
@@ -12,6 +13,8 @@ export function handleReprotType(context: SetupContext) {
     const dateFormat = ref<reportCyleTimeType>(reportCyleTimeType.day)
     // 时间
     const time = ref<Moment>(getInitTime());
+    // 交易用户
+    const selectedUser = ref<Value>({ key: getUsrId() })
     // 周期类型与时间类型 一对一的关系
     const timeMap = new Map([
         [reportCycleType.day, reportCyleTimeType.day],
@@ -45,6 +48,10 @@ export function handleReprotType(context: SetupContext) {
     function timeChange() {
         update()
     }
+    // 交易用户变更
+    function userChange() {
+        update()
+    }
     // 根据周期类型 格式化时间
     function formateTime() {
         return moment(time.value).format(getFomateType())
@@ -55,10 +62,10 @@ export function handleReprotType(context: SetupContext) {
     }
     // 通知上层更新数据
     function update() {
-        const param = { cycletype: selectedReportType.value.key, cycletime: formateTime() }
+        const param = { cycletype: selectedReportType.value.key, cycletime: formateTime(), userid: selectedUser.value.key }
         context.emit('update', param)
     }
-    return { selectedReportType, reportType, isMonth, reportTypeChange, dateFormat, time, timeChange, }
+    return { selectedReportType, reportType, isMonth, reportTypeChange, dateFormat, time, timeChange, selectedUser, userChange }
 }
 
 export function handleInitTypeAndTime() {

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

@@ -19,7 +19,7 @@
 <script lang="ts">
 import Filter from '../../components/filterTable/index.vue';
 import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
-import { queryTableList } from '../../../setup';
+import { queryTableList } from '@/views/report/setup';
 import { handleInitTypeAndTime } from '@/views/report/setup';
 import { qryAreaSpotplReport } from '@/services/go/ermcp/report';
 import { Ermcp3AreaSpotPLReport } from '@/services/go/ermcp/report/interface';

+ 89 - 0
src/views/report/sum_pl_report/components/filterTable/index.vue

@@ -0,0 +1,89 @@
+<template>
+  <!-- 过滤客户资料表格 -->
+  <Filter @update="update">
+    <!-- <FilterOption :selectList="selectList"
+                    :inputList="[]"
+                    :fixedBtnList="fixedBtnList" /> -->
+  </Filter>
+</template>
+
+<script lang="ts">
+import FilterOption from '@/common/components/filter/index.vue';
+import { defineComponent } from 'vue';
+import { ref } from 'vue';
+import { handleFilter, SelectList } from '@/common/setup/filter';
+import { handlerManagerList } from '@/common/setup/user';
+import { QueryMiddleGoodsDetail } from '@/services/go/ermcp/goodsInfo';
+import { SelectOption } from '@/common/setup/filter/interface';
+import Filter from '../../../components/filter/index.vue';
+import { TypeAndTime } from '@/views/report/interface';
+
+export default defineComponent({
+    name: 'exposure-filter-table',
+    components: { FilterOption, Filter },
+    setup(props, context) {
+        function update(value: TypeAndTime) {
+            context.emit('update', value);
+        }
+        const select: SelectList[] = [
+            {
+                value: undefined,
+                key: 'userId',
+                placeholder: '全部交易用户',
+                list: [],
+            },
+            {
+                value: undefined,
+                key: 'warehousetype',
+                placeholder: '全部套保品种',
+                list: [],
+            },
+        ];
+        const loading = ref<boolean>(false);
+        // 交易用户
+        const { tableList: userList, queryTable } = handlerManagerList(loading, 2);
+        const { selectList, inputList, fixedBtnList, updateSelected } = handleFilter(select, [], context);
+        // 获取交易用户
+        function getUserList() {
+            return queryTable().then(() => {
+                const result: SelectOption[] = [];
+                userList.value.forEach((e) => {
+                    e.userlist.forEach((el) => {
+                        result.push({ value: el.loginid, lable: `${el.loginname}-${el.logincode}` });
+                    });
+                });
+                return result;
+            });
+        }
+        // 获取套保品种
+        function getTBList() {
+            return QueryMiddleGoodsDetail().then((res) => {
+                const result: SelectOption[] = [];
+                res.forEach((e) => {
+                    const { isvalid, middlegoodsname, middlegoodsid } = e.mg;
+                    if (isvalid) {
+                        result.push({ value: middlegoodsid, lable: middlegoodsname });
+                    }
+                });
+                return result;
+            });
+        }
+        // initData(() => {
+        //     Promise.all([getUserList(), getTBList()]).then((res) => {
+        //         select[0].list = res[0]; // 交易用户
+        //         select[1].list = res[1]; // 套保品种
+        //         updateSelected(select);
+        //     });
+        // });
+        return {
+            selectList,
+            inputList,
+            fixedBtnList,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+</style>;
+

+ 80 - 0
src/views/report/sum_pl_report/list/sum_pl_report/index.vue

@@ -0,0 +1,80 @@
+<template>
+  <!-- 汇总损益报表 -->
+  <div class="exposure_report"
+       :loading="loading">
+    <Filter @update="update"></Filter>
+    <contextMenu :contextMenuList="forDataBtn">
+      <a-table :columns="columns"
+               class="topTable hiddenFirstCol"
+               :pagination="false"
+               :expandedRowKeys="expandedRowKeys"
+               :customRow="Rowclick"
+               rowKey="key"
+               :data-source="tableList">
+      </a-table>
+    </contextMenu>
+  </div>
+</template>
+
+<script lang="ts">
+import Filter from '../../components/filterTable/index.vue';
+import { defineComponent, initData, getTableColumns, getTableEvent, getBtnList, contextMenu, BtnList } from '@/common/export/table';
+import { queryTableList } from '@/views/report/setup';
+import { TypeAndTime } from '@/views/report/interface';
+import { handleInitTypeAndTime } from '@/views/report/setup';
+import { Ermcp3ArealSumPL, Ermcp3ExpourseReport } from '@/services/go/ermcp/report/interface';
+import { qryAreaExpourseReport, qryAreaSumPL } from '@/services/go/ermcp/report';
+export default defineComponent({
+    name: 'sum_pl_report',
+    components: {
+        Filter,
+        contextMenu,
+        BtnList,
+    },
+    setup() {
+        // 表头数据
+        const { columns, registerColumn, updateColumn, filteredInfo } = getTableColumns();
+        // 表格事件
+        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<any>({});
+        // // 表格操作按钮列表
+        // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+        // 表格列表数据
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3ArealSumPL>(qryAreaSumPL);
+        initData(() => {
+            const { getInitTime, getInitType } = handleInitTypeAndTime();
+            // 获取列表数据
+            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
+            // 注册表头信息 过滤
+            registerColumn('table_pcweb_exposure_report', []);
+        });
+        function update(value: TypeAndTime) {
+            queryTable(value);
+        }
+        // 查询
+        function search(value: any) {
+            filteredInfo.value = value;
+            // 更新表信息
+            updateColumn();
+        }
+
+        return {
+            columns,
+            filteredInfo,
+            expandedRowKeys,
+            selectedRow,
+            Rowclick,
+            loading,
+            tableList,
+            search,
+            queryTable,
+            btnClick,
+            update,
+        };
+    },
+});
+</script>
+
+<style lang="less">
+.exposure-report {
+}
+</style>;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 96 - 425
swagger-to-ts/index.js


Vissa filer visades inte eftersom för många filer har ändrats