diff --git a/src/api/budget/paidPlan.js b/src/api/budget/paidPlan.js new file mode 100644 index 0000000..f2e142e --- /dev/null +++ b/src/api/budget/paidPlan.js @@ -0,0 +1,41 @@ +import request from '@/utils/request' + +export function paidIndex (params) { + return request({ + method: 'get', + url: '/api/admin/paid-plan/index', + params + }) +} + +export function paidShow (params) { + return request({ + method: 'get', + url: '/api/admin/paid-plan/show', + params + }) +} + +export function paidStore (data) { + return request({ + method: 'post', + url: '/api/admin/paid-plan/store', + data + }) +} + +export function paidSave (data) { + return request({ + method: 'post', + url: '/api/admin/paid-plan/save', + data + }) +} + +export function paidDestroy (params) { + return request({ + method: 'get', + url: '/api/admin/paid-plan/destroy', + params + }) +} diff --git a/src/api/dashboard/notice.js b/src/api/dashboard/notice.js index 545357a..002aaf6 100644 --- a/src/api/dashboard/notice.js +++ b/src/api/dashboard/notice.js @@ -34,3 +34,12 @@ export function statistic(params,noLoading = false){ noLoading }) } + +export function carry (params) { + return request({ + method: 'get', + url: '/api/admin/notice/carry', + params, + + }) +} diff --git a/src/views/budget/budgetList.vue b/src/views/budget/budgetList.vue index 05ee004..800f1ea 100644 --- a/src/views/budget/budgetList.vue +++ b/src/views/budget/budgetList.vue @@ -32,7 +32,7 @@ :value="select.type" clearable size="small" - style="width: 300px" + style="width: 160px" @change="(e) => (select.type = e[e.length - 1] || '')" /> diff --git a/src/views/budget/components/payPlan.vue b/src/views/budget/components/payPlan.vue new file mode 100644 index 0000000..68ea94b --- /dev/null +++ b/src/views/budget/components/payPlan.vue @@ -0,0 +1,317 @@ + + + + + diff --git a/src/views/budget/seeBudget.vue b/src/views/budget/seeBudget.vue index 24107c1..9c6477c 100644 --- a/src/views/budget/seeBudget.vue +++ b/src/views/budget/seeBudget.vue @@ -48,13 +48,19 @@
+ + @@ -76,7 +82,11 @@ import { mergeTableRow } from "@/utils/mergeTableRow" + import payPlan from '@/views/budget/components/payPlan.vue' export default { + components: { + payPlan + }, data() { return { isShowAdd: false, diff --git a/src/views/dashboard/components/PieChart.vue b/src/views/dashboard/components/PieChart.vue index c03a28a..106d4fa 100644 --- a/src/views/dashboard/components/PieChart.vue +++ b/src/views/dashboard/components/PieChart.vue @@ -63,7 +63,7 @@ this.chart.setOption({ legend: { orient: 'horizontal', - bottom: '4%', + bottom: '3%', }, tooltip: { trigger: 'item', @@ -72,25 +72,24 @@ , series: [{ name: '数据', - type: 'pie', - radius: ['60%', '90%'], - center: ['50%', '50%'], //圆心坐标 - avoidLabelOverlap: true, //是否启用防止标签重叠策略 - label: { //每个数据的标签 - show: true, //设置为true则显示第一个数据 - position: 'center', //位置居中 - formatter: '{d}%', //{d}表示数据在总数据中的百分比 - fontSize: 20, - fontWeight: 'bold' - }, - color: ['#695BF9', '#1E3E55'], //系列的颜色 - emphasis: { //高亮,即鼠标经过时的样式 - scale: false //表示不放大item - }, - labelLine: { - show: true + type: 'pie', + radius: ['60%', '90%'], + center: ['50%', '50%'], //圆心坐标 + avoidLabelOverlap: true, //是否启用防止标签重叠策略 + label: { //每个数据的标签 + show: true, //设置为true则显示第一个数据 + position: 'center', //位置居中 + formatter: '{d}%', //{d}表示数据在总数据中的百分比 + fontSize: 20, + fontWeight: 'bold' + }, + color: ['#695BF9', '#1E3E55'], //系列的颜色 + emphasis: { //高亮,即鼠标经过时的样式 + scale: false //表示不放大item + }, + labelLine: { + show: true }, - center: ['50%', '50%'], data: chartdata.yArr, animationDuration }] @@ -99,4 +98,4 @@ } } } - + diff --git a/src/views/dashboard/components/budgetStatic.vue b/src/views/dashboard/components/budgetStatic.vue new file mode 100644 index 0000000..2aa40e8 --- /dev/null +++ b/src/views/dashboard/components/budgetStatic.vue @@ -0,0 +1,233 @@ + + + + + diff --git a/src/views/dashboard/components/carryStatic.vue b/src/views/dashboard/components/carryStatic.vue new file mode 100644 index 0000000..0609ec6 --- /dev/null +++ b/src/views/dashboard/components/carryStatic.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index b32fae9..c573d29 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -154,13 +154,41 @@ - +
+ + +
+
+ 统计查看 + +
+
+ 执行统计 + +
+
+
@@ -248,7 +276,31 @@
+ + + + + + + + + @@ -257,11 +309,14 @@ import detailContract from "@/views/contract/components/detailContract"; import LxHeader from "@/components/LxHeader/index.vue"; import Pagination from "@/components/Pagination"; import PieChart from "./components/PieChart.vue"; -import { adminDepartmentList } from "../../api/system/department.js"; -import { adminUserList, getInfo } from "../../api/user.js"; -import { getNotice, readNotice, statistic } from "@/api/dashboard/notice"; -import { parseTime, moneyFormatter } from "@/utils/index"; +import { adminDepartmentList } from '@/api/system/department'; +import { adminUserList, getInfo } from '@/api/user'; +import { getNotice, readNotice, statistic, carry } from "@/api/dashboard/notice"; +import { parseTime, moneyFormatter } from '@/utils'; import { Message } from "element-ui"; +import budgetStatic from '@/views/dashboard/components/budgetStatic.vue' +import lineChart from '@/views/dashboard/components/LineChart.vue' +import carryStatic from '@/views/dashboard/components/carryStatic.vue' export default { name: "Manage", components: { @@ -269,6 +324,9 @@ export default { Pagination, detailContract, PieChart, + budgetStatic, + lineChart, + carryStatic }, data() { return { @@ -278,6 +336,10 @@ export default { select: { year: "", }, + carrySelect: { + month: this.$moment().format('YYYY-MM') + }, + lineChartData: {}, statistic: "", department_id: [], userIds: [], @@ -433,6 +495,7 @@ export default { this.getNotices(); this.getStatistic(); + this.getCarry(); getInfo() .then((response) => { @@ -442,6 +505,54 @@ export default { .catch((error) => {}); }, methods: { + async getCarry () { + const res = await carry(this.carrySelect); + this.lineChartData = { + //legendArr: [`${this.carrySelect.month}计划`,`${this.carrySelect.month}实际`,`${this.$moment(this.carrySelect.month).add(1,'months').format('YYYY-MM')}计划`], + rotate: 54, + xArr: res?.map(i => i.plan_department?.name), + series: [ + { + name: `${this.carrySelect.month}计划`, + type: 'bar', + barGap: 0, + emphasis: { + focus: 'series' + }, + data: res?.map(i => { + const { use_money_total,money_total_1 } = i + return Math.round((Number(use_money_total||0) / Number(money_total_1||0)) * 10000) / 100 + }) + }, + { + name: `${this.carrySelect.month}实际`, + type: 'bar', + barGap: 0, + emphasis: { + focus: 'series' + }, + data: res?.map(i => { + const { use_money_total,money_total_2 } = i + return Math.round((Number(use_money_total||0) / Number(money_total_2||0)) * 10000) / 100 + }) + }, + { + name: `${this.$moment(this.carrySelect.month).add(1,'months').format('YYYY-MM')}计划`, + type: 'bar', + barGap: 0, + emphasis: { + focus: 'series' + }, + data: res?.map(i => { + const { use_money_total_next,money_total } = i + return Math.round((Number(use_money_total_next||0) / Number(money_total||0)) * 10000) / 100 + }) + }, + ] + }; + console.log(res) + }, + changeYear(e) { this.select.year = e; this.getStatistic(); @@ -605,6 +716,34 @@ export default { };