Commit 9c4537d5 by cwy

0403

parent b8768f47
...@@ -69,7 +69,6 @@ class ExcelFile extends BaseController ...@@ -69,7 +69,6 @@ class ExcelFile extends BaseController
array_push($list,$arr); array_push($list,$arr);
} }
} }
dump($list);
}catch (\Exception $e){ }catch (\Exception $e){
var_dump($e->getMessage()); var_dump($e->getMessage());
} }
...@@ -394,12 +393,18 @@ class ExcelFile extends BaseController ...@@ -394,12 +393,18 @@ class ExcelFile extends BaseController
array_push($data['admin'],$arr); array_push($data['admin'],$arr);
} }
// 添加用户端 // 添加用户端
if($normCollectsId){ if($normCollects){
$collectsInfo = Db::table('norm_collects_extend')->where('norm_collects_id', $normCollectsId)->select(); $collectsInfo = Db::table('norm_collects_extend')->where('norm_collects_id', $normCollectsId)->select();
foreach ($collectsInfo as $collectsValue){ foreach ($collectsInfo as $collectsValue){
$arr = ['name'=>$collectsValue['extend_name'],'value'=>$collectsValue['extend_value']]; $arr = ['name'=>$collectsValue['extend_name'],'value'=>$collectsValue['extend_value']];
array_push($data['user'],$arr); array_push($data['user'],$arr);
} }
}else{
$normExtendInfo = Db::table('norm_extend')->where('norm_id', $norm['id'])->where('user_filled', 1)->select();
foreach ($normExtendInfo as $normExtendInfoValue){
$arr = ['name'=>$normExtendInfoValue['extend_name'],'value'=>$normExtendInfoValue['extend_value']?$normExtendInfoValue['extend_value']:'/'];
array_push($data['user'],$arr);
}
} }
// 添加第一条指标信息 // 添加第一条指标信息
array_push($sheet['data'],$data); array_push($sheet['data'],$data);
...@@ -407,7 +412,6 @@ class ExcelFile extends BaseController ...@@ -407,7 +412,6 @@ class ExcelFile extends BaseController
if($sheet['data']){ if($sheet['data']){
array_push($list,$sheet); array_push($list,$sheet);
} }
// 创建一个新的 Spreadsheet 对象 // 创建一个新的 Spreadsheet 对象
$spreadsheet = new Spreadsheet(); $spreadsheet = new Spreadsheet();
// 设置为活动工作表 // 设置为活动工作表
...@@ -537,12 +541,14 @@ class ExcelFile extends BaseController ...@@ -537,12 +541,14 @@ class ExcelFile extends BaseController
$sheet->getRowDimension($row)->setRowHeight(80); // 设置第n行的高度为30 $sheet->getRowDimension($row)->setRowHeight(80); // 设置第n行的高度为30
$sheet->getColumnDimension($column[$num+$position])->setWidth(30); // 设置A列的宽度为20 $sheet->getColumnDimension($column[$num+$position])->setWidth(30); // 设置A列的宽度为20
if($title[$position]=='图片'){ if($title[$position]=='图片'){
if($value['imgPath'] != "无"){ if($value['imgPath'] != "无" && $value['imgPath'] != "/"){
// 创建一个 Drawing 对象,并设置图片的路径 // 创建一个 Drawing 对象,并设置图片的路径
$drawing = new Drawing(); $drawing = new Drawing();
$drawing->setName('Sample Image'); $drawing->setName('Sample Image');
$drawing->setDescription('Sample Image'); $drawing->setDescription('Sample Image');
$drawing->setPath('./storage/topic/20240402/bff4607948a621271fac9b86ca8dc17c.png'); // 图片路径 $imgList = explode(",", $value['imgPath']);
$words = explode("storage", $imgList[0]);
$drawing->setPath('./storage'.$words[1]); // 图片路径
$drawing->setCoordinates($column[$num+$position].$row); // 图片放置的单元格位置 $drawing->setCoordinates($column[$num+$position].$row); // 图片放置的单元格位置
$drawing->setWorksheet($sheet); // 关联到工作表 $drawing->setWorksheet($sheet); // 关联到工作表
// 调整图片大小以适应单元格(可选) // 调整图片大小以适应单元格(可选)
...@@ -558,12 +564,15 @@ class ExcelFile extends BaseController ...@@ -558,12 +564,15 @@ class ExcelFile extends BaseController
$sheet->setCellValue($column[$num+$position].$row, '/'); $sheet->setCellValue($column[$num+$position].$row, '/');
$position++; $position++;
} }
if($value['imgPath'] != "无"){ if($value['imgPath'] != "无" && $value['imgPath'] != "/"){
// 创建一个 Drawing 对象,并设置图片的路径 // 创建一个 Drawing 对象,并设置图片的路径
$drawing = new Drawing(); $drawing = new Drawing();
$drawing->setName('Sample Image'); $drawing->setName('Sample Image');
$drawing->setDescription('Sample Image'); $drawing->setDescription('Sample Image');
$drawing->setPath('./storage/topic/20240402/bff4607948a621271fac9b86ca8dc17c.png'); // 图片路径 $imgList = explode(",", $value['imgPath']);
$words = explode("storage", $imgList[0]);
$drawing->setPath('./storage'.$words[1]); // 图片路径
// $drawing->setPath('./storage/topic/20240402/bff4607948a621271fac9b86ca8dc17c.png'); // 图片路径
$drawing->setCoordinates($column[$num+$position].$row); // 图片放置的单元格位置 $drawing->setCoordinates($column[$num+$position].$row); // 图片放置的单元格位置
$drawing->setWorksheet($sheet); // 关联到工作表 $drawing->setWorksheet($sheet); // 关联到工作表
// 调整图片大小以适应单元格(可选) // 调整图片大小以适应单元格(可选)
......
...@@ -25,6 +25,7 @@ class NormReceives extends AuthBase ...@@ -25,6 +25,7 @@ class NormReceives extends AuthBase
$data['name'] = input("param.name"); $data['name'] = input("param.name");
$data['task_id'] = input("param.task_id"); $data['task_id'] = input("param.task_id");
$data['status'] = input("param.status"); $data['status'] = input("param.status");
$data['statusSelect'] = input("param.statusSelect");
$data['user_id'] = input("param.user_id"); $data['user_id'] = input("param.user_id");
$data['norm_id'] = input("param.norm_id"); $data['norm_id'] = input("param.norm_id");
$data['order'] = input("param.order")?input("param.order"):'desc'; $data['order'] = input("param.order")?input("param.order"):'desc';
...@@ -33,6 +34,9 @@ class NormReceives extends AuthBase ...@@ -33,6 +34,9 @@ class NormReceives extends AuthBase
if($data['admin'] == 0){ if($data['admin'] == 0){
$data['user_id'] = $this->userId; $data['user_id'] = $this->userId;
} }
if(!empty($data['statusSelect'])){
$data['status'] =$data['statusSelect'];
}
// 分页数据 // 分页数据
$NormReceivesBus = new \app\api\business\NormReceivesBus; $NormReceivesBus = new \app\api\business\NormReceivesBus;
$NormListBus = new \app\api\business\NormListBus; $NormListBus = new \app\api\business\NormListBus;
......
...@@ -38,6 +38,8 @@ class TaskPackage extends AuthBase ...@@ -38,6 +38,8 @@ class TaskPackage extends AuthBase
// $normBus = new CommonBus('normBus'); // 通过公共业务初始化指标类 // $normBus = new CommonBus('normBus'); // 通过公共业务初始化指标类
// $normRes = $normBus->getConditionalQuery(['task_id'=>$value['id']]); // $normRes = $normBus->getConditionalQuery(['task_id'=>$value['id']]);
// // 领取进度 // // 领取进度
$NormBus = new CommonBus('NormBus'); // 通过公共业务初始化指标类
$NormInfo = $NormBus->getConditionalQuery(['task_id' => $value['id']]);
$NormListBus = new CommonBus('NormListBus'); // 通过公共业务初始化指标类 $NormListBus = new CommonBus('NormListBus'); // 通过公共业务初始化指标类
$totalDegree = $NormListBus->getConditionalQueryAll(['task_id' => $value['id']]); $totalDegree = $NormListBus->getConditionalQueryAll(['task_id' => $value['id']]);
$NormReceivesBus = new CommonBus('NormReceivesBus'); // 通过公共业务初始化指标类 $NormReceivesBus = new CommonBus('NormReceivesBus'); // 通过公共业务初始化指标类
...@@ -45,7 +47,7 @@ class TaskPackage extends AuthBase ...@@ -45,7 +47,7 @@ class TaskPackage extends AuthBase
$NormCollectsBus = new CommonBus('NormCollectsBus'); // 通过公共业务初始化指标类 $NormCollectsBus = new CommonBus('NormCollectsBus'); // 通过公共业务初始化指标类
$collectsTimes = $NormCollectsBus->getConditionalQueryAll(['task_id' => $value['id']]); $collectsTimes = $NormCollectsBus->getConditionalQueryAll(['task_id' => $value['id']]);
if($totalDegree){ if($totalDegree){
$totalNum = count($totalDegree)*$totalDegree[0]['num']; $totalNum = count($totalDegree)*$NormInfo['num'];
$result['data'][$index]['receivedQuantity'] = count($receivedTimes) . '/' . $totalNum; $result['data'][$index]['receivedQuantity'] = count($receivedTimes) . '/' . $totalNum;
$result['data'][$index]['collectsQuantity'] = count($collectsTimes) . '/' . $totalNum; $result['data'][$index]['collectsQuantity'] = count($collectsTimes) . '/' . $totalNum;
}else{ }else{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment