diff --git a/app/chengji/controller/Index.php b/app/chengji/controller/Index.php index 60754a77..f8c8145f 100644 --- a/app/chengji/controller/Index.php +++ b/app/chengji/controller/Index.php @@ -952,11 +952,8 @@ class Index extends BaseController // 设置格式 $sheet->getStyle('A'.($row-1).':L'.($row+$rows-1))->applyFromArray($styleArray); - $row = $row + $rows +1 ; - - } diff --git a/app/chengji/view/index/deletecjs.html b/app/chengji/view/index/deletecjs.html index f83f61e1..f5707091 100644 --- a/app/chengji/view/index/deletecjs.html +++ b/app/chengji/view/index/deletecjs.html @@ -115,11 +115,12 @@ layui.use(['form'], function(){ $(bj).children().remove(); // 获取班级列表 $.ajax({ - url:"/teach/banji/mybanji", + url:"/kaoshi/index/cybanji", type:"POST", data:{ school:school ,ruxuenian:ruxuenian + ,kaoshi:"{$list.set.kaoshi}" }, dataType:'json', success:function(result){ diff --git a/app/kaoshi/controller/Kaohao.php b/app/kaoshi/controller/Kaohao.php index d9fb1742..ccbd986f 100644 --- a/app/kaoshi/controller/Kaohao.php +++ b/app/kaoshi/controller/Kaohao.php @@ -412,6 +412,17 @@ class Kaohao extends BaseController header('Cache-Control: max-age=0'); $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls'); $writer->save('php://output'); + + // 保存文件 + $filename = $kslist->title.' 标签数据'.date('ymdHis').'.xlsx'; + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + header('Content-Disposition: attachment;filename="' . $filename . '"'); + header('Cache-Control: max-age=0'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); + $writer->save('php://output'); + ob_flush(); + flush(); + } @@ -598,20 +609,21 @@ class Kaohao extends BaseController // 修改标题字号 $spreadsheet->getActiveSheet()->getStyle('A1')->getFont()->setBold(true)->setName('宋体')->setSize(11); // 设置行高 - $spreadsheet->getActiveSheet()->getDefaultRowDimension()->setRowHeight(18); + $spreadsheet->getActiveSheet()->getDefaultRowDimension()->setRowHeight(20); $spreadsheet->getActiveSheet()->getRowDimension('1')->setRowHeight(25); - $spreadsheet->getActiveSheet()->getRowDimension('3')->setRowHeight(20); // 设置筛选 $sheet->setAutoFilter('A3:'.$col.($i-1)); // 保存文件 - $filename = $kslist->title.'成绩采集表'.date('ymdHis').'.xls'; + $filename = $kslist->title.'成绩采集表'.date('ymdHis').'.xlsx'; header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); header('Content-Disposition: attachment;filename="' . $filename . '"'); header('Cache-Control: max-age=0'); - $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls'); + $writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'); $writer->save('php://output'); + ob_flush(); + flush(); } diff --git a/app/kaoshi/view/kaohao/caiji.html b/app/kaoshi/view/kaohao/caiji.html index d3c818fa..7c12f85b 100644 --- a/app/kaoshi/view/kaohao/caiji.html +++ b/app/kaoshi/view/kaohao/caiji.html @@ -56,11 +56,14 @@ // 获取数据 $.post( - "/teach/banji/mybanjis", + "/kaoshi/index/cybanji", { - "school":school - ,"ruxuenian":"{$nianji}" + school:school + ,ruxuenian:"{$nianji}" + ,kaoshi:"{$list.set.kaoshi}" }, + url:"/kaoshi/index/cybanji", + function(data,status){ if($.isEmptyObject(data)) {