fix: 导出用户增加companyname字段

This commit is contained in:
caoqianming 2023-05-15 10:31:19 +08:00
parent 64f15bc8cf
commit f32316e7fa
1 changed files with 2 additions and 2 deletions

View File

@ -14,11 +14,11 @@ def export_consumer(users):
wb = Workbook()
ws1 = wb.active
ws1.title = '用户表'
ws1.append(['姓名','手机号', '单位', '身份证号', '微信昵称', '工作类别', '用户角色', '创建日期', '所属账户'])
ws1.append(['姓名','手机号', '单位', '单位自填', '身份证号', '微信昵称', '工作类别', '用户角色', '创建日期', '所属账户'])
row = ws1.row_dimensions[1]
row.font = Font(bold=True)
for i in users:
ws1.append([i['name'], i['username'], i['company_name'], i['ID_number1'], i['nickname'], i['workscope_name'], i['role_name'], i['create_time'], i['create_admin_name']])
ws1.append([i['name'], i['username'], i['company_name'], i['companyname'], i['ID_number1'], i['nickname'], i['workscope_name'], i['role_name'], i['create_time'], i['create_admin_name']])
filename = 'users' + datetime.now().strftime("%Y%m%d%H%M%S") +'.xlsx'
path = '/media/export/' + filename
wb.save((BASE_DIR + path).replace('\\', '/'))