create_and_edit.blade.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. @extends('layouts.app')
  2. @section('content')
  3. <div class="container">
  4. <div class="col-md-10 offset-md-1">
  5. <div class="card ">
  6. <div class="card-header">
  7. <h1>
  8. 客户日志 -
  9. @if($customer_log->id)
  10. Edit #{{ $customer_log->id }}
  11. @else
  12. 创建
  13. @endif
  14. </h1>
  15. </div>
  16. <div class="card-body">
  17. @if($customer_log->id)
  18. <form action="{{ route('customer_logs.update', $customer_log->id) }}" method="POST" accept-charset="UTF-8">
  19. <input type="hidden" name="_method" value="PUT">
  20. @else
  21. <form action="{{ route('customer_logs.store') }}" method="POST" accept-charset="UTF-8">
  22. @endif
  23. @include('common.error')
  24. <input type="hidden" name="_token" value="{{ csrf_token() }}">
  25. <div class="form-group">
  26. <label for="customer_id-field">客户名称</label>
  27. <select name="customer_id" class="form-control" required>
  28. <option value="" hidden disabled {{ $customer_log->customer_id ? '':'selected' }}>请选择客户名称</option>
  29. @foreach($customers as $customer)
  30. <option value="{{ $customer->id }}">{{ $customer->name }}</option>
  31. @endforeach
  32. </select>
  33. {{-- <input class="form-control" type="text" name="customer_id" id="customer_id-field" value="{{ old('customer_id', $customer_log->customer_id ) }}" />--}}
  34. </div>
  35. <div class="form-group">
  36. <label for="customer_log_status_id-field">状态</label>
  37. <select name="customer_log_status_id" class="form-control" required>
  38. <option value="" hidden disabled {{ $customer_log->customer_log_status_id ? '':'selected' }}>请选择状态</option>
  39. @foreach($customerLogStatuses as $customerLogStatus)
  40. <option value="{{ $customerLogStatus->id }}">{{ $customerLogStatus->name }}</option>
  41. @endforeach
  42. </select>
  43. {{-- <input class="form-control" type="text" name="customer_log_status_id" id="customer_log_status_id-field" value="{{ old('customer_log_status_id', $customer_log->customer_log_status_id ) }}" />--}}
  44. </div>
  45. <div class="form-group">
  46. <label for="description-field">描述</label>
  47. <textarea name="description" id="description-field" class="form-control" rows="3">{{ old('description', $customer_log->description ) }}</textarea>
  48. </div>
  49. <div class="well well-sm">
  50. <button type="submit" class="btn btn-primary">保存</button>
  51. <a class="btn btn-link float-xs-right" href="{{ route('customer_logs.index') }}"> <- 返回</a>
  52. </div>
  53. </form>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. @endsection