huangbin 4 роки тому
батько
коміт
ba9ee21880

+ 4 - 0
src/assets/styles/index.css

@@ -1581,6 +1581,10 @@ body {
 .table-height {
   height: calc(100% - 40px);
 }
+.table-detail-container {
+  position: relative;
+  overflow: hidden;
+}
 .iframe-container {
   height: calc(100% - 40px);
 }

+ 5 - 0
src/assets/styles/index.less

@@ -293,6 +293,11 @@ body {
     height: calc(100% - 40px);
 }
 
+.table-detail-container {
+    position: relative;
+    overflow: hidden;
+}
+
 .iframe-container {
     height: calc(100% - 40px);
     > iframe {

+ 5 - 3
src/common/components/thirdMenu/index.vue

@@ -40,7 +40,9 @@ export default defineComponent({
             current.value = props.selectedKey;
         });
         function menuClick(value: string) {
-            context.emit('selectMenu', +value, current);
+            const index = +value;
+            const item = props.list[index]
+            context.emit('selectMenu', +value, item);
         }
         return {
             current,
@@ -74,12 +76,12 @@ export default defineComponent({
                     .ant-tabs-nav-scroll {
                         .ant-tabs-nav {
                             .ant-tabs-tab {
-                                width: 121px;
+                                min-width: 121px;
                                 height: 26px;
                                 line-height: 26px;
                                 text-align: center;
                                 color: @m-grey1;
-                                padding: 0;
+                                padding: 0 20px;
                                 margin: 0;
                                 background: url(../../../assets/images/tabbg.png) center center no-repeat;
                                 background-size: cover;

+ 4 - 2
src/common/setup/table/compose.ts

@@ -89,8 +89,10 @@ export function handleComposeTable_detail<T>({ queryFn, tableName, tableFilterKe
     const list = getThirdMenuData()
     const tabList = ref<TabList[]>([])
     list[0]?.children.forEach(el => {
-        const { code, title } = el
-        tabList.value.push({ lable: title, code })
+        const { code, title, type } = el
+        if (type === 3) {
+            tabList.value.push({ lable: title, code })
+        }
     })
 
     initData(() => {

+ 1 - 1
src/services/go/commonService/interface.ts

@@ -41,7 +41,7 @@ export interface OperationTabMenu {
     rulekey: string; //对应权限主键,对应FUNCMENULIST表RESOURCECODE
     sort: number; //排序
     title: string; //标题
-    type: number; //类型,1:菜单 2:按钮   5:管理端页面地址
+    type: 1 | 2 | 3 | 5; //类型,1:菜单 2:按钮  3: 明细  5:管理端页面地址
     url: string;
     remark: string;
     children: OperationTabMenu[];

+ 12 - 0
src/services/go/ermcp/report/index.ts

@@ -98,6 +98,9 @@ export function qryTaFutureDataReport(req: QryTaFutureDataReportReq): Promise<Er
  * @param req
  */
 export function qryAreaExpourseContractDetail(req: QryAreaExpourseContractDetailReq): Promise<Ermcp3ExposureContractDetail[]> {
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaExpourseContractDetail', req).catch((err) => {
         throw new Error(`查询敞口合同明细(敞口报表/现货合同明细): ${err}`);
     });
@@ -109,6 +112,9 @@ export function qryAreaExpourseContractDetail(req: QryAreaExpourseContractDetail
  * @param req
  */
 export function qryAreaExpourseFutuDetail(req: QryAreaExpourseFutuDetailReq): Promise<Ermcp3ExposureFutuDetail[]> {
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaExpourseFutuDetail', req).catch((err) => {
         throw new Error(`查询敞口期货明细(敞口报表/期货明细): ${err}`);
     });
@@ -120,6 +126,9 @@ export function qryAreaExpourseFutuDetail(req: QryAreaExpourseFutuDetailReq): Pr
  * @param req
  */
 export function qryAreaExpourseHedgeplanDetail(req: QryAreaExpourseHedgeplanDetailReq): Promise<Ermcp3ExposureHedgeplanDetail[]> {
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaExpourseHedgeplanDetail', req).catch((err) => {
         throw new Error(`查询敞口套保计划明细(敞口报表/套保计划明细): ${err}`);
     });
@@ -131,6 +140,9 @@ export function qryAreaExpourseHedgeplanDetail(req: QryAreaExpourseHedgeplanDeta
  * @param req
  */
 export function qryAreaExpourseParamChLogDetail(req: QryAreaExpourseParamChLogDetailReq): Promise<Ermcp3ExposureParamChLog[]> {
+    if (!req.userid) {
+        req.userid = getUserId()
+    }
     return commonSearch_go('/Ermcp3/QryAreaExpourseParamChLogDetail', req).catch((err) => {
         throw new Error(`查询敞口参数调整明细(敞口报表/参数调整明细): ${err}`);
     });

+ 5 - 5
src/services/go/ermcp/report/interface.ts

@@ -2,7 +2,7 @@
  * 敞口报表请求
  */
 export interface AreaExpourseReportReq {
-    userid: number,     // 用户ID
+    userid?: number,     // 用户ID
     querytype: number,  // 查询类型 1-报表, 这个接口只查报表;明细的字段完全不同,另有接口
 
     cycletype?: number, // 周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
@@ -363,7 +363,7 @@ export interface Ermcp3TaFutuReDataReport {
  * 查询敞口合同明细(敞口报表/现货合同明细)请求
  */
 export interface QryAreaExpourseContractDetailReq {
-    userid: number,         //  用户ID
+    userid?: number,         //  用户ID
     middlegoodsid: number,  //  套保商品id
     cycletype: number,      //  周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string       //  周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
@@ -412,7 +412,7 @@ export interface Ermcp3ExposureContractDetail {
  * 查询敞口期货明细(敞口报表/期货明细)请求
  */
 export interface QryAreaExpourseFutuDetailReq {
-    userid: number              //  用户ID
+    userid?: number              //  用户ID
     middlegoodsid: number       //  套保商品id
     cycletype: number           //  周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string           //  周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
@@ -449,7 +449,7 @@ export interface Ermcp3ExposureFutuDetail {
  * 查询敞口套保计划明细(敞口报表/套保计划明细)请求
  */
 export interface QryAreaExpourseHedgeplanDetailReq {
-    userid: number      //      用户ID
+    userid?: number      //      用户ID
     middlegoodsid: number //    套保商品id
     cycletype: number //        周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string //        周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】
@@ -494,7 +494,7 @@ export interface Ermcp3ExposureHedgeplanDetail {
  * 查询敞口参数调整明细(敞口报表/参数调整明细)请求
  */
 export interface QryAreaExpourseParamChLogDetailReq {
-    userid: number          //  用户ID
+    userid?: number          //  用户ID
     middlegoodsid: number   //  套保商品id
     cycletype: number       //  周期类型 - 0:日 1:月 2:季 3:年 4:周 5:全报表【原值】
     cycletime: string       //  周期时间 日(YYYYMMDD) 月(YYYYMM) 季(YYYYQ) 年(YYYY) 周(YYYYMMDD周内任意一天) 全(0)【原值】

+ 110 - 47
src/views/report/exposure-report/list/exposure_report/index.vue

@@ -1,75 +1,138 @@
 <template>
   <!-- 敞口报表 -->
-  <div class="exposure_report"
+  <div class="table-detail-container table-height"
        :loading="loading">
-    <Filter @update="update"></Filter>
-    <contextMenu :contextMenuList="forDataBtn">
-      <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>
-    </contextMenu>
+    <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>
+    <!-- 明细 -->
+    <Description v-if="visible"
+                 @close="closeDrawer"
+                 @changeTab="changeTab"
+                 :columns="columnsDetail"
+                 :tabList="tabList"
+                 :tableList="detailTableList" />
   </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 { defineComponent, queryTableList } from '@/common/export/table';
 import { TypeAndTime } from '@/views/report/interface';
 import { handleInitTypeAndTime } from '@/views/report/setup';
-import { Ermcp3ExpourseReport } from '@/services/go/ermcp/report/interface';
-import { qryAreaExpourseReport } from '@/services/go/ermcp/report';
+import { AreaExpourseReportReq, Ermcp3ExpourseReport, QryAreaExpourseHedgeplanDetailReq } from '@/services/go/ermcp/report/interface';
+import { qryAreaExpourseContractDetail, qryAreaExpourseFutuDetail, qryAreaExpourseHedgeplanDetail, qryAreaExpourseParamChLogDetail, qryAreaExpourseReport } from '@/services/go/ermcp/report';
+import { ComposeTableDetailParam, handleComposeTable_detail } from '@/common/setup/table/compose';
+import Description from '@/common/components/description/index.vue';
+import { watchEffect } from 'vue';
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
+import { TabList } from '@/common/setup/table/interface';
+
 export default defineComponent({
     name: 'exposure-report',
     components: {
         Filter,
-        contextMenu,
-        BtnList,
+        Description,
     },
     setup() {
-        // 表头数据
-        const { columns, registerColumn, updateColumn } = getTableColumns();
-        // 表格事件
-        const { expandedRowKeys, selectedRow, Rowclick, btnClick } = getTableEvent<any>({});
-        // // 表格操作按钮列表
-        // const { commonBtn, forDataBtn } = getBtnList('warehouse_info_normal', true);
+        let cycletime = '';
         // 表格列表数据
-        const { loading, tableList, queryTable } = queryTableList<Ermcp3ExpourseReport>(qryAreaExpourseReport);
-        initData(() => {
+        const { loading, tableList, queryTable } = queryTableList<Ermcp3ExpourseReport>();
+        // 获取列表数据
+        const queryTableAction = () => {
             const { getInitTime, getInitType } = handleInitTypeAndTime();
+            cycletime = getInitTime();
+            const param: AreaExpourseReportReq = {
+                cycletype: getInitType(),
+                cycletime,
+                querytype: 1,
+            };
             // 获取列表数据
-            queryTable({ cycletype: getInitType(), cycletime: getInitTime() });
-            // 注册表头信息 过滤
-            registerColumn('table_pcweb_exposure_report', []);
-        });
-        function update(value: TypeAndTime) {
-            queryTable(value);
-        }
-
-        return {
+            queryTable(qryAreaExpourseReport, param);
+        };
+        const param: ComposeTableDetailParam = {
+            queryFn: queryTableAction, // 查询表格数据
+            tableName: 'table_pcweb_exposure_report', // 表头key
+            tableFilterKey: [], // 表格过滤字段
+        };
+        const {
+            visible,
+            closeDrawer, // 控制 drawer 组件是否显示
             columns,
-
+            updateColumn, //  表头数据
+            columnsDetail,
+            registerColumnDetail,
+            detailTableList, // 明细表头数据
             expandedRowKeys,
             selectedRow,
-            Rowclick,
-            loading,
-            tableList,
-            queryTable,
-            btnClick,
-            update,
-        };
+            Rowclick, // 表格事件
+            tabList,
+        } = handleComposeTable_detail<Ermcp3ExpourseReport>(param);
+
+        // 切换明细
+        function changeTab(index: number, current: TabList) {
+            const { code, lable } = current;
+            const data = selectedRow.value as Ermcp3ExpourseReport;
+            const { cycletype, middlegoodsid } = data;
+            const param: QryAreaExpourseHedgeplanDetailReq = {
+                middlegoodsid,
+                cycletype,
+                cycletime,
+            };
+            let fn = null;
+            if (code === 'exposure_report_exposure_contract_changes') {
+                // 现货合同变动量明细
+                // 注册表头
+                registerColumnDetail('table_pcweb_change_in_spot_contract', []);
+                fn = qryAreaExpourseContractDetail;
+            } else if (code === 'exposure_report_exposure_hedging_plan') {
+                // 套保计划变动量明细
+                // 注册表头
+                registerColumnDetail('table_pcweb_change_in_hedging_plan', []);
+                fn = qryAreaExpourseHedgeplanDetail;
+            } else if (code === 'exposure_report_exposure_futures_changes') {
+                // 期货变动量明细
+                // 注册表头
+                registerColumnDetail('table_pcweb_change_in_future', []);
+                fn = qryAreaExpourseFutuDetail;
+            } else if (code === 'exposure_report_exposure_parameter_adjustment_changes') {
+                // 参数调整变动量明细
+                // 注册表头
+                registerColumnDetail('table_pcweb_change_in_parameter_adjustment', []);
+                fn = qryAreaExpourseParamChLogDetail;
+            } else {
+                console.error(`${lable}没有配置对应的code: ${code},`);
+                return;
+            }
+            // 查询明细数据
+            queryResultLoadingAndInfo(fn, loading, param).then((res) => {
+                detailTableList.value = res;
+            });
+        }
+        watchEffect(() => {
+            if (visible.value) {
+                if (tabList.value.length) {
+                    changeTab(0, tabList.value[0]);
+                }
+            }
+        });
+        function search(value: TypeAndTime) {
+            cycletime = value.cycletime;
+            const obj = Object.assign(value, { querytype: 1 });
+            queryTable(qryAreaExpourseReport, obj);
+        }
+
+        return { loading, tableList, visible, closeDrawer, columns, updateColumn, search, columnsDetail, detailTableList, expandedRowKeys, selectedRow, Rowclick, tabList, changeTab };
     },
 });
 </script>
 
 <style lang="less">
-.exposure-report {
-}
 </style>;

+ 4 - 10
src/views/report/finance-report/list/finance_report_finance/index.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 财务报表 -->
-  <div class="finance-report table-height"
+  <div class="table-detail-container table-height"
        :loading="loading">
     <Filter @update="search"></Filter>
     <a-table :columns="columns"
@@ -24,7 +24,7 @@
 
 <script lang="ts">
 import Filter from '../../components/filterTable/index.vue';
-import { defineComponent, contextMenu, BtnList, queryTableList } from '@/common/export/table';
+import { defineComponent, queryTableList } from '@/common/export/table';
 import { TypeAndTime } from '@/views/report/interface';
 import { handleInitTypeAndTime } from '@/views/report/setup';
 import { Ermcp3FinanceReport, FinanceReportReq } from '@/services/go/ermcp/report/interface';
@@ -39,8 +39,6 @@ export default defineComponent({
     name: 'finance-report',
     components: {
         Filter,
-        contextMenu,
-        BtnList,
         Description,
     },
     setup() {
@@ -80,7 +78,7 @@ export default defineComponent({
 
         // 切换明细
         function changeTab(index: number, current: TabList) {
-            const { code } = current;
+            const { code, lable } = current;
             const data = selectedRow.value as Ermcp3FinanceReport;
             const { cycletype, currencyid } = data;
             const param: FinanceReportReq = {
@@ -101,7 +99,7 @@ export default defineComponent({
                 registerColumnDetail('table_pcweb_inventory_commodity_report_brand_details', []);
                 param.sumfields = '3';
             } else {
-                console.warn('财务报表 新增明细,请开发人员配置');
+                console.error(`${lable}没有配置对应的code: ${code},`);
                 return;
             }
             // 查询明细数据
@@ -128,8 +126,4 @@ export default defineComponent({
 </script>
 
 <style lang="less">
-.finance-report {
-    position: relative;
-    overflow: hidden;
-}
 </style>;