From c7b5940d381d48f1ec5cc30578b7aa18e328f963 Mon Sep 17 00:00:00 2001 From: xy <271556543@qq.com> Date: Fri, 19 Jan 2024 11:05:58 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E9=97=A8=E6=89=A7=E8=A1=8C=E9=A2=84?= =?UTF-8?q?=E7=AE=97=E5=88=86=E6=9C=88=E5=BA=A6=E5=AD=A3=E5=BA=A6=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E3=80=81=E8=BF=9B=E5=B1=95=E7=8E=8785%=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/dashboard/notice.js | 5 +- src/views/budget/component/payPlan.vue | 65 ++++++++++++++++ src/views/budget/seeBudget.vue | 2 +- .../statisticalReport/quarterlyStatistics.vue | 78 +++++++++++-------- 4 files changed, 113 insertions(+), 37 deletions(-) diff --git a/src/api/dashboard/notice.js b/src/api/dashboard/notice.js index 44766e9..d73d0c1 100644 --- a/src/api/dashboard/notice.js +++ b/src/api/dashboard/notice.js @@ -16,11 +16,12 @@ export function readNotice(params){ }) } -export function statistic(params){ +export function statistic(params,noloading=false){ return request({ method:'get', url:'/api/admin/notice/statistic', - params + params, + noloading }) } diff --git a/src/views/budget/component/payPlan.vue b/src/views/budget/component/payPlan.vue index e7daf6d..de13cf1 100644 --- a/src/views/budget/component/payPlan.vue +++ b/src/views/budget/component/payPlan.vue @@ -54,10 +54,14 @@ diff --git a/src/views/budget/seeBudget.vue b/src/views/budget/seeBudget.vue index 6737d5d..5427a4f 100644 --- a/src/views/budget/seeBudget.vue +++ b/src/views/budget/seeBudget.vue @@ -43,7 +43,7 @@ diff --git a/src/views/statisticalReport/quarterlyStatistics.vue b/src/views/statisticalReport/quarterlyStatistics.vue index e40cfbf..c83dd1c 100644 --- a/src/views/statisticalReport/quarterlyStatistics.vue +++ b/src/views/statisticalReport/quarterlyStatistics.vue @@ -7,6 +7,9 @@ >
+ + + 年份 - + @@ -54,7 +57,9 @@ import { departmentMoney } from "@/api/static"; export default { data() { return { + type: 1, select: { + type: 1,//1季度,2月 page: 1, page_size: 10, keyword: "", @@ -62,7 +67,27 @@ export default { year:"" }, list: [], - table: [ + }; + }, + methods: { //日期选择 + percent (a,b) { + if (b == 0) { + return 0 + } + return (parseInt(a) / parseInt(b) * 100).toFixed(2) + }, + + async getList() { + this.select.type = this.type; + const res = await departmentMoney(this.select); + this.list = res; + this.$refs['xyTable'].doLayout() + }, + }, + computed: { + table () { + const type = this.select.type; + return [ { label: '项目', fixed: 'left', @@ -79,7 +104,7 @@ export default { row.plan?.map((i,index) => { return ( -

{i.name}

+

{i.name}

) }) @@ -100,7 +125,7 @@ export default { customFn: row => { return (
-

{ +

{ row.plan?.reduce((a, b) => { return parseInt(a) + parseInt(b.money) },0) @@ -108,7 +133,7 @@ export default { { row.plan?.map((i,index) => { return ( -

{ i.money }

+

{ i.money }

) }) } @@ -119,18 +144,17 @@ export default { ] }, ...(() => { - let labels = new Map([ + let quarterLabels = new Map([ [0, '第一季度'], [1, '第二季度'], [2, '第三季度'], - [3, '10月'], - [4, '11月'], - [5, '12月'] + [3, '第四季度'] ]) + let monthLabels = new Map(Array.from({length: 12},(_,index)=>([index,`${index+1}月`]))) let arr = [] - for (let z = 0;z < 6;z ++) { + for (let z = 0;z < (type === 1 ? 4 : 12);z ++) { arr.push({ - label: labels.get(z), + label: type === 1 ? quarterLabels.get(z) : monthLabels.get(z), Fprop: '', multiHd: [ { @@ -140,7 +164,7 @@ export default { customFn: row => { return (
-

{ +

{ row.plan?.reduce((a, b) => { return parseInt(a) + parseInt(b.detail[z].plan_total) },0) @@ -148,7 +172,7 @@ export default { { row.plan?.map((i,index) => { return ( -

{ i.detail[z].plan_total }

+

{ i.detail[z].plan_total }

) }) } @@ -163,7 +187,7 @@ export default { customFn: row => { return (
-

{ +

{ row.plan?.reduce((a, b) => { return parseInt(a) + parseInt(b.detail[z].act_total) },0) @@ -186,7 +210,7 @@ export default { customFn: row => { return (

-

{ +

{ this.percent(row.plan?.reduce((a, b) => { return parseInt(a) + parseInt(b.detail[z].act_total) },0),row.plan?.reduce((a, b) => { @@ -196,7 +220,7 @@ export default { { row.plan?.map((i,index) => { return ( -

{ this.percent(i.detail[z].act_total,i.detail[z].plan_total) }%

+

{ this.percent(i.detail[z].act_total,i.detail[z].plan_total) }%

) }) } @@ -221,7 +245,7 @@ export default { { row.plan?.map((i,index) => { return ( -

{ +

{ i.detail?.reduce((a,b) => { return a + parseInt(b.plan_total) },0) @@ -233,26 +257,12 @@ export default { ) } } - ], - }; - }, - methods: { //日期选择 - percent (a,b) { - if (b == 0) { - return 0 - } - return (parseInt(a) / parseInt(b) * 100).toFixed(2) - }, - - async getList() { - const res = await departmentMoney(this.select); - this.list = res; - }, + ] + } }, - computed: {}, created() { this.select.year = this.$moment().format('YYYY'); - this.getList(); + this.getList(); }, };