diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 1c70436..546f0c1 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -34,6 +34,73 @@ +
+ +
+ +
+ +
+
+
{{moneyFormat(statistic.progress.money_total)}}
+
合计金额
+
+
+
{{moneyFormat(statistic.progress.use_money_total)}}
+
使用金额
+
+
+
{{((statistic.progress.use_money_total/statistic.progress.money_total)*100).toFixed(2)}}%
+
进展率
+
+
+
+
+
+ +
+ +
+ +
+ +
+ + + + + +
+
+ +
+ +
+ +
+ +
+ + + + + +
+
+ +
@@ -44,8 +111,8 @@ import LxHeader from '@/components/LxHeader/index.vue' import Pagination from '@/components/Pagination' import { adminDepartmentList } from '../../api/system/department.js' import { adminUserList, getInfo } from '../../api/user.js' -import {getNotice,readNotice} from "@/api/dashboard/notice" -import {parseTime} from "@/utils/index" +import {getNotice,readNotice,statistic} from "@/api/dashboard/notice" +import {parseTime,moneyFormatter} from "@/utils/index" import {Message} from "element-ui"; export default { name: 'Manage', @@ -54,6 +121,7 @@ export default { }, data() { return { + statistic:'', department_id: [], userIds: [], list: [], @@ -72,10 +140,95 @@ export default { userList: [], formLabelWidth: '200px', user: {}, + + departmentProgress:[], + departmentTable:[ + { + label:'科室', + width:220, + prop:'name', + sortable:false + }, + { + label:'合计金额(元)', + width: 240, + align:'right', + sortable:false, + prop:'money_total', + formatter:(cell,data,value)=>{ + return moneyFormatter(value) + } + }, + { + label:'已使用(元)', + width: 240, + align:'right', + sortable:false, + prop:'use_money_total', + formatter:(cell,data,value)=>{ + return moneyFormatter(value) + } + }, + { + label:'进展情况', + sortable:false, + minWidth: 220, + align: 'left', + customFn:(row)=>{ + return ( +
+ +
+ ) + } + } + ], + typeTable:[ + { + label:'预算类别', + width:220, + prop:'name', + sortable:false + }, + { + label:'合计金额(元)', + width: 240, + align:'right', + sortable:false, + prop:'money_total', + formatter:(cell,data,value)=>{ + return moneyFormatter(value) + } + }, + { + label:'已使用(元)', + width: 240, + align:'right', + sortable:false, + prop:'use_money_total', + formatter:(cell,data,value)=>{ + return moneyFormatter(value) + } + }, + { + label:'进展情况', + sortable:false, + minWidth: 220, + align: 'left', + customFn:(row)=>{ + return ( +
+ +
+ ) + } + } + ] } }, created() { - //this.getList() + this.getNotices() + this.getStatistic() getInfo().then(response => { console.log(response) @@ -83,6 +236,12 @@ export default { }).catch(error => {}) }, methods: { + async getStatistic(){ + const res = await statistic() + console.log(res) + this.statistic = res + }, + toContract(row){ this.$refs['detailContract'].getDetail(row.contract_id) this.$refs['detailContract'].isShowDetail = true @@ -106,15 +265,7 @@ export default { this.total = res.total }, - departmentChange(v) { - if (v.length > 0) { - adminUserList({department_id: v[v.length - 1], page_size: 9999}).then(r => { - this.userList = r.data - }).catch(error => {}) - } else { - this.userList = [] - } - }, + filterChildren(data) { data.forEach(i => { if (i.children && i.children.length > 0) { @@ -176,18 +327,43 @@ export default { }).catch(() => {}); }, }, - mounted() { - this.getNotices() + computed:{ + moneyFormat(){ + return function (price){ + return moneyFormatter(price) + } + } } } -