master
xy 1 year ago
parent 137e1b5ac2
commit 104fe302b6

@ -425,6 +425,31 @@
</div>
</div>
</template>
<template #plan_admin_links>
<div class="xy-table-item">
<div class="xy-table-item-label">
可用人员
</div>
<div class="xy-table-item-content">
<el-select style="width: 300px;"
collapse-tags
filterable
multiple
:value="form.plan_admin_links.map(i => i.admin_id)"
placeholder="请选择"
@change="e => {
form.plan_admin_links = e.map(i => ({admin_id: i}))
}">
<el-option
v-for="item in users"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
<div class="xy-table-item-label">
@ -639,6 +664,32 @@
</div>
</div>
</template>
<template #plan_admin_links>
<div class="xy-table-item">
<div class="xy-table-item-label">
可用人员
</div>
<div class="xy-table-item-content">
<el-select style="width: 300px;"
collapse-tags
filterable
multiple
:value="editorForm.plan_admin_links.map(i => i.admin_id)"
placeholder="请选择"
@change="e => {
editorForm.plan_admin_links = e.map(i => ({admin_id: i}))
}">
<el-option
v-for="item in users"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item">
@ -730,7 +781,7 @@ import {
editorBudget,
detailBudget,
} from "@/api/budget/budget";
import { listdeptNoAuth } from "@/api/system/department";
import { listCommondepartment, listCommonuser } from "@/api/common";
import { Message } from "element-ui";
import {parseTime, moneyFormatter, moneyRecovery, deepCopy} from "@/utils";
import { getparameter, getparameterTree } from "@/api/system/dictionary";
@ -801,6 +852,7 @@ export default {
remark: "",
plan_department_link_id: [],
plan_department_links: [],
plan_admin_links: [],
update_money: "",
pid_info: null,
},
@ -926,6 +978,7 @@ export default {
is_auth: 0
},
departments: [], //
users: [],
//
isShowEditor: false,
@ -980,9 +1033,6 @@ export default {
this.form.pid_info = row;
}
},
changeDepartments(v) {
console.log(v);
},
async getTypes() {
const res = await getparameterTree({
id: 3
@ -1072,10 +1122,17 @@ export default {
},
//
getDepartment() {
listdeptNoAuth().then((res) => {
listCommondepartment({show_tree:1}).then((res) => {
this.departments = res;
});
},
async getUsers () {
const res = await listCommonuser({
page: 1,
page_size: 999
})
this.users = res.data;
},
//
async getFlowIds () {
let copy = deepCopy(this.flowIds)
@ -1149,6 +1206,7 @@ export default {
money: moneyRecovery(this.form.money),
plan_department_id: this.form.department,
plan_department_links: plan_department_links,
plan_admin_links: this.form.plan_admin_links,
remark: this.form.remark,
pid: this.form.pid,
flow_mod_id: this.form.flow_mod_id
@ -1204,6 +1262,7 @@ export default {
remark: this.editorForm.remark,
plan_department_id: this.editorForm.department,
plan_department_links: plan_department_links,
plan_admin_links: this.editorForm.plan_admin_links,
pid: this.editorForm.pid,
flow_mod_id: this.editorForm.flow_mod_id
}).then((res) => {
@ -1239,6 +1298,7 @@ export default {
content: res.content,
remark: res.remark,
plan_department_links: res.plan_department_links,
plan_admin_links: res.plan_admin_links.map(i=> ({admin_id: i.admin_id})),
pid: res.pid,
};
let ids = [];
@ -1264,6 +1324,7 @@ export default {
this.getTypes();
this.getDepartment();
this.getBudgets();
this.getUsers();
},
};
</script>

@ -431,11 +431,21 @@ import {listdeptNoAuth} from "@/api/system/department";
}
},
{
label: "已经使用",
prop: 'use_money_total',
width: 136,
align: 'right',
}
label: "实付金额",
prop: "use_money_total",
width: 120,
align: "right",
formatter: (v1, v2, value) =>
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
},
{
label: "已用金额",
prop: "has_money_total",
width: 120,
align: "right",
formatter: (v1, v2, value) =>
value ? `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",") : "",
},
],
}
},

@ -155,27 +155,10 @@ export default {
},
series: [
{
barWidth: 40,
barWidth: 30,
type: 'bar',
stack: "a",
name: "合计金额(元)",
label: {
show: true,
color: "#fff",
formatter: (params) => {
let m2 = params?.money_total_2 || 0;
let m1 = params?.money_total_1 || 0;
let m3 = params?.use_money_total || 0;
let per = 0;
if (m2 != 0) {
per = ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
per = ((m3 / m1) * 100).toFixed(2);
}
return Number(per) + "%";
},
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 1, color: '#83bff6' },
@ -195,10 +178,29 @@ export default {
data: this.departmentList.map(item => (parseFloat(item.money_total_2) ? parseFloat(item.money_total_2) : parseFloat(item.money_total_1) - parseFloat(item.use_money_total))),
},
{
barWidth: 40,
barWidth: 30,
type: "bar",
stack: "a",
name: "已使用金额(元)",
label: {
show: true,
color: "#188df0",
position: "top",
formatter: (params) => {
console.log(params)
let m2 = this.departmentList[params.dataIndex]?.money_total_2 || 0;
let m1 = this.departmentList[params.dataIndex]?.money_total_1 || 0;
let m3 = this.departmentList[params.dataIndex]?.use_money_total || 0;
let per = 0;
if (m2 != 0) {
per = ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
per = ((m3 / m1) * 100).toFixed(2);
}
return Number(per) + "%";
},
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#b4cef3' },

@ -0,0 +1,273 @@
<template>
<el-card class="box-card" shadow="hover">
<div slot="header" class="clearfix">
<SvgIcon style="color: #3171f4;width: 22px;height: 22px;" icon-class="wengao"></SvgIcon>
<span style="padding-left: 15px"
>项目支出</span
>
<i class="el-icon-more" style="margin-left: auto; font-size: 20px"></i>
</div>
<div class="progress-card">
<div class="progress-card-item">
<div class="worker-progress__icon icon-yuan">
<SvgIcon icon-class="yuan"></SvgIcon>
</div>
<div class="progress-card-item__num">{{ 0 }}</div>
<div class="progress-card-item__label">年初预算合计金额</div>
</div>
<div class="progress-card-item">
<div class="worker-progress__icon icon-zhangdan">
<SvgIcon icon-class="zhangdan"></SvgIcon>
</div>
<div class="progress-card-item__num">{{ 0}}</div>
<div class="progress-card-item__label">调整后预算合计金额</div>
</div>
<div class="progress-card-item">
<div class="worker-progress__icon icon-zhifu">
<SvgIcon icon-class="zhifu"></SvgIcon>
</div>
<div class="progress-card-item__num">{{ 0 }}</div>
<div class="progress-card-item__label">已支付金额</div>
</div>
<div class="progress-card-item">
<MyProgress width="145px" height="145px" title="执行" :percent="0" ></MyProgress>
</div>
</div>
<Table style="margin-top: 20px;" :data="list" size="small" :columns="table" :max-height="280"></Table>
</el-card>
</template>
<script>
import ElementResize from "element-resize-detector";
import { moneyFormatter } from "@/utils";
import echarts from 'echarts'
import SvgIcon from "@/components/SvgIcon/index.vue";
import MyProgress from "@/components/Progress/index.vue";
export default {
components: {
MyProgress,
SvgIcon
},
name: "card8",
layout: {
x: 0,
y: 5,
w: 6,
h: 4,
i: "9",
name: "项目支出",
},
data() {
return {
tableHeight: 200,
list: [
{
money_total_1: "1900000.00",
money_total_2: "0.00",
ids: "11",
plan_department_id: 2,
use_money_total: 0,
money_total: "0.00",
end_money: 0,
plan_department: {
id: 2,
pid: 0,
name: "办公室(党建作风办)",
manager_id: 7,
leader_id: 4,
sortnumber: 1,
created_at: "2021-06-22 07:01:41",
updated_at: "2023-03-22 14:56:51",
deleted_at: null,
},
},
],
table: [
{
title: "序号",
type: "index",
width: 60,
fixed: "left",
align: "center",
},
{
title: "部门",
key: "plan_department.name",
minWidth: 180,
align: "center",
fixed: "left",
render: (h, params) => {
return h("p",{ style: { "text-align": "left" } }, params.row.plan_department.name);
}
},
{
title: "年初预算数(元)",
key: "money_total_1",
align: "center",
width: 160,
render: (h, params) => {
return h("p",{ style: { "text-align": "right" } }, moneyFormatter(params.row.money_total_1));
}
},
{
title: "调整后预算数(元)",
key: "money_total_2",
align: "center",
width: 160,
render: (h, params) => {
return h("p",{ style: { "text-align": "right" } }, moneyFormatter(params.row.money_total_2));
}
},
{
title: "已使用(元)",
key: "money_total",
align: "center",
width: 140,
render: (h, params) => {
return h("p",{ style: { "text-align": "right" } }, moneyFormatter(params.row.money_total));
}
},
{
title: "进展情况",
key: "rate",
align: "center",
width: 160,
render: (h, row) => {
let m2 = row?.money_total_2 || 0;
let m1 = row?.money_total_1 || 0;
let m3 = row?.use_money_total || 0;
let per = 0;
if (m2 != 0) {
per = ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
per = ((m3 / m1) * 100).toFixed(2);
}
return h("el-progress", {
props: {
percentage: Number(per),
},
});
}
},
{
title: "操作",
key: "action",
align: "center",
minWidth: 100,
render: (h, params) => {
return h("Button", {
props: {
size: "small"
}
} , "查看")
}
}
]
};
},
methods: {
init() {
let cardDom = this.$el;
let cardTitleH = 58;
const elementResize = ElementResize({
strategy:'scroll'
})
elementResize.listenTo(cardDom,ele => {
this.tableHeight = cardDom.getBoundingClientRect().height - 40 - cardTitleH
})
}
},
created() {},
mounted() {
this.init();
}
};
</script>
<style scoped lang="scss">
.clearfix {
display: flex;
align-items: center;
}
::v-deep .el-card__body {
width: 100%;
height: calc(100% - 58px);
}
::v-deep .ivu-table th,::v-deep .ivu-table td {
border-bottom-style: dashed;
}
.progress-card {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 20px;
&-item {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
&__label {
font-size: 15px;
color: #000000;
padding-top: 20px;
}
&__num {
font-size: 20px;
line-height: 7px;
color: #000000;
font-weight: bold;
padding-top: 18px;
}
.worker-progress__icon {
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
width: 72px;
height: 72px;
svg {
border-radius: 100%;
width: 40px;
height: 40px;
}
}
.icon-yuan {
background: #56b7f9;
color: #fff;
filter: drop-shadow(0px 6px 6px rgba(43,188,255,0.5));
svg {
color: #56b7f9;
background: #fff;
}
}
.icon-zhangdan {
background: #446df6;
filter: drop-shadow(0px 6px 6px rgba(54,117,255,0.5));
svg {
color: #fff;
width: 36px;
}
}
.icon-zhifu {
background: #f2a93f;
filter: drop-shadow(0px 6px 6px rgba(255,164,45,0.5));
svg {
color: #fff;
width: 36px;
}
}
}
}
::v-deep .el-progress--circle .el-progress__text {
white-space: break-spaces;
}
</style>

@ -105,9 +105,14 @@ export default {
"Button",
{
props: {
type: "primary",
type: "default",
size: "small",
ghost: true,
},
style: {
background: "#f0f3fa",
color: "#333",
border: "1px solid #dae1f0",
fontSize: "13px"
},
on: {
["click"]: (_) => {
@ -136,10 +141,10 @@ export default {
props: {
type: "primary",
size: "small",
ghost: true,
},
style: {
"margin-left": "6px"
"margin-left": "6px",
fontSize: "13px"
},
on: {
["click"]: (_) => {

@ -208,7 +208,7 @@ export default {
},
{
title: "执行情况",
minWidth: 160,
minWidth: 120,
fixed: "right",
render: (h, { row }) => {
let m2 = row?.money_total_2 || 0;

Loading…
Cancel
Save