This commit is contained in:
tcy
2025-08-22 19:01:55 +08:00
parent 26e1493aa7
commit 8f9b042941
7 changed files with 106 additions and 124 deletions

View File

@ -1,30 +0,0 @@
import request from '@/utils/request';
// 合同金额
export const totalAmount = () => {
return request({
url: '/money/big/screen/totalAmount',
method: 'get',
});
};
// 资金KPI
export const monthMoney = () => {
return request({
url: '/money/big/screen/monthMoney',
method: 'get',
});
};
// 现金流
export const monthCash = () => {
return request({
url: '/money/big/screen/monthCash',
method: 'get',
});
};
// 现金流总和
export const cashTotal = () => {
return request({
url: '/money/big/screen/cashTotal',
method: 'get',
});
};

View File

@ -74,3 +74,26 @@ export const totalAmount = () => {
params: clientid
});
};
// 资金KPI
export const monthMoney = () => {
return request({
url: '/money/big/screen/monthMoney',
method: 'get',
});
};
// 现金流
export const monthCash = () => {
return request({
url: '/money/big/screen/monthCash',
method: 'get',
});
};
// 现金流总和
export const cashTotal = () => {
return request({
url: '/money/big/screen/cashTotal',
method: 'get',
});
};

View File

@ -1,34 +1,15 @@
<template>
<div class="centerPage">
<div>
<div style="height: 147px;width: 100%;display: flex;justify-content: space-between;">
<!-- <div class="top_box">
<div class="top_box_title">收入合同</div>
<div>
<span class="top_box_number">205,805.17</span>
<span>万元</span>
</div>
<div class="top_box_bottom">
<div>
<img class="up_img" src="@/assets/large/up.png" alt=""></img>
<span class="top_box_title"> 3.2% 较上月</span>
</div>
<img class="top_img" src="@/assets/large/top1.png" alt=""></img>
</div>
</div> -->
<!-- <RevenueContractCard title="收入合同" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
badgeIcon="top1" period="较上月" />
<RevenueContractCard title="支出合同" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
badgeIcon="top2" period="较上月" />
<RevenueContractCard title="合同利润" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="down"
badgeIcon="top3" period="较上月" />
<RevenueContractCard title="工程变更" :value="156234.89" :growthRate="-1.5" trendDirection="up" trendIcon="up"
badgeIcon="top4" period="较上月" /> -->
<RevenueContractCard title="收入合同" :value="bigDataObj.incomeTotalAmount" />
<RevenueContractCard title="支出合同" :value="bigDataObj.expensesTotalAmount" />
<RevenueContractCard title="合同利润" :value="bigDataObj.profitAmount" />
<RevenueContractCard title="工程变更" :value="bigDataObj.changeAmount" unit="%" />
<div style="height: 147px; width: 100%; display: flex; justify-content: space-between">
<!-- 收入合同保持万元显示 -->
<RevenueContractCard title="收入合同" :value="formatToTenThousand(data.incomeTotalAmount, 'tenThousand')" />
<!-- 支出合同保持万元显示 -->
<RevenueContractCard title="支出合同" :value="formatToTenThousand(data.expensesTotalAmount, 'tenThousand')" />
<!-- 合同利润保持万元显示 -->
<RevenueContractCard title="合同利润" :value="formatToTenThousand(data.profitAmount, 'tenThousand')" />
<!-- 工程变更改为百分比显示 -->
<RevenueContractCard title="工程变更" :value="formatToTenThousand(data.changeAmount, 'percentage')" unit="" />
</div>
</div>
<div class="centerPage_map">

View File

@ -2,41 +2,34 @@
<div class="leftPage">
<div class="kpi_box">
<TitleComponent :title="'支付KPI'" style="margin-bottom: 20px" />
<ProgressComponent
title="应收账款"
:value="formatCurrency(incomeData.planAmount)"
<ProgressComponent title="应收账款" :value="formatCurrency(incomeData.planAmount)"
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
progressColor="rgba(255, 77, 79, 1)"
/>
<ProgressComponent
title="应付账款"
:value="formatCurrency(expensesData.planAmount)"
progressColor="rgba(255, 77, 79, 1)" />
<ProgressComponent title="应付账款" :value="formatCurrency(expensesData.planAmount)"
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
progressColor="rgba(29, 214, 255, 1)"
/>
<ProgressComponent
title="本月付款"
:value="formatCurrency(expensesData.actualAmount)"
progressColor="rgba(29, 214, 255, 1)" />
<ProgressComponent title="本月付款" :value="formatCurrency(expensesData.actualAmount)"
:percentageChange="getPercentageChange(expensesData.planAmount, expensesData.actualAmount)"
:progressPercentage="getProgressPercentage(expensesData.planAmount, expensesData.actualAmount)"
progressColor="rgba(0, 227, 150, 1)"
/>
<ProgressComponent
title="本月收款"
:value="formatCurrency(incomeData.actualAmount)"
progressColor="rgba(0, 227, 150, 1)" />
<ProgressComponent title="本月收款" :value="formatCurrency(incomeData.actualAmount)"
:percentageChange="getPercentageChange(incomeData.planAmount, incomeData.actualAmount)"
:progressPercentage="getProgressPercentage(incomeData.planAmount, incomeData.actualAmount)"
progressColor="rgba(255, 147, 42, 1)"
/>
progressColor="rgba(255, 147, 42, 1)" />
</div>
<div class="contract_box">
<!-- 切换按钮 -->
<div style="height: 60px;">
<TitleComponent :title="'收支合同分析'" style="margin-bottom: 20px" />
</div>
<!-- 切换按钮 -->
<div style="margin-bottom: 10px; text-align: center">
<button @click="switchChart('income')" :style="activeChart === 'income' ? activeBtnStyle : defaultBtnStyle">收入合同</button>
<button @click="switchChart('expenses')" :style="activeChart === 'expenses' ? activeBtnStyle : defaultBtnStyle" style="margin-left: 15px">
<button @click="switchChart('income')"
:style="activeChart === 'income' ? activeBtnStyle : defaultBtnStyle">收入合同</button>
<button @click="switchChart('expenses')" :style="activeChart === 'expenses' ? activeBtnStyle : defaultBtnStyle"
style="margin-left: 15px">
支出合同
</button>
</div>
@ -202,8 +195,8 @@ const generatePieOption = (data) => {
{
name: '合同数量',
type: 'pie',
radius: ['45%', '65%'],
center: ['50%', '60%'],
radius: ['30%', '60%'],
center: ['50%', '80%'],
data: [], // 空数据,避免显示圆环
itemStyle: { borderColor: '#000', borderWidth: 1 },
// 中心显示“加载中”提示
@ -309,18 +302,21 @@ onMounted(async () => {
.leftPage {
width: 100%;
height: 100%;
.kpi_box {
margin-bottom: 10px;
}
.contract_box {
height: 35vh;
height: 33vh;
display: flex;
flex-direction: column; // 按钮区和图表区垂直排列
}
.chart-container {
flex: 1; // 占满剩余高度,确保图表容器足够大
min-height: 200px; // 最小高度,避免容器过矮
height: 28vh;
}
.kpi_box,
.contract_box {
padding: 10px;

View File

@ -696,6 +696,7 @@ export const getInventoryOption = () => {
};
export const getBarOptions = (data: any) => {
const option = {
legend: {
show: true,
top: '50%',
@ -714,6 +715,9 @@ export const getBarOptions = (data: any) => {
formatter: '{b0}{c0}万元',
textStyle: {
color: '#fff'
},
axisPointer: {
type: 'shadow' // 默认为直线,可选为:'line' | 'shadow',
}
// borderColor: 'rgba(252, 217, 18, 1)'
},

View File

@ -45,7 +45,7 @@ import TitleComponent from './TitleComponent.vue';
import EchartBox from '@/components/EchartBox/index.vue';
import { getLineOption, getBarOptions } from './optionList';
import ProgressComponent from './ProgressComponent.vue';
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen';
import { monthMoney, monthCash, cashTotal } from '@/api/largeScreen/index';
const lineOption = ref();
const barOption = ref();
@ -90,6 +90,8 @@ const getTurnoverList = async () => {
expenses
]
};
console.log(barData);
barOption.value = getBarOptions(barData);
};
const getTotalAmonunt = async () => {

View File

@ -1,7 +1,8 @@
<template>
<div class="p-2">
<!-- 搜索区域 -->
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter"
:leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
@ -21,10 +22,12 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['patch:patch:add']">新增</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd"
v-hasPermi="['patch:patch:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['patch:patch:export']">导出</el-button>
<el-button type="warning" plain icon="Download" @click="handleExport"
v-hasPermi="['patch:patch:export']">导出</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -56,10 +59,10 @@
<el-table-column label="任务状态" align="center" prop="taskStatus">
<template #default="scope">
<span
:class="[Number(scope.row.taskStatus) === 0 ? 'text-warning' : Number(scope.row.taskStatus) === 1 ? 'text-success' : 'text-danger']"
>
:class="[Number(scope.row.taskStatus) === 0 ? 'text-warning' : Number(scope.row.taskStatus) === 1 ? 'text-success' : 'text-danger']">
{{
Number(scope.row.taskStatus) === 0 ? '未完成' : Number(scope.row.taskStatus) === 1 ? '已完成' : `未知状态(${scope.row.taskStatus})`
Number(scope.row.taskStatus) === 0 ? '未完成' : Number(scope.row.taskStatus) === 1 ? '已完成' :
`未知状态(${scope.row.taskStatus})`
}}
</span>
</template>
@ -71,13 +74,15 @@
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['patch:patch:edit']"></el-button>
</el-tooltip> -->
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['patch:patch:remove']"></el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['patch:patch:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<!-- 进度详情弹窗 -->
<el-dialog :title="`进度详情(当前总进度:${currentTotalProgress}%`" v-model="progressDialogVisible" width="1000px" destroy-on-close>
<el-dialog :title="`进度详情(当前总进度:${currentTotalProgress}%`" v-model="progressDialogVisible" width="1000px"
destroy-on-close>
<div class="mb-4">
<!-- v-hasPermi="['patch:progress:add']" -->
<el-button type="primary" plain icon="Plus" size="small" @click="handleProgressAdd()"> 新增进度 </el-button>
@ -94,37 +99,28 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="140">
<template #default="scope">
<el-tooltip content="修改进度" placement="top">
<el-button
link
type="primary"
icon="Edit"
size="small"
@click="handleProgressUpdate(scope.row)"
v-hasPermi="['patch:progress:edit']"
></el-button>
<el-button link type="primary" icon="Edit" size="small" @click="handleProgressUpdate(scope.row)"
v-hasPermi="['patch:progress:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除进度" placement="top">
<el-button
link
type="primary"
icon="Delete"
size="small"
@click="handleProgressDelete(scope.row)"
v-hasPermi="['patch:progress:remove']"
></el-button>
<el-button link type="primary" icon="Delete" size="small" @click="handleProgressDelete(scope.row)"
v-hasPermi="['patch:progress:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-dialog>
<!-- 新增/修改进度弹窗 -->
<el-dialog :title="progressDialog.title" v-model="progressDialog.visible" width="500px" append-to-body destroy-on-close>
<el-dialog :title="progressDialog.title" v-model="progressDialog.visible" width="500px" append-to-body
destroy-on-close>
<el-form ref="progressFormRef" :model="progressForm" :rules="progressRules" label-width="120px">
<el-input v-model="progressForm.ordersId" placeholder="关联的任务ID" readonly style="color: #666; background: #f5f7fa" type="hidden" />
<el-input v-model="progressForm.ordersId" placeholder="关联的任务ID" readonly
style="color: #666; background: #f5f7fa" type="hidden" />
<el-input v-model="progressForm.projectId" type="hidden" />
<el-input v-model="progressForm.slaveId" placeholder="请输入执行人ID" v-if="false" />
<el-form-item label="进度" prop="progress">
<el-input v-model="progressForm.progress" placeholder="请输入进度0-100之间的数字" type="number" @input="handleProgressInput" />
<el-input v-model="progressForm.progress" placeholder="请输入进度0-100之间的数字" type="number"
@input="handleProgressInput" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="progressForm.remark" type="textarea" placeholder="请输入备注" rows="3" />
@ -139,13 +135,15 @@
</el-dialog>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 新增/修改任务弹窗 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body destroy-on-close>
<el-form ref="masterFormRef" :model="form" :rules="rules" label-width="100px">
<el-input v-model="form.projectId" placeholder="请输入项目ID" :readonly="!!currentProjectId" :disabled="!!currentProjectId" v-if="false" />
<el-input v-model="form.projectId" placeholder="请输入项目ID" :readonly="!!currentProjectId"
:disabled="!!currentProjectId" v-if="false" />
<template #help>
<span v-if="currentProjectId" class="text-success">已自动关联当前选中项目</span>
</template>
@ -154,14 +152,17 @@
</el-form-item>
<el-form-item label="执行人姓名" prop="userId">
<el-select v-model="form.userId" placeholder="请选择执行人姓名" clearable style="width: 100%">
<el-option v-for="item in slaveOptions" :key="item.id" :label="item.nickName" :value="item.userId"></el-option>
<el-option v-for="item in slaveOptions" :key="item.id" :label="item.nickName"
:value="item.userId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="计划完成时间" prop="pcd">
<el-date-picker clearable v-model="form.pcd" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择计划完成时间" />
<el-date-picker clearable v-model="form.pcd" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择计划完成时间" />
</el-form-item>
<el-form-item label="实际完成时间" prop="act">
<el-date-picker clearable v-model="form.act" type="datetime" value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择实际完成时间" />
<el-date-picker clearable v-model="form.act" type="datetime" value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择实际完成时间" />
</el-form-item>
<el-form-item label="任务描述" prop="describe">
<el-input v-model="form.describe" type="textarea" placeholder="请输入任务描述" />
@ -243,7 +244,7 @@ interface ProgressDetail {
updateTime?: string;
projectId?: string | number;
}
interface ProgressForm extends Omit<ProgressDetail, 'updateTime'> {}
interface ProgressForm extends Omit<ProgressDetail, 'updateTime'> { }
// 4. 获取组件实例
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@ -631,7 +632,9 @@ const handleProgressInput = () => {
const handleExport = () => {
proxy?.download('patch/patch/export', { ...queryParams.value }, `任务列表_${new Date().getTime()}.xlsx`);
};
onMounted(() => {
getList();
});
// 监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value?.id,
@ -651,13 +654,16 @@ onUnmounted(() => {
.mb-4 {
margin-bottom: 16px;
}
.el-table .small-padding .cell {
padding: 0 5px;
}
.el-table .fixed-width {
width: 120px !important;
}
.el-table-column .el-button--text + .el-button--text {
.el-table-column .el-button--text+.el-button--text {
margin-left: 10px;
}
</style>