修改测试问题及优化项

This commit is contained in:
fks-xuxinyue
2024-08-28 17:34:54 +08:00
parent c21a79da87
commit 06e0ec7425
10 changed files with 454 additions and 151 deletions

View File

@@ -20,10 +20,11 @@
</a-form-item>
<a-form-item>
<a-cascader
v-model:value="queryParams.transactionType"
v-model:value="transactionType"
multiple
style="width: 200px"
:options="options"
@change="changeSelect"
placeholder="请选择交易类型"
suffix-icon="Shopping Around">
<template #tagRender="data">
@@ -49,7 +50,7 @@
</div>
<div style="display: flex; margin-top: 20px; height: calc(84% - 20px)">
<div class="detailTable">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 2000 }">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 1280 }">
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'accountType'">
<span v-if="record.accountType">{{ record.accountType.label }}</span>
@@ -195,6 +196,7 @@
};
const total = ref<number>();
const year = ref(new Date().getFullYear().toString());
const transactionType = ref();
const queryParams = ref({
pageNum: 1,
pageSize: 10,
@@ -202,9 +204,16 @@
accountType: props.parentId,
year: year.value,
});
const transactionTypeValue = ref();
const changeSelect = (value, selectedOptions) => {
transactionTypeValue.value = selectedOptions.flatMap((group) =>
group.flatMap((node) => [node.value, ...(node.children?.map((child) => child.value) || [])]),
);
};
const searchTableList = () => {
year.value = queryParams.value.year;
transactionType.value = queryParams.value.transactionType;
transactionTypeList.value = transactionTypeValue.value;
queryParams.value.transactionTypeList = transactionTypeValue.value;
accountType.value = queryParams.value.accountType;
getTotalTable(queryParams.value.accountType);
mainRef.value?.nsTableRef.reload();
@@ -283,6 +292,9 @@
accountType.value = props.parentId;
year.value = new Date().getFullYear();
transactionType.value = '';
transactionTypeList.value = [];
queryParams.value.transactionTypeList = transactionTypeList.value;
getTotalTable();
mainRef.value?.nsTableRef.reload();
// getDetailList();
};
@@ -364,7 +376,7 @@
};
const mainRef = ref();
const transactionType = ref();
const transactionTypeList = ref([]);
const accountType = ref();
accountType.value = props.parentId;
const tableConfig = ref({
@@ -373,6 +385,7 @@
params: {
orgId,
accountType,
transactionTypeList,
year,
},
headerActions: [
@@ -467,40 +480,49 @@
{
title: '资产类别',
dataIndex: 'accountType',
width: 100,
},
{
title: '交易方式',
dataIndex: 'transactionTypeName',
width: 100,
},
{
title: '交易日期',
dataIndex: 'transactionDate',
width: 100,
sorter: (a, b) => a.transactionDate - b.transactionDate,
},
{
title: '本期收入(tCO2)',
dataIndex: 'income',
width: 150,
sorter: (a, b) => a.income - b.income,
},
{
title: '本期支出(tCO2)',
dataIndex: 'expenditure',
width: 150,
sorter: (a, b) => a.expenditure - b.expenditure,
},
{
title: '发生金额(¥)',
width: 150,
dataIndex: 'amountIncurredValue',
},
{
title: '交易对象',
width: 100,
dataIndex: 'tradingPartner',
},
{
title: '更新人',
width: 100,
dataIndex: 'updateUser',
},
{
title: '更新时间',
width: 150,
dataIndex: 'updateTime',
},
],