xy 2 years ago
parent 3751b1abe6
commit 8ed8d70981

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<el-drawer <el-drawer
size="56%" size="64%"
:title="type === 1 ? '年中绩效指标' : '年末绩效指标'" :title="type === 1 ? '年中绩效指标' : '年末绩效指标'"
:visible.sync="isShow" :visible.sync="isShow"
direction="rtl" direction="rtl"
@ -9,7 +9,7 @@
<xy-table <xy-table
ref="table" ref="table"
:list="list" :list="list"
:table-item="table" :table-item="tableItem"
:default-expand-all="false" :default-expand-all="false"
@expand-change="expandChange" @expand-change="expandChange"
> >
@ -62,7 +62,6 @@ export default {
return { return {
symbols: [], symbols: [],
units: [], units: [],
isPid0: false,
isShow: false, isShow: false,
type: 1, type: 1,
action: process.env.VUE_APP_UPLOAD_API, action: process.env.VUE_APP_UPLOAD_API,
@ -96,11 +95,12 @@ export default {
<el-form-item label="得分" required={true}> <el-form-item label="得分" required={true}>
<el-input-number <el-input-number
disabled={this.isPid0}
precision={2} precision={2}
controls={false} controls={false}
vModel={row._form.score} vModel={row._form.score}
size="small" size="small"
min={0}
max={100}
placeholder="请输入自评值" placeholder="请输入自评值"
></el-input-number> ></el-input-number>
</el-form-item> </el-form-item>
@ -176,7 +176,7 @@ export default {
}, },
}} }}
> >
立即创建 保存
</el-button> </el-button>
<el-button <el-button
on={{ on={{
@ -194,6 +194,11 @@ export default {
); );
}, },
}, },
{
label: "分值",
prop: "target.score",
width: 100,
},
{ {
label: "指标名称", label: "指标名称",
prop: "target.name", prop: "target.name",
@ -202,47 +207,10 @@ export default {
{ {
label: "评价方式", label: "评价方式",
prop: "target.evaluation_way", prop: "target.evaluation_way",
minWidth: 180 minWidth: 260,
}, align: "left"
{
label: "是否固定指标项目",
prop: "is_fixed",
width: 120,
formatter(row,data,val) {
return val? '是' : '否';
}
},
{
label: "计算符号",
prop: "target.symbol_id",
width: 120,
formatter: (cel,data,val) => {
return this.symbols.find(i => i.id === val)?.value;
}
},
{
label: "单位",
prop: "target.unit_id",
width: 120,
formatter: (cel,data,val) => {
return this.units.find(i => i.id === val)?.value
}
},
{
label: "半年(程)指标值",
prop: "target.half_target",
width: 180,
},
{
label: "全年(程)指标值",
prop: "target.year_target",
width: 180,
},
{
label: "创建时间",
prop: "created_at",
width: 200,
}, },
], ],
select: { select: {
page: 1, page: 1,
@ -343,6 +311,7 @@ export default {
return { return {
_form: { _form: {
id: "", id: "",
score: "",
result: "", result: "",
remark: "", remark: "",
type: this.type, type: this.type,
@ -380,12 +349,33 @@ export default {
}, },
submit() {}, submit() {},
}, },
computed: {}, computed: {
tableItem () {
let temp = this.table
return [
...this.table,
{
label: temp === 1 ? '半年(程)指标值' : '全年(程)指标值',
width: 180,
customFn: row => (
<div>
{
this.symbols.find(i => i.id === row.target?.symbol_id)?.value === '定性' ? (<span>{ temp === 1 ? row.target?.half_target : row?.target.year_target }</span>) : (
<p><span>{ this.symbols.find(i => i.id === row.target?.symbol_id)?.value }</span><span>{ temp === 1 ? row.target?.half_target : row?.target.year_target }</span><span>{ this.units.find(i => i.id === row.target?.unit_id)?.value }</span></p>
)
}
</div>
)
}
]
}
},
watch: { watch: {
isShow(val) { isShow(val) {
if (val) { if (val) {
this.getList(); this.getList();
} else { } else {
this.list = [];
} }
}, },
}, },

@ -266,13 +266,13 @@ export default {
target_type_id: "", target_type_id: "",
target_type2_id: "", target_type2_id: "",
name: "", name: "",
symbol_id: "",
unit_id: "", unit_id: "",
is_fixed: 1,
evaluation_way: "",
score: 0.00, score: 0.00,
symbol_id: "",
half_target: "", half_target: "",
year_target: "", year_target: "",
is_fixed: 1,
evaluation_way: "",
}, },
rules: { rules: {
target_type_id: [ target_type_id: [
@ -327,6 +327,13 @@ export default {
}; };
}, },
methods: { methods: {
setId (id) {
this.id = id
},
setType (type) {
this.type = type
},
show() { show() {
this.isShow = true; this.isShow = true;
}, },
@ -338,13 +345,13 @@ export default {
target_type_id: "", target_type_id: "",
target_type2_id: "", target_type2_id: "",
name: "", name: "",
symbol_id: "",
unit_id: "", unit_id: "",
is_fixed: 1,
evaluation_way: "",
score: 0.00, score: 0.00,
symbol_id: "",
half_target: "", half_target: "",
year_target: "", year_target: "",
is_fixed: 1,
evaluation_way: "",
}; };
}, },
setForm(key = [], value = []) { setForm(key = [], value = []) {
@ -416,7 +423,7 @@ export default {
"form.symbol_id": { "form.symbol_id": {
handler:function(val) { handler:function(val) {
this.$nextTick(() => { this.$nextTick(() => {
this.isDingxing = this.$refs['symbolSelect']?.selectedLabel === '定'; this.isDingxing = this.$refs['symbolSelect']?.selectedLabel === '定';
}) })
}, },
immediate: true immediate: true

@ -150,6 +150,7 @@ export default {
pid: "", pid: "",
name: "", name: "",
remark: "", remark: "",
score: 0,
sort: "", sort: "",
}; };
}, },

@ -41,12 +41,10 @@
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-dropdown @command="command => { <el-dropdown @command="command => {
if (command === 'yearMiddle') { if (command === 'yearMiddle') {
$refs['addPlanEvaluate'].isPid0 = scope.row.pid === 0;
$refs['addPlanEvaluate'].type = 1; $refs['addPlanEvaluate'].type = 1;
$refs['addPlanEvaluate'].setPlanId(scope.row.id); $refs['addPlanEvaluate'].setPlanId(scope.row.id);
$refs['addPlanEvaluate'].show(); $refs['addPlanEvaluate'].show();
} else { } else {
$refs['addPlanEvaluate'].isPid0 = scope.row.pid === 0;
$refs['addPlanEvaluate'].type = 2; $refs['addPlanEvaluate'].type = 2;
$refs['addPlanEvaluate'].setPlanId(scope.row.id); $refs['addPlanEvaluate'].setPlanId(scope.row.id);
$refs['addPlanEvaluate'].show(); $refs['addPlanEvaluate'].show();

@ -8,6 +8,13 @@
<div slot="content"></div> <div slot="content"></div>
<slot> <slot>
<div> <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 style="padding: 0 6px">年份</span>
<span> <span>
<DatePicker <DatePicker
@ -835,6 +842,7 @@ export default {
}, },
], ],
select: { select: {
name: "",
page: 1, page: 1,
year: "", year: "",
type: "", type: "",
@ -999,6 +1007,7 @@ export default {
// //
getBudgets() { getBudgets() {
getBudget({ getBudget({
name: this.select.name,
page_size: this.pageSize, page_size: this.pageSize,
page: this.pageIndex, page: this.pageIndex,
year: this.select.year, year: this.select.year,

@ -85,7 +85,6 @@ export default {
symbols: [], symbols: [],
units: [], units: [],
planPid: 0,
isShow: false, isShow: false,
list: [], list: [],
@ -99,14 +98,14 @@ export default {
<el-input-number precision={2} <el-input-number precision={2}
min={0} min={0}
max={100} max={100}
disabled={this.planPid === 0} disabled={!!(row.target && row.target.is_fixed)}
vModel={row.score} vModel={row.score}
size="small" size="small"
controls={false} controls={false}
placeholder="分值"></el-input-number> placeholder="分值"></el-input-number>
<el-button style="border-top-left-radius: 0;border-bottom-left-radius: 0;transform: translateX(-4px);" <el-button style="border-top-left-radius: 0;border-bottom-left-radius: 0;transform: translateX(-4px);"
size="small" size="small"
disabled={this.planPid === 0} disabled={!!(row.target && row.target.is_fixed)}
type="primary" type="primary"
icon="el-icon-edit" icon="el-icon-edit"
on={{ on={{
@ -114,13 +113,6 @@ export default {
this.$confirm('确认保存分数?','提示',{ this.$confirm('确认保存分数?','提示',{
closeOnClickModal: false closeOnClickModal: false
}).then(_ => { }).then(_ => {
let totalScore = this.list.reduce((pre,cur)=>(pre + parseFloat(cur.score||0)),0)
if (totalScore > 100) {
this.$message({
type: "warning",
message: "分值超过100"
})
} else {
save(row).then(_ => { save(row).then(_ => {
this.$message({ this.$message({
type: 'success', type: 'success',
@ -128,7 +120,6 @@ export default {
}) })
this.getList() this.getList()
}) })
}
}) })
} }
}}>保存</el-button> }}>保存</el-button>
@ -162,6 +153,7 @@ export default {
minWidth: 200, minWidth: 200,
customFn: (row) => { customFn: (row) => {
return ( return (
<div>
<el-popover <el-popover
style="margin-left: .4em;" style="margin-left: .4em;"
placement="top" placement="top"
@ -198,6 +190,25 @@ export default {
删除 删除
</el-button> </el-button>
</el-popover> </el-popover>
{
!!(row.target && row.target.is_fixed) ? "" : (
<el-button slot="reference"
size="mini"
type="primary"
style="margin-left: 4px;"
on={{
['click']: _ => {
this.$refs['addPoint'].setId(row.target_id);
this.$refs['addPoint'].setType('editor');
this.$refs['addPoint'].show();
}
}}>
编辑
</el-button>
)
}
</div>
); );
}, },
}, },

Loading…
Cancel
Save