|
|
@@ -32,14 +32,16 @@
|
|
|
</app-filter>
|
|
|
</template>
|
|
|
<app-table :data="dataList" :columns="tableColumns" :loading="loading" :highlight-current-row="false"
|
|
|
- :span-method="objectSpanMethod" :summary-method="getSummaries" show-summary>
|
|
|
+ :span-method="arraySpanMethod" :summary-method="getSummaries" show-summary>
|
|
|
<template #headerLeft>
|
|
|
<app-operation :data-list="getActionButtons(['query_internal_profitshare_export'])"
|
|
|
@click="(code: string) => openComponent(code)" />
|
|
|
</template>
|
|
|
<!-- 商品/市场 -->
|
|
|
- <template #goodsname="{ row }">
|
|
|
- <el-link type="primary" @click="openComponent('Details', row)">{{ row.goodsname }}</el-link>
|
|
|
+ <template #goodscode="{ row }">
|
|
|
+ <el-link type="primary" @click="openComponent('Details', row)">
|
|
|
+ {{ row.goodscode || row.goodsid }}
|
|
|
+ </el-link>
|
|
|
</template>
|
|
|
</app-table>
|
|
|
<component :is="componentMap.get(componentId)" v-bind="{ record, queryParams }" @closed="closeComponent"
|
|
|
@@ -86,23 +88,6 @@ const { dataList, loading, run } = useRequest(shareAmountQuery, {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-// 计算行合并值
|
|
|
-const objectSpanMethod = (data: { rowIndex: number; columnIndex: number; }) => {
|
|
|
- if (data.columnIndex < 2) {
|
|
|
- if (data.rowIndex === 0) {
|
|
|
- return {
|
|
|
- rowspan: dataList.value.length,
|
|
|
- colspan: 1,
|
|
|
- }
|
|
|
- } else {
|
|
|
- return {
|
|
|
- rowspan: 0,
|
|
|
- colspan: 0,
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
const { queryParams, filterOption, getQueryParams, resetFilters } = useDataFilter<Model.ShareAmountQueryReq>({
|
|
|
filters: [
|
|
|
{
|
|
|
@@ -162,10 +147,30 @@ const dateFormat = computed(() => {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+// 计算行合并值
|
|
|
+const arraySpanMethod = (data: { row: Model.ShareAmountQueryRsp; rowIndex: number; columnIndex: number; }) => {
|
|
|
+ if (data.columnIndex < 2) {
|
|
|
+ let rowspan = 1
|
|
|
+ // 统计当前行与后续行中相同名称的数量
|
|
|
+ for (let i = data.rowIndex + 1; i < dataList.value.length; i++) {
|
|
|
+ if (dataList.value[i].areatype === data.row.areatype) {
|
|
|
+ rowspan++
|
|
|
+ } else {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果上一行和当前行名称相同
|
|
|
+ if (data.rowIndex > 0 && dataList.value[data.rowIndex - 1].areatype === data.row.areatype) {
|
|
|
+ return [0, 0] // 隐藏单元格
|
|
|
+ }
|
|
|
+ return [rowspan, 1] // 合并行数,列数保持为 1
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
const tableColumns = ref<Model.TableColumn[]>([
|
|
|
{ field: 'areatype', label: 'report.instprofitshare.areatype', formatValue: (val) => roleTypeEnum.getEnumTypeName(val) },
|
|
|
{ field: 'areaaccountid', label: 'report.instprofitshare.areaaccountid' },
|
|
|
- { field: 'goodsname', label: 'report.instprofitshare.goodsname' },
|
|
|
+ { field: 'goodscode', label: 'report.instprofitshare.goodsname' },
|
|
|
{ field: 'tradefeetype', label: 'report.instprofitshare.searchtype', formatValue: (val) => divideFeekindEnum.getEnumTypeName(val) },
|
|
|
{ field: 'totalcount', label: 'report.instprofitshare.totalcount' },
|
|
|
{ field: 'totalfee', label: 'report.instprofitshare.totalfee' },
|