linwu преди 3 години
родител
ревизия
658af10d59

+ 203 - 0
app/Admin/Controllers/Content/BuyHouseZrController.php

@@ -0,0 +1,203 @@
+<?php
+
+namespace App\Admin\Controllers\Content;
+
+use App\Http\Controllers\Controller;
+use App\Models\TalentHouse;
+use App\Models\TalentHouseApply;
+use Encore\Admin\Controllers\HasResourceActions;
+use Encore\Admin\Grid;
+use Encore\Admin\Layout\Content;
+use Illuminate\Http\Request;
+
+class BuyHouseZrController extends Controller
+{
+    use HasResourceActions;
+
+    private $status = ['未知', '待审核', '审核通过', '审核不通过'];
+    private $marry = ['未知', '未婚', '已婚', '离异', '丧偶'];
+
+    /**
+     * Index interface.
+     *
+     * @param Content $content
+     * @return Content
+     */
+    public function index(Content $content)
+    {
+        return $content
+            ->header('申报列表')
+            ->description(' ')
+            ->body(view('admin.content.buy_house_zr')->with(['grid' => $this->grid()]));
+    }
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new TalentHouseApply());
+
+        $grid->model()->with('house')->where('is_back',2)->where('zj_check_status',2)->orderBy('zr_check_status', 'ASC');
+
+        $status_text = $this->status;
+        $grid->id('ID');
+        $grid->name('姓名');
+        $grid->mobile('联系电话');
+        $grid->talent_level('人才层次');
+        $grid->column('房源')->display(function () {
+            return $this->house->name;
+        });
+        $grid->zr_check_status('状态')->display(function () use ($status_text) {
+            return $status_text[$this->zr_check_status];
+        });
+        $grid->zr_check_status('备注');
+
+        $grid->actions(function ($actions) {
+            if ($actions->row['zr_check_status'] == 1) {
+                $actions->append("<button class='btn btn-primary btn-xs applyaudit' data-code=" . $actions->row['id'] . ">审核</button>");
+            }
+            $actions->append("&nbsp;<button class='btn btn-primary btn-xs detail' id=" . $actions->row['id'] . ">详情</button>");
+        });
+
+        $grid->filter(function ($filter) {
+            $filter->disableIdFilter();
+            $filter->equal('house_id', '房源')->select(TalentHouse::all()->pluck('name', 'id'));
+            $status_option = ['全部', '待审核', '审核通过', '审核不通过'];
+            $filter->where(function ($query) {
+                if ($this->input > 0) {
+                    $query->where('status', '=', $this->input);
+                }
+            }, '状态', 'status')->radio($status_option);
+        });
+        return $grid;
+    }
+
+    /**
+     * 审核
+     */
+    public function audit(Request $request)
+    {
+        $id     = $request->id;
+        $status = $request->status;
+        $reason = $request->reason;
+        $url    = empty($request->url) ? admin_base_path('content/buy_house_zj') : $request->url;
+        if (empty($id)) {
+            admin_toastr('数据异常', 'error');
+            return redirect(admin_base_path('content/buy_house_zj'));
+        }
+        $result = TalentHouseApply::where('id', '=', $id)
+            ->update([
+                'zr_check_status'  => $status,
+                'zr_check_comment' => $reason,
+                'zr_check_time'    => date('Y-m-d H:i:s'),
+                'status'           => $status,
+            ]);
+        if ($result) {
+            admin_toastr('审核成功', 'success');
+        } else {
+            admin_toastr('该信息不存在或已审核', 'error');
+        }
+
+        return redirect($url);
+    }
+
+    /**
+     * 详情
+     */
+    public function detail(Request $request)
+    {
+        $id   = $request->id;
+        $info = TalentHouseApply::with('idcard')->where('id',$id)->first();
+        $info->family = json_decode($info->family);
+        $info->marry_text = $this->marry[$info->marry];
+
+        //layer相册层
+        $photos = [
+            'certificates'       => [],
+            'marry_prove'        => [],
+            'household_register' => [],
+            'work_prove'         => [],
+        ];
+        if (!empty(json_decode($info->certificates))) {
+            $info->certificates = json_decode($info->certificates);
+            $photo_data         = [];
+            foreach ($info->certificates as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['certificates'] = [
+                'title' => '证件信息',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->certificates = [];
+        }
+        if (!empty(json_decode($info->marry_prove))) {
+            $info->marry_prove = json_decode($info->marry_prove);
+            $photo_data        = [];
+            foreach ($info->marry_prove as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['marry_prove'] = [
+                'title' => '婚姻证明',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->marry_prove = [];
+        }
+        if (!empty(json_decode($info->household_register))) {
+            $info->household_register = json_decode($info->household_register);
+            $photo_data               = [];
+            foreach ($info->household_register as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['household_register'] = [
+                'title' => '户口本',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->household_register = [];
+        }
+        if (!empty(json_decode($info->work_prove))) {
+            $info->work_prove = json_decode($info->work_prove);
+            $photo_data       = [];
+            foreach ($info->work_prove as $k => $v) {
+                $photo_data[] = [
+                    'alt' => $v->name,
+                    'pid' => $v->uid,
+                    'src' => $v->response->path,
+                ];
+            }
+            $photos['work_prove'] = [
+                'title' => '在职证明',
+                'id'    => 1,
+                'start' => 0,
+                'data'  => $photo_data,
+            ];
+        } else {
+            $info->work_prove = [];
+        }
+        $html = view('admin.ajax.buy_house_detail')->with(['info' => $info, 'photos' => $photos])->render();
+        return response()->json(['code' => 1, 'data' => $html]);
+    }
+}

+ 3 - 0
app/Admin/routes.php

@@ -333,6 +333,9 @@ Route::group([
         $router->get('buy_house_zj', 'BuyHouseZjController@index')->name('content.buy_house_zj');
         $router->get('buy_house_zj/detail', 'BuyHouseZjController@detail')->name('content.buy_house_zj.detail');
         $router->post('buy_house_zj/audit', 'BuyHouseZjController@audit')->name('content.buy_house_zj.audit');
+        $router->get('buy_house_zr', 'BuyHouseZrController@index')->name('content.buy_house_zr');
+        $router->get('buy_house_zr/detail', 'BuyHouseZrController@detail')->name('content.buy_house_zr.detail');
+        $router->post('buy_house_zr/audit', 'BuyHouseZrController@audit')->name('content.buy_house_zr.audit');
         $router->get('buy_house_jc', 'BuyHouseJcController@index')->name('content.buy_house_jc');
         $router->get('buy_house_jc/detail', 'BuyHouseJcController@detail')->name('content.buy_house_jc.detail');
         $router->post('buy_house_jc/audit', 'BuyHouseJcController@audit')->name('content.buy_house_jc.audit');

+ 5 - 1
app/Http/Controllers/Web/Content/BuyhouseController.php

@@ -235,9 +235,13 @@ class BuyhouseController extends WebBaseController
                     $check['comment'] = $apply['rs_check_status'] == 1 ? '' : $apply['rs_check_comment'];
                     $check['type']    = $this->check_type[$apply['rs_check_status']];
                 } elseif ($apply['zj_check_status'] != 2) {
-                    $check['status_text'] = '自然资源局' . $this->apply_status[$apply['zj_check_status']];
+                    $check['status_text'] = '住建局' . $this->apply_status[$apply['zj_check_status']];
                     $check['comment']     = $apply['zj_check_status'] == 1 ? '' : $apply['zj_check_comment'];
                     $check['type']        = $this->check_type[$apply['zj_check_status']];
+                }  elseif ($apply['zr_check_status'] != 2) {
+                    $check['status_text'] = '自然资源局' . $this->apply_status[$apply['zr_check_status']];
+                    $check['comment']     = $apply['zr_check_status'] == 1 ? '' : $apply['zr_check_comment'];
+                    $check['type']        = $this->check_type[$apply['zr_check_status']];
                 } else {
                     $check['title']       = '';
                     $check['status_text'] = $this->apply_status[$apply['zj_check_status']];

+ 1 - 1
public/themes/default/views/app/content/buyhouse/login.blade.php

@@ -151,7 +151,7 @@
                             <div slot="header" class="clearfix">
                                 <span style="font-size:18px">我的申报</span>
                             </div>
-                            <div v-for="item in apply" class="text item" @click="toHouse(item.url)">
+                            <div v-for="item in apply" class="text item" @click="toHouse(item.url)" style="padding:5px 0;">
                                 <a href="javascript:void(0)" class="news_item">
                                     <span class="news_title">@{{item.house.name}}</span>
                                 </a>

+ 130 - 0
resources/views/admin/content/buy_house_zr.blade.php

@@ -0,0 +1,130 @@
+{!! $grid->render() !!}
+<style>
+    p#vtip { display: none; position: absolute; padding: 10px; left: 5px; font-size: 0.8em; background-color: white; border: 1px solid #a6c9e2; -moz-border-radius: 5px; -webkit-border-radius: 5px; z-index: 9999 }
+    p#vtip #vtipArrow { position: absolute; top: -10px; left: 5px }
+</style>
+<div class="modal fade" id="audit" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
+                </button>
+                <h4 class="modal-title" id="myModalLabel12">申报审核</h4>
+            </div>
+            <div class="modal-body">
+                <div class="modal-body">
+                    <form method="POST" action="{{route('content.buy_house_zj.audit')}}" id="auditForm" class="form-horizontal" accept-charset="UTF-8" pjax-container="1" id="dialog-form-5cc19c85d0a5f">
+                        <div class="box-body fields-group">
+                            <div class="form-group  ">
+                                <label for="audit1" class="col-sm-2  control-label">审核状态</label>
+                                <div class="col-sm-8">
+                                    <label class="radio-inline">
+                                        <input type="radio" name="status" value="2" class="minimal audit1" checked>
+                                        &nbsp;审核通过&nbsp;&nbsp;
+                                    </label>
+                                    <label class="radio-inline">
+                                        <input type="radio" name="status" value="3" class="minimal audit1" >
+                                        &nbsp;审核驳回&nbsp;&nbsp;
+                                    </label>
+                                </div>
+                            </div>
+                            <div class="form-group  ">
+                                <label for="reason" class="col-sm-2  control-label">备注</label>
+                                <div class="col-sm-8">
+                                    <textarea name="reason" class="form-control reason" rows="5" placeholder="输入 备注"></textarea>
+                                </div>
+                            </div>
+                        </div>
+                        <input type="hidden" name="id" id="id" value="" />
+                        <input type="hidden" name="url" id="url" value="{{url()->full()}}" />
+                        <input type="hidden" name="_token" value="{{ csrf_token() }}">
+                    </form>
+                </div>
+                <div class="modal-footer">
+                    {{--<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>取消</button>--}}
+                    <button type="button" id="dialog-submit-5cc19c85d0a5f" class="btn btn-primary" data-loading-text="提交中..."><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>确认</button>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<div class="modal fade" id="dialog" tabindex="-1" role="dialog" aria-labelledby="ModalLabel">
+    <div class="modal-dialog" role="document" style="width:1200px;">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
+                </button>
+                <h4 class="modal-title" id="myModalLabel1">业务</h4>
+            </div>
+            <div class="modal-body">
+
+                <div class="contentfade" style="height: 700px;overflow: auto;">
+
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    this.vtip = function() {
+        this.xOffset = -10; // x distance from mouse
+        this.yOffset = 15; // y distance from mouse
+        $(".vtip").unbind().hover(
+            function(e) {
+                this.t = $(this).attr("title");
+                this.title = '';
+                this.top = (e.pageY + yOffset);
+                this.left = (e.pageX + xOffset);
+                $('body').css("cursor","help");
+                $('p#vtip').width()>450?$('p#vtip').width(450):'';
+                $('body').append( '<p id="vtip">' + this.t + '</p>' );
+                $('p#vtip').css("top", this.top+"px").css("left", this.left+"px").fadeIn(0);
+            },
+            function() {
+                this.title = this.t;
+                $('body').css("cursor","");
+                $("p#vtip").fadeOut("slow").remove();
+            }
+        ).mousemove(
+            function(e) {
+                this.top = (e.pageY + yOffset);
+                this.left = (e.pageX + xOffset);
+                $("p#vtip").css("top", this.top+"px").css("left", this.left+"px");
+            }
+        );
+
+    };
+    $(document).ready(function() {
+        vtip();
+    });
+    $(document).off("click",'.applyaudit').on('click','.applyaudit',function () {
+        $('#id').val($(this).data('code'));
+        $('#audit').addClass('in');
+        $('#audit').css('display', 'block');
+        $(' #audit .contentfade').html('');
+    });
+    $(document).off("click","#audit .btn-primary").on('click',"#audit .btn-primary",function () {
+        $('#auditForm').submit();
+    });
+    $(".close").off().on('click', function () {
+        $(this).closest(".modal").removeClass('in');
+        $(this).closest(".modal").hide();
+    });
+
+    $('.detail').on('click', function () {
+        $("#myModalLabel1").html('详情');
+        var id = $(this).attr('id');
+        $('#dialog').addClass('in');
+        $('#dialog').css('display', 'block');
+        $('.contentfade').html('');
+        $.ajax({
+            url: "{{admin_base_path('/content/buy_house_zj/detail')}}",
+            data:{'id':id,'_token':'{{csrf_token()}}'},
+            // dataType:'json',
+            success:function (res) {
+                $('.contentfade').html(res.data);
+            },
+        })
+    });
+</script>