|
@@ -674,7 +674,7 @@ class serveManagement(View):
|
|
|
rd_sheet = rd_book.sheet_by_index(0)
|
|
|
# wt_book = copy(rd_book)
|
|
|
# wt_sheet = wt_book.get_sheet(0)
|
|
|
- wt_book = xlwt.Workbook(encoding='utf8')
|
|
|
+ wt_book = xlwt.Workbook()
|
|
|
wt_sheet = wt_book.add_sheet('对账结果', cell_overwrite_ok=True)
|
|
|
row_start = 7
|
|
|
for row in range(rd_sheet.nrows):
|
|
@@ -694,12 +694,9 @@ class serveManagement(View):
|
|
|
for index, value in enumerate(col_value_list):
|
|
|
wt_sheet.write(row_start, index, value)
|
|
|
row_start += 1
|
|
|
- res = HttpResponse(content_type='application/vnd.ms-excel')
|
|
|
+ res = HttpResponse(content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet')
|
|
|
res['Content-Disposition'] = 'attachment; filename={}'.format(escape_uri_path(file.name))
|
|
|
- output = BytesIO()
|
|
|
- wt_book.save(output)
|
|
|
- output.seek(0)
|
|
|
- res.write(output.getvalue())
|
|
|
+ wt_book.save(res)
|
|
|
return res
|
|
|
except Exception as e:
|
|
|
print(e)
|