diff --git a/resources/views/common/customer_create.blade.php b/resources/views/common/customer_create.blade.php new file mode 100644 index 00000000..e866419c --- /dev/null +++ b/resources/views/common/customer_create.blade.php @@ -0,0 +1,113 @@ +{{csrf_field()}} +
+
+
+

基础信息

+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+

扩展信息

+
+ @foreach($fields as $d) +
+ +
+ @switch($d->field_type) + @case('input') + required==1) lay-verify="required" @endif placeholder="{{$d->field_tips}}" > + @break + @case('textarea') + + @break + @case('select') + + @break + @case('radio') + @if($d->field_option&&strpos($d->field_option,"\n")) + @foreach(explode("\n",$d->field_option) as $v) + @php + $key = \Illuminate\Support\Str::before($v,':'); + $val = \Illuminate\Support\Str::after($v,':'); + @endphp + field_value) checked @endif title="{{$val}}"> + @endforeach + @endif + @break + @case('checkbox') + @if($d->field_option&&strpos($d->field_option,"\n")) + @foreach(explode("\n",$d->field_option) as $v) + @php + $key = \Illuminate\Support\Str::before($v,':'); + $val = \Illuminate\Support\Str::after($v,':'); + $fieldValue = []; + if ($d->field_value&&strpos($d->field_value,',')){ + $fieldValue = explode(",",$d->field_value); + } + @endphp + field_value ) checked @endif title="{{$val}}"> + @endforeach + @endif + @break + @case('image') +
+ +
+
    +
+ +
+
+ @break + @case('images') +
+ +
+
    +
+ +
+
+ @break + @default + @break + @endswitch +
+
+ @endforeach +
+
+
+
+ +
+
diff --git a/resources/views/common/customer_edit.blade.php b/resources/views/common/customer_edit.blade.php new file mode 100644 index 00000000..54129e77 --- /dev/null +++ b/resources/views/common/customer_edit.blade.php @@ -0,0 +1,115 @@ +{{method_field('put')}} +{{csrf_field()}} +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ @foreach($fields as $d) +
+ +
+ @switch($d->field_type) + @case('input') + required==1) lay-verify="required" @endif placeholder="{{$d->field_tips}}" > + @break + @case('textarea') + + @break + @case('select') + + @break + @case('radio') + @if($d->field_option&&strpos($d->field_option,"\n")) + @foreach(explode("\n",$d->field_option) as $v) + @php + $key = \Illuminate\Support\Str::before($v,':'); + $val = \Illuminate\Support\Str::after($v,':'); + @endphp + id])&&$key==$data[$d->id]) checked @endif title="{{$val}}"> + @endforeach + @endif + @break + @case('checkbox') + @if($d->field_option&&strpos($d->field_option,"\n")) + @foreach(explode("\n",$d->field_option) as $v) + @php + $key = \Illuminate\Support\Str::before($v,':'); + $val = \Illuminate\Support\Str::after($v,':'); + $fieldValue = []; + if (isset($data[$d->id])&&strpos($data[$d->id],',')){ + $fieldValue = explode(",",$data[$d->id]); + } + @endphp + id])&&$key==$data[$d->id]) ) checked @endif title="{{$val}}"> + @endforeach + @endif + @break + @case('image') +
+ +
+
    + @if(isset($data[$d->id])) +
  • 删除

  • + @endif +
+ +
+
+ @break + @case('images') +
+ +
+
    + @if(isset($data[$d->id]) && strpos($data[$d->id],',')) + @foreach(explode(',',$data[$d->id]) as $v) +
  • 删除

  • + @endforeach + @endif +
+ +
+
+ @break + @default + @break + @endswitch +
+
+ @endforeach +
+
+
+
+ +
+
diff --git a/resources/views/crm/assignment/_js.blade.php b/resources/views/common/customer_js.blade.php similarity index 100% rename from resources/views/crm/assignment/_js.blade.php rename to resources/views/common/customer_js.blade.php diff --git a/resources/views/crm/assignment/_form.blade.php b/resources/views/crm/assignment/_form.blade.php deleted file mode 100644 index f469e120..00000000 --- a/resources/views/crm/assignment/_form.blade.php +++ /dev/null @@ -1,7 +0,0 @@ - -
-
- - 返 回 -
-
diff --git a/resources/views/crm/assignment/create.blade.php b/resources/views/crm/assignment/create.blade.php index 50a83ef8..7c61aa06 100644 --- a/resources/views/crm/assignment/create.blade.php +++ b/resources/views/crm/assignment/create.blade.php @@ -4,124 +4,12 @@
- {{csrf_field()}} -
-
-
-

基础信息

-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
-

扩展信息

-
- @foreach($fields as $d) -
- -
- @switch($d->field_type) - @case('input') - required==1) lay-verify="required" @endif placeholder="{{$d->field_tips}}" > - @break - @case('textarea') - - @break - @case('select') - - @break - @case('radio') - @if($d->field_option&&strpos($d->field_option,"\n")) - @foreach(explode("\n",$d->field_option) as $v) - @php - $key = \Illuminate\Support\Str::before($v,':'); - $val = \Illuminate\Support\Str::after($v,':'); - @endphp - field_value) checked @endif title="{{$val}}"> - @endforeach - @endif - @break - @case('checkbox') - @if($d->field_option&&strpos($d->field_option,"\n")) - @foreach(explode("\n",$d->field_option) as $v) - @php - $key = \Illuminate\Support\Str::before($v,':'); - $val = \Illuminate\Support\Str::after($v,':'); - $fieldValue = []; - if ($d->field_value&&strpos($d->field_value,',')){ - $fieldValue = explode(",",$d->field_value); - } - @endphp - field_value ) checked @endif title="{{$val}}"> - @endforeach - @endif - @break - @case('image') -
- -
-
    -
- -
-
- @break - @case('images') -
- -
-
    -
- -
-
- @break - @default - @break - @endswitch -
-
- @endforeach -
-
-
-
- -
-
+ @include('common.customer_create',['fields'=>$fields])
@endsection @section('script') - @include('crm.assignment._js') + @include('common.customer_js') @endsection diff --git a/resources/views/crm/assignment/edit.blade.php b/resources/views/crm/assignment/edit.blade.php index 1c314c1c..75b15ea7 100644 --- a/resources/views/crm/assignment/edit.blade.php +++ b/resources/views/crm/assignment/edit.blade.php @@ -7,126 +7,12 @@
- {{method_field('put')}} - {{csrf_field()}} -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
- @foreach($fields as $d) -
- -
- @switch($d->field_type) - @case('input') - required==1) lay-verify="required" @endif placeholder="{{$d->field_tips}}" > - @break - @case('textarea') - - @break - @case('select') - - @break - @case('radio') - @if($d->field_option&&strpos($d->field_option,"\n")) - @foreach(explode("\n",$d->field_option) as $v) - @php - $key = \Illuminate\Support\Str::before($v,':'); - $val = \Illuminate\Support\Str::after($v,':'); - @endphp - id])&&$key==$data[$d->id]) checked @endif title="{{$val}}"> - @endforeach - @endif - @break - @case('checkbox') - @if($d->field_option&&strpos($d->field_option,"\n")) - @foreach(explode("\n",$d->field_option) as $v) - @php - $key = \Illuminate\Support\Str::before($v,':'); - $val = \Illuminate\Support\Str::after($v,':'); - $fieldValue = []; - if (isset($data[$d->id])&&strpos($data[$d->id],',')){ - $fieldValue = explode(",",$data[$d->id]); - } - @endphp - id])&&$key==$data[$d->id]) ) checked @endif title="{{$val}}"> - @endforeach - @endif - @break - @case('image') -
- -
-
    - @if(isset($data[$d->id])) -
  • 删除

  • - @endif -
- -
-
- @break - @case('images') -
- -
-
    - @if(isset($data[$d->id]) && strpos($data[$d->id],',')) - @foreach(explode(',',$data[$d->id]) as $v) -
  • 删除

  • - @endforeach - @endif -
- -
-
- @break - @default - @break - @endswitch -
-
- @endforeach -
-
-
-
- -
-
+ @include('common.customer_edit',['model'=>$model,'fields'=>$fields,'data'=>$data])
@endsection @section('script') - @include('crm.assignment._js') + @include('common.customer_js') @endsection