Browse Source

指标导出

dev-xx
马远东 1 year ago
parent
commit
890fb9a065
  1. 10
      src/api/classify/classify.js
  2. 11
      src/option/supervise/supervise.js
  3. 103
      src/views/supervise/management.vue

10
src/api/classify/classify.js

@ -132,3 +132,13 @@ export const $_exportIndicatorsList = (data) => {
responseType: 'blob', responseType: 'blob',
}) })
} }
// 导出
export const $_exportList = (params) => {
return request({
url: '/api/logpm-supervise/classify/export-list',
params,
method: 'get',
responseType: 'blob',
})
}

11
src/option/supervise/supervise.js

@ -122,6 +122,17 @@ export const managementColumnList = [
sortable: true, sortable: true,
head: false, head: false,
}, },
{
prop: 'pointStr',
label: '考核积分',
type: 1,
values: '',
width: '130',
checkarr: [],
fixed: false,
sortable: true,
head: false,
},
{ {
prop: 'examineDeptName', prop: 'examineDeptName',
label: '考核范围', label: '考核范围',

103
src/views/supervise/management.vue

@ -47,7 +47,6 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="归属部门"> <el-form-item label="归属部门">
<el-tree-select <el-tree-select
v-model="queryTop.createDeptName" v-model="queryTop.createDeptName"
@ -61,7 +60,6 @@
/> />
</el-form-item> </el-form-item>
<el-form-item class="el-btn"> <el-form-item class="el-btn">
<el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button> <el-button type="primary" icon="el-icon-search" @click="searchChange"> </el-button>
</el-form-item> </el-form-item>
@ -73,16 +71,31 @@
<div class="avue-crud__header"> <div class="avue-crud__header">
<!-- 头部左侧按钮模块 --> <!-- 头部左侧按钮模块 -->
<div class="avue-crud__left"> <div class="avue-crud__left">
<el-button type="primary" @click="AddCategory" v-if="PermissionButton.Classification_add"> <el-button
type="primary"
@click="AddCategory"
v-if="PermissionButton.Classification_add"
>
<el-icon><Plus /></el-icon> </el-button <el-icon><Plus /></el-icon> </el-button
> >
<el-button type="primary" @click="BatchDelete" icon="Delete" v-if="PermissionButton.Category_deletion"> <el-button
type="primary"
@click="BatchDelete"
icon="Delete"
v-if="PermissionButton.Category_deletion"
>
批量删除</el-button 批量删除</el-button
> >
<el-button type="primary" @click="details.popUpShow.UploadBatch = true" icon="Upload" v-if="PermissionButton.Classification_import"> <el-button
type="primary"
@click="details.popUpShow.UploadBatch = true"
icon="Upload"
v-if="PermissionButton.Classification_import"
>
导入 导入
</el-button> </el-button>
<el-button type="primary" @click="exportReport"> 导出 </el-button>
<el-button type="primary" v-if="PermissionButton.Category_View" class="el_view"> <el-button type="primary" v-if="PermissionButton.Category_View" class="el_view">
查看 查看
</el-button> </el-button>
@ -272,6 +285,7 @@ import { ref, reactive, computed, onMounted } from 'vue';
import { managementColumnList } from '@/option/supervise/supervise.js'; import { managementColumnList } from '@/option/supervise/supervise.js';
import functions from '@/utils/functions.js'; import functions from '@/utils/functions.js';
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import { downloadXls } from '@/utils/util';
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import { import {
$_Getclassify, $_Getclassify,
@ -281,12 +295,13 @@ import {
$_classifyAddChild, $_classifyAddChild,
$_classifupdateChild, $_classifupdateChild,
$_parentId, $_parentId,
$_exportList,
} from '@/api/classify/classify'; } from '@/api/classify/classify';
import { isNumber, setNodeHeight } from '@/utils/util'; import { isNumber, setNodeHeight } from '@/utils/util';
const loadingclassification = ref(false); // const loadingclassification = ref(false); //
const $useStore = useStore(); const $useStore = useStore();
const accessControl = $useStore.getters.permission; const accessControl = $useStore.getters.permission;
console.log(accessControl,'按钮权限'); console.log(accessControl, '按钮权限');
const classificationdata = ref([]); // const classificationdata = ref([]); //
const current = ref(1); // const current = ref(1); //
const total = ref(0); // const total = ref(0); //
@ -313,7 +328,7 @@ const examineDeptName = ref(''); //考核部门名字
/** 表格实例 */ /** 表格实例 */
const tableNode = ref(); const tableNode = ref();
const departmentNameTemp = ref(''); // const departmentNameTemp = ref(''); //
const departmentName=ref('')// const departmentName = ref(''); //
const departmentNameID = ref(''); //ID const departmentNameID = ref(''); //ID
let my_DATA = JSON.parse(localStorage.getItem('my_data')); let my_DATA = JSON.parse(localStorage.getItem('my_data'));
departmentNameTemp.value = my_DATA.departmentName; // departmentNameTemp.value = my_DATA.departmentName; //
@ -323,9 +338,9 @@ console.log(departmentNameID.value, '归属名称ID');
const PermissionButton = computed(() => { const PermissionButton = computed(() => {
return { return {
Classification_add: accessControl.Classification_add, // Classification_add: accessControl.Classification_add, //
Category_deletion:accessControl.Category_deletion, // Category_deletion: accessControl.Category_deletion, //
Classification_import:accessControl.Classification_import, // Classification_import: accessControl.Classification_import, //
Category_View:accessControl.Category_View, // Category_View: accessControl.Category_View, //
}; };
}); });
// //
@ -407,6 +422,35 @@ const loadInitialCategories = (val = 0) => {
}; };
loadInitialCategories(); loadInitialCategories();
//
const exportReport = () => {
ElMessageBox.confirm('是否导出数据?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
loadingclassification.value = true;
let data = {
isPid: 0,
...query.value,
};
$_exportList(data)
.then(res => {
ElMessage({
message: '导出成功',
type: 'success',
});
downloadXls(res.data, `指标管理数据.xlsx`);
})
.catch(() => {})
.finally(() => {
loadingclassification.value = false;
});
})
.catch(() => {});
};
const handleNodeClick = (data, node, component) => { const handleNodeClick = (data, node, component) => {
// 'data' // 'data'
// 'node' Node // 'node' Node
@ -537,8 +581,6 @@ const Indicatortype = () => {
onLoad(query.value); onLoad(query.value);
}; };
const BelongsearcheNodeClick = data => { const BelongsearcheNodeClick = data => {
department.value = data; // department.value = data; //
if (data.hasChildren) { if (data.hasChildren) {
@ -546,21 +588,17 @@ const BelongsearcheNodeClick = data => {
} }
query.value.examineDeptName = data.label; query.value.examineDeptName = data.label;
onLoad(query.value); onLoad(query.value);
}; };
// //
const Belongingdepartment = () => { const Belongingdepartment = () => {
console.log(queryTop.value.examineDeptName,'queryTop.value.createDeptName'); console.log(queryTop.value.examineDeptName, 'queryTop.value.createDeptName');
if (!queryTop.value.examineDeptName){ if (!queryTop.value.examineDeptName) {
query.value.examineDeptName = null; query.value.examineDeptName = null;
onLoad(query.value); onLoad(query.value);
} }
}; };
const BelongsearcheNodeClickFn = data => { const BelongsearcheNodeClickFn = data => {
department.value = data; // department.value = data; //
if (data.hasChildren) { if (data.hasChildren) {
@ -569,11 +607,8 @@ const BelongsearcheNodeClickFn = data => {
query.value.createDeptName = data.label; query.value.createDeptName = data.label;
onLoad(query.value); onLoad(query.value);
console.log(data); console.log(data);
}; };
const BelongingdepartmentFn = () => { const BelongingdepartmentFn = () => {
if (!queryTop.value.createDeptName) { if (!queryTop.value.createDeptName) {
query.value.createDeptName = null; query.value.createDeptName = null;
@ -581,12 +616,9 @@ const BelongingdepartmentFn = () => {
} }
}; };
// //
const ClassificationDditing = val => { const ClassificationDditing = val => {
lassificationform.value = {};
lassificationform.value={}
console.log(val); console.log(val);
EditID.value = val.row.id; //ID EditID.value = val.row.id; //ID
title.value = false; // title.value = false; //
@ -599,7 +631,7 @@ const ClassificationDditing = val => {
lassificationform.value.examineDeptId = data.examineDeptId; //ID lassificationform.value.examineDeptId = data.examineDeptId; //ID
departmentName.value = data.createDeptName; // departmentName.value = data.createDeptName; //
examineDeptName.value = data.examineDeptName; // examineDeptName.value = data.examineDeptName; //
console.log(lassificationform.value,'回显存储'); console.log(lassificationform.value, '回显存储');
// //
data.pointsEntities.forEach(res => { data.pointsEntities.forEach(res => {
PointsList.value.push({ integral: res.point }); PointsList.value.push({ integral: res.point });
@ -691,7 +723,7 @@ const newlyAddedFn = formEl => {
formEl.validate(async valid => { formEl.validate(async valid => {
if (valid) { if (valid) {
const _arr = new Set(); const _arr = new Set();
console.log(examineDeptName.value,'考核部门'); console.log(examineDeptName.value, '考核部门');
let data = { let data = {
name: lassificationform.value.name, // name: lassificationform.value.name, //
description: lassificationform.value.description, // description: lassificationform.value.description, //
@ -736,7 +768,7 @@ const newlyAddedFn = formEl => {
}) })
.catch(res => {}) .catch(res => {})
.finally(() => { .finally(() => {
department.value={} department.value = {};
loadingAddPopup.value = false; // loadingAddPopup.value = false; //
}); });
} else { } else {
@ -757,7 +789,7 @@ const newlyAddedFn = formEl => {
.catch(res => {}) .catch(res => {})
.finally(() => { .finally(() => {
loadingAddPopup.value = false; // loadingAddPopup.value = false; //
department.value={} department.value = {};
}); });
} }
} else { } else {
@ -772,13 +804,12 @@ const selectionChange = list => {
selectionList.value = list; selectionList.value = list;
console.log(selectionList.value, '已经选中的数据'); console.log(selectionList.value, '已经选中的数据');
}; };
function ProhibitSelection(val,index){ function ProhibitSelection(val, index) {
if(val.isEdit=='0'){ if (val.isEdit == '0') {
return false return false;
}else{ } else {
return true return true;
} }
} }
// //
const integralAdd = () => { const integralAdd = () => {
@ -898,7 +929,7 @@ const handleClose = res => {
// .maboxhi { // .maboxhi {
// height: 700px !important; // height: 700px !important;
// } // }
.el_view{ .el_view {
display: none; display: none;
} }
</style> </style>

Loading…
Cancel
Save