xy 2 years ago
parent 3751b1abe6
commit 8ed8d70981

@ -1,7 +1,7 @@
<template>
<div>
<el-drawer
size="56%"
size="64%"
:title="type === 1 ? '年中绩效指标' : '年末绩效指标'"
:visible.sync="isShow"
direction="rtl"
@ -9,7 +9,7 @@
<xy-table
ref="table"
:list="list"
:table-item="table"
:table-item="tableItem"
:default-expand-all="false"
@expand-change="expandChange"
>
@ -62,7 +62,6 @@ export default {
return {
symbols: [],
units: [],
isPid0: false,
isShow: false,
type: 1,
action: process.env.VUE_APP_UPLOAD_API,
@ -96,11 +95,12 @@ export default {
<el-form-item label="得分" required={true}>
<el-input-number
disabled={this.isPid0}
precision={2}
controls={false}
vModel={row._form.score}
size="small"
min={0}
max={100}
placeholder="请输入自评值"
></el-input-number>
</el-form-item>
@ -176,7 +176,7 @@ export default {
},
}}
>
立即创建
保存
</el-button>
<el-button
on={{
@ -194,6 +194,11 @@ export default {
);
},
},
{
label: "分值",
prop: "target.score",
width: 100,
},
{
label: "指标名称",
prop: "target.name",
@ -202,47 +207,10 @@ export default {
{
label: "评价方式",
prop: "target.evaluation_way",
minWidth: 180
},
{
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,
minWidth: 260,
align: "left"
},
],
select: {
page: 1,
@ -343,6 +311,7 @@ export default {
return {
_form: {
id: "",
score: "",
result: "",
remark: "",
type: this.type,
@ -380,12 +349,33 @@ export default {
},
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: {
isShow(val) {
if (val) {
this.getList();
} else {
this.list = [];
}
},
},

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

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

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

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

@ -85,7 +85,6 @@ export default {
symbols: [],
units: [],
planPid: 0,
isShow: false,
list: [],
@ -99,14 +98,14 @@ export default {
<el-input-number precision={2}
min={0}
max={100}
disabled={this.planPid === 0}
disabled={!!(row.target && row.target.is_fixed)}
vModel={row.score}
size="small"
controls={false}
placeholder="分值"></el-input-number>
<el-button style="border-top-left-radius: 0;border-bottom-left-radius: 0;transform: translateX(-4px);"
size="small"
disabled={this.planPid === 0}
disabled={!!(row.target && row.target.is_fixed)}
type="primary"
icon="el-icon-edit"
on={{
@ -114,21 +113,13 @@ export default {
this.$confirm('确认保存分数?','提示',{
closeOnClickModal: false
}).then(_ => {
let totalScore = this.list.reduce((pre,cur)=>(pre + parseFloat(cur.score||0)),0)
if (totalScore > 100) {
save(row).then(_ => {
this.$message({
type: "warning",
message: "分值超过100"
type: 'success',
message: '保存成功'
})
} else {
save(row).then(_ => {
this.$message({
type: 'success',
message: '保存成功'
})
this.getList()
})
}
this.getList()
})
})
}
}}>保存</el-button>
@ -162,42 +153,62 @@ export default {
minWidth: 200,
customFn: (row) => {
return (
<el-popover
style="margin-left: .4em;"
placement="top"
width="160"
trigger="click"
>
<p>确定删除吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text">
取消
</el-button>
<el-button
type="primary"
size="mini"
on={{
["click"]: (e) => {
destroy({
id: row.id,
}).then((res) => {
this.$message({
type: "success",
message: "删除成功",
<div>
<el-popover
style="margin-left: .4em;"
placement="top"
width="160"
trigger="click"
>
<p>确定删除吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text">
取消
</el-button>
<el-button
type="primary"
size="mini"
on={{
["click"]: (e) => {
destroy({
id: row.id,
}).then((res) => {
this.$message({
type: "success",
message: "删除成功",
});
this.getList();
});
this.getList();
});
},
}}
>
确定
},
}}
>
确定
</el-button>
</div>
<el-button slot="reference" size="mini" type="danger">
删除
</el-button>
</div>
</el-popover>
<el-button slot="reference" size="mini" type="danger">
删除
</el-button>
</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