刘翔宇-旅管家 4 years ago
parent efdf1e21dd
commit 29747d36ac

@ -125,8 +125,8 @@
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input v-model="form.money" clearable placeholder="请填写金额" style="width: 300px;" @blur="moneyFormat"
@focus="moneyRecover" />
<el-input v-model="form.money" clearable placeholder="请填写金额" style="width: 300px;" @blur="moneyFormat('money')"
@focus="moneyRecover('money')" />
</div>
</div>
</template>
@ -217,11 +217,22 @@
<template v-slot:money>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>金额
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>年初预算金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input v-model="editorForm.money" clearable placeholder="请填写金额" style="width: 300px;"
@blur="moneyFormatEditor" @focus="moneyRecoverEditor" />
<el-input v-model="editorForm.money" clearable placeholder="请填写年初预算金额" style="width: 300px;"
@blur="moneyFormatEditor('money')" @focus="moneyRecoverEditor('money')" />
</div>
</div>
</template>
<template v-slot:update_money>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>调整后预算金额
</div>
<div class="xy-table-item-content xy-table-item-price">
<el-input v-model="editorForm.update_money" clearable placeholder="请填写调整后预算金额" style="width: 300px;"
@blur="moneyFormatEditor('update_money')" @focus="moneyRecoverEditor('update_money')" />
</div>
</div>
</template>
@ -280,7 +291,8 @@
content: "",
remark: "",
plan_department_link_id: [],
plan_department_links: []
plan_department_links: [],
update_money: ""
},
rules: {
name: [{
@ -348,10 +360,19 @@
width: 110
},
{
label: '项目金额(元)',
label: '年初预算金额(元)',
prop: 'money',
align: 'right',
width: 160,
width: 180,
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: '调整后预算金额(元)',
prop: 'update_money',
align: 'right',
width: 200,
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
@ -399,29 +420,29 @@
this.types = res.detail
},
moneyRecoverEditor() {
if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.editorForm.money)) {
moneyRecoverEditor(key) {
if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.editorForm[key])) {
return
}
this.editorForm.money = moneyRecovery(this.editorForm.money)
this.editorForm[key] = moneyRecovery(this.editorForm[key])
},
moneyFormatEditor() {
if (!/^\d+(\.\d+)?$/.test(this.editorForm.money)) {
moneyFormatEditor(key) {
if (!/^\d+(\.\d+)?$/.test(this.editorForm[key])) {
return
}
this.editorForm.money = moneyFormatter(this.editorForm.money)
this.editorForm[key] = moneyFormatter(this.editorForm[key])
},
moneyRecover() {
if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.form.money)) {
moneyRecover(key) {
if (!/^\d{1,3}(,\d{3})*(\.\d+)/.test(this.form[key])) {
return
}
this.form.money = moneyRecovery(this.form.money)
this.form[key] = moneyRecovery(this.form[key])
},
moneyFormat() {
if (!/^\d+(\.\d+)?$/.test(this.form.money)) {
moneyFormat(key) {
if (!/^\d+(\.\d+)?$/.test(this.form[key])) {
return
}
this.form.money = moneyFormatter(this.form.money)
this.form[key] = moneyFormatter(this.form[key])
},
//
summary(param) {
@ -553,6 +574,7 @@
year: this.editorForm.year,
content: this.editorForm.content,
money: moneyRecovery(this.editorForm.money),
update_money: moneyRecovery(this.editorForm.update_money),
remark: this.editorForm.remark,
plan_department_id: this.editorForm.department,
plan_department_links: plan_department_links
@ -581,7 +603,8 @@
name: res.name,
type: res.type,
department: res.plan_department_id,
money: moneyFormatter(res.money),
money: moneyFormatter(res.money),
update_money: moneyFormatter(res.update_money),
year: res.year,
content: res.content,
remark: res.remark,
@ -592,8 +615,8 @@
ids.push(item.department_id);
})
//this.editorForm.plan_department_link_id = ids;
this.$set(this.editorForm, "plan_department_link_id", ids);
this.$set(this.editorForm, "plan_department_link_id", ids);
this.isShowEditor = true
console.log(this.editorForm)
})
@ -613,7 +636,7 @@
<style lang="scss" scoped>
.xy-table-item-label {
width: 140px;
width: 160px;
}
.xy-table-item-price {

@ -1,266 +1,307 @@
<template>
<div style="padding: 0 20px">
<lx-header icon="md-apps" text="预算计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<span style="padding: 0 6px;">年份</span>
<span>
<DatePicker placeholder="选择所属年份" type="year" placement="bottom" :value="select.year" style="width: 130px;" @on-change="(e)=>select.year = e"></DatePicker>
</span>
<span style="padding: 0 6px;">
预算类型
</span>
<span>
<Select placeholder="选择预算类型" v-model="select.type" style="width:130px;" clearable>
<Option v-for="item in types" :value="item.id" :key="item.id">{{ item.value }}</Option>
</Select>
</span>
<span style="padding: 0 6px;">
科室
</span>
<span>
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</span>
<Button type="primary" style="margin-left: 10px" @click="getBudgets"></Button>
<Button type="primary" style="margin-left: 10px" @click="()=>select={page:1,year:'', type:'', department:''}">重置</Button>
</div>
</slot>
</lx-header>
<xy-table ref="xyTable" :table-item="table" :list="list" :show-summary="true" :summary-method="summary">
<template v-slot:btns><div></div></template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange"/>
</div>
</div>
</template>
<script>
import {getBudget,detailBudget} from "@/api/budget/budget"
import {listdeptNoAuth} from "@/api/system/department"
import {getparameter} from '@/api/system/dictionary'
import {moneyFormatter, parseTime} from "@/utils"
export default {
data() {
return {
isShowAdd:false,
types:[],
form:{
name:"",
type:"",
year:"",
department:"",
money:"",
content:"",
remark:""
},
rules:{
name:[
{required:true,message:"必填项"}
],
type:[
{required:true,message:"必选项"}
],
year:[
{required:true,message:"必选项"}
],
department:[
{required:true,message:"必选项"}
],
money:[
{required:true,message:"必填项"},
{pattern:/^\d+(\.\d+)?$/, message: '必须为数字'}
],
content:[
{required:true,message:"必填项"}
]
},
list:[],
totalMoney:0,
total:0,
pageIndex:1,
table:[
{
label:"项目名称",
prop:'name',
width: 200,
align:'left',
sortable:false,
fixed:'left'
},
{
label:"预算类型",
prop:'type',
width:115,
formatter: (cell, data, value) => {
let res = this.types.filter(item => {
return item.id === value
})
return res[0]?.value || '未知'
}
},
{
label:"所属年份",
prop:'year',
width: 105
},
{
label: "相关科室",
prop:'plan_department.name',
width: 110
},
{
label:'项目金额(元)',
prop:'money',
align:'right',
width: 160,
formatter:(cell,data,value)=>{
return moneyFormatter(value)
}
},
{
label:"创建信息",
prop:'created_at',
width: 160,
formatter:(cell,data,value)=>{
return parseTime(new Date(value),'{y}-{m}-{d}')
}
},
{
label:"描述",
minWidth:300,
prop:'content',
align:'left',
sortable:false
},
],
select:{
page:1,
year:"",
type:"",
department:""
},
departments:[],//
//
isShowEditor:false,
editorForm:{},
}
},
methods: {
async getTypes(){
const res = await getparameter({number:'money_way'})
this.types = res.detail
},
//
summary(param){
this.$nextTick(()=>{
this.$refs['xyTable'].$children[0].doLayout()
})
const { columns, data } = param
const sums = []
columns.map((column,index) => {
if(index === 0){
sums[index] = '总计'
return
}
if(column.property === 'money'){
sums[index] = moneyFormatter(this.totalMoney)
return
}
// const values = data.map(item => Number(item[column.property]));
// if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
//
// sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
// } else {
// sums[index] = '';
// }
})
return sums
},
//
pageChange(e){
this.pageIndex = e
this.getBudgets()
},
//
getDepartment(){
listdeptNoAuth().then(res=>{
this.departments = res
})
},
//
getBudgets(){
getBudget({
page_size:10,
page:this.pageIndex,
year:this.select.year,
type:this.select.type,
plan_department_id:this.select.department
}).then(res=>{
this.list = res.list.data
this.total = res.list.total
this.totalMoney = res.total_money
})
},
showEditor(row){
this.getDepartment()
detailBudget({id:row.id}).then(res=>{
this.editorForm =
{
id:res.id,
name:res.name,
type:res.type,
department:res.plan_department_id,
money:res.money,
year:res.year,
content:res.content,
remark:res.remark
}
this.isShowEditor = true
console.log(this.editorForm)
})
},
},
created() {
this.select.year=this.$moment().format('YYYY');
},
mounted() {
this.getTypes()
this.getDepartment()
this.getBudgets()
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label{
width: 140px;
}
.xy-table-item-price{
position: relative;
&::after{
z-index: 1;
position: absolute;
right: 0;
top: 0;
content:'(元)'
}
::v-deep .el-input__clear{
position: relative;
right: 30px;
z-index: 2;
}
}
<template>
<div style="padding: 0 20px">
<lx-header icon="md-apps" text="预算计划" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<div>
<span style="padding: 0 6px;">年份</span>
<span>
<DatePicker placeholder="选择所属年份" type="year" placement="bottom" :value="select.year" style="width: 130px;"
@on-change="(e)=>select.year = e"></DatePicker>
</span>
<span style="padding: 0 6px;">
预算类型
</span>
<span>
<Select placeholder="选择预算类型" v-model="select.type" style="width:130px;" clearable>
<Option v-for="item in types" :value="item.id" :key="item.id">{{ item.value }}</Option>
</Select>
</span>
<span style="padding: 0 6px;">
科室
</span>
<span>
<el-select placeholder="科室选择" clearable size="small" v-model="select.department" style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
</span>
<Button type="primary" style="margin-left: 10px" @click="getBudgets"></Button>
<Button type="primary" style="margin-left: 10px"
@click="()=>select={page:1,year:'', type:'', department:''}">重置</Button>
</div>
</slot>
</lx-header>
<xy-table ref="xyTable" :table-item="table" :list="list" :show-summary="true" :summary-method="summary">
<template v-slot:btns>
<div></div>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange" />
</div>
</div>
</template>
<script>
import {
getBudget,
detailBudget
} from "@/api/budget/budget"
import {
listdeptNoAuth
} from "@/api/system/department"
import {
getparameter
} from '@/api/system/dictionary'
import {
moneyFormatter,
parseTime
} from "@/utils"
export default {
data() {
return {
isShowAdd: false,
types: [],
form: {
name: "",
type: "",
year: "",
department: "",
money: "",
content: "",
remark: ""
},
rules: {
name: [{
required: true,
message: "必填项"
}],
type: [{
required: true,
message: "必选项"
}],
year: [{
required: true,
message: "必选项"
}],
department: [{
required: true,
message: "必选项"
}],
money: [{
required: true,
message: "必填项"
},
{
pattern: /^\d+(\.\d+)?$/,
message: '必须为数字'
}
],
content: [{
required: true,
message: "必填项"
}]
},
list: [],
totalMoney: 0,
total: 0,
pageIndex: 1,
table: [{
label: "项目名称",
prop: 'name',
width: 200,
align: 'left',
sortable: false,
fixed: 'left'
},
{
label: "预算类型",
prop: 'type',
width: 115,
formatter: (cell, data, value) => {
let res = this.types.filter(item => {
return item.id === value
})
return res[0]?.value || '未知'
}
},
{
label: "所属年份",
prop: 'year',
width: 105
},
{
label: "相关科室",
prop: 'plan_department.name',
width: 110
},
{
label: '年初预算金额(元)',
prop: 'money',
align: 'right',
width: 180,
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: '调整后预算金额(元)',
prop: 'update_money',
align: 'right',
width: 200,
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: "创建信息",
prop: 'created_at',
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}')
}
},
{
label: "描述",
minWidth: 300,
prop: 'content',
align: 'left',
sortable: false
},
],
select: {
page: 1,
year: "",
type: "",
department: ""
},
departments: [], //
//
isShowEditor: false,
editorForm: {},
}
},
methods: {
async getTypes() {
const res = await getparameter({
number: 'money_way'
})
this.types = res.detail
},
//
summary(param) {
this.$nextTick(() => {
this.$refs['xyTable'].$children[0].doLayout()
})
const {
columns,
data
} = param
const sums = []
columns.map((column, index) => {
if (index === 0) {
sums[index] = '总计'
return
}
if (column.property === 'money') {
sums[index] = moneyFormatter(this.totalMoney)
return
}
// const values = data.map(item => Number(item[column.property]));
// if (!values.every(value => isNaN(value)) && (column.property === 'money' || column.property === 'plan_price'|| column.property === 'fund_log_total')) {
//
// sums[index] = sums[index].toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
// } else {
// sums[index] = '';
// }
})
return sums
},
//
pageChange(e) {
this.pageIndex = e
this.getBudgets()
},
//
getDepartment() {
listdeptNoAuth().then(res => {
this.departments = res
})
},
//
getBudgets() {
getBudget({
page_size: 10,
page: this.pageIndex,
year: this.select.year,
type: this.select.type,
plan_department_id: this.select.department
}).then(res => {
this.list = res.list.data
this.total = res.list.total
this.totalMoney = res.total_money
})
},
showEditor(row) {
this.getDepartment()
detailBudget({
id: row.id
}).then(res => {
this.editorForm = {
id: res.id,
name: res.name,
type: res.type,
department: res.plan_department_id,
money: res.money,
year: res.year,
content: res.content,
remark: res.remark
}
this.isShowEditor = true
console.log(this.editorForm)
})
},
},
created() {
this.select.year = this.$moment().format('YYYY');
},
mounted() {
this.getTypes()
this.getDepartment()
this.getBudgets()
}
}
</script>
<style scoped lang="scss">
.xy-table-item-label {
width: 140px;
}
.xy-table-item-price {
position: relative;
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
}
</style>

@ -12,8 +12,12 @@
<router-link :to="`/statisticalReport/budgetProgress`">
<div class="progress-card">
<div class="progress-card-item">
<div class="progress-card-item__num">{{moneyFormat(statistic.progress.money_total)}}</div>
<div class="progress-card-item__label">预算合计金额</div>
<div class="progress-card-item__num">{{moneyFormat(statistic.progress.money_total_1)}}</div>
<div class="progress-card-item__label">年初预算合计金额</div>
</div>
<div class="progress-card-item">
<div class="progress-card-item__num">{{moneyFormat(statistic.progress.money_total_2)}}</div>
<div class="progress-card-item__label">调整后预算合计金额</div>
</div>
<div class="progress-card-item">
<div class="progress-card-item__num">{{moneyFormat(statistic.progress.use_money_total)}}</div>
@ -21,7 +25,8 @@
</div>
<div class="progress-card-item">
<div class="progress-card-item__num">
{{((statistic.progress.use_money_total/statistic.progress.money_total)*100).toFixed(2)}}%</div>
{{toper(statistic.progress.money_total_1,statistic.progress.money_total_2,statistic.progress.use_money_total)}}%
</div>
<div class="progress-card-item__label">进展率</div>
</div>
</div>
@ -171,16 +176,27 @@
departmentProgress: [],
departmentTable: [{
label: '科室',
width: 120,
width: 80,
prop: 'plan_department.name',
sortable: false
sortable: false,
fixed:"left"
},
{
label: '合计金额(元)',
width: 120,
label: '年初预算合计金额(元)',
width: 160,
align: 'right',
sortable: false,
prop: 'money_total',
prop: 'money_total_1',
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: '调整后预算合计金额(元)',
width: 160,
align: 'right',
sortable: false,
prop: 'money_total_2',
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
@ -199,18 +215,53 @@
label: '进展情况',
sortable: false,
align: 'left',
customFn: (row) => {
return ( <div>
<el-progress percentage = {Number(((row.use_money_total / row.money_total) * 100 || 0).toFixed(2)) }> </el-progress> </div>
width: 320,
fixed:"right",
customFn: (row) => {
let m2=row.money_total_2;
let m1=row.money_total_1;
let m3=row.use_money_total;
let per =0 ;
if (m2 != 0) {
per= ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
per= ((m3 / m1) * 100).toFixed(2);
}
return ( < div >
<el-progress percentage = {
Number(per)
} > </el-progress> </div >
)
}
}
],
typeTable: [{
label: '预算类别',
width: 140,
width: 100,
prop: 'type_text',
sortable: false
sortable: false,
fixed:"left",
},
{
label: '年初预算合计金额(元)',
width: 160,
align: 'right',
sortable: false,
prop: 'money_total_1',
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: '调整后预算合计金额(元)',
width: 160,
align: 'right',
sortable: false,
prop: 'money_total_2',
formatter: (cell, data, value) => {
return moneyFormatter(value)
}
},
{
label: '合计金额(元)',
@ -236,10 +287,23 @@
label: '进展情况',
sortable: false,
minWidth: 220,
align: 'left',
align: 'left',
fixed:"right",
customFn: (row) => {
return ( <div>
<el-progress percentage={Number(((row.use_money_total / row.money_total) * 100 || 0).toFixed(2))}> </el-progress> </div>
let m2=row.money_total_2;
let m1=row.money_total_1;
let m3=row.use_money_total;
let per =0 ;
if (m2 != 0) {
per= ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
per= ((m3 / m1) * 100).toFixed(2);
}
return ( < div >
<el-progress percentage = {
Number(per)
} > </el-progress> </div >
)
}
}
@ -285,7 +349,14 @@
typeFormatter(cell, data, value) {
return value === 1 ? '合同类型' : '付款类型'
},
toper(m1, m2, m3) {
if (m2 != 0) {
return ((m3 / m2) * 100).toFixed(2);
} else if (m1 != 0) {
return ((m3 / m1) * 100).toFixed(2);
} else
return 0
},
async getNotices() {
const res = await getNotice({
page_size: 10,

@ -30,6 +30,7 @@
</Select>
<Button type="primary" style="margin-left: 10px" ghost>重置</Button>
<Button type="primary" style="margin-left: 10px" @click="doSearch()"></Button>
<Button type="primary" @click="toExport()" style="margin-left: 10px">导出</Button>
</slot>
</lx-header>
@ -93,6 +94,9 @@
delFundLog,
editorFundLog
} from "@/api/paymentRegistration/fundLog"
import {
getToken
} from '@/utils/auth'
import {
parseTime
} from "@/utils"
@ -122,14 +126,14 @@
return item.id === value
})
return res[0]?.value || '未知'
},
width:120
},
width: 120
},
{
label: "年份",
prop: 'year',
align: 'center',
width:90
align: 'center',
width: 90
},
{
label: "名称",
@ -139,8 +143,8 @@
{
label: "计划金额",
prop: 'money',
align: 'right',
width:160
align: 'right',
width: 160
}
],
plans: [], //
@ -308,19 +312,23 @@
},
//
async getBudgets() {
let res = await getBudget({
await getBudget({
name: this.planSearch.name,
page_size: 10,
page: this.plansPageIndex,
plan_department_id: this.planSearch.plan_department_id
})
this.plans = res.list.data
}).then(res => {
this.plans = res.list.data
this.planTotal = res.list.total;
this.planTotal = res.list.total;
this.toggleSelection(this.plan.map(item => {
return item.value.plan_id
}), 1)
})
this.toggleSelection(this.plan.map(item => {
return item.value.plan_id
}), 1)
},
async showPlanForSearch() {
this.isShowPlanForSearch = true
@ -331,7 +339,7 @@
console.log(sel)
if (sel) {
this.select.plan_id = sel.id;
this.select.plan_name = "["+sel.year+"]-"+sel.name;
this.select.plan_name = "[" + sel.year + "]-" + sel.name;
} else {
this.select.plan_id = "";
this.select.plan_name = "";
@ -352,18 +360,40 @@
this.pageIndex = e
this.getFundLogs()
},
async getFundLogs() {
const res = await getFundLog({
toExport() {
this.is_export = 1;
this.getFundLogs(true);
},
async getFundLogs(is_export) {
await getFundLog({
page_size: 10,
page: this.pageIndex,
keyword: this.keyword,
date: this.selectDate,
status: this.status,
act_plan_link_id: this.select.plan_id
}).then(res => {
let tokens = getToken();
if (is_export) {
var url = "/api/admin/fund_log/index?token=" + tokens
if (this.selectDate)
url += "&date=" + this.selectDate;
if (this.keyword)
url += "&keyword=" + this.keyword;
if (this.status)
url += "&status=" + this.status;
if (this.plan_id)
url += "&act_plan_link_id=" + this.plan_id;
url += "&is_export=" + this.is_export;
url = location.host + url;
console.log(url)
window.open("http://" + url, '_blank')
this.select.is_export = 0
return;
}
this.list = res.data
this.total = res.total
})
this.list = res.data
this.total = res.total
},
deleteFundLog(row) {

Loading…
Cancel
Save