人效管理-绩效管理-绩效模板维护-接口对接

dev-scheduling
ysn 2 months ago
parent d99287243c
commit f950f145b4
  1. 26
      src/api/performanceManagement/dataReporting.js
  2. 57
      src/api/performanceManagement/templateMaintenance.js
  3. 175
      src/views/personnelEfficiencyManagement/performanceManagement/components/batchAddContent.vue
  4. 203
      src/views/personnelEfficiencyManagement/performanceManagement/components/batchAddPerf.vue
  5. 365
      src/views/personnelEfficiencyManagement/performanceManagement/dataReporting.vue
  6. 260
      src/views/personnelEfficiencyManagement/performanceManagement/templateMaintenance.vue

@ -0,0 +1,26 @@
// 绩效填报相关接口
import request from '@/axios';
// 1. 绩效模板内容列表
export function listBsEfficiencyTempParam(params) {
return request({
url: '/blade-desk/bsEfficiencyTempParam/list',
method: 'get',
params
})
}
// 2. 绩效模板内容删除
export function removeBsEfficiencyTempParam(params) {
return request({
url: '/blade-desk/bsEfficiencyTempParam/remove',
method: 'post',
params
})
}
// 3. 绩效模板内容新增
export function submitBsEfficiencyTempParam(data) {
return request({
url: '/blade-desk/bsEfficiencyTempParam/submit',
method: 'post',
data
})
}

@ -1,39 +1,42 @@
// 绩效模板维护 // 绩效模板相关接口
import request from '@/axios'; import request from '@/axios';
// 1. 绩效模板分页查询
// 列表 export function pageBsEfficiencyTemp(params) {
export const pageList = (params) => {
return request({ return request({
url: '/blade-desk/bsEfficiencyTemp/page', url: '/blade-desk/bsEfficiencyTemp/page',
method: 'get', method: 'get',
params params
}); })
}; }
// 2. 绩效模板新增
// 查询用户列表 export function submitBsEfficiencyTemp(data) {
export const pageListUser = (params) => {
return request({
url: '/blade-system/user/page',
method: 'get',
params
});
};
// 新增
export const addItem = params => {
return request({ return request({
url: '/blade-desk/bsEfficiencyTemp/submit', url: '/blade-desk/bsEfficiencyTemp/submit',
method: 'post', method: 'post',
data: params data
}); })
}; }
// 3. 绩效模板详情
// 删除 export function detailBsEfficiencyTemp(params) {
export const delItem = params => { return request({
url: '/blade-desk/bsEfficiencyTemp/detail',
method: 'get',
params
})
}
// 4. 绩效模板删除
export function removeBsEfficiencyTemp(params) {
return request({ return request({
url: '/blade-desk/bsEfficiencyTemp/remove', url: '/blade-desk/bsEfficiencyTemp/remove',
method: 'post', method: 'post',
params params
}); })
}; }
// 5. 绩效模板下发
export function taskAssignmentBsEfficiencyTemp(data) {
return request({
url: '/blade-desk/bsEfficiencyTemp/taskAssignment',
method: 'post',
data
})
}

@ -5,26 +5,28 @@
<el-button type="danger" @click="delTable">删除选中行</el-button> <el-button type="danger" @click="delTable">删除选中行</el-button>
</div> </div>
<!-- 单个 Form 包裹整个表格 --> <!-- 单个 Form 包裹整个表格 -->
<el-form <el-form ref="tableForm" :model="form" :rules="formRules" label-width="0px">
ref="tableForm"
:model="form"
:rules="formRules"
label-width="0px"
>
<!-- 全局错误提示 --> <!-- 全局错误提示 -->
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px;"> <div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px">
{{ formError }} {{ formError }}
</div> </div>
<el-table :data="form.tableData" @select="selectChange" border> <el-table :data="form.tableData" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="55" :selectable="checkSelectable"></el-table-column> <el-table-column type="selection" width="55" :selectable="checkSelectable" />
<!-- 模板内容 --> <!-- 模板内容 -->
<el-table-column align="center" label="模板内容"> <el-table-column align="center" label="模板内容">
<template #header> <template #header>
<span><i style="color: red">*</i>模板内容</span> <span><i style="color: red">*</i>模板内容</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].content`" :rules="formRules.content"> <el-form-item
<el-input v-model="scope.row.content" :disabled="scope.$index == form.tableData.length - 1" placeholder="请输入模板内容"></el-input> :prop="`tableData[${scope.$index}].paramName`"
:rules="formRules.paramName"
>
<el-input
v-model="scope.row.paramName"
:disabled="scope.$index == form.tableData.length - 1"
placeholder="请输入模板内容"
/>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -38,62 +40,147 @@
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {
listBsEfficiencyTempParam,
removeBsEfficiencyTempParam,
submitBsEfficiencyTempParam,
} from '@/api/performanceManagement/dataReporting';
export default { export default {
props:{ props: {
showContent:{ showContent: {
type:Boolean, type: Boolean,
default:false default: false,
}, },
title:{ title: {
type:String, type: String,
default:'' default: '',
} },
}, },
data() { data() {
return { return {
openShow: false, openShow: false,
formError:"", formError: '',
form:{ form: {
tableData:[ tableData: [],
{_select:false,content:'总分'}
]
}, },
formRules:{} formRules: {
} paramName: [{ required: true, message: '请输入模板内容', trigger: 'blur' }],
}, },
created(){ selection: [],
this.openShow = this.showContent };
if(this.title == '模板内容维护' && this.form.tableData.length == 1){ },
this.addTable() created() {
} this.openShow = this.showContent;
this.loadTemplateContent();
}, },
methods:{ methods: {
closeDialog(val) { closeDialog(val) {
this.openShow = false this.openShow = false;
this.$emit('closeDialog', val) this.$emit('closeDialog', val);
}, },
addTable(){ //
console.log('1111111111111') loadTemplateContent() {
listBsEfficiencyTempParam().then(res => {
if (res.data.code === 200) {
const records = res.data.data || [];
if (records.length > 0) {
this.form.tableData = records.map(item => ({
...item,
_select: false,
}));
} else {
this.form.tableData = [{ _select: false, paramName: '总分' }];
this.addTable();
}
} else {
this.form.tableData = [{ _select: false, paramName: '总分' }];
this.addTable();
}
});
},
addTable() {
// arr.length - 1 // arr.length - 1
const newItem = { _select: false, content: '' }; const newItem = { _select: false, paramName: '' };
this.form.tableData.splice(this.form.tableData.length - 1, 0, newItem); this.form.tableData.splice(this.form.tableData.length - 1, 0, newItem);
}, },
// 2: //
checkSelectable(row, index) { checkSelectable(row, index) {
// false // false
return index !== this.form.tableData.length - 1; return index !== this.form.tableData.length - 1;
}, },
selectChange(list, row){ handleSelectionChange(selection) {
row._select = !row._select; this.selection = selection;
}, },
// //
delTable() { delTable() {
this.form.tableData = this.form.tableData.filter(row => !row._select); if (this.selection.length === 0) {
this.$message.error('请至少选择一条数据');
return;
}
const count = this.selection.length;
this.$confirm(`确定要删除选中的 ${count} 条数据吗?此操作不可恢复!`, '删除确认', {
confirmButtonText: '确定删除',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'el-button--danger',
})
.then(() => {
// id
const hasIdRows = this.selection.filter(item => item.id);
// 1. id
if (hasIdRows.length > 0) {
const ids = hasIdRows.map(item => item.id).join(',');
removeBsEfficiencyTempParam({ ids }).then(res => {
if (res.data.code == 200) {
this.doFrontDelete(); //
}
});
} else {
// 2. id
this.doFrontDelete();
}
})
.catch(() => {});
},
//
doFrontDelete() {
//
this.form.tableData = this.form.tableData.filter(
row => !this.selection.some(item => item === row)
);
this.selection = [];
this.$message.success('删除成功');
}, },
//
submitForm() {
this.formError = '';
this.$refs.tableForm.validate((isValid, invalidFields) => {
if (!isValid) {
this.formError = '存在未完善的字段,请检查表格中的红色提示';
this.$nextTick(() => {
const firstError = document.querySelector('.el-form-item.is-error');
if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' });
} }
} });
return;
}
const submitData = this.form.tableData.map(row => {
const { _select, ...validData } = row;
return validData;
});
console.log('提交数据', submitData); //
submitBsEfficiencyTempParam(submitData).then(res => {
if (res.data.code === 200) {
this.$message.success('保存成功');
this.closeDialog(true); //
}
});
});
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

@ -5,14 +5,9 @@
<el-button type="danger" @click="delTable">删除选中行</el-button> <el-button type="danger" @click="delTable">删除选中行</el-button>
</div> </div>
<!-- 单个 Form 包裹整个表格 --> <!-- 单个 Form 包裹整个表格 -->
<el-form <el-form ref="tableForm" :model="form" :rules="formRules" label-width="0px">
ref="tableForm"
:model="form"
:rules="formRules"
label-width="0px"
>
<!-- 全局错误提示 --> <!-- 全局错误提示 -->
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px;"> <div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px">
{{ formError }} {{ formError }}
</div> </div>
<el-table :data="form.tableData" @select="selectChange" border> <el-table :data="form.tableData" @select="selectChange" border>
@ -24,10 +19,7 @@
</template> </template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].taskName`" :rules="formRules.taskName"> <el-form-item :prop="`tableData[${scope.$index}].taskName`" :rules="formRules.taskName">
<el-input <el-input v-model="scope.row.taskName" placeholder="请输入"></el-input>
v-model="scope.row.taskName"
placeholder="请输入"
></el-input>
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
@ -37,12 +29,16 @@
<span><i style="color: red">*</i>绩效填报人</span> <span><i style="color: red">*</i>绩效填报人</span>
</template> </template>
<template #default="scope"> <template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].reportUser`" :rules="formRules.reportUser"> <el-form-item
:prop="`tableData[${scope.$index}].reportUser`"
:rules="formRules.reportUser"
>
<el-select <el-select
v-model="scope.row.reportUser" v-model="scope.row.reportUser"
placeholder="请选择绩效填报人" placeholder="请选择绩效填报人"
filterable filterable
remote remote
reserve-keyword
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading" :loading="loading"
> >
@ -68,43 +64,44 @@
</template> </template>
<script> <script>
import {pageListUser,addItem} from '@/api/performanceManagement/templateMaintenance' import { submitBsEfficiencyTemp } from '@/api/performanceManagement/templateMaintenance';
import { getList } from '@/api/system/user';
export default { export default {
props:{ props: {
showDialog:{ showDialog: {
type:Boolean, type: Boolean,
default:false default: false,
}, },
moldAddMore:{ moldAddMore: {
type:Boolean, type: Boolean,
default:false default: false,
}, },
title:{ title: {
type:String, type: String,
default:'' default: '',
}, },
checkRow:{ checkRow: {
type:Object, type: Object,
default:() => {} default: () => {},
}
}, },
data(){ },
data() {
return { return {
openShow:false, openShow: false,
formError:'', formError: '',
form:{ form: {
tableData:[] tableData: [],
}, },
loading:false, loading: false,
userData:[], userData: [],
formRules:{ formRules: {
// 1 // 1
tableData: [ tableData: [
{ {
required: true, required: true,
message: '请至少添加一行数据', message: '请至少添加一行数据',
trigger: 'submit', trigger: 'submit',
type: 'array' // type: 'array', //
}, },
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
@ -114,71 +111,81 @@ export default {
callback(); callback();
} }
}, },
trigger: 'submit' trigger: 'submit',
} },
], ],
// wcId // wcId
taskName: [ taskName: [
{ required: true, message: '请输入绩效任务名称', trigger: ['change', 'submit'] } { required: true, message: '请输入绩效任务名称', trigger: ['change', 'submit'] },
], ],
// wcId // wcId
reportUser: [ reportUser: [
{ required: true, message: '请选择绩效填报人', trigger: ['change', 'submit'] } { required: true, message: '请选择绩效填报人', trigger: ['change', 'submit'] },
], ],
}, },
detailRow:{} detailRow: {},
} };
}, },
created(){ created() {
this.openShow = this.showDialog this.openShow = this.showDialog;
if(this.title == "新增"){ // detailRow
this.form.tableData = [] if (this.title == '新增') {
this.addTable() this.form.tableData = [];
}else{ this.addTable();
this.detailRow = JSON.parse(JSON.stringify(this.checkRow)) } else {
this.form.tableData = [] this.detailRow = JSON.parse(JSON.stringify(this.checkRow));
this.form.tableData.push(this.detailRow) this.form.tableData = [];
this.form.tableData.push(this.detailRow);
} }
//
this.remoteMethod('');
}, },
methods:{ methods: {
closeDialog(val){ closeDialog(val) {
this.openShow = false this.openShow = false;
this.$emit('closeDialog',val) this.$emit('closeDialog', val);
}, },
addTable(){ addTable() {
this.form.tableData.push({ this.form.tableData.push({
_select:false, _select: false,
taskName:"", taskName: '',
reportUser:"" reportUser: '',
}) });
}, },
selectChange(list, row){ selectChange(list, row) {
row._select = !row._select; row._select = !row._select;
}, },
// //
delTable() { delTable() {
this.form.tableData = this.form.tableData.filter(row => !row._select); this.form.tableData = this.form.tableData.filter(row => !row._select);
}, },
remoteMethod(query){ //
console.log('query============',query) remoteMethod(query) {
this.loading = true this.loading = true;
if(query == ""){ const page = { currentPage: 1, pageSize: 500 };
pageListUser({ const queryParams = Object.assign({}, this.query || {}, {
current:1,size:300 status: this.auditMode ? 0 : 1,
}).then(res =>{ userName: query,
this.userData = res.data.data.records });
this.loading = false getList(page.currentPage, page.pageSize, queryParams)
}) .then(res => {
}else{ const data = res.data.data;
pageListUser({ this.userData = data.records;
current:1,size:300, if (this.detailRow.reportUser){
realName:query // id
}).then(res =>{ const hasItem = this.userData.some(item => item.id == this.detailRow.reportUser);
this.userData = res.data.data.records if (!hasItem) {
this.loading = false //
}) this.userData.unshift({
id: this.detailRow.reportUser,
realName: this.detailRow.reportUserName,
});
} }
}
})
.finally(() => {
this.loading = false;
});
}, },
// //
submitForm() { submitForm() {
@ -188,7 +195,6 @@ export default {
if (!isValid) { if (!isValid) {
// //
this.formError = '存在未完善的字段,请检查表格中的红色提示'; this.formError = '存在未完善的字段,请检查表格中的红色提示';
this.$nextTick(() => { this.$nextTick(() => {
// //
const firstError = document.querySelector('.el-form-item.is-error'); const firstError = document.querySelector('.el-form-item.is-error');
@ -203,29 +209,26 @@ export default {
const { _select, ...validData } = row; // const { _select, ...validData } = row; //
return validData; return validData;
}); });
if (this.title == '新增') {
if(this.title == "新增"){ submitBsEfficiencyTemp(submitData).then(res => {
addItem(submitData).then(res =>{ if (res.data.code == 200) {
if(res.data.code == 200){ this.$message.success('新增成功');
this.$message.success('新增成功') this.closeDialog(true);
this.closeDialog(true)
}
})
}else{
addItem(submitData).then(res =>{
if(res.data.code == 200){
this.$message.success('修改成功')
this.closeDialog(true)
} }
}) });
} } else {
submitBsEfficiencyTemp(submitData).then(res => {
}) if (res.data.code == 200) {
this.$message.success('修改成功');
this.closeDialog(true);
} }
});
} }
} });
},
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
// //
:deep(.el-table .el-form-item) { :deep(.el-table .el-form-item) {

@ -18,6 +18,9 @@
@refresh-change="refreshChange" @refresh-change="refreshChange"
@on-load="onLoad" @on-load="onLoad"
> >
<template #menu-left>
<el-button type="primary" @click="maintenanceContents">绩效内容维护</el-button>
</template>
<template #status="scope"> <template #status="scope">
<el-tag v-if="scope.row.status == 1">进行中</el-tag> <el-tag v-if="scope.row.status == 1">进行中</el-tag>
<!-- <el-tag v-if="scope.row.status == 2" type="warning">待汇总</el-tag> --> <!-- <el-tag v-if="scope.row.status == 2" type="warning">待汇总</el-tag> -->
@ -27,20 +30,27 @@
<el-tag v-if="scope.row.status == 6" type="success">已完成</el-tag> <el-tag v-if="scope.row.status == 6" type="success">已完成</el-tag>
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="text" v-if="scope.row.status == 3 || scope.row.status == 5 || scope.row.status == 4" @click="detailRow(scope.row)">详情</el-button> <el-button
type="text"
v-if="scope.row.status == 3 || scope.row.status == 5 || scope.row.status == 4"
@click="detailRow(scope.row)"
>详情</el-button
>
<el-button <el-button
type="text" type="text"
v-if="scope.row.status == 1 || scope.row.status == 5" v-if="scope.row.status == 1 || scope.row.status == 5"
@click="fillRow(scope.row)" @click="fillRow(scope.row)"
>填报</el-button >填报</el-button
> >
<el-button type="text" v-if="(scope.row.parentId && scope.row.status == 6) || <el-button
(!scope.row.parentId && scope.row.status == 1)" type="text"
v-if="
(scope.row.parentId && scope.row.status == 6) ||
(!scope.row.parentId && scope.row.status == 1)
"
>下载</el-button >下载</el-button
> >
<el-button type="text" v-if="scope.row.parentId && scope.row.status == 1" <el-button type="text" v-if="scope.row.parentId && scope.row.status == 1">删除</el-button>
>删除</el-button
>
<el-button type="text" v-if="scope.row.status == 2" @click="collectRow(scope.row)" <el-button type="text" v-if="scope.row.status == 2" @click="collectRow(scope.row)"
>汇总</el-button >汇总</el-button
> >
@ -48,24 +58,19 @@
<el-button type="text" v-if="scope.row.status == 3" @click="examineRow(scope.row)" <el-button type="text" v-if="scope.row.status == 3" @click="examineRow(scope.row)"
>审批</el-button >审批</el-button
> >
<el-button type="text" v-if="scope.row.parentId && scope.row.status == 6" <el-button type="text" v-if="scope.row.parentId && scope.row.status == 6">重置</el-button>
>重置</el-button
>
</template> </template>
</avue-crud> </avue-crud>
<reportingPerf v-if="showReport" :showReport="showReport" :isDetail="isDetail" <reportingPerf
:title="title" @closeDialog="closeDialog"></reportingPerf> v-if="showReport"
<prefDetail :showReport="showReport"
v-if="showDetail" :isDetail="isDetail"
:showDetail="showDetail" :title="title"
@closeDetail="closeDetail"> @closeDialog="closeDialog"
</prefDetail> ></reportingPerf>
<prefDetail v-if="showDetail" :showDetail="showDetail" @closeDetail="closeDetail"> </prefDetail>
<el-dialog append-to-body title="填报" v-model="showDialog"> <el-dialog append-to-body title="填报" v-model="showDialog">
<avue-form <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"></avue-form>
:option="excelOption"
v-model="excelForm"
:upload-after="uploadAfter"
></avue-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="showDialog = false"> </el-button> <el-button @click="showDialog = false"> </el-button>
@ -119,12 +124,7 @@
<el-table-column align="center" label="通报" prop="notice"></el-table-column> <el-table-column align="center" label="通报" prop="notice"></el-table-column>
<el-table-column align="center" label="请假扣分" prop="leave"></el-table-column> <el-table-column align="center" label="请假扣分" prop="leave"></el-table-column>
<el-table-column align="center" label="考勤扣分" prop="check"></el-table-column> <el-table-column align="center" label="考勤扣分" prop="check"></el-table-column>
<el-table-column <el-table-column align="center" label="投稿加分项" prop="add" width="100"></el-table-column>
align="center"
label="投稿加分项"
prop="add"
width="100"
></el-table-column>
<el-table-column align="center" label="群策群力" prop="all"></el-table-column> <el-table-column align="center" label="群策群力" prop="all"></el-table-column>
<el-table-column <el-table-column
align="center" align="center"
@ -155,30 +155,39 @@
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<batchAddContent
v-if="showContent"
:showContent="showContent"
:title="title"
@closeDialog="closeDialog"
/>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import reportingPerf from "./components/reportingPerf.vue" import reportingPerf from './components/reportingPerf.vue';
import prefDetail from './components/prefDetail.vue'; import prefDetail from './components/prefDetail.vue';
import { excelOption } from "./js/dataReportOption"; import batchAddContent from './components/batchAddContent.vue';
import { excelOption } from './js/dataReportOption';
export default { export default {
components:{reportingPerf,prefDetail}, components: { reportingPerf, prefDetail,batchAddContent },
data() { data() {
return { return {
showDialog: false, showDialog: false,
excelForm: {}, excelForm: {},
excelOption: excelOption, excelOption: excelOption,
typeValue: "1", typeValue: '1',
resultValue: "", resultValue: '',
showReport:false, showReport: false,
isDetail:false, isDetail: false,
title:"", title: '',
showContent: false,
tableData: [ tableData: [
{ {
id: 1, id: 1,
userCode: "001", userCode: '001',
userName: "张三", userName: '张三',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
notice: 0, notice: 0,
@ -192,8 +201,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "002", userCode: '002',
userName: "李四", userName: '李四',
KPI: 68, KPI: 68,
lh: 26, lh: 26,
notice: 0, notice: 0,
@ -207,8 +216,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "003", userCode: '003',
userName: "王五", userName: '王五',
KPI: 70, KPI: 70,
user: 96, user: 96,
lh: 26, lh: 26,
@ -223,8 +232,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "004", userCode: '004',
userName: "刘明", userName: '刘明',
KPI: 70, KPI: 70,
user: 98, user: 98,
lh: 26, lh: 26,
@ -238,7 +247,7 @@ export default {
total: 94, total: 94,
}, },
], ],
showDetail:false, showDetail: false,
showExamine: false, showExamine: false,
loading: false, loading: false,
data: [], data: [],
@ -249,15 +258,15 @@ export default {
total: 0, total: 0,
}, },
option: { option: {
height: "auto", height: 'auto',
align: "center", align: 'center',
calcHeight: 32, calcHeight: 32,
rowKey: "id", rowKey: 'id',
rowParentKey: "parentId", rowParentKey: 'parentId',
tip: false, tip: false,
simplePage: true, simplePage: true,
searchShow: true, searchShow: true,
searchMenuSpan:12, searchMenuSpan: 12,
searchIcon: true, searchIcon: true,
searchIndex: 3, searchIndex: 3,
tree: false, tree: false,
@ -268,12 +277,12 @@ export default {
delBtn: false, delBtn: false,
addBtn: false, addBtn: false,
editBtn: false, editBtn: false,
editBtnText: "修改", editBtnText: '修改',
addBtnIcon: " ", addBtnIcon: ' ',
viewBtnIcon: " ", viewBtnIcon: ' ',
delBtnIcon: " ", delBtnIcon: ' ',
editBtnIcon: " ", editBtnIcon: ' ',
viewBtnText: "详情", viewBtnText: '详情',
labelWidth: 120, labelWidth: 120,
searchLabelWidth: 120, searchLabelWidth: 120,
menu: true, menu: true,
@ -288,63 +297,63 @@ export default {
excelBtn: true, excelBtn: true,
columnSort: true, columnSort: true,
showOverflowTooltip: true, showOverflowTooltip: true,
searchLabelPosition: "left", searchLabelPosition: 'left',
searchLabelPosition: "left", searchLabelPosition: 'left',
searchGutter: 24, searchGutter: 24,
searchSpan: 6, searchSpan: 6,
menuAlign: "center", menuAlign: 'center',
gridBtn: false, gridBtn: false,
searchMenuPosition: "right", searchMenuPosition: 'right',
column: [ column: [
{ {
label: "任务名称", label: '任务名称',
prop: "taskName", prop: 'taskName',
search: true, search: true,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
align: "left", align: 'left',
headerAlign: "center", headerAlign: 'center',
}, },
{ {
label: "绩效填报人", label: '绩效填报人',
prop: "informantUser", prop: 'informantUser',
search: true, search: true,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
}, },
{ {
label: "状态", label: '状态',
prop: "status", prop: 'status',
type: "select", type: 'select',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
dicData: [ dicData: [
{ label: "进行中", value: 1 }, { label: '进行中', value: 1 },
{ label: "待汇总", value: 2 }, { label: '待汇总', value: 2 },
{ label: "待审批", value: 3 }, { label: '待审批', value: 3 },
{ label: "审批通过", value: 4 }, { label: '审批通过', value: 4 },
{ label: "审批不通过", value: 5 }, { label: '审批不通过', value: 5 },
{ label: "已完成", value: 6 }, { label: '已完成', value: 6 },
], ],
}, },
{ {
label: "下发人", label: '下发人',
prop: "taskUserName", prop: 'taskUserName',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
}, },
{ {
label: "下发时间", label: '下发时间',
prop: "createName", prop: 'createName',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
}, },
{ {
label: "填报时间", label: '填报时间',
prop: "createName", prop: 'createName',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
@ -355,44 +364,50 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
maintenanceContents() {
this.title = '模板内容维护';
this.showContent = true;
},
// //
fillRow(row) { fillRow(row) {
// this.showDialog = true; // this.showDialog = true;
this.title = row.parentId ? '任务明细填报' : "任务填报"; this.title = row.parentId ? '任务明细填报' : '任务填报';
this.isDetail = row.parentId ? true : false; this.isDetail = row.parentId ? true : false;
this.showReport = true; this.showReport = true;
}, },
closeDialog(val){ closeDialog(val) {
console.log('222222222222222222') console.log('222222222222222222');
this.showReport = false this.showReport = false;
this.isDetail = false this.isDetail = false;
this.showDetail = false this.showDetail = false;
if(val){ this.showContent = false;
this.onLoad()
if (val) {
this.onLoad();
} }
}, },
closeDetail(val){ closeDetail(val) {
this.showDetail = false this.showDetail = false;
}, },
detailRow(row){ detailRow(row) {
console.log('1111111111111111111111') console.log('1111111111111111111111');
this.showDetail = true this.showDetail = true;
}, },
// //
collectRow(row) { collectRow(row) {
this.$confirm("确定汇总当前绩效?", { this.$confirm('确定汇总当前绩效?', {
confirmButtonText: "确定", confirmButtonText: '确定',
cancelButtonText: "取消", cancelButtonText: '取消',
type: "warning", type: 'warning',
}).then((res) => {}); }).then(res => {});
}, },
changeType(val) { changeType(val) {
if (val == 1) { if (val == 1) {
this.tableData = [ this.tableData = [
{ {
id: 1, id: 1,
userCode: "0001", userCode: '0001',
userName: "张三", userName: '张三',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -415,8 +430,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0002", userCode: '0002',
userName: "李四", userName: '李四',
KPI: 68, KPI: 68,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -439,8 +454,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0003", userCode: '0003',
userName: "王五", userName: '王五',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -463,8 +478,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0004", userCode: '0004',
userName: "刘明", userName: '刘明',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -490,8 +505,8 @@ export default {
this.tableData = [ this.tableData = [
{ {
id: 1, id: 1,
userCode: "0005", userCode: '0005',
userName: "王红", userName: '王红',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -514,8 +529,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0006", userCode: '0006',
userName: "王明", userName: '王明',
KPI: 68, KPI: 68,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -538,8 +553,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0007", userCode: '0007',
userName: "刘丽", userName: '刘丽',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -562,8 +577,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0008", userCode: '0008',
userName: "张磊", userName: '张磊',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -589,8 +604,8 @@ export default {
this.tableData = [ this.tableData = [
{ {
id: 1, id: 1,
userCode: "0010", userCode: '0010',
userName: "张三", userName: '张三',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -613,8 +628,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0011", userCode: '0011',
userName: "李四", userName: '李四',
KPI: 68, KPI: 68,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -637,8 +652,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0012", userCode: '0012',
userName: "王五", userName: '王五',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -661,8 +676,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0013", userCode: '0013',
userName: "刘明", userName: '刘明',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 10, orderTime: 10,
@ -688,8 +703,8 @@ export default {
this.tableData = [ this.tableData = [
{ {
id: 1, id: 1,
userCode: "0014", userCode: '0014',
userName: "纪明", userName: '纪明',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 20, orderTime: 20,
@ -712,8 +727,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0015", userCode: '0015',
userName: "齐磊", userName: '齐磊',
KPI: 68, KPI: 68,
lh: 26, lh: 26,
orderTime: 18, orderTime: 18,
@ -736,8 +751,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0016", userCode: '0016',
userName: "刘丽丽", userName: '刘丽丽',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 19, orderTime: 19,
@ -760,8 +775,8 @@ export default {
}, },
{ {
id: 1, id: 1,
userCode: "0017", userCode: '0017',
userName: "王凯", userName: '王凯',
KPI: 70, KPI: 70,
lh: 26, lh: 26,
orderTime: 16, orderTime: 16,
@ -793,125 +808,125 @@ export default {
this.data = [ this.data = [
{ {
id: 1, id: 1,
taskName: "2025年09月绩效", taskName: '2025年09月绩效',
createName: "2025-10-01", createName: '2025-10-01',
taskUserName: "张三", taskUserName: '张三',
status: 1, status: 1,
children: [ children: [
{ {
parentId: 1, parentId: 1,
id: 5, id: 5,
taskName: "2025年09月绩效-质量 绩效模板", taskName: '2025年09月绩效-质量 绩效模板',
createName: "2025-10-01", createName: '2025-10-01',
taskUserName: "李四", taskUserName: '李四',
status: 1, status: 1,
}, },
{ {
parentId: 1, parentId: 1,
id: 6, id: 6,
taskName: "2025年09月绩效-一线员工 绩效模板", taskName: '2025年09月绩效-一线员工 绩效模板',
createName: "2025-10-01", createName: '2025-10-01',
taskUserName: "王五", taskUserName: '王五',
status: 6, status: 6,
}, },
], ],
}, },
{ {
id: 2, id: 2,
taskName: "2025年08月绩效", taskName: '2025年08月绩效',
createName: "2025-09-01", createName: '2025-09-01',
taskUserName: "张三", taskUserName: '张三',
status: 3, status: 3,
children: [ children: [
{ {
parentId: 2, parentId: 2,
id: 7, id: 7,
taskName: "2025年08月绩效-质量 绩效模板", taskName: '2025年08月绩效-质量 绩效模板',
createName: "2025-09-01", createName: '2025-09-01',
taskUserName: "李四", taskUserName: '李四',
status: 6, status: 6,
}, },
{ {
parentId: 2, parentId: 2,
id: 8, id: 8,
taskName: "2025年08月绩效-一线员工 绩效模板", taskName: '2025年08月绩效-一线员工 绩效模板',
createName: "2025-09-01", createName: '2025-09-01',
taskUserName: "王五", taskUserName: '王五',
status: 6, status: 6,
}, },
], ],
}, },
{ {
id: 3, id: 3,
taskName: "2025年07月绩效", taskName: '2025年07月绩效',
createName: "2025-08-01", createName: '2025-08-01',
taskUserName: "张三", taskUserName: '张三',
status: 3, status: 3,
children: [ children: [
{ {
parentId: 3, parentId: 3,
id: 9, id: 9,
taskName: "2025年07月绩效-质量 绩效模板", taskName: '2025年07月绩效-质量 绩效模板',
createName: "2025-08-01", createName: '2025-08-01',
taskUserName: "李四", taskUserName: '李四',
status: 6, status: 6,
}, },
{ {
parentId: 3, parentId: 3,
id: 10, id: 10,
taskName: "2025年07月绩效-一线员工 绩效模板", taskName: '2025年07月绩效-一线员工 绩效模板',
createName: "2025-08-01", createName: '2025-08-01',
taskUserName: "王五", taskUserName: '王五',
status: 6, status: 6,
}, },
], ],
}, },
{ {
id: 4, id: 4,
taskName: "2025年06月绩效", taskName: '2025年06月绩效',
createName: "2025-07-01", createName: '2025-07-01',
taskUserName: "张三", taskUserName: '张三',
status: 4, status: 4,
children: [ children: [
{ {
parentId: 3, parentId: 3,
id: 9, id: 9,
taskName: "2025年06月绩效-质量 绩效模板", taskName: '2025年06月绩效-质量 绩效模板',
createName: "2025-07-01", createName: '2025-07-01',
taskUserName: "李四", taskUserName: '李四',
status: 6, status: 6,
}, },
{ {
parentId: 3, parentId: 3,
id: 10, id: 10,
taskName: "2025年06月绩效-一线员工 绩效模板", taskName: '2025年06月绩效-一线员工 绩效模板',
createName: "2025-07-01", createName: '2025-07-01',
taskUserName: "王五", taskUserName: '王五',
status: 6, status: 6,
}, },
], ],
}, },
{ {
id: 4, id: 4,
taskName: "2025年06月绩效", taskName: '2025年06月绩效',
createName: "2025-07-01", createName: '2025-07-01',
taskUserName: "张三", taskUserName: '张三',
status: 5, status: 5,
children: [ children: [
{ {
parentId: 3, parentId: 3,
id: 9, id: 9,
taskName: "2025年06月绩效-质量 绩效模板", taskName: '2025年06月绩效-质量 绩效模板',
createName: "2025-07-01", createName: '2025-07-01',
taskUserName: "李四", taskUserName: '李四',
status: 6, status: 6,
}, },
{ {
parentId: 3, parentId: 3,
id: 10, id: 10,
taskName: "2025年06月绩效-一线员工 绩效模板", taskName: '2025年06月绩效-一线员工 绩效模板',
createName: "2025-07-01", createName: '2025-07-01',
taskUserName: "王五", taskUserName: '王五',
status: 6, status: 6,
}, },
], ],

@ -20,27 +20,47 @@
> >
<template #menu-left> <template #menu-left>
<el-button type="primary" @click="handleAdd">新增绩效</el-button> <el-button type="primary" @click="handleAdd">新增绩效</el-button>
<el-button type="primary" @click="maintenanceContents">绩效内容维护</el-button> <!-- <el-button type="danger" @click="batchDelete">删除</el-button> -->
<!-- <el-button type="primary" @click="maintenanceContents">绩效内容维护</el-button> -->
</template> </template>
<template #menu="scope"> <template #menu="scope">
<el-button type="primary" text @click="editRow(scope.row)">修改</el-button> <el-button type="primary" text @click="editRow(scope.row)">修改</el-button>
<el-button type="primary" text @click="deleteRow(scope.row)">删除</el-button> <el-button type="primary" text @click="deleteRow(scope.row)">删除</el-button>
<el-button type="primary" text>下发</el-button> <el-button type="primary" text @click="taskAssignment(scope.row)">下发</el-button>
</template> </template>
</avue-crud> </avue-crud>
<batchAddPerf v-if="showDialog" :showDialog="showDialog" :title="title" <batchAddPerf
v-if="showDialog"
:showDialog="showDialog"
:title="title"
:checkRow="checkRow" :checkRow="checkRow"
:moldAddMore="moldAddMore" @closeDialog="closeDialog"></batchAddPerf> :moldAddMore="moldAddMore"
<batchAddContent v-if="showContent" :showContent="showContent" :title="title" @closeDialog="closeDialog"></batchAddContent> @closeDialog="closeDialog"
/>
<!-- <batchAddContent
v-if="showContent"
:showContent="showContent"
:title="title"
@closeDialog="closeDialog"
/> -->
</basic-container> </basic-container>
</template> </template>
<script> <script>
import batchAddPerf from "./components/batchAddPerf.vue" import batchAddPerf from './components/batchAddPerf.vue';
import batchAddContent from "./components/batchAddContent.vue" // import batchAddContent from './components/batchAddContent.vue';
import {pageList,delItem} from "@/api/performanceManagement/templateMaintenance.js" import {
pageBsEfficiencyTemp,
submitBsEfficiencyTemp,
detailBsEfficiencyTemp,
removeBsEfficiencyTemp,
taskAssignmentBsEfficiencyTemp,
} from '@/api/performanceManagement/templateMaintenance.js';
export default { export default {
components: { batchAddPerf,batchAddContent }, components: {
batchAddPerf,
// batchAddContentx
},
data() { data() {
return { return {
selectionList: [], selectionList: [],
@ -48,19 +68,19 @@ export default {
loading: false, loading: false,
data: [], data: [],
form: {}, form: {},
showDialog:false, showDialog: false,
moldAddMore:false, moldAddMore: false,
showContent:false, showContent: false,
title:"", title: '',
checkRow:{}, checkRow: {},
page: { page: {
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
total: 0, total: 0,
}, },
option: { option: {
height: "auto", height: 'auto',
align: "center", align: 'center',
calcHeight: 32, calcHeight: 32,
tip: false, tip: false,
simplePage: true, simplePage: true,
@ -76,12 +96,12 @@ export default {
delBtn: false, delBtn: false,
addBtn: false, addBtn: false,
editBtn: false, editBtn: false,
editBtnText: "修改", editBtnText: '修改',
addBtnIcon: " ", addBtnIcon: ' ',
viewBtnIcon: " ", viewBtnIcon: ' ',
delBtnIcon: " ", delBtnIcon: ' ',
editBtnIcon: " ", editBtnIcon: ' ',
viewBtnText: "详情", viewBtnText: '详情',
labelWidth: 120, labelWidth: 120,
searchLabelWidth: 120, searchLabelWidth: 120,
menu: true, menu: true,
@ -96,13 +116,13 @@ export default {
excelBtn: true, excelBtn: true,
columnSort: true, columnSort: true,
showOverflowTooltip: true, showOverflowTooltip: true,
searchLabelPosition: "left", searchLabelPosition: 'left',
searchLabelPosition: "left", searchLabelPosition: 'left',
searchGutter: 24, searchGutter: 24,
searchSpan: 6, searchSpan: 6,
menuAlign: "center", menuAlign: 'center',
gridBtn: false, gridBtn: false,
searchMenuPosition: "right", searchMenuPosition: 'right',
column: [ column: [
// { // {
// label: "", // label: "",
@ -166,16 +186,16 @@ export default {
// // ], // // ],
// }, // },
{ {
label: "绩效任务名称", label: '绩效任务名称',
prop: "taskName", prop: 'taskName',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
rules: [ rules: [
{ {
required: true, required: true,
message: "请输入模板名称", message: '请输入绩效任务名称',
trigger: "blur", trigger: 'blur',
}, },
], ],
}, },
@ -195,30 +215,30 @@ export default {
// ], // ],
// }, // },
{ {
label: "绩效填报人", label: '绩效填报人',
prop: "reportUserName", prop: 'reportUserName',
type: "select", type: 'select',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
rules: [ rules: [
{ {
required: true, required: true,
message: "请输入绩效填报人", message: '请输入绩效填报人',
trigger: "blur", trigger: 'blur',
}, },
], ],
}, },
{ {
label: "维护人", label: '维护人',
prop: "createUser", prop: 'createUser',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
}, },
{ {
label: "维护时间", label: '维护时间',
prop: "updateTime", prop: 'createTime',
search: false, search: false,
sortable: true, sortable: true,
overHidden: true, overHidden: true,
@ -229,45 +249,104 @@ export default {
}, },
mounted() {}, mounted() {},
methods: { methods: {
closeDialog(val){ closeDialog(val) {
this.showDialog = false this.showDialog = false
this.moldAddMore = false this.moldAddMore = false
this.showContent = false // this.showContent = false
if(val){ if (val) {
this.onLoad() this.onLoad();
} }
}, },
handleAdd(){ handleAdd() {
this.title = "新增" this.title = '新增';
this.moldAddMore = true this.moldAddMore = true;
this.showDialog = true this.showDialog = true;
}, },
editRow(row){ editRow(row) {
this.title = "修改" this.title = '修改';
this.checkRow = row row.reportUser = row.reportUser + '';
this.moldAddMore = false this.checkRow = { ...row };
this.showDialog = true this.moldAddMore = false;
this.showDialog = true;
},
//
batchDelete() {
if (this.selectionList.length == 0) {
this.$message.error('请至少选择一条数据');
return;
}
const count = this.selectionList.length;
this.$confirm(`确定要删除选中的 ${count} 条绩效模板吗?此操作不可恢复!`, '删除确认', {
confirmButtonText: '确定删除',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'el-button--danger',
})
.then(() => {
removeBsEfficiencyTemp({
ids: this.selectionList.map(item => item.id).join(','),
}).then(res => {
if (res.data.code == 200) {
this.$message.success('删除成功');
this.selectionList = [];
this.onLoad();
}
});
})
.catch(() => {
//
});
}, },
deleteRow(row){ deleteRow(row) {
this.$confirm('确定将选择数据删除?', { this.$confirm('确定将选择数据删除?', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
}).then(() => { })
delItem({ .then(() => {
ids:row.id //
}).then((res) => { removeBsEfficiencyTemp({
if(res.data.code == 200){ ids: String(row.id),
this.$message.success('删除成功') })
this.onLoad() .then(res => {
if (res.data.code == 200) {
this.$message.success('删除成功');
this.onLoad();
} }
}) })
.catch(() => {
this.$message.error('删除失败,请重试');
});
}) })
.catch(() => {});
}, },
maintenanceContents(){ taskAssignment(row) {
this.title = "模板内容维护" this.$confirm('确定将选择数据下发?', {
this.showContent = true confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
//
taskAssignmentBsEfficiencyTemp({
id: row.id,
})
.then(res => {
if (res.data.code == 200) {
this.$message.success(res.data.msg);
this.onLoad();
}
})
.catch(() => {
this.$message.error('下发失败,请重试');
});
})
.catch(() => {});
}, },
// maintenanceContents() {
// this.title = '';
// this.showContent = true;
// },
currentChange(currentPage) { currentChange(currentPage) {
this.page.currentPage = currentPage; this.page.currentPage = currentPage;
}, },
@ -279,7 +358,7 @@ export default {
}, },
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.treeDeptId = ""; this.treeDeptId = '';
this.onLoad(this.page); this.onLoad(this.page);
}, },
searchChange(params, done) { searchChange(params, done) {
@ -296,52 +375,17 @@ export default {
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}, },
onLoad() { onLoad() {
this.loading = true this.loading = true;
pageList({ pageBsEfficiencyTemp({
current:this.page.currentPage, current: this.page.currentPage,
size:this.page.pageSize, size: this.page.pageSize,
...this.query, ...this.query,
}).then((res) => { }).then(res => {
this.data = res.data.data.records this.data = res.data.data.records;
this.page.total = res.data.data.total this.page.total = res.data.data.total;
this.loading = false this.loading = false;
}) });
// this.data = [
// {
// templateType: 2,
// applicationDept: 1,
// templateName: " KPI",
// templateContent: "KPIKPI*70%",
// informant: 1,
// },
// {
// templateType: 2,
// applicationDept: 1,
// templateName: " ",
// templateContent: "*30%",
// informant: 1,
// },
// {
// templateType: 2,
// applicationDept: 4,
// templateName: "线 ",
// templateContent:
// "DPPM",
// informant: 1,
// },
// {
// templateType: 1,
// templateName: " ",
// templateContent:
// "稿",
// informant: 2,
// },
// ];
// this.page.total = this.data.length;
}, },
}, },
}; };
</script> </script>
<style></style>

Loading…
Cancel
Save