增加用户导出 && 客户和线索解锁判断
This commit is contained in:
@@ -119,3 +119,17 @@ export async function orgNameList(params) {
|
|||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.data.message));
|
return Promise.reject(new Error(res.data.message));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出用户
|
||||||
|
* @param params 查询条件
|
||||||
|
*/
|
||||||
|
export async function exportUsers(params) {
|
||||||
|
const res = await request.get('/organization/user/export', {
|
||||||
|
params
|
||||||
|
});
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="ele-btn-icon"
|
class="ele-btn-icon"
|
||||||
icon="el-icon-dcustomerload"
|
icon="el-icon-download"
|
||||||
@click="exportData"
|
@click="exportData"
|
||||||
>导出</el-button
|
>导出</el-button
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -30,6 +30,14 @@
|
|||||||
>
|
>
|
||||||
导入
|
导入
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="ele-btn-icon"
|
||||||
|
icon="el-icon-download"
|
||||||
|
type="primary"
|
||||||
|
@click="exportData"
|
||||||
|
>导出</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
<!-- 用户名列 -->
|
<!-- 用户名列 -->
|
||||||
<template v-slot:username="{ row }">
|
<template v-slot:username="{ row }">
|
||||||
@@ -97,8 +105,10 @@
|
|||||||
pageUsers,
|
pageUsers,
|
||||||
removeUser,
|
removeUser,
|
||||||
removeUsers,
|
removeUsers,
|
||||||
updateUserStatus
|
updateUserStatus,
|
||||||
|
exportUsers
|
||||||
} from '@/api/organization/user';
|
} from '@/api/organization/user';
|
||||||
|
import { utils, writeFile } from 'xlsx';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SystemUser',
|
name: 'SystemUser',
|
||||||
@@ -221,7 +231,8 @@
|
|||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
showEdit: false,
|
showEdit: false,
|
||||||
// 是否显示导入弹窗
|
// 是否显示导入弹窗
|
||||||
showImport: false
|
showImport: false,
|
||||||
|
title: '用户列表'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -293,6 +304,36 @@
|
|||||||
row.status = !row.status ? 1 : 0;
|
row.status = !row.status ? 1 : 0;
|
||||||
this.$message.error(e.message);
|
this.$message.error(e.message);
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
exportData() {
|
||||||
|
const loading = this.$loading({ lock: true });
|
||||||
|
this.$refs.table.doRequest(({ where, order }) => {
|
||||||
|
exportUsers({ ...where, ...order })
|
||||||
|
.then((data) => {
|
||||||
|
loading.close();
|
||||||
|
const array = [data.columns];
|
||||||
|
data.list.forEach((d) => {
|
||||||
|
let arrayItem = [];
|
||||||
|
for (let key in d) {
|
||||||
|
arrayItem.push(d[key]);
|
||||||
|
}
|
||||||
|
array.push(arrayItem);
|
||||||
|
});
|
||||||
|
writeFile(
|
||||||
|
{
|
||||||
|
SheetNames: ['Sheet1'],
|
||||||
|
Sheets: {
|
||||||
|
Sheet1: utils.aoa_to_sheet(array)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
this.title + '.xlsx'
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.close();
|
||||||
|
this.$message.error(e.message);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -161,6 +161,10 @@
|
|||||||
item.bizName
|
item.bizName
|
||||||
}}</div>
|
}}</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template v-slot:status="{ row }">
|
||||||
|
{{ row.status_name }}<br />
|
||||||
|
{{ row.is_unlock }}
|
||||||
|
</template>
|
||||||
<!-- 操作列 -->
|
<!-- 操作列 -->
|
||||||
<!--
|
<!--
|
||||||
<template v-slot:action="{ row }">
|
<template v-slot:action="{ row }">
|
||||||
@@ -248,7 +252,8 @@
|
|||||||
label: '状态',
|
label: '状态',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
showOverflowTooltip: true,
|
showOverflowTooltip: true,
|
||||||
minWidth: 100
|
minWidth: 100,
|
||||||
|
slot: 'status'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'enTime',
|
prop: 'enTime',
|
||||||
|
|||||||
Reference in New Issue
Block a user