wesley 6 年之前
父节点
当前提交
1fbd0e770a

+ 43 - 0
app/Models/CompanyChangedModel.php

xqd
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Models;
+
+use App\Models\BaseModel;
+
+/**
+ * @description 挖掘线索
+ * @author  system;
+ * @version    1.0
+ * @date 2018-11-19 08:23:08
+ *
+ */
+class CompanyChangedModel extends BaseModel
+{
+    /**
+     * 数据表名
+     *
+     * @var string
+     *
+     */
+    protected $table = 'company_changed';
+    /**
+     * 主键
+     */
+    protected $primaryKey = 'id';
+
+    //分页
+    protected $perPage = PAGE_NUMS;
+
+    /**
+     * 可以被集体附值的表的字段
+     *
+     * @var string
+     */
+    protected $fillable = [
+        'company_id',
+        'changed_time',
+        'changed_name',
+        'changed_before',
+        'changed_after'
+    ];
+}

+ 32 - 1
app/Models/CompanyInfoModel.php

xqd
@@ -52,18 +52,49 @@ class CompanyInfoModel extends BaseModel
         'website'
     ];
 
-
+    /***
+     * 是否已加为线索
+     * @return mixed
+     */
     public function isThread()
     {
         $ower_id = \Auth::guard('admin')->user()->id;
         return UserThreadsModel::where('ower_id', $ower_id)->where('company_id', $this->id)->count();
     }
 
+    /***
+     * 联系人
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
+     */
     public function contacts()
     {
         return $this->hasMany('App\Models\CompanyContactsModel', 'company_id');
     }
 
+    /***
+     * 表更纪录
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
+     */
+    public function changeds(){
+        return $this->hasMany('App\Models\CompanyChangedModel','company_id')->get();
+    }
+
+    /***
+     * 主要人员
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
+     */
+    public function mainpersons(){
+        return $this->hasMany('App\Models\CompanyMainpersonsModel','company_id')->get();
+    }
+
+    /***
+     * 股东
+     * @return \Illuminate\Database\Eloquent\Relations\HasMany
+     */
+    public function shareholders(){
+        return $this->hasMany('App\Models\CompanyShareholdersModel','company_id')->get();
+    }
+
     public $filterFields = [
         'district' => [
             ['value' => '成都', 'name' => '成都'],

+ 42 - 0
app/Models/CompanyMainpersonsModel.php

xqd
@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Models;
+
+use App\Models\BaseModel;
+
+/**
+ * @description 挖掘线索
+ * @author  system;
+ * @version    1.0
+ * @date 2018-11-19 08:23:08
+ *
+ */
+class CompanyMainpersonsModel extends BaseModel
+{
+    /**
+     * 数据表名
+     *
+     * @var string
+     *
+     */
+    protected $table = 'company_mainpersons';
+    /**
+     * 主键
+     */
+    protected $primaryKey = 'id';
+
+    //分页
+    protected $perPage = PAGE_NUMS;
+
+    /**
+     * 可以被集体附值的表的字段
+     *
+     * @var string
+     */
+    protected $fillable = [
+        'company_id',
+        'username',
+        'post'
+    ];
+
+}

+ 43 - 0
app/Models/CompanyShareholdersModel.php

xqd
@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Models;
+
+use App\Models\BaseModel;
+
+/**
+ * @description 挖掘线索
+ * @author  system;
+ * @version    1.0
+ * @date 2018-11-19 08:23:08
+ *
+ */
+class CompanyShareholdersModel extends BaseModel
+{
+    /**
+     * 数据表名
+     *
+     * @var string
+     *
+     */
+    protected $table = 'company_shareholders';
+    /**
+     * 主键
+     */
+    protected $primaryKey = 'id';
+
+    //分页
+    protected $perPage = PAGE_NUMS;
+
+    /**
+     * 可以被集体附值的表的字段
+     *
+     * @var string
+     */
+    protected $fillable = [
+        'company_id',
+        'username',
+        'insto',
+        'amount',
+        'amount_paid'
+    ];
+}

+ 39 - 0
database/migrations/2018_12_21_143518_create_company_changed_table.php

xqd
@@ -0,0 +1,39 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCompanyChangedTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('company_changed', function (Blueprint $table) {
+            $table->increments('id');
+
+            $table->integer('company_id')->comment('企业ID');
+            $table->dateTime('changed_time')->comment('变更日期');
+            $table->string('changed_name',255)->comment('变更项目');
+            $table->text('changed_before')->comment('变更前');
+            $table->text('changed_after')->comment('变更后');
+
+
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('company_changed');
+    }
+}

+ 37 - 0
database/migrations/2018_12_21_144451_create_company_shareholders_table.php

xqd
@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCompanyShareholdersTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('company_shareholders', function (Blueprint $table) {
+            $table->increments('id');
+            $table->integer('company_id')->comment('企业ID');
+            $table->string('username',255)->comment('股东名称');
+            $table->string('insto',10)->nullable()->comment('持股比例');
+            $table->double('amount')->nullable()->comment('认缴出资(万元)');
+            $table->double('amount_paid')->nullable()->comment('实缴出资(万元)');
+
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('company_shareholders');
+    }
+}

+ 35 - 0
database/migrations/2018_12_21_145853_create_company_mainpersons_table.php

xqd
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateCompanyMainpersonsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('company_mainpersons', function (Blueprint $table) {
+            $table->increments('id');
+            $table->integer('company_id')->comment('企业ID');
+            $table->string('username',255)->comment('姓名');
+            $table->string('post',255)->comment('职务');
+
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('company_mainpersons');
+    }
+}

+ 64 - 8
resources/views/admin/company/info/view.blade.php

xqd xqd xqd xqd xqd xqd
@@ -28,8 +28,8 @@
             font-size: 16px;
         }
 
-        @media (max-width:600px)
-        {  .tabs-container ul.nav-tabs li {
+        @media (max-width: 600px) {
+            .tabs-container ul.nav-tabs li {
                 width: 100%;
             }
         }
@@ -74,7 +74,7 @@
             background-color: #f5f9fc;
         }
 
-        .ibox-content > .col-md-12,  .ibox-content > .col-md-12 > .row{
+        .ibox-content > .col-md-12, .ibox-content > .col-md-12 > .row {
             margin: auto;
             height: 100%;
         }
@@ -82,7 +82,7 @@
         .ibox-content .panel-body {
             background-color: #ffffff;
             height: 100%;
-            overflow-y:auto;
+            overflow-y: auto;
         }
     </style>
 @endsection
@@ -114,7 +114,7 @@
 
                                         <div class="col-xl-11 col-lg-10 col-md-9">
                                             <div class="row">
-                                                <div class="col-md-6" >
+                                                <div class="col-md-6">
                                                     <h3 style="font-weight: 700">{{ $data->companyName }}</h3>
                                                 </div>
 
@@ -126,12 +126,12 @@
                                             </div>
 
 
-                                            <div class="row company_baseinfo" >
+                                            <div class="row company_baseinfo">
                                                 <div class="col-md-4">
                                                     <h3><label for="">经营状态:</label>{{ $data->openStatus }}</h3>
                                                 </div>
                                                 <div class="col-sm-4">
-                                                   <h3><label>成立日期:</label>{{ $data->startDate }}</h3>
+                                                    <h3><label>成立日期:</label>{{ $data->startDate }}</h3>
                                                 </div>
                                                 <div class="col-md-4">
                                                     <h3><label for="">公司类型:</label>{{ $data->entType }}</h3>
@@ -256,17 +256,73 @@
 
                                                         <div class="panel-body">
                                                             <h3>股东信息</h3>
+
+                                                            <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                                                                <tr>
+                                                                    <th>股东姓名</th>
+                                                                    <th>持股比例</th>
+                                                                    <th>认缴出资</th>
+                                                                    <th>实缴出资</th>
+                                                                </tr>
+
+                                                                @foreach($data->shareholders() as $item)
+                                                                    <tr>
+                                                                        <td>{{ $item->username }}</td>
+                                                                        <td>{{ $item->insto }}</td>
+                                                                        <td>{{ $item->amount }}</td>
+                                                                        <td>{{ $item->amount_paid or '-'}}</td>
+                                                                    </tr>
+                                                                @endforeach
+                                                            </table>
+
                                                         </div>
 
                                                         <div class="panel-body">
                                                             <h3>主要人员</h3>
+
+                                                            <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                                                                <tr>
+                                                                    <th>序号</th>
+                                                                    <th>姓名</th>
+                                                                    <th>职务</th>
+                                                                </tr>
+
+                                                                @foreach($data->mainpersons() as $key => $item)
+                                                                    <tr>
+                                                                        <td>{{ $key+1 }}</td>
+                                                                        <td>{{ $item->username }}</td>
+                                                                        <td>{{ $item->post }}</td>
+                                                                    </tr>
+                                                                @endforeach
+                                                            </table>
                                                         </div>
                                                     </div>
 
                                                     {{-- 变更纪录 --}}
                                                     <div id="tab-2" class="tab-pane">
                                                         <div class="panel-body">
-                                                            <strong>表更纪录</strong>
+                                                            <h3>变更纪录</h3>
+
+                                                            <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                                                                <tr>
+                                                                    <th>序号</th>
+                                                                    <th>变更日期</th>
+                                                                    <th>变更项目</th>
+                                                                    <th>变更前</th>
+                                                                    <th>变更后</th>
+                                                                </tr>
+
+                                                                @foreach($data->changeds() as $key =>$item)
+                                                                    <tr>
+                                                                        <td>{{ $key+1 }}</td>
+                                                                        <td>{{ $item->changed_time }}</td>
+                                                                        <td>{{ $item->changed_name }}</td>
+                                                                        <td>{{ $item->changed_before }}</td>
+                                                                        <td>{{ $item->changed_after }}</td>
+                                                                    </tr>
+                                                                @endforeach
+                                                            </table>
+
                                                         </div>
                                                     </div>