预算付款计划查看显示

master
xy 1 year ago
parent cd138195ed
commit a654df2522

@ -2,10 +2,10 @@
ENV = 'development' ENV = 'development'
# base api # base api
VUE_APP_DOMIAN=http://192.168.60.99:9003/ #VUE_APP_DOMIAN=http://192.168.60.99:9003/
#VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/ VUE_APP_DOMIAN=http://192.168.60.99:8003/
VUE_APP_BASE_API = '' VUE_APP_BASE_API = ''
VUE_APP_UPLOAD=http://hdcontract.ali251.langye.net/api/admin/upload-file VUE_APP_UPLOAD=http://192.168.60.99:8003/api/admin/upload-file
#VUE_APP_UPLOAD=http://192.168.60.99:9003/api/admin/upload-file #VUE_APP_UPLOAD=http://192.168.60.99:9003/api/admin/upload-file
VUE_APP_OUT_URL = http://192.168.60.18:2021 VUE_APP_OUT_URL = http://192.168.60.18:2021

@ -1,6 +1,7 @@
<template> <template>
<div> <div>
<xy-dialog <xy-dialog
:width="64"
ref="dialog" ref="dialog"
:is-show.sync="isShow" :is-show.sync="isShow"
type="form" type="form"
@ -11,15 +12,45 @@
> >
<template v-slot:plan_id> <template v-slot:plan_id>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label">项目 </div> <div class="xy-table-item-label">隶属项目 </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-input {{ plan.pid_info_name }}
readonly </div>
:value="rowName" </div>
clearable <div class="xy-table-item">
placeholder="请输入项目" <div class="xy-table-item-label">项目名称 </div>
style="width: 300px" <div class="xy-table-item-content">
></el-input> {{ plan.name }}
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">预算类型 </div>
<div class="xy-table-item-content">
{{ types.find(i => i.id === plan.type) ? types.find(i => i.id === plan.type).value : '' }}
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">所属年份 </div>
<div class="xy-table-item-content">
{{ plan.year }}
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">年初预算金额 </div>
<div class="xy-table-item-content">
{{ isNaN(Number(plan.money)) ? '0.00' : Number(plan.money).toFixed(2) }}
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">调整后预算金额 </div>
<div class="xy-table-item-content">
{{ isNaN(Number(plan.update_money)) ? '0.00' : Number(plan.update_money).toFixed(2) }}
</div>
</div>
<div class="xy-table-item">
<div class="xy-table-item-label">描述 </div>
<div class="xy-table-item-content">
{{ plan.content }}
</div> </div>
</div> </div>
</template> </template>
@ -56,7 +87,9 @@
import { paidSave, paidIndex, paidStore, paidDestroy } from "@/api/budget/budget" import { paidSave, paidIndex, paidStore, paidDestroy } from "@/api/budget/budget"
import { statistic } from "@/api/dashboard/notice"; import { statistic } from "@/api/dashboard/notice";
export default { export default {
props: {}, props: {
types: Array
},
data() { data() {
return { return {
rowType: "", rowType: "",
@ -67,6 +100,23 @@ export default {
type: "", type: "",
itemTable: [ itemTable: [
{
width: 200,
label: "占比",
sortable: false,
customFn: row => {
row._total = this.formList.reduce((pre, cur) => {
if (cur.paid_plan_date === row.paid_plan_date) {
return pre + (isNaN(Number(cur.paid_money)) ? 0 : Number(cur.paid_money))
} else {
return pre
}
},0)
return (
<el-progress percentage={(isNaN(Number(row.paid_money)) || row._total === 0) ? 0 : Math.round((Number(row.paid_money) / row._total * 100)*100)/100 }></el-progress>
)
}
},
{ {
prop: "paid_money", prop: "paid_money",
label: "付款金额", label: "付款金额",
@ -150,43 +200,57 @@ export default {
sortable: false, sortable: false,
customFn: (row, scope) => { customFn: (row, scope) => {
return ( return (
<Poptip <div>
confirm={true} <Poptip
transfer={true} confirm={true}
placement="bottom" transfer={true}
title="确认要删除吗" placement="bottom"
on={{ title="确认要删除吗"
["on-ok"]: (_) => { on={{
if (!row.id) { ["on-ok"]: (_) => {
this.formList.splice(scope.$index, 1); if (!row.id) {
} else { this.formList.splice(scope.$index, 1);
paidDestroy({ } else {
id: row.id paidDestroy({
}).then(res => { id: row.id
this.$message({ }).then(res => {
type: 'success', this.$message({
message: '删除成功' type: 'success',
message: '删除成功'
})
this.getDetail();
}) })
this.getDetail(); }
}) },
} }}
}, >
}} <Button
> style="margin-left: 4px;"
<Button ghost
size="small"
type="error"
>
删除
</Button>
</Poptip>
{
/*
<Button
style="margin-left: 4px;" style="margin-left: 4px;"
ghost ghost
size="small" size="small"
type="error" type="primary"
> >
删除 确认
</Button> </Button>
</Poptip> */
}
</div>
); );
}, },
}, },
], ],
rowName: "", plan: {},
formList: [], formList: [],
editId: [], editId: [],
form: { form: {
@ -338,7 +402,6 @@ export default {
this.typeList = arr; this.typeList = arr;
} }
//this.split = Array.from({ length: Math.ceil(this.typeList/2) },() => 0.5) //this.split = Array.from({ length: Math.ceil(this.typeList/2) },() => 0.5)
console.log(123, this.typeList);
}, },
}, },
watch: { watch: {
@ -368,8 +431,13 @@ export default {
::v-deep .el-input__inner { ::v-deep .el-input__inner {
text-align: left; text-align: left;
} }
::v-deep .el-progress {
white-space: nowrap;
}
.xy-table-item-label { .xy-table-item-label {
width: 150px; width: 200px;
font-weight: 600;
text-align: right;
} }
.select { .select {

@ -43,7 +43,7 @@
<template v-slot:btns> <template v-slot:btns>
<el-table-column header-align="center" align="left" :width="130" label="操作" > <el-table-column header-align="center" align="left" :width="130" label="操作" >
<template #default="{ row }"> <template #default="{ row }">
<Button size="small" type="primary" @click="$refs['payPlan'].rowType = row.type,$refs['payPlan'].plan_department_id = row.plan_department_id,$refs['payPlan'].rowName = row.name,$refs['payPlan'].setId(row.id),$refs['payPlan'].show()">付款计划</Button> <Button size="small" type="primary" @click="$refs['payPlan'].rowType = row.type,$refs['payPlan'].plan_department_id = row.plan_department_id,$refs['payPlan'].plan = row,$refs['payPlan'].setId(row.id),$refs['payPlan'].show()">付款计划</Button>
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
@ -53,7 +53,7 @@
<Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" /> <Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" />
</div> </div>
<payPlan ref="payPlan"></payPlan> <payPlan ref="payPlan" :types="types"></payPlan>
</div> </div>
</template> </template>

@ -43,7 +43,7 @@
</span> </span>
<i-switch size="large" style="margin-left: 12px;" v-model="switch1" @on-change="pageChange" > <i-switch size="large" style="margin-left: 12px;" v-model="switch1" @on-change="pageChange" >
<span slot="open">分页</span> <span slot="open">分页</span>
<span slot="close">不分</span> <span slot="close">不分</span>
</i-switch> </i-switch>
<Button <Button
type="primary" type="primary"
@ -122,13 +122,13 @@ export default {
}, },
data() { data() {
return { return {
switch1: true,// switch1: false,//
type: -1, //01 type: -1, //01
departments: [], departments: [],
select: { select: {
department_id: "", department_id: "",
page: 1, page: 1,
page_size: 10, page_size: 9999,
keyword: "", keyword: "",
year:"", year:"",
is_auth: 1 is_auth: 1
@ -280,6 +280,9 @@ export default {
methods: { methods: {
pageChange (e) { pageChange (e) {
this.select.page_size = e ? 10 : 9999; this.select.page_size = e ? 10 : 9999;
if (!e) {
this.select.page = 1;
}
this.getList(); this.getList();
}, },
@ -299,6 +302,20 @@ export default {
async getList() { async getList() {
const res = await index(this.select); const res = await index(this.select);
this.total = res.total; this.total = res.total;
if (!this.switch1) {
res.data.sort((a, b) => {
let aNums = 0 ,bNums = 0;
a.public_act_date ? "" : aNums++;
a.invite_act_date ? "" : aNums++;
a.open_act_date ? "" : aNums++;
b.public_act_date ? "" : bNums++;
b.invite_act_date ? "" : bNums++;
b.open_act_date ? "" : bNums++;
return bNums - aNums;
})
}
this.list = res.data; this.list = res.data;
}, },

Loading…
Cancel
Save