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.

324 lines
9.7 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="绩效自评自审"
>
<div slot="content"></div>
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px">名称</span>
<span><el-input
v-model="select.name"
placeholder="请输入名称"
style="width: 130px"
size="small"
></el-input></span>
<span style="padding: 0 6px">年份</span>
<span>
<DatePicker
:value="select.year"
placeholder="选择所属年份"
placement="bottom"
style="width: 130px"
type="year"
@on-change="(e) => (select.year = e)"
></DatePicker>
</span>
<span style="padding: 0 6px; word-break: keep-all"> 关键字 </span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
></Input>
</div>
<Button style="margin-left: 10px" type="primary" @click=""
>重置
</Button>
<Button
style="margin-left: 10px"
type="primary"
@click="(select.page = 1), getList()"
>查询</Button
>
</div>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table" @delete="destroy" @editor="edit">
<template v-slot:btns>
<el-table-column
label="操作"
header-align="center"
fixed="right"
width="210"
>
<template v-slot:default="scope">
<el-dropdown @command="command => {
if (command === 'yearMiddle') {
$refs['addPlanEvaluate'].type = 1;
$refs['addPlanEvaluate'].setPlanId(scope.row.id);
$refs['addPlanEvaluate'].show();
} else {
$refs['addPlanEvaluate'].type = 2;
$refs['addPlanEvaluate'].setPlanId(scope.row.id);
$refs['addPlanEvaluate'].show();
}
}">
<Button size="small" type="primary">
绩效目标<i class="el-icon-arrow-down el-icon--right"></i>
</Button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="yearMiddle">年中</el-dropdown-item>
<el-dropdown-item command="yearEnd">年末</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dropdown @command="command => {
if (command === 'yearMiddle') {
$refs['addSelfEvaluationForm'].setId(scope.row.id);
$refs['addSelfEvaluationForm'].setType(1);
$refs['addSelfEvaluationForm'].show();
} else {
$refs['addSelfEvaluationForm'].setId(scope.row.id);
$refs['addSelfEvaluationForm'].setType(2);
$refs['addSelfEvaluationForm'].show();
}
}">
<Button style="margin-left: 4px;" size="small" type="primary">
自评表<i class="el-icon-arrow-down el-icon--right"></i>
</Button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="yearMiddle">
<span :style="{'color': scope.row.year_middle_audit < 0 ? 'red' : '' }">年中</span>
</el-dropdown-item>
<el-dropdown-item command="yearEnd">
<span :style="{'color': scope.row.year_end_audit < 0 ? 'red' : '' }">年末</span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <Button-->
<!-- size="small"-->
<!-- type="primary"-->
<!-- class="slot-btns-item"-->
<!-- @click="-->
<!-- () => {-->
<!-- $refs['addPlanEvaluate'].type = 1;-->
<!-- $refs['addPlanEvaluate'].setPlanId(scope.row.id);-->
<!-- $refs['addPlanEvaluate'].show();-->
<!-- }-->
<!-- "-->
<!-- >-->
<!-- 年中目标-->
<!-- </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>-->
</template>
</el-table-column>
</template>
</xy-table>
<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>
<addEvaluate ref="addEvaluate" @refresh="getList"></addEvaluate>
<addPlanEvaluate ref="addPlanEvaluate"></addPlanEvaluate>
<addSelfEvaluationForm ref="addSelfEvaluationForm" @refresh="getList"></addSelfEvaluationForm>
</div>
</template>
<script>
import { getBudget } from "@/api/budget/budget";
import { index, destroy } from "@/api/achievements/evaluate";
import { moneyFormatter, parseTime } from "@/utils";
import { getparameter } from "@/api/system/dictionary";
import addEvaluate from "@/views/achievements/components/addEvaluate.vue";
import addPlanEvaluate from "@/views/achievements/components/addPlanEvaluate.vue";
import addSelfEvaluationForm from '@/views/achievements/components/addSelfEvaluationForm.vue'
export default {
components: {
addEvaluate,
addPlanEvaluate,
addSelfEvaluationForm
},
data() {
return {
budgetTypes: [],
select: {
is_auth: 1,
name: "",
year: new Date().getFullYear().toString(),
keyword: "",
page: 1,
page_size: 10,
pid: 0,
has_plan_target: 1,
},
total: 0,
table: [
{
label: "项目名称",
prop: "name",
width: 200,
align: "left",
sortable: false,
fixed: "left",
customFn: row => {
return (
<p>
<span style="color: red;">{row.year_middle_audit < 0 ? '【年中自评驳回】' : '' }</span>
<span style="color: red;">{row.year_end_audit < 0 ? '【年末自评驳回】' : '' }</span>
<span>{row.name}</span>
</p>
)
}
},
{
label: "预算类型",
prop: "type_detail.value",
width: 115,
},
{
label: "所属年份",
prop: "year",
width: 105,
},
{
label: "相关科室",
prop: "plan_department.name",
width: 110,
},
{
label: "年初预算金额",
prop: "money",
align: "right",
width: 180,
formatter: (cell, data, value) => {
if (value == 0) return "--";
else 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 this.$moment(value).format("YYYY-MM-DD");
},
},
{
label: "描述",
minWidth: 300,
prop: "content",
align: "left",
sortable: false,
},
{
label: "自评意见",
width: 100,
prop: "plan_logs",
customFn: row => {
return (
<el-popover>
<div slot="default">
{
row.plan_logs.map((i,index) => (<p style="line-height: 2;">{++index}. {i.reason}{this.$moment(i.created_at).format('YYYY-MM-DD HH:mm')}</p>))
}
</div>
<el-link type="primary" slot="reference">查看</el-link>
</el-popover>
)
}
}
],
list: [],
};
},
methods: {
async getBudgetTypes() {
const res = await getparameter({
number: "money_way",
});
this.types = res.detail;
},
async getList() {
const res = await getBudget(this.select);
this.list = res.list.data;
this.total = res.list.total;
},
edit(row, type) {
this.$refs["addEvaluate"].id = row.id;
this.$refs["addEvaluate"].setForm("type", type);
this.$refs["addEvaluate"].type = "add";
this.$refs["addEvaluate"].show();
},
destroy(row) {
destroy({
id: row.id,
}).then((res) => {
this.$message({
type: "success",
message: "删除成功",
});
this.getList();
});
},
},
computed: {},
created() {
this.getBudgetTypes();
this.getList();
},
};
</script>
<style scoped lang="scss">
.selects {
display: flex;
align-items: center;
flex-wrap: wrap;
}
Button + Button {
margin-left: 4px;
}
</style>