瀏覽代碼

临时工添加身份证字段

yuang 4 年之前
父節點
當前提交
a65cf1ab4e

+ 1 - 1
app/LaborCompanyDispatchDetail.php

@@ -5,7 +5,6 @@ namespace App;
 use Illuminate\Database\Eloquent\Model;
 
 use App\Traits\ModelLogChanging;
-
 class LaborCompanyDispatchDetail extends Model
 {
     use ModelLogChanging;
@@ -15,6 +14,7 @@ class LaborCompanyDispatchDetail extends Model
         'name',//临时工姓名
         'gender',//性别
         'age',//年龄
+        'card_id',//身份证
     ];
 
     static public $enums = [

+ 32 - 0
database/migrations/2022_03_15_080709_add_card_id_to_labor_company_dispatch_details_table.php

@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddCardIdToLaborCompanyDispatchDetailsTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('labor_company_dispatch_details', function (Blueprint $table) {
+            $table->string("card_id")->nullable()->comment("身份证号");
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('labor_company_dispatch_details', function (Blueprint $table) {
+            $table->dropColumn("card_id");
+        });
+    }
+}

+ 5 - 1
resources/views/personnel/laborApply/dispatch/detail/create.blade.php

@@ -31,7 +31,11 @@
                                     <input class="form-control" type="number" :name="'users['+i+'][age]'"
                                            :id="'users['+i+'][age]'">
                                 </div>
-
+                                <label class="col-lg-1 col-sm-3 col-form-label" :for="'users['+i+'][cardId]'">身份证</label>
+                                <div class="col-lg-2 col-sm-12">
+                                    <input class="form-control" type="text" :name="'users['+i+'][card_id]'"
+                                           :id="'users['+i+'][card_id]'">
+                                </div>
                                 <div v-if="i!==0" class="col-1 ml-1">
                                     <button class="btn btn-sm btn-primary float-right" type="button"
                                             @click="items.splice(i,1)">-

+ 6 - 1
resources/views/personnel/laborApply/dispatch/detail/edit.blade.php

@@ -32,7 +32,12 @@
                                            :value="item.age"
                                            :id="'users['+i+'][age]'">
                                 </div>
-
+                                <label class="col-lg-1 col-sm-3 col-form-label" :for="'users['+i+'][cardId]'">身份证</label>
+                                <div class="col-lg-2 col-sm-12">
+                                    <input class="form-control" type="text" :name="'users['+i+'][card_id]'"
+                                           :value="item.card_id"
+                                           :id="'users['+i+'][card_id]'">
+                                </div>
                                 <div v-if="i!==0" class="col-1 ml-1">
                                     <button class="btn btn-sm btn-primary float-right" type="button"
                                             @click="items.splice(i,1)">-

+ 2 - 0
resources/views/personnel/laborApply/dispatch/index.blade.php

@@ -77,6 +77,7 @@
                                     <td>@{{ v.name }}</td>
                                     <td>@{{ v.gender }}</td>
                                     <td>@{{ v.age }}</td>
+                                    <td>@{{ v.card_id }}</td>
                                 </tr>
                             </table>
                             <table v-else style="margin: 0;padding: 0">
@@ -84,6 +85,7 @@
                                     <td>@{{ labor_company_dispatch.labor_company_dispatch_details[0].name }}</td>
                                     <td>@{{ labor_company_dispatch.labor_company_dispatch_details[0].gender }}</td>
                                     <td>@{{ labor_company_dispatch.labor_company_dispatch_details[0].age }}</td>
+                                    <td>@{{ labor_company_dispatch.labor_company_dispatch_details[0].card_id }}</td>
                                 </tr>
                             </table>
                             <a href="javascript:void(0)"