Browse Source

增加失信被执行情况

sandm 1 year ago
parent
commit
5369d5a4cf

+ 40 - 1
app/Admin/Controllers/Recruit/RecruitController.php

@@ -238,7 +238,7 @@ class RecruitController extends Controller
             $form->number('ordid', '排序')->default(0);
             $form->multipleFile('addFile', '附件')->move('storage/app/public/recruit/' . time());
         })->tab('报名表单与条件', function ($form) {
-            $form->checkbox('forms', '报名表单模块')->options(['basic' => '基础信息模块','expand_special' => '扩展模块-加分','detail' => '详情介绍模块','identification' => '身份证明上传模块','education_certification' => '学历证明上传模块','other_certification' => '其他证明上传模块', 'remark' => '备注模块','chengnuoshu'=>'诚信承诺书','internship' => '实习专场'])->default(['basic'])->setMustMark();
+            $form->checkbox('forms', '报名表单模块')->options(['basic' => '基础信息模块','expand_special' => '扩展模块-加分','detail' => '详情介绍模块','identification' => '身份证明上传模块','education_certification' => '学历证明上传模块','other_certification' => '其他证明上传模块', 'remark' => '备注模块','chengnuoshu'=>'诚信承诺书','shixin'=>'失信被执行人查询信息页扫描件','internship' => '实习专场'])->default(['basic'])->setMustMark();
             $form->text('limit_times', '报名次数限制')->rules('required|regex:/^\d+$/', [
                 'required' => '报名限制次数必须填写',
                 'regex' => '次数必须为数字'
@@ -913,6 +913,29 @@ class RecruitController extends Controller
                 $data->chengnuoshu = [];
             }
         }
+        if(in_array('shixin',$recruit->forms)){
+            if(json_decode($data->shixin)){
+                $data->shixin = json_decode($data->shixin);
+                $photo_data = [];
+                foreach ($data->shixin as $k => $v) {
+                    if($v->status){
+                        $photo_data[] = [
+                            'alt' => $v->name,
+                            'pid' => $v->uid,
+                            'src' => $v->response->path,
+                        ];
+                    }
+                }
+                $photos['shixin'] = [
+                    'title' => '失信被执行人查询信息页扫描件',
+                    'id' => 1,
+                    'start' => 0,
+                    'data' =>$photo_data
+                ];
+            }else{
+                $data->shixin = [];
+            }
+        }
 
         $html = view('admin.recruit.manageajax_userinfo')->with(['appointinfo' => $data,'recruit' => $recruit,'photos'=>$photos])->render();
         return response()->json(['code' => 1, 'data' => $html]);
@@ -2116,6 +2139,9 @@ class RecruitController extends Controller
             if(in_array('chengnuoshu',explode(',', $recruit->forms))){
                 $header[] = '诚信承诺书';
             }
+            if(in_array('shixin',explode(',', $recruit->forms))){
+                $header[] = '失信被执行人查询信息页扫描件';
+            }
             $header[] = '审核状态';
             $header[] = '审核意见';
 //            if(in_array('3',explode(',', $recruit->step))){
@@ -2366,6 +2392,19 @@ class RecruitController extends Controller
 
                     array_push($item, implode("\r\n", $chengnuoshu));
                 }
+                if (in_array('shixin', explode(',', $recruit->forms))) {
+                    $shixin = json_decode($v->shixin, true);
+                    $shixin = [];
+                    if($shixin){
+                        foreach ($shixin as $val){
+                            if(array_key_exists('path', $val['response'])){
+                                array_push($shixin,"https://www.jucai.gov.cn" . $val['response']['path']);
+                            }
+                        }
+                    }
+
+                    array_push($item, implode("\r\n", $shixin));
+                }
                 switch (intval($v->audit)){
                     case 1:
                         $item[] = '审核中';

+ 72 - 1
app/Http/Controllers/Web/Recruit/IndexController.php

@@ -457,6 +457,19 @@ class IndexController extends WebBaseController
                 }
                 $user_info['chengnuoshu'] = $chengnuoshu;
 
+                if(json_decode($user_info['shixin'])){
+                    $shixin = json_decode($user_info['shixin'],true);
+                    foreach ($shixin as $k => $v){
+                        if(array_key_exists('response',$v)){
+                            $shixin[$k]['url'] = $v['response']['path'];
+                        }
+
+                    }
+                }else{
+                    $shixin = [];
+                }
+                $user_info['shixin'] = $shixin;
+
                 //获取最新的报名审核信息
                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
                 if($logs){
@@ -580,6 +593,24 @@ class IndexController extends WebBaseController
                     $user_info['chengnuoshu'] = $chengnuoshu;
                 }
 
+                //如果有失信被执行人模块
+                if(in_array('shixin',$forms)){
+                    if(json_decode($user_info['shixin'])){
+                        $shixin = json_decode($user_info['shixin'],true);
+                        foreach ($shixin as $k => $v){
+                            if(array_key_exists('response',$v)){
+                                if(array_key_exists('path',$v['response'])){
+                                    $shixin[$k]['url'] = $v['response']['path'];
+                                }
+                            }
+
+                        }
+                    }else{
+                        $shixin = [];
+                    }
+                    $user_info['shixin'] = $shixin;
+                }
+
                 //获取最新的报名审核信息
                 $logs = RecruitAppointLog::where('appoint_id',$user_info->id)->where('step',1)->where('type',2)->orderBy('created_at','desc')->first();
                 if($logs){
@@ -638,7 +669,8 @@ class IndexController extends WebBaseController
                     'identification' => [],
                     'education_certification' => [],
                     'other_certification' => [],
-                    'chengnuoshu' => []
+                    'chengnuoshu' => [],
+                    'shixin' => []
                 ]);
             }else{
                 //如果没有,结合基础数据及模块表单信息,制作数据对象
@@ -676,6 +708,9 @@ class IndexController extends WebBaseController
                 if(in_array('chengnuoshu',$forms)){
                     $user_info['chengnuoshu'] = [];
                 }
+                if(in_array('shixin',$forms)){
+                    $user_info['shixin'] = [];
+                }
                 $user_info['recruit_id'] = $id;
                 $user_info['operation'] = 1;
             }
@@ -1027,6 +1062,24 @@ class IndexController extends WebBaseController
                             $appoint_info->save();
                         }
                     }
+
+                    //如果有失信被执行人模块
+                    if(in_array('shixin',$forms)){
+                        $shixin = $request->input('shixin');
+                        if(is_array($shixin)){
+                            //删除掉没有成功返回路径的图片
+                            foreach ($shixin as $k => $v){
+                                if(!array_key_exists('response',$v)){
+                                    unset($shixin[$k]);
+                                }
+                            }
+                        }
+
+                        if($shixin){
+                            $appoint_info->shixin = json_encode($shixin);
+                            $appoint_info->save();
+                        }
+                    }
                     DB::commit();
                     if($operation == 2){
                         $log = [
@@ -1150,6 +1203,24 @@ class IndexController extends WebBaseController
                             $result->save();
                         }
                     }
+
+                    //如果有失信被执行人模块
+                    if(in_array('shixin',$forms)){
+                        $shixin = $request->input('shixin');
+                        if($shixin){
+                            if(is_array($shixin)){
+                                //删除掉没有成功返回路径的图片
+                                foreach ($shixin as $k => $v){
+                                    if(!array_key_exists('response',$v)){
+                                        unset($shixin[$k]);
+                                    }
+                                }
+                            }
+
+                            $result->shixin = json_encode($shixin);
+                            $result->save();
+                        }
+                    }
                     DB::commit();
                     if($operation == 2){
                         $log = [

+ 40 - 0
public/themes/default/views/app/recruit/sign_up.blade.php

@@ -1050,6 +1050,31 @@
                             </td>
                         </tr>
                     @endif
+                    @if(in_array('shixin',$module))
+                        <tr style="height:52px;page-break-inside:avoid">
+                            <td valign="center" >
+                                <span class="require">*</span>失信被执行人查询信息页扫描件(需本人签字)
+                            </td>
+                            <td valign="center" colspan="11">
+                                <el-form-item prop="shixin" ref="shixin">
+                                    <div style="padding: 10px 0">
+                                        <el-upload
+                                                action="{{ route('recruit.api.upload') }}"
+                                                list-type="picture-card"
+                                                :data="{_token:'{{csrf_token()}}'}"
+                                                :file-list="user.shixin"
+                                                :before-upload="beforeImageUpload"
+                                                :on-success="uploadSuccessSX"
+                                                :multiple="true"
+                                                :on-preview="handlePictureCardPreview"
+                                                :on-remove="removeSX">
+                                            <i class="el-icon-plus"></i>
+                                        </el-upload>
+                                    </div>
+                                </el-form-item>
+                            </td>
+                        </tr>
+                    @endif
                     @if(in_array('remark',$module))
                         <tr style="height:52px;page-break-inside:avoid">
                             <td valign="center" >
@@ -1379,6 +1404,13 @@
                             this.$message.error(response.msg);
                         }
                     },
+                    uploadSuccessSX:function(response, file, fileList){
+                        if(response.status){
+                            this.user.shixin = fileList
+                        }else{
+                            this.$message.error(response.msg);
+                        }
+                    },
                     removeID:function(file,fileList) {
                         this.user.identification = fileList
                     },
@@ -1394,6 +1426,9 @@
                     removeCNS:function(file,fileList) {
                         this.user.chengnuoshu = fileList
                     },
+                    removeSX:function(file,fileList) {
+                        this.user.shixin = fileList
+                    },
                     handlePictureCardPreview:function(file){
                         this.dialogImageUrl = file.url;
                         this.dialogVisible = true;
@@ -1719,6 +1754,11 @@
                             {validator:this.validCNS, trigger: 'change'}
                         ],
                         @endif
+                        @if(in_array('shixin',$module))
+                        shixin:[
+                            {validator:this.validCNS, trigger: 'change'}
+                        ],
+                        @endif
                     },
                     init: 0,
                     upload: '',