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.

227 lines
5.5 KiB

3 years ago
<template>
3 years ago
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="绩效自评自审"
>
3 years ago
<div slot="content"></div>
<slot>
<div class="selects">
<div>
3 years ago
<span style="padding: 0 6px; word-break: keep-all"> 关键字 </span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
></Input>
3 years ago
</div>
3 years ago
<Button style="margin-left: 10px" type="primary" @click=""
>重置
3 years ago
</Button>
3 years ago
<Button
style="margin-left: 10px"
type="primary"
@click="(select.page = 1), getList()"
>查询</Button
>
3 years ago
</div>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table" @delete="destroy" @editor="edit">
<template v-slot:btns>
3 years ago
<el-table-column
label="操作"
header-align="center"
fixed="right"
width="170"
>
3 years ago
<template v-slot:default="scope">
3 years ago
<Button
size="small"
type="primary"
class="slot-btns-item"
@click="
() => {
$refs['addPlanEvaluate'].type = 1;
$refs['addPlanEvaluate'].setPlanId(scope.row.id);
$refs['addPlanEvaluate'].show();
}
"
3 years ago
>
3 years ago
年中目标
</Button>
<Button
size="small"
type="primary"
class="slot-btns-item"
@click="
() => {
$refs['addPlanEvaluate'].type = 2;
$refs['addPlanEvaluate'].setPlanId(scope.row.id);
$refs['addPlanEvaluate'].show();
}
"
>
年末目标
</Button>
3 years ago
</template>
</el-table-column>
</template>
</xy-table>
3 years ago
<div style="display: flex;justify-content: flex-end;">
<Page :total="total"
@on-change="e => {
select.page = e;
getList()
}"
show-elevator
show-sizer
@on-page-size-change="e => {
select.page_size = e;
select.page = 1;
getList()
}" />
</div>
3 years ago
<addEvaluate ref="addEvaluate" @refresh="getList"></addEvaluate>
3 years ago
<addPlanEvaluate ref="addPlanEvaluate"></addPlanEvaluate>
3 years ago
</div>
</template>
<script>
3 years ago
import { getBudget } from "@/api/budget/budget";
import { index, destroy } from "@/api/achievements/evaluate";
import { moneyFormatter, parseTime } from "@/utils";
import { getparameter } from "@/api/system/dictionary";
3 years ago
3 years ago
import addEvaluate from "@/views/achievements/components/addEvaluate.vue";
import addPlanEvaluate from "@/views/achievements/components/addPlanEvaluate.vue";
3 years ago
export default {
3 years ago
components: {
3 years ago
addEvaluate,
3 years ago
addPlanEvaluate,
3 years ago
},
data() {
return {
budgetTypes: [],
3 years ago
select: {
3 years ago
keyword: "",
page: 1,
3 years ago
page_size: 10,
3 years ago
},
total: 0,
3 years ago
table: [
{
label: "项目名称",
prop: "name",
width: 200,
sortable: false,
fixed: "left",
},
3 years ago
{
label: "预算类型",
2 years ago
prop: "type_detail.value",
3 years ago
width: 115,
},
{
label: "所属年份",
3 years ago
prop: "year",
width: 105,
3 years ago
},
{
label: "相关科室",
3 years ago
prop: "plan_department.name",
width: 110,
3 years ago
},
{
3 years ago
label: "年初预算金额(元)",
prop: "money",
align: "right",
3 years ago
width: 180,
formatter: (cell, data, value) => {
3 years ago
if (value == 0) return "--";
else return moneyFormatter(value);
},
3 years ago
},
{
3 years ago
label: "调整后预算金额(元)",
prop: "update_money",
align: "right",
3 years ago
width: 200,
formatter: (cell, data, value) => {
3 years ago
return moneyFormatter(value);
},
3 years ago
},
{
label: "创建信息",
3 years ago
prop: "created_at",
3 years ago
width: 160,
formatter: (cell, data, value) => {
3 years ago
return this.$moment(value).format("YYYY-MM-DD");
},
3 years ago
},
{
label: "描述",
minWidth: 300,
3 years ago
prop: "content",
align: "left",
sortable: false,
3 years ago
},
],
list: [],
3 years ago
};
3 years ago
},
methods: {
async getBudgetTypes() {
const res = await getparameter({
3 years ago
number: "money_way",
});
this.types = res.detail;
3 years ago
},
async getList() {
3 years ago
const res = await getBudget(this.select);
this.list = res.list.data;
3 years ago
},
3 years ago
edit(row, type) {
3 years ago
this.$refs["addEvaluate"].id = row.id;
3 years ago
this.$refs["addEvaluate"].setForm("type", type);
3 years ago
this.$refs["addEvaluate"].type = "add";
this.$refs["addEvaluate"].show();
},
destroy(row) {
destroy({
3 years ago
id: row.id,
}).then((res) => {
3 years ago
this.$message({
type: "success",
3 years ago
message: "删除成功",
});
3 years ago
this.getList();
3 years ago
});
},
3 years ago
},
3 years ago
computed: {},
3 years ago
created() {
this.getBudgetTypes();
this.getList();
3 years ago
},
};
3 years ago
</script>
<style scoped lang="scss">
3 years ago
.selects {
3 years ago
display: flex;
align-items: center;
flex-wrap: wrap;
}
3 years ago
Button + Button {
margin-left: 4px;
}
3 years ago
</style>