customer_save.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. @endsection
  5. @section('content')
  6. <body class="gray-bg">
  7. <div class="wrapper wrapper-content animated fadeInRight">
  8. <div class="row">
  9. <div class="col-sm-12">
  10. <div class="ibox float-e-margins">
  11. <div class="ibox-content">
  12. <form class="form-horizontal" id="form">
  13. <div class="form-group">
  14. <label class="col-sm-2 control-label" for="customer_name">客户名称:</label>
  15. <div class="col-sm-8">
  16. <input type="text" class="form-control" id="customer_name" name="customer_name"
  17. value="{{$data->customer_name ?? ''}}">
  18. </div>
  19. </div>
  20. <div class="form-group">
  21. <label class="col-sm-2 control-label" for="domain">域名:</label>
  22. <div class="col-sm-8">
  23. <input type="text" class="form-control" id="domain" name="domain"
  24. value="{{$data->domain??''}}">
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="col-sm-2 control-label" for="contact_user">联系人:</label>
  29. <div class="col-sm-8">
  30. <input type="text" class="form-control" id="contact_user" name="contact_user"
  31. value="{{$data->contact_user??''}}">
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="col-sm-2 control-label" for="contact_phone">联系方式:</label>
  36. <div class="col-sm-8">
  37. <input type="text" class="form-control" id="contact_phone" name="contact_phone"
  38. value="{{$data->contact_phone??''}}">
  39. </div>
  40. </div>
  41. <div class="form-group">
  42. <label class="col-sm-2 control-label" for="remark">备注:</label>
  43. <div class="col-sm-8">
  44. <textarea name="remark" id="remark" cols="30" rows="10"
  45. class="form-control">{{$data->remark??''}}</textarea>
  46. </div>
  47. </div>
  48. @php $authUser=auth()->user(); @endphp
  49. {{--编辑情况下 只有超管或者渠道boss 才可以操作--}}
  50. @if($data&&($authUser->is_super||$authUser->role_id==\App\Http\Models\Role::TYPE_CHANNEL_BOSS))
  51. <div class="form-group">
  52. <label class="col-sm-2 control-label" for="user_id">转移用户:</label>
  53. <div class="col-sm-8 ">
  54. <select data-placeholder="转移用户..." style="width:350px;"
  55. class="chosen-select" id="user_id" name="user_id">
  56. <option value="">请选择用户</option>
  57. @foreach ($users as $item)
  58. <option value="{{$item->id}}"
  59. @if(($data->user_id??0)==$item->id) selected @endif>{{$item->username}}</option>
  60. @endforeach
  61. </select>
  62. </div>
  63. </div>
  64. @endif
  65. <div class="hr-line-dashed"></div>
  66. <div class="form-group">
  67. <div class="col-sm-4 col-sm-offset-2">
  68. <button class="btn btn-primary" type="button"
  69. onclick="units.save({{$data->id??0}})">
  70. 保存
  71. </button>
  72. <button class="btn btn-white closeLayer" type="button" id="cancel">取消</button>
  73. </div>
  74. </div>
  75. </form>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </body>
  82. @endsection
  83. @section('footer')
  84. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  85. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  86. <script>
  87. laydate.render({
  88. elem: '#sign_at', //指定元素
  89. type: 'datetime'
  90. });
  91. var config = {".chosen-select": {}};
  92. for (var selector in config) $(selector).chosen(config[selector]);
  93. var units = {
  94. save: function (id) {
  95. var data = tips.getFormValues('#form');
  96. data.channel_ids = $("#channel_ids").val();
  97. var ajaxConfig = {
  98. url: '/admin/agents/customer/' + id,
  99. type: 'put',
  100. data: data,
  101. success: function (result) {
  102. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  103. window.parent.tips.tableRefresh('#table');
  104. tips.closeParentLayer();
  105. });
  106. }
  107. };
  108. tips.ajax(ajaxConfig);
  109. }
  110. };
  111. </script>
  112. @endsection