You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
4.0 KiB

3 years ago
<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>
<span style="padding: 0 6px;word-break: keep-all;">年份</span>
<span>
3 years ago
<DatePicker :value="select.year" placeholder="请选择年份" type="year" placement="bottom-start" style="width: 160px" @on-change="(e)=>select.year = e"></DatePicker>
3 years ago
</span>
<span style="padding: 0 6px;word-break: keep-all;">预算类型</span>
<span>
3 years ago
<Select clearable v-model="select.type" placeholder="请选择预算类型" type="date" style="width: 160px">
3 years ago
<Option v-for="item in type" :value="item.id" :key="item.id">{{item.value}}</Option>
3 years ago
</Select>
3 years ago
</span>
3 years ago
<span style="padding: 0 6px;">
科室
</span>
3 years ago
<span>
3 years ago
<el-cascader
placeholder="选择科室"
size="small"
:value="select.department"
style="width: 160px;"
:options="departments"
:props="{ checkStrictly: true, label: 'name', value: 'id' }"
clearable
@change="e => select.department = e[e.length-1] || ''"/>
</span>
3 years ago
3 years ago
<Button type="primary" style="margin-left: 10px" ghost @click="select = {pageIndex:1,year:'',type:'',department:''}">重置</Button>
<Button type="primary" style="margin-left: 10px" @click="getPlanProgress"></Button>
3 years ago
</slot>
</lx-header>
3 years ago
<xy-table :table-item="table" :list="list">
<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>
3 years ago
</div>
</template>
<script>
3 years ago
import {getProgress} from "@/api/budget/budget"
import {listdeptNoAuth} from "@/api/system/department";
3 years ago
import {getparameter} from "@/api/system/dictionary";
3 years ago
export default {
data() {
3 years ago
return {
3 years ago
type:[],//预算类型
3 years ago
departments:[],
select:{
pageIndex:1,
year:'',
type:'',
department:''
},
total:0,
list:[],
table:[
3 years ago
{
prop:'name',
label:'项目名称',
width: 200,
align: 'left',
fixed: 'left'
},
3 years ago
{
prop:'type',
label:'预算类型',
width: 120,
3 years ago
formatter: (cell, data, value) => {
let res = this.type.filter(item => {
return item.id === value
})
return res[0]?.value || '未知'
3 years ago
}
},
{
prop:'year',
label:'所属年份',
width: 160
},
{
prop:'plan_department.name',
label:"相关科室",
width: 180
},
{
prop:'content',
label:'描述',
3 years ago
align:'left',
minWidth:250
3 years ago
},
{
prop:'rate',
label:'进展率',
3 years ago
width: 120,
3 years ago
formatter:(cell,data,value)=>{
return value + '%'
}
}
]
}
3 years ago
},
3 years ago
methods: {
3 years ago
async getType(){
const res = await getparameter({number:'money_way'})
this.type = res.detail
},
3 years ago
//翻页
pageChange(e){
this.select.pageIndex = e
this.getPlanProgress()
},
//获取科室
getDepartment(){
listdeptNoAuth().then(res=>{
3 years ago
this.departments = res
})
},
3 years ago
3 years ago
async getPlanProgress(){
const res = await getProgress({
page_size:10,
page:this.select.pageIndex,
year:this.select.year,
type:this.select.type,
plan_department_id:this.select.department
})
this.list = res.data
this.total = res.total
console.log(res)
}
},
mounted() {
3 years ago
this.getType()
3 years ago
this.getDepartment()
this.getPlanProgress()
}
3 years ago
}
</script>
<style scoped lang="scss">
</style>