号源日历样式调整,后台增加3个表格导出

main
yanzai 1 year ago
parent 7e97e5eb0b
commit 613ef2d4f9

@ -6,6 +6,7 @@ use App\Http\Controllers\API\PEISApiController;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Http\Controllers\API\H5\FenzhenController as fzc; use App\Http\Controllers\API\H5\FenzhenController as fzc;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
@ -79,7 +80,7 @@ class FenzhenController extends Controller
$table_list=$res['data']['table1']; $table_list=$res['data']['table1'];
$clinic_list=$res['data']['table2']; $clinic_list=$res['data']['table2'];
$table_list3=$res['data']['table3']; $table_list3=$res['data']['table3'];
// dd(json_encode($table_list3,JSON_UNESCAPED_UNICODE)); // dd(json_encode($res['data'],JSON_UNESCAPED_UNICODE));
$template_path = Storage::path('public/excel/check_time.xlsx'); $template_path = Storage::path('public/excel/check_time.xlsx');
$spreadsheet = IOFactory::load($template_path); $spreadsheet = IOFactory::load($template_path);
$worksheet = $spreadsheet->getActiveSheet(); $worksheet = $spreadsheet->getActiveSheet();
@ -156,8 +157,9 @@ class FenzhenController extends Controller
$shiji_timecount=0; $shiji_timecount=0;
$chaoshi_timecount=0; $chaoshi_timecount=0;
$weichaoshi_count=0; $weichaoshi_count=0;
$tj_numbers=[];
foreach ($table_list3 as $table_list3_i) { foreach ($table_list3 as $table_list3_i) {
$tj_numbers[]=$table_list3_i['uuid'];
$biaozhun_timecount+=$table_list3_i['clinic_time']; $biaozhun_timecount+=$table_list3_i['clinic_time'];
$shiji_timecount+=$table_list3_i['used_time']; $shiji_timecount+=$table_list3_i['used_time'];
$chaoshi_timecount+=$table_list3_i['timeout']; $chaoshi_timecount+=$table_list3_i['timeout'];
@ -197,6 +199,59 @@ class FenzhenController extends Controller
$worksheet->getStyle('AC3:AJ' . ($row +2))->applyFromArray($styleArray); $worksheet->getStyle('AC3:AJ' . ($row +2))->applyFromArray($styleArray);
//准时到检率
$tj_numbers=implode(",", $tj_numbers);
$peis = new PEISApiController();
$wait=$peis::Get($peis::Api('报告时间计算',$tj_numbers),'460107000001',"报告时间计算");
$jianhou_sign_count=0;
$zhunshi_count=0;
//dd($wait);
if(isset($wait['Data'])){
$jianhou_sign_count=count($wait['Data']);
}
foreach ($table_list3 as $key=> $fz_value) {
foreach ($wait['Data'] as $index => $sx_value) {
if($fz_value['uuid']==$sx_value['体检号']){
if($date.' '.$fz_value['end_time']>$sx_value['检后签到时间']){
$zhunshi_count++;
}
}
}
}
$worksheet->setCellValueExplicit('AL' . 3,$date , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AM' . 3,$zhunshi_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AN' . 3,$jianhou_sign_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AO' . 3,round($zhunshi_count/$jianhou_sign_count, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->getStyle('AL3:AO' . 3)->applyFromArray($styleArray);
//预约率
$yyl_yuyue_count=0;//预约人数
$yyl_tj_count=0;//体检总人数
$yuyueList=DB::table('orders')->where(['appointment_date'=>$date])->whereIn('status',[2,4])->whereNotNull(['appointment_number'])->get();
$yyl_yuyue_count=count($yuyueList);
$yyl_tj_count=$usercount;
$worksheet->setCellValueExplicit('AL' . 7,$date , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AM' . 7,$yyl_yuyue_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AN' . 7,$yyl_tj_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AO' . 7,round($yyl_yuyue_count/$yyl_tj_count, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->getStyle('AL7:AO' . 7)->applyFromArray($styleArray);
//预约准时率
$yyzsl_ren_count=0;//预约准时到达人数
$yyzsl_zong_count=0;//预约总人数
$yyzsl_zong_count=$yyl_yuyue_count;
foreach ($yuyueList as $key=> $yy_value) {
if($yy_value->appointment_date.' '.$yy_value->appointment_time > $yy_value->check_time){
$yyzsl_ren_count++;
}
}
$worksheet->setCellValueExplicit('AL' . 11,$date , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AM' . 11,$yyzsl_ren_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AN' . 11,$yyzsl_zong_count , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->setCellValueExplicit('AO' . 11,round($yyzsl_ren_count/$yyzsl_zong_count, 2) , \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);
$worksheet->getStyle('AL11:AO' . 11)->applyFromArray($styleArray);
$file_name = Str::orderedUuid(); $file_name = Str::orderedUuid();
$dir_path = "public/excel/" . date('Ym') . '/' . $file_name; $dir_path = "public/excel/" . date('Ym') . '/' . $file_name;

@ -709,8 +709,8 @@
</view> </view>
</view> </view>
<view class="flex flex-wrap pt-30rpx pb-30rpx b-0 b-t-1 b-solid b-#E1ECEE" v-if="time_list.length"> <view class="flex flex-wrap pt-30rpx pb-30rpx b-0 b-t-1 b-solid b-#E1ECEE" v-if="time_list.length">
<view class="w-20% text-center box-border p-20rpx" v-for="(item, index) in time_list" :key="index" :class="{ <view class="w-16.6% text-center box-border p-20rpx text-lan" v-for="(item, index) in time_list" :key="index" :class="{
'text-red': item.status == 2, 'text-hui': item.status == 2,
}" @click="getCurrentTime(item, index)"> }" @click="getCurrentTime(item, index)">
<view class="text-24rpx rounded-12rpx h-54rpx flex flex-items-center flex-justify-center" <view class="text-24rpx rounded-12rpx h-54rpx flex flex-items-center flex-justify-center"
:class="timeIndex == index ? 'activeTime' : ''"> :class="timeIndex == index ? 'activeTime' : ''">
@ -762,6 +762,14 @@
</view> </view>
</template> </template>
<style scoped lang="scss"> <style scoped lang="scss">
.text-lan{
color:#42A89E;
font-weight: 700;
}
.text-hui{
color:#ccc;
font-weight: 500;
}
.activeTime { .activeTime {
background-color: #239ea3; background-color: #239ea3;
color: #fff; color: #fff;

Loading…
Cancel
Save