|
|
|
|
@ -1,5 +1,12 @@ |
|
|
|
|
<template> |
|
|
|
|
<el-dialog title="详情" append-to-body :modelValue="openShow" fullscreen width="70%" @close="closeDialog()"> |
|
|
|
|
<el-dialog |
|
|
|
|
title="详情" |
|
|
|
|
append-to-body |
|
|
|
|
:modelValue="openShow" |
|
|
|
|
fullscreen |
|
|
|
|
width="70%" |
|
|
|
|
@close="closeDialog()" |
|
|
|
|
> |
|
|
|
|
<!-- 绩效详情 --> |
|
|
|
|
<avue-crud |
|
|
|
|
:option="option" |
|
|
|
|
@ -15,24 +22,28 @@ |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
> |
|
|
|
|
<template #menu-right> |
|
|
|
|
<el-button type="primary">附件下载(明细)</el-button> |
|
|
|
|
<el-button type="primary">附件下载(汇总)</el-button> |
|
|
|
|
<el-button type="primary" @click="downloadDetail">附件下载(明细)</el-button> |
|
|
|
|
<el-button type="primary" @click="downloadSummary">附件下载(汇总)</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</el-dialog> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { |
|
|
|
|
detailBsEfficiencyTask, |
|
|
|
|
downloadBsEfficiencyTaskTemplate, |
|
|
|
|
} from '@/api/performanceManagement/dataReporting'; |
|
|
|
|
import { downloadXls, downloadFile, downloadFileBlob } from '@/utils/util'; |
|
|
|
|
export default { |
|
|
|
|
props: { |
|
|
|
|
showDetail: { |
|
|
|
|
type: Boolean, |
|
|
|
|
default:false |
|
|
|
|
default: false, |
|
|
|
|
}, |
|
|
|
|
detailData:{ |
|
|
|
|
row: { |
|
|
|
|
type: Object, |
|
|
|
|
default:()=>({}) |
|
|
|
|
} |
|
|
|
|
default: () => ({}), |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -40,11 +51,11 @@ export default { |
|
|
|
|
loading: false, |
|
|
|
|
form: {}, |
|
|
|
|
option: { |
|
|
|
|
height: "auto", |
|
|
|
|
align: "center", |
|
|
|
|
height: 'auto', |
|
|
|
|
align: 'center', |
|
|
|
|
calcHeight: 32, |
|
|
|
|
rowKey: "id", |
|
|
|
|
rowParentKey: "parentId", |
|
|
|
|
rowKey: 'id', |
|
|
|
|
rowParentKey: 'parentId', |
|
|
|
|
tip: false, |
|
|
|
|
simplePage: true, |
|
|
|
|
searchShow: true, |
|
|
|
|
@ -59,12 +70,12 @@ export default { |
|
|
|
|
delBtn: false, |
|
|
|
|
addBtn: false, |
|
|
|
|
editBtn: false, |
|
|
|
|
editBtnText: "修改", |
|
|
|
|
addBtnIcon: " ", |
|
|
|
|
viewBtnIcon: " ", |
|
|
|
|
delBtnIcon: " ", |
|
|
|
|
editBtnIcon: " ", |
|
|
|
|
viewBtnText: "详情", |
|
|
|
|
editBtnText: '修改', |
|
|
|
|
addBtnIcon: ' ', |
|
|
|
|
viewBtnIcon: ' ', |
|
|
|
|
delBtnIcon: ' ', |
|
|
|
|
editBtnIcon: ' ', |
|
|
|
|
viewBtnText: '详情', |
|
|
|
|
labelWidth: 120, |
|
|
|
|
searchLabelWidth: 120, |
|
|
|
|
menu: false, |
|
|
|
|
@ -79,14 +90,14 @@ export default { |
|
|
|
|
excelBtn: true, |
|
|
|
|
columnSort: true, |
|
|
|
|
showOverflowTooltip: true, |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: "left", |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchLabelPosition: 'left', |
|
|
|
|
searchGutter: 24, |
|
|
|
|
searchSpan: 6, |
|
|
|
|
menuAlign: "center", |
|
|
|
|
menuAlign: 'center', |
|
|
|
|
gridBtn: false, |
|
|
|
|
searchMenuPosition: "right", |
|
|
|
|
column: [] |
|
|
|
|
searchMenuPosition: 'right', |
|
|
|
|
column: [], |
|
|
|
|
}, |
|
|
|
|
page: { |
|
|
|
|
pageSize: 10, |
|
|
|
|
@ -97,57 +108,101 @@ export default { |
|
|
|
|
columnData: [ |
|
|
|
|
{ label: '员工工号', prop: 'cardNo' }, |
|
|
|
|
{ label: '姓名', prop: 'name' }, |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.openShow = this.showDetail |
|
|
|
|
this.columnData.map(item =>{ |
|
|
|
|
this.option.column.push({ |
|
|
|
|
label:item.label, |
|
|
|
|
prop:item.prop, |
|
|
|
|
search:(item.label == '员工工号' || item.label == '姓名') ? true : false |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
this.onLoad() |
|
|
|
|
this.openShow = this.showDetail; |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
closeDialog(val) { |
|
|
|
|
console.log('3333333333333333333') |
|
|
|
|
this.openShow = false |
|
|
|
|
this.$emit('closeDetail',val) |
|
|
|
|
this.openShow = false; |
|
|
|
|
this.$emit('closeDetail', val); |
|
|
|
|
}, |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.page.currentPage = 1 |
|
|
|
|
this.onLoad() |
|
|
|
|
done() |
|
|
|
|
this.page.currentPage = 1; |
|
|
|
|
this.onLoad(); |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {} |
|
|
|
|
this.onLoad() |
|
|
|
|
this.query = {}; |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
currentChange(currentPage) { |
|
|
|
|
this.page.currentPage = currentPage |
|
|
|
|
this.page.currentPage = currentPage; |
|
|
|
|
}, |
|
|
|
|
sizeChange(pageSize) { |
|
|
|
|
this.page.pageSize = pageSize |
|
|
|
|
this.page.pageSize = pageSize; |
|
|
|
|
}, |
|
|
|
|
refreshChange() { |
|
|
|
|
this.onLoad() |
|
|
|
|
this.onLoad(); |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
this.data = [ |
|
|
|
|
{id:"001",cardNo:"001",name:"张三"}, |
|
|
|
|
{id:"002",cardNo:"002",name:"李四"}, |
|
|
|
|
{id:"003",cardNo:"003",name:"王五"}, |
|
|
|
|
] |
|
|
|
|
this.page.total = this.data.length |
|
|
|
|
this.loading = true; |
|
|
|
|
const params = { |
|
|
|
|
id: this.row.id, |
|
|
|
|
...this.query, |
|
|
|
|
}; |
|
|
|
|
detailBsEfficiencyTask(params) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.data.code === 200) { |
|
|
|
|
this.data = res.data.data.table.tableDataList || []; |
|
|
|
|
const arr = res.data.data.table.tableColumn; |
|
|
|
|
arr.push({ ...arr[0], prop: arr[0].prop + 'Exact', hide: true, search: true }); |
|
|
|
|
arr.push({ ...arr[1], prop: arr[1].prop + 'Exact', hide: true, search: true }); |
|
|
|
|
res.data.data.table.tableColumn = arr.map(item => ({ ...item, sortable: true })); |
|
|
|
|
this.option.column = res.data.data.table.tableColumn; |
|
|
|
|
} else { |
|
|
|
|
this.data = []; |
|
|
|
|
this.page.total = 0; |
|
|
|
|
} |
|
|
|
|
this.loading = false; |
|
|
|
|
}) |
|
|
|
|
.catch(() => { |
|
|
|
|
this.data = []; |
|
|
|
|
this.page.total = 0; |
|
|
|
|
this.loading = false; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
downloadDetail() { |
|
|
|
|
if (!this.row.subTasks || this.row.subTasks.length === 0) { |
|
|
|
|
this.$message.warning('暂无可下载文件!'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const completedTasks = this.row.subTasks.filter(task => task.status === 2); |
|
|
|
|
if (completedTasks.length === 0) { |
|
|
|
|
this.$message.warning('暂无可下载文件!'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
// 调用模板下载接口 |
|
|
|
|
downloadBsEfficiencyTaskTemplate() |
|
|
|
|
.then(res => { |
|
|
|
|
downloadXls(res.data, `${this.row.yearMonth}绩效填报模板.xlsx`); |
|
|
|
|
this.row.subTasks.forEach(task => { |
|
|
|
|
if (task.attachLink != '') { |
|
|
|
|
downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
.catch(error => { |
|
|
|
|
console.error('下载模板失败:', error); |
|
|
|
|
this.$message.error('下载失败,请检查网络或稍后重试'); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
downloadSummary() { |
|
|
|
|
this.row.subTasks.forEach(task => { |
|
|
|
|
if (task.attachLink != '') { |
|
|
|
|
downloadFileBlob(task.attachLink, task.taskName + '.xlsx'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|
|
|
|
|
|
</style> |