| src/views/financialManagement/accounting/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/financialManagement/expenseManagement/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/financialManagement/financialStatements/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/financialManagement/inventoryAccounting/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| src/views/financialManagement/revenueManagement/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/views/financialManagement/accounting/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,547 @@ <template> <div style="padding: 20px;"> <!-- 页颿 é¢åç鿡件 --> <div class="w-full md:w-auto flex items-center gap-3" style="margin-bottom: 20px;"> <el-button type="primary" icon="Refresh" @click="resetFilters" size="default" > æ¥è¯¢ </el-button> </div> <main class="container mx-auto px-4 pb-10"> <!-- åºå®èµäº§ææ å¡ç --> <div class="grid-container"> <!-- è®¾å¤æ»æ° --> <el-card class="bg2"> <p>è®¾å¤æ»æ°</p> <h3> {{ assetInfo.totalEquipment }} </h3> </el-card> <!-- èµäº§åå¼ --> <el-card class="bg3"> <p>èµäº§åå¼</p> <h3> Â¥{{ assetInfo.totalOriginalValue }} </h3> </el-card> <!-- ç´¯è®¡ææ§ --> <el-card class="bg4"> <p>ç´¯è®¡ææ§</p> <h3> Â¥{{ assetInfo.totalDepreciation }} </h3> </el-card> <!-- åå¼ --> <el-card class="bg5"> <p>åå¼</p> <h3> Â¥{{ assetInfo.totalNetValue }} </h3> </el-card> </div> <!-- åºå®èµäº§ç»è®¡å¾è¡¨ --> <div class="grid-layout"> <!-- æè®¾å¤ç±»åç»è®¡ --> <el-card style="margin-bottom: 20px;"> <h2 class="section-title">设å¤ç±»ååå¸</h2> <div class="echarts"> <Echarts :legend="typeDistributionLegend" :chartStyle="chartStylePie" :series="typeDistributionSeries" :tooltip="pieTooltip" style="height: 260px; width: 35%;"> <div class="chart-num"> <span style="font-size: 22px;">设å¤ç±»å</span> <span style="font-size: 36px; font-weight: 500; font-family: 'MyCustomFont', sans-serif;">{{ assetInfo.totalEquipment }}</span> </div> </Echarts> <Echarts ref="chart" :chartStyle="chartStyle" :grid="grid" :legend="lineLegend" :series="typeDistributionLineSeries" :tooltip="tooltip" :xAxis="xAxis" :yAxis="yAxis" style="height: 260px; width: 64%;"></Echarts> </div> </el-card> </div> <!-- 设å¤å°è´¦è¡¨æ ¼ --> <el-card style="margin-bottom: 20px;"> <el-table :data="equipmentList" stripe style="width: 100%" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }" > <el-table-column prop="id" label="èµäº§ç¼å·" width="120" /> <el-table-column prop="deviceName" label="设å¤åç§°" width="250" /> <el-table-column prop="deviceModel" label="åå·è§æ ¼" min-width="150" /> <el-table-column prop="supplierName" label="ä¾åºå" min-width="120" /> <el-table-column prop="unit" label="åä½" width="120" /> <el-table-column prop="number" label="æ°é" width="120" /> <el-table-column prop="originalValue" label="åå¼(å )" width="120"> <template #default="{ row }"> Â¥{{ formatCurrency(row.taxIncludingPriceTotal) }} </template> </el-table-column> <el-table-column prop="depreciation" label="ç´¯è®¡ææ§(å )" width="140"> <template #default="{ row }"> Â¥{{ formatCurrency(row.taxIncludingPriceTotal-row.unTaxIncludingPriceTotal) }} </template> </el-table-column> <el-table-column prop="netValue" label="åå¼(å )" width="120"> <template #default="{ row }"> Â¥{{ formatCurrency(row.unTaxIncludingPriceTotal) }} </template> </el-table-column> <el-table-column prop="status" label="ç¶æ" width="100"> <template #default="{ row }"> <el-tag :type="getStatusTagType(row.status)" size="small" > {{ row.status }} </el-tag> </template> </el-table-column> </el-table> <!-- å页 --> <div class="pagination-container"> <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pagination.currentPage" :page-sizes="[10, 20, 50, 100]" :page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="pagination.total" /> </div> </el-card> </main> </div> </template> <script setup> import { ref, computed, onMounted, reactive } from 'vue'; import 'element-plus/dist/index.css'; import Echarts from "@/components/Echarts/echarts.vue"; import { getLedgerPage, getAssetInfo } from "@/api/equipmentManagement/ledger"; import dayjs from "dayjs"; // ç鿡件 const dateRange = ref(null); const equipmentType = ref(''); // åºå®èµäº§ä¿¡æ¯ const assetInfo = ref({ totalEquipment: 0, totalOriginalValue: 0, totalDepreciation: 0, totalNetValue: 0 }); // 设å¤å表 const equipmentList = ref([]); const pagination = ref({ currentPage: 1, pageSize: 10, total: 0 }); // å¾è¡¨é ç½® const chartStyle = { width: '100%', height: '100%', position: 'relative', }; const grid = { left: '3%', right: '4%', bottom: '3%', containLabel: true }; const lineLegend = { show: false, }; // æçº¿å¾æç¤ºæ¡ const tooltip = reactive({ trigger: 'axis', axisPointer: { type: 'line', lineStyle: { color: '#aaa' } }, // èªå®ä¹å 容 formatter: function (params) { if (!params || !params.length) return ''; const axisLabel = params[0].axisValueLabel || params[0].axisValue || ''; const rows = params .map(p => { const colorDot = `<span style="display:inline-block;margin-right:6px;width:8px;height:8px;border-radius:50%;background:${p.color}"></span>`; return `${colorDot}${p.seriesName}: ${p.value}`; }) .join('<br/>'); return `<div>${axisLabel}</div><div>${rows}</div>`; } }); const xAxis = ref([ { type: 'category', axisTick: { show: true, alignWithLabel: true }, data: [], }, ]); const yAxis = [ { type: 'value', name: 'æ°é/éé¢', // 左侧yè½´ position: 'left', min: 0, // åæ è½´åç§°æ ·å¼ nameTextStyle: { color: '#000', fontSize: 14, }, } ]; const chartStylePie = { width: '100%', height: '100%' // 设置å¾è¡¨å®¹å¨çé«åº¦ }; const pieColors = ['#F04864', '#FACC14', '#8543E0', '#1890FF', '#13C2C2', '#2FC25B']; // 坿 ¹æ®å®é è°æ´ // 饼徿°æ® const typeDistributionData = ref([]); const departmentDistributionData = ref([]); // 饼å¾å¾ä¾ const typeDistributionLegend = computed(() => ({ show: true, top: 'center', left: '60%', orient: 'vertical', icon: 'circle', data: typeDistributionData.value.map(item => item.name), formatter: function(name) { const item = typeDistributionData.value.find(i => i.name === name); if (!item) return name; return `${name} | ${item.count} å° | ${item.amount}`; }, textStyle: { color: '#333', fontSize: 14, lineHeight: 26, } })); // 饼å¾ç³»å const typeDistributionSeries = computed(() => [ { type: 'pie', radius: ['50%', '65%'], center: ['25%', '50%'], avoidLabelOverlap: false, itemStyle: { borderColor: '#fff', borderWidth: 2 }, label: { show: false }, data: typeDistributionData.value, color: pieColors } ]); // æçº¿å¾æ°æ® const typeDistributionLineSeries = ref([]); // é¥¼å¾æç¤ºæ¡ const pieTooltip = reactive({ trigger: 'item', formatter: function(params) { // æ£æ¥æ°æ®æ¯å¦åå¨ if (!params.data) return params.name; // æ¼æ¥å®æ´å 容 return ` <div> <div style="color:${params.color};font-size:16px;">â</div> <div>${params.name}</div> <div>æ°éï¼${params.data.count} å°</div> <div>éé¢ï¼${params.data.amount}</div> </div> `; } }); // éé¡¹æ°æ® const equipmentTypeOptions = ref([]); // è·åæ°æ® const fetchData = async () => { try { // è·ååºå®èµäº§æ±æ»ä¿¡æ¯ const assetInfoRes = await getAssetInfo({ startDate: dateRange.value ? dateRange.value[0] : null, endDate: dateRange.value ? dateRange.value[1] : null, equipmentType: equipmentType.value }); if (assetInfoRes.code === 200) { assetInfo.value = assetInfoRes.data; } // è·å设å¤å表 const equipmentListRes = await getLedgerPage({ current: pagination.value.currentPage, size: pagination.value.pageSize, startDate: dateRange.value ? dateRange.value[0] : null, endDate: dateRange.value ? dateRange.value[1] : null, equipmentType: equipmentType.value }); if (equipmentListRes.code === 200) { equipmentList.value = equipmentListRes.data.records; pagination.value.total = equipmentListRes.data.total; // æ ¹æ® equipmentList æ deviceName è¿è¡åç±»ç»è®¡ const deviceNameMap = {}; equipmentList.value.forEach(item => { const deviceName = item.deviceName; if (!deviceNameMap[deviceName]) { deviceNameMap[deviceName] = { name: deviceName, count: 0, totalValue: 0 }; } deviceNameMap[deviceName].count += item.number || 1; // å设 number ä¸ºè®¾å¤æ°é deviceNameMap[deviceName].totalValue += item.taxIncludingPriceTotal || 0; // ç´¯å å«ç¨æ»ä»· }); // 转æ¢ä¸º typeDistributionData æ ¼å¼ typeDistributionData.value = Object.values(deviceNameMap).map(item => ({ name: item.name, value: item.count, count: item.count, amount: `Â¥${formatCurrency(item.totalValue)}` })); // æ´æ°xè½´æ°æ® xAxis.value[0].data = typeDistributionData.value.map(item => item.name); // æå»ºæçº¿å¾æ°æ® typeDistributionLineSeries.value = [ { name: 'è®¾å¤æ°é', type: 'line', data: typeDistributionData.value.map(item => item.count) } ]; } } catch (error) { console.error('è·ååºå®èµäº§æ°æ®å¤±è´¥ï¼', error); } }; // åå§å onMounted(() => { // è·ååè¡¨æ°æ® fetchData(); }); // æ ¼å¼åè´§å¸ const formatCurrency = (value) => { if (!value) return '0.00'; return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ','); }; // è·åç¶ææ ç¾ç±»å const getStatusTagType = (status) => { switch (status) { case 'å¨ç¨': return 'success'; case 'é²ç½®': return 'info'; case 'ç»´ä¿®ä¸': return 'warning'; case 'æ¥åº': return 'danger'; default: return 'info'; } }; // éç½®ç鿡件 const resetFilters = () => { dateRange.value = null; equipmentType.value = ''; fetchData(); }; // å页å¤ç const handleSizeChange = (size) => { pagination.value.pageSize = size; fetchData(); }; const handleCurrentChange = (page) => { pagination.value.currentPage = page; fetchData(); }; </script> <style scoped lang="scss"> /* åºç¡æ ·å¼è¡¥å */ :root { --el-color-primary: #4f46e5; } .el-card { position: relative; border-radius: 12px; padding: 14px 10px 10px 10px; box-shadow: 0 2px 8px #eee; :deep(.el-card__body) { padding: 10px 20px !important; } &.bg1 { background: url(@/assets/icons/png/1.png) no-repeat 100% 100% !important; } &.bg2 { background: url(@/assets/icons/png/2.png) no-repeat 100% 100% !important; } &.bg3 { background: url(@/assets/icons/png/3.png) no-repeat 100% 100% !important; } &.bg4 { background: url(@/assets/icons/png/4.png) no-repeat 100% 100% !important; } &.bg5 { background: url(@/assets/icons/png/5.png) no-repeat 100% 100% !important; } } .grid-container { /* grid 容å¨åºç¡æ ·å¼ */ display: grid; gap: 1rem; /* gap-4 å¯¹åº 1rem (16px) */ margin-bottom: 2rem; /* mb-8 å¯¹åº 2rem (32px) */ p { font-size: 22px; margin-top: 0px; color: #fff; } h3 { font-size: 36px; font-weight: 500; font-family: 'MyCustomFont', sans-serif; margin: 10px 0; color: #fff; } } /* ç§»å¨ç«¯é»è®¤æ ·å¼ (grid-cols-1) */ .grid-container { grid-template-columns: repeat(1, minmax(0, 1fr)); } /* å°å±å¹åä»¥ä¸ (sm:grid-cols-2) */ @media (min-width: 640px) { .grid-container { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* 大å±å¹åä»¥ä¸ (lg:grid-cols-5) */ @media (min-width: 1024px) { .grid-container { grid-template-columns: repeat(5, minmax(0, 1fr)); } } /* å¡çæ¬åææå¢å¼º */ .el-card:hover { transform: translateY(-2px); } .echarts { display: flex; justify-content: space-between; } /* å¾è¡¨å®¹å¨æ ·å¼ */ .el-chart { width: 100%; height: 100%; } .section-title { position: relative; font-size: 18px; color: #333; padding-left: 10px; margin-bottom: 10px; font-weight: 700; } .section-title::before { position: absolute; left: 0; top: 0px; content: ''; width: 4px; height: 18px; background-color: #002FA7; border-radius: 2px; } .chart-num { position: absolute; z-index: 3; top: 92px; left: 92px; display: flex; flex-direction: column; justify-content: center; } .pagination-container { margin-top: 20px; display: flex; justify-content: center; } </style> src/views/financialManagement/expenseManagement/index.vue
@@ -106,6 +106,7 @@ listPage, { expenseMethod: undefined, entryDate: undefined, }, [ { @@ -226,9 +227,11 @@ const changeDaterange = (value) => { if (value) { filters.entryDate = value; filters.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); filters.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); } else { filters.entryDate = null; filters.entryDateStart = undefined; filters.entryDateEnd = undefined; } @@ -256,12 +259,6 @@ }; onMounted(() => { filters.entryDate = [ dayjs().format("YYYY-MM-DD"), dayjs().add(1, "day").format("YYYY-MM-DD"), ] filters.entryDateStart = dayjs().format("YYYY-MM-DD") filters.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD") getTableData(); }); </script> src/views/financialManagement/financialStatements/index.vue
@@ -10,7 +10,7 @@ range-separator="è³" start-placeholder="å¼å§æ¥æ" end-placeholder="ç»ææ¥æ" :default-value="[new Date(firstDayOfMonth), new Date()]" clearable @change="handleDateChange" class="w-full md:w-auto" style="margin-right: 30px;" @@ -137,8 +137,7 @@ import dayjs from "dayjs"; // æ¥æèå´ const dateRange = ref([]); const firstDayOfMonth = ref(null); const dateRange = ref(null); const chartStyle = { width: '100%', height: '100%', // 设置å¾è¡¨å®¹å¨çé«åº¦ @@ -320,6 +319,9 @@ }) const getData = async () => { if (!dateRange.value || !dateRange.value.length) { return; } try { const {code,data} = await reportForms({entryDateStart:dateRange.value[0], entryDateEnd:dateRange.value[1]}); if(code === 200) { @@ -370,30 +372,22 @@ }; // åå§åæ¥æèå´ï¼é»è®¤å½æï¼ // åå§å onMounted(() => { const today = new Date(); const firstDay = new Date(today.getFullYear(), today.getMonth(), 1); firstDayOfMonth.value = firstDay; dateRange.value = [dayjs(firstDay).format("YYYY-MM-DD"), dayjs(today).format("YYYY-MM-DD")]; getData() // ä¸è®¾ç½®é»è®¤æ¥æï¼ç±ç¨æ·æå¨éæ© }); // å¤çæ¥æèå´åå const handleDateChange = (newRange) => { if (newRange && newRange.length === 2) { dateRange.value = newRange; if (newRange && newRange.length === 2) { getData() } }; // éç½®æ¥æèå´ const resetDateRange = () => { const today = new Date(); const firstDay = new Date(today.getFullYear(), today.getMonth(), 1); dateRange.value = [dayjs(firstDay).format("YYYY-MM-DD"), dayjs(today).format("YYYY-MM-DD")]; getData() dateRange.value = null; }; </script> src/views/financialManagement/inventoryAccounting/index.vue
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,390 @@ <template> <div class="inventory-statistics"> <!-- çé表å --> <div class="filter-form"> <el-form :model="filterForm" inline> <!-- <el-form-item label="æ¶é´èå´">--> <!-- <el-date-picker--> <!-- v-model="filterForm.dateRange"--> <!-- type="daterange"--> <!-- range-separator="è³"--> <!-- start-placeholder="å¼å§æ¥æ"--> <!-- end-placeholder="ç»ææ¥æ"--> <!-- />--> <!-- </el-form-item>--> <!-- <el-form-item label="ä¾åºååç§°">--> <!-- <el-input v-model="filterForm.supplierName" style="width: 240px" placeholder="请è¾å ¥" clearable prefix-icon="Search" />--> <!-- </el-form-item>--> <!-- <el-form-item label="产ååç§°">--> <!-- <el-input v-model="filterForm.productCategory" style="width: 240px" placeholder="请è¾å ¥" clearable prefix-icon="Search" />--> <!-- </el-form-item>--> <el-form-item> <el-button type="primary" @click="handleSearch">æ¥è¯¢</el-button> <!-- <el-button @click="handleReset">éç½®</el-button>--> <!-- <el-button type="success" @click="handleExport">导åº</el-button>--> </el-form-item> </el-form> </div> <!-- ç»è®¡æ±æ»å¡ç --> <div class="summary-cards"> <el-row :gutter="20"> <el-col :span="6"> <el-card class="summary-card"> <div class="summary-item"> <p class="summary-title">æ»åºåæ°é</p> <p class="summary-value">{{ summaryData.totalInventoryCount }}</p> </div> </el-card> </el-col> <el-col :span="6"> <el-card class="summary-card"> <div class="summary-item"> <p class="summary-title">æ»åºåéé¢</p> <p class="summary-value">Â¥{{ summaryData.totalInventoryValue }}</p> </div> </el-card> </el-col> <el-col :span="6"> <el-card class="summary-card"> <div class="summary-item"> <p class="summary-title">åºåå卿°é</p> <p class="summary-value">{{ summaryData.inventoryChangeCount }}</p> </div> </el-card> </el-col> <el-col :span="6"> <el-card class="summary-card"> <div class="summary-item"> <p class="summary-title">åºååå¨éé¢</p> <p class="summary-value">Â¥{{ summaryData.inventoryChangeValue }}</p> </div> </el-card> </el-col> </el-row> </div> <!-- å¾è¡¨åºå --> <div class="chart-section"> <el-row :gutter="20"> <el-col :span="12"> <el-card class="chart-card"> <template #header> <div class="card-header"> <span>åºååç±»å æ¯</span> </div> </template> <div id="category-pie-chart" style="height: 400px;"></div> </el-card> </el-col> <el-col :span="12"> <el-card class="chart-card"> <template #header> <div class="card-header"> <span>åºåéé¢è¶å¿</span> </div> </template> <div id="amount-trend-chart" style="height: 400px;"></div> </el-card> </el-col> </el-row> </div> <!-- æ°æ®è¡¨æ ¼ --> <div class="table_list"> <el-table :data="tableData" v-loading="loading" border style="width: 100%" :header-cell-style="{ background: '#f5f7fa', color: '#606266' }" > <el-table-column align="center" type="selection" width="55" /> <el-table-column align="center" label="åºå·" type="index" width="60" /> <el-table-column label="ä¾åºååç§°" prop="supplierName" width="240" show-overflow-tooltip /> <el-table-column label="产å" prop="productCategory" min-width="100" show-overflow-tooltip /> <el-table-column label="è§æ ¼åå·" prop="specificationModel" min-width="200" show-overflow-tooltip /> <el-table-column label="åä½" prop="unit" width="70" show-overflow-tooltip /> <el-table-column label="å ¥åºæ°é" prop="inboundNum" width="90" show-overflow-tooltip /> <el-table-column label="åºåæ°é" prop="inboundNum0" width="90" show-overflow-tooltip /> <el-table-column label="å«ç¨åä»·" prop="taxInclusiveUnitPrice" width="100" show-overflow-tooltip /> <el-table-column label="å«ç¨æ»ä»·" prop="taxInclusiveTotalPrice" width="100" show-overflow-tooltip /> <el-table-column label="ç¨ç(%)" prop="taxRate" width="80" show-overflow-tooltip /> <el-table-column label="ä¸å«ç¨æ»ä»·" prop="taxExclusiveTotalPrice" width="100" show-overflow-tooltip /> <el-table-column label="å ¥åºäºº" prop="createBy" width="100" show-overflow-tooltip /> </el-table> <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current" :limit="page.size" @pagination="paginationChange" /> </div> </div> </template> <script setup> import { ref, reactive, onMounted, nextTick } from 'vue' import * as echarts from 'echarts' import {getStockInChartData, getStockInPage} from "@/api/inventoryManagement/stockIn.js"; // ç¶æåé const loading = ref(false) const total = ref(0) const tableData = ref([]) const summaryData = ref({}) const page = reactive({ current: 1, size: 100, }) // å¾è¡¨å®ä¾ const categoryPieChart = ref(null) const amountTrendChart = ref(null) // çé表å const filterForm = reactive({ dateRange: [], supplierName: '', productCategory: '' }) const paginationChange = (obj) => { page.current = obj.page; page.size = obj.limit; loadData() } // åå§åæ°æ® onMounted(() => { loadSummaryData() loadData() }) // å è½½ç»è®¡æ±æ»æ°æ® const loadSummaryData = () => { getStockInChartData().then(res => { summaryData.value = res.data }) } // å è½½åºåæ°æ® const loadData = () => { loading.value = true getStockInPage({ ...filterForm, ...page }).then(res => { loading.value = false tableData.value = res.data.records total.value = res.data.total console.log('res', res.data.records) // æ°æ®å è½½å®æåæ¸²æå¾è¡¨ nextTick(() => { renderCategoryPieChart() renderAmountTrendChart() }) }).catch(() => { loading.value = false }) } // 渲æåç±»å æ¯é¥¼å¾ const renderCategoryPieChart = () => { if (!categoryPieChart.value) { categoryPieChart.value = echarts.init(document.getElementById('category-pie-chart')) } // æ ¹æ® tableData æ productCategory åç±»å¹¶è®¡ç® inboundNum0 æ°éæ»å const categoryMap = tableData.value.reduce((acc, cur) => { acc[cur.productCategory] = (acc[cur.productCategory] || 0) + cur.inboundNum0 return acc }, {}) // å°åç±»ç»æè½¬æ¢ä¸º ECharts 饼徿éçæ°æ®æ ¼å¼ const categoryData = Object.entries(categoryMap).map(([name, value]) => ({ name: name, value: value })) const option = { title: { text: 'åºååç±»å æ¯', left: 'center' }, tooltip: { trigger: 'item', formatter: '{a} <br/>{b}: {c} ({d}%)' }, legend: { orient: 'vertical', left: 'left' }, series: [ { name: 'åºååç±»', type: 'pie', radius: ['40%', '70%'], avoidLabelOverlap: false, itemStyle: { borderRadius: 10, borderColor: '#fff', borderWidth: 2 }, label: { show: true, formatter: '{b}: {d}%' }, emphasis: { label: { show: true, fontSize: '16', fontWeight: 'bold' } }, data: categoryData } ] } categoryPieChart.value.setOption(option) } // 渲æéé¢è¶å¿æçº¿å¾ const renderAmountTrendChart = () => { if (!amountTrendChart.value) { amountTrendChart.value = echarts.init(document.getElementById('amount-trend-chart')) } // ææä»½åç»å¹¶è®¡ç®taxInclusiveTotalPriceæ»å const monthlyAmounts = tableData.value.reduce((acc, cur) => { const date = new Date(cur.createTime); const month = date.getMonth() + 1; // ç¡®ä¿monthå¨1-12èå´å if (month >= 1 && month <= 12) { acc[month] = (acc[month] || 0) + cur.taxInclusiveTotalPrice; } return acc; }, {}); // çæ12个æçæ°æ®ï¼ç¼ºå¤±æä»½ç¨0ä»£æ¿ const amounts = []; for (let i = 1; i <= 12; i++) { amounts.push(monthlyAmounts[i] || 0); } const dates = ['1æ', '2æ', '3æ', '4æ', '5æ', '6æ', '7æ', '8æ', '9æ', '10æ', '11æ', '12æ'] const option = { title: { text: 'åºåéé¢è¶å¿', left: 'center' }, tooltip: { trigger: 'axis', formatter: '{b}: Â¥{c}' }, xAxis: { type: 'category', data: dates }, yAxis: { type: 'value', axisLabel: { formatter: 'Â¥{value}' } }, series: [ { name: 'åºåéé¢', type: 'line', data: amounts, smooth: true, areaStyle: {} } ] } amountTrendChart.value.setOption(option) } // æ¥è¯¢æä½ const handleSearch = () => { loadData() } // éç½®æä½ const handleReset = () => { filterForm.dateRange = [] filterForm.supplierName = '' filterForm.productCategory = '' loadData() } // å¯¼åºæä½ const handleExport = () => { console.log('å¯¼åºæ°æ®') } // çªå£å¤§å°æ¹åæ¶ï¼éæ°è°æ´å¾è¡¨å¤§å° window.addEventListener('resize', () => { if (categoryPieChart.value) categoryPieChart.value.resize() if (amountTrendChart.value) amountTrendChart.value.resize() }) </script> <style scoped> .inventory-statistics { padding: 20px; } .filter-form { margin-bottom: 20px; } .summary-cards { margin-bottom: 20px; } .summary-card { text-align: center; height: 100px; display: flex; align-items: center; justify-content: center; } .summary-item { width: 100%; } .summary-title { font-size: 14px; color: #606266; margin-bottom: 5px; } .summary-value { font-size: 24px; font-weight: bold; color: #303133; } .summary-value.warning { color: #e6a23c; } .summary-value.danger { color: #f56c6c; } .chart-section { margin-bottom: 20px; } .chart-card { height: 460px; } .card-header { font-weight: bold; } .table_list { margin-top: 20px; } .pagination { text-align: right; margin-top: 20px; } </style> src/views/financialManagement/revenueManagement/index.vue
@@ -106,6 +106,7 @@ listPage, { incomeMethod: undefined, entryDate: undefined, }, [ { @@ -226,9 +227,11 @@ const changeDaterange = (value) => { if (value) { filters.entryDate = value; filters.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD"); filters.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD"); } else { filters.entryDate = null; filters.entryDateStart = undefined; filters.entryDateEnd = undefined; } @@ -256,12 +259,6 @@ }; onMounted(() => { filters.entryDate = [ dayjs().format("YYYY-MM-DD"), dayjs().add(1, "day").format("YYYY-MM-DD"), ] filters.entryDateStart = dayjs().format("YYYY-MM-DD") filters.entryDateEnd = dayjs().add(1, "day").format("YYYY-MM-DD") getTableData(); }); </script>