<el-table
:data="tableData"
ref="JZPFData"
v-loading="loading"
border
:span-method="objectJBXXMethod"
height="calc(90vh - 140px)"
:header-cell-style="{ background: '#deebff', color: '#606266' }"
highlight-current-row
>
<el-table-column
prop="name"
label="考核因素"
width="80px"
align="center"
>
<template slot-scope="scope">
{{ scope.row.name }}
</template>
</el-table-column>
<el-table-column prop="templateStr" align="center" label="考核指标">
<template slot-scope="scope">
<div style="text-align: left" v-if="!scope.row.form_id">
{{ scope.row.templateStr }}
</div>
<div
style="display: flex"
v-else-if="scope.row.type == 'otherScore'"
>
<span>{{ scope.row.templateStr }}</span>
<el-form-item :prop="scope.row.form_id" label-width="0px">
<el-input
:disabled="
formType=='status' || formType == 'see'
"
v-model="form[scope.row.form_id]"
size="mini"
style="width: 70px"
></el-input>
</el-form-item>
</div>
<div
style="text-align: center"
v-else-if="scope.row.form_id == 'totalScore'"
>
{{ totalScore }}
</div>
<el-form-item v-else :prop="scope.row.form_id" label-width="0px">
<div style="margin-boottom: 10px; float: left" v-if="
(formType == 'status'||formType =='edit'||(formStatus ==1)) &&
scope.row.form_id == 'managerCheck'
">
<span>审核状态:</span>
<el-radio-group
v-model="status"
:disabled="formType!='status'"
>
<el-radio :label="1">同意</el-radio>
<el-radio :label="2">拒绝</el-radio>
</el-radio-group>
</div>
<el-input
:disabled="formType == 'see' ? true: formType == 'edit' &&scope.row.form_id == 'managerCheck' ? true: formType == 'status'
&& scope.row.form_id != 'managerCheck'
? true
: false
"
v-model="form[scope.row.form_id]"
size="mini"
type="textarea"
></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column
label="权重分"
align="center"
prop="templateScore"
width="65px"
></el-table-column>
<el-table-column prop="value" label="得分" width="80px">
<template slot-scope="scope">
<span v-if="scope.row.type == 'otherScore'">{{ otherScore }} </span>
<el-select
v-else
v-model="scope.row.typeDetailScore"
:disabled="
formType=='status' || formType == 'see'
"
placeholder=""
size="mini"
>
<el-option
v-for="(item, i) in scope.row.detailScoreSelect"
:key="i"
:label="i"
:value="i * 1"
/>
</el-select>
</template>
</el-table-column>
</el-table>
方法
getDetail(id) {
this.loading = true;
let totalList= [
{
span_num: 1,
name: "考核得分",
templateScore: 100,
templateStr: "其它加分或减分 :",
type: "otherScore",
form_id: "score",
},
{
span_num: 1,
type: "totalInput",
name: "最终得分",
form_id: "totalScore", //不输入
},
{
span_num: 1,
type: "totalInput",
name: "部门主管考评意见",
form_id: "chargerCheck",
},
{
span_num: 1,
type: "totalInput",
name: "部门经理考评意见",
form_id: "managerCheck",
},
{
span_num: 1,
type: "totalInput",
name: "备注",
form_id: "remark",
},
]
let tableData = [
{
detailScoreSelect: 4
name: "安全生产 6分"
span_num: 3
templateScore: 3
templateStr: "1.确保自身人身安全,工作时做好必要防护,进入工地组戴安全帽、穿工作服,不能穿拖鞋,进药剂间戴防护罩和橡胶手套;"
type: 1
typeDetail: 1
typeDetailScore: 2
}...
];
tableData = tableData.concat(totalList);
this.tableData = tableData;
this.loading = false;
});
},
objectJBXXMethod({ row, column, rowIndex, columnIndex }) {
//columnIndex:列
// 当前行row、当前列column、当前行号rowIndex、当前列号columnIndex四个属性。
if (columnIndex === 0) {
return {
rowspan: row.span_num, //合并行【3,0,0,5...
colspan: 1,
};
}
if (columnIndex === 1) {
if (row.type == "totalInput") {
return [1, 3];
}
}
},