|
|
@@ -2,7 +2,16 @@
|
|
|
<!-- 汇总损益报表 -->
|
|
|
<div class="table-detail-container table-height" :loading="loading">
|
|
|
<Filter @update="search"></Filter>
|
|
|
- <a-table :columns="columns" class="srcollYTable" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }" :pagination="false" :expandedRowKeys="expandedRowKeys" :customRow="customRow" rowKey="key" :data-source="tableList">
|
|
|
+ <a-table
|
|
|
+ :columns="columns"
|
|
|
+ class="srcollYTable"
|
|
|
+ :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>
|
|
|
@@ -13,6 +22,10 @@
|
|
|
<template #futureactualpl="{ record }">
|
|
|
<span>{{ record.futureactualpl.toFixed(2) }}</span>
|
|
|
</template>
|
|
|
+ <!-- 期现比例 -->
|
|
|
+ <template #futurespotratio="{ text }">
|
|
|
+ <span>{{ (+text) * 100 }}{{+text ? '%' : ''}}</span>
|
|
|
+ </template>
|
|
|
<template #sumactualpl="{ record }">
|
|
|
<span>{{ record.sumactualpl.toFixed(2) }}</span>
|
|
|
</template>
|
|
|
@@ -22,7 +35,14 @@
|
|
|
</a-table>
|
|
|
<!-- 明细 -->
|
|
|
<Description v-if="visible" @close="closeDrawer" @changeTab="changeTab" :tabList="tabList">
|
|
|
- <a-table :columns="columnsDetail" class="topTable" :pagination="false" rowKey="key" :data-source="detailTableList" :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }">
|
|
|
+ <a-table
|
|
|
+ :columns="columnsDetail"
|
|
|
+ class="topTable"
|
|
|
+ :pagination="false"
|
|
|
+ rowKey="key"
|
|
|
+ :data-source="detailTableList"
|
|
|
+ :scroll="{ x: '100%', y: 'calc(100vh - 163px)' }"
|
|
|
+ >
|
|
|
<!-- 出现浮点失真 强行处理 * 2-->
|
|
|
<template #spotactualpl="{ record }">
|
|
|
<span>{{ record.spotactualpl.toFixed(2) }}</span>
|
|
|
@@ -45,133 +65,133 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import Filter from '../../components/filterTable/index.vue';
|
|
|
-import { defineComponent, queryTableList } from '@/common/export/table';
|
|
|
-import { ComposeTableDetailParam, handleComposeTable_detail } from '@/common/setup/table/compose';
|
|
|
import Description from '@/common/components/description/index.vue';
|
|
|
-import { ref, watchEffect } from 'vue';
|
|
|
-import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
-import { TypeAndTime } from '@/views/report/interface';
|
|
|
-import { handleInitTypeAndTime } from '@/views/report/setup';
|
|
|
-import { Ermcp3ArealSumPL, QryAreaSumPLReq } from '@/services/go/ermcp/report/interface';
|
|
|
-import { qryAreaSumPL } from '@/services/go/ermcp/report';
|
|
|
import { TabList } from '@/common/components/description/interface';
|
|
|
import { EnumRouterName } from '@/common/constants/enumRouterName';
|
|
|
+import { defineComponent, queryTableList } from '@/common/export/table';
|
|
|
+import { queryResultLoadingAndInfo } from '@/common/methods/request/resultInfo';
|
|
|
import { getTableButton } from '@/common/setup/table/button';
|
|
|
+import { ComposeTableDetailParam, handleComposeTable_detail } from '@/common/setup/table/compose';
|
|
|
+import { qryAreaSumPL } from '@/services/go/ermcp/report';
|
|
|
+import { Ermcp3ArealSumPL, QryAreaSumPLReq } from '@/services/go/ermcp/report/interface';
|
|
|
+import { TypeAndTime } from '@/views/report/interface';
|
|
|
+import { handleInitTypeAndTime } from '@/views/report/setup';
|
|
|
+import { ref, watchEffect } from 'vue';
|
|
|
+import Filter from '../../components/filterTable/index.vue';
|
|
|
import { columns } from './setup';
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'sum_pl_report',
|
|
|
- components: {
|
|
|
- Filter,
|
|
|
- Description,
|
|
|
- },
|
|
|
- setup() {
|
|
|
- let cycletime = '';
|
|
|
- // 周期类型
|
|
|
- const cycletype = ref(0);
|
|
|
- // 表格列表数据
|
|
|
- const { loading, tableList, queryTable } = queryTableList<Ermcp3ArealSumPL>(true, 2);
|
|
|
- // 获取列表数据
|
|
|
- const queryTableAction = () => {
|
|
|
- const { getInitTime, getInitType } = handleInitTypeAndTime();
|
|
|
- cycletime = getInitTime();
|
|
|
- const param: QryAreaSumPLReq = {
|
|
|
- cycletype: getInitType(),
|
|
|
- cycletime,
|
|
|
- querytype: 1,
|
|
|
- };
|
|
|
- // 获取列表数据
|
|
|
- queryTable(qryAreaSumPL, param);
|
|
|
- };
|
|
|
- const param: ComposeTableDetailParam = {
|
|
|
- queryFn: queryTableAction, // 查询表格数据
|
|
|
- tableName: 'table_pcweb_aggregate_profit_and_loss', // 表头key
|
|
|
- tableFilterKey: [], // 表格过滤字段
|
|
|
- menuType: EnumRouterName.sum_pl_report_sum_pl, // 当前tab页对应的code
|
|
|
- };
|
|
|
- const {
|
|
|
- visible,
|
|
|
- closeDrawer, // 控制 drawer 组件是否显示
|
|
|
- updateColumn, // 表头数据
|
|
|
- columnsDetail,
|
|
|
- registerColumnDetail,
|
|
|
- detailTableList, // 明细表头数据
|
|
|
- expandedRowKeys,
|
|
|
- selectedRow,
|
|
|
- Rowclick, // 表格事件
|
|
|
- } = handleComposeTable_detail<Ermcp3ArealSumPL>(param);
|
|
|
- const chaceSearchValue = ref<TypeAndTime>();
|
|
|
+ name: 'sum_pl_report',
|
|
|
+ components: {
|
|
|
+ Filter,
|
|
|
+ Description,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ let cycletime = '';
|
|
|
+ // 周期类型
|
|
|
+ const cycletype = ref(0);
|
|
|
+ // 表格列表数据
|
|
|
+ const { loading, tableList, queryTable } = queryTableList<Ermcp3ArealSumPL>(true, 2);
|
|
|
+ // 获取列表数据
|
|
|
+ const queryTableAction = () => {
|
|
|
+ const { getInitTime, getInitType } = handleInitTypeAndTime();
|
|
|
+ cycletime = getInitTime();
|
|
|
+ const param: QryAreaSumPLReq = {
|
|
|
+ cycletype: getInitType(),
|
|
|
+ cycletime,
|
|
|
+ querytype: 1,
|
|
|
+ };
|
|
|
+ // 获取列表数据
|
|
|
+ queryTable(qryAreaSumPL, param);
|
|
|
+ };
|
|
|
+ const param: ComposeTableDetailParam = {
|
|
|
+ queryFn: queryTableAction, // 查询表格数据
|
|
|
+ tableName: 'table_pcweb_aggregate_profit_and_loss', // 表头key
|
|
|
+ tableFilterKey: [], // 表格过滤字段
|
|
|
+ menuType: EnumRouterName.sum_pl_report_sum_pl, // 当前tab页对应的code
|
|
|
+ };
|
|
|
+ const {
|
|
|
+ visible,
|
|
|
+ closeDrawer, // 控制 drawer 组件是否显示
|
|
|
+ updateColumn, // 表头数据
|
|
|
+ columnsDetail,
|
|
|
+ registerColumnDetail,
|
|
|
+ detailTableList, // 明细表头数据
|
|
|
+ expandedRowKeys,
|
|
|
+ selectedRow,
|
|
|
+ Rowclick, // 表格事件
|
|
|
+ } = handleComposeTable_detail<Ermcp3ArealSumPL>(param);
|
|
|
+ const chaceSearchValue = ref<TypeAndTime>();
|
|
|
|
|
|
- // 底部明细标签
|
|
|
- const tabList = getTableButton();
|
|
|
+ // 底部明细标签
|
|
|
+ const tabList = getTableButton();
|
|
|
|
|
|
- // 自定义表格事件
|
|
|
- const customRow = (record: Ermcp3ArealSumPL, index: number) => {
|
|
|
- // 日报表不显示“损益明细“标签页
|
|
|
- if (cycletype.value === 0) {
|
|
|
- return {};
|
|
|
- }
|
|
|
- return Rowclick(record, index);
|
|
|
- };
|
|
|
+ // 自定义表格事件
|
|
|
+ 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;
|
|
|
- const data = selectedRow.value as Ermcp3ArealSumPL;
|
|
|
- const { cycletype, currencyid } = data;
|
|
|
- const param: QryAreaSumPLReq = {
|
|
|
- querytype: 2,
|
|
|
- cycletype,
|
|
|
- cycletime,
|
|
|
- currencyid,
|
|
|
- userid: chaceSearchValue.value?.userid,
|
|
|
- };
|
|
|
- if (code === 'sum_pl_report_profit_and_loss_details') {
|
|
|
- // 损益明细
|
|
|
- // 注册表头
|
|
|
- registerColumnDetail('table_pcweb_inventory_summary_profit_and_loss_details', []);
|
|
|
- } else {
|
|
|
- console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
- return;
|
|
|
- }
|
|
|
- // 查询明细数据
|
|
|
- queryResultLoadingAndInfo(qryAreaSumPL, loading, param).then((res) => {
|
|
|
- detailTableList.value = res;
|
|
|
- });
|
|
|
+ // 切换明细
|
|
|
+ function changeTab(index: number, current: TabList) {
|
|
|
+ const { code, lable } = current;
|
|
|
+ const data = selectedRow.value as Ermcp3ArealSumPL;
|
|
|
+ const { cycletype, currencyid } = data;
|
|
|
+ const param: QryAreaSumPLReq = {
|
|
|
+ querytype: 2,
|
|
|
+ cycletype,
|
|
|
+ cycletime,
|
|
|
+ currencyid,
|
|
|
+ userid: chaceSearchValue.value?.userid,
|
|
|
+ };
|
|
|
+ if (code === 'sum_pl_report_profit_and_loss_details') {
|
|
|
+ // 损益明细
|
|
|
+ // 注册表头
|
|
|
+ registerColumnDetail('table_pcweb_inventory_summary_profit_and_loss_details', []);
|
|
|
+ } else {
|
|
|
+ console.error(`${lable}没有配置对应的code: ${code},`);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 查询明细数据
|
|
|
+ queryResultLoadingAndInfo(qryAreaSumPL, loading, param).then((res) => {
|
|
|
+ detailTableList.value = res;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ watchEffect(() => {
|
|
|
+ if (visible.value) {
|
|
|
+ if (tabList.length) {
|
|
|
+ changeTab(0, tabList[0]);
|
|
|
}
|
|
|
- watchEffect(() => {
|
|
|
- if (visible.value) {
|
|
|
- if (tabList.length) {
|
|
|
- changeTab(0, tabList[0]);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- function search(value: TypeAndTime) {
|
|
|
- cycletype.value = value.cycletype;
|
|
|
- chaceSearchValue.value = value;
|
|
|
- cycletime = value.cycletime;
|
|
|
- const obj = Object.assign(value, { querytype: 1 });
|
|
|
- queryTable(qryAreaSumPL, obj);
|
|
|
- }
|
|
|
+ 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,
|
|
|
- customRow,
|
|
|
- tabList,
|
|
|
- changeTab,
|
|
|
- };
|
|
|
- },
|
|
|
+ return {
|
|
|
+ loading,
|
|
|
+ tableList,
|
|
|
+ visible,
|
|
|
+ closeDrawer,
|
|
|
+ columns,
|
|
|
+ updateColumn,
|
|
|
+ search,
|
|
|
+ columnsDetail,
|
|
|
+ detailTableList,
|
|
|
+ expandedRowKeys,
|
|
|
+ selectedRow,
|
|
|
+ customRow,
|
|
|
+ tabList,
|
|
|
+ changeTab,
|
|
|
+ };
|
|
|
+ },
|
|
|
});
|
|
|
</script>
|