allot.blade.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/chosen/chosen.css')}}" rel="stylesheet">
  4. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  5. @endsection
  6. @section('content')
  7. <body class="gray-bg">
  8. <div class="wrapper wrapper-content animated fadeInRight">
  9. <div class="row">
  10. <div class="col-sm-12">
  11. <div class="ibox float-e-margins">
  12. <div class="ibox-content">
  13. <form method="get" class="form-horizontal" id="form">
  14. <div class="form-group">
  15. <label class="col-sm-2 control-label" for="manager_ids">项目经理:</label>
  16. <div class="col-sm-10">
  17. <select data-placeholder="选择行业类型..." multiple class="chosen-select"
  18. style="width:350px;"
  19. id="manager_ids" name="manager_ids">
  20. <option value="">请选择项目经理</option>
  21. @foreach ($managers as $item)
  22. <option value="{{$item->id}}"
  23. @if(in_array($item->id,$hasMangerIds)) selected @endif>{{$item->username}}</option>
  24. @endforeach
  25. </select>
  26. </div>
  27. </div>
  28. <div class="hr-line-dashed"></div>
  29. <div class="form-group">
  30. <label class="col-sm-2 control-label" for="editor_ids">采编人员:</label>
  31. <div class="col-sm-10">
  32. <select data-placeholder="选择采编人员..." multiple class="chosen-select"
  33. style="width:350px;"
  34. id="editor_ids" name="editor_ids">
  35. <option value="">请选择采编人员</option>
  36. @foreach ($editors as $item)
  37. <option value="{{$item->id}}"
  38. @if(in_array($item->id,$hasEditorIds)) selected @endif>{{$item->username}}</option>
  39. @endforeach
  40. </select>
  41. </div>
  42. </div>
  43. <div class="hr-line-dashed"></div>
  44. <div class="form-group">
  45. <label class="col-sm-2 control-label" for="server_ids">客服人员:</label>
  46. <div class="col-sm-10">
  47. <select data-placeholder="选择客服人员..." multiple class="chosen-select"
  48. style="width:350px;"
  49. id="server_ids" name="server_ids">
  50. <option value="">请选择客服人员</option>
  51. @foreach ($services as $item)
  52. <option value="{{$item->id}}"
  53. @if(in_array($item->id,$hasServerIds)) selected @endif>{{$item->username}}</option>
  54. @endforeach
  55. </select>
  56. </div>
  57. </div>
  58. <div class="hr-line-dashed"></div>
  59. <div class="form-group">
  60. <div class="col-sm-4 col-sm-offset-2">
  61. <button class="btn btn-primary" type="button" data-id="{{$user->id??0}}" id="save">
  62. 保存
  63. </button>
  64. <button class="btn btn-white" type="button" id="cancel">取消</button>
  65. </div>
  66. </div>
  67. </form>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </body>
  74. @endsection
  75. @section('footer')
  76. <script src="{{asset('js/plugins/chosen/chosen.jquery.js')}}"></script>
  77. <script src="{{asset('js/plugins/switchery/switchery.js')}}"></script>
  78. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  79. <script>
  80. $(document).on('click', '#cancel', function () {
  81. tips.closeParentLayer();
  82. });
  83. var config = {".chosen-select": {}};
  84. for (var selector in config) $(selector).chosen(config[selector]);
  85. var jsSwitch = document.querySelector(".js-switch");
  86. new Switchery(jsSwitch, {color: "#1AB394", size: 'small'});
  87. $(document).on('click', '#save', function () {
  88. var data = {};
  89. data.siteIds = JSON.parse('{!!json_encode($siteIds)!!}');
  90. data.editorIds = $("#editor_ids").val();
  91. data.serverIds = $("#server_ids").val();
  92. data.managerIds = $("#manager_ids").val();
  93. var ajaxConfig = {
  94. url: '/admin/sites/allot',
  95. type: 'put',
  96. data: data,
  97. success: function (result) {
  98. layer.msg(result.message, {icon: 6, time: 1000}, function () {
  99. tips.closeParentLayer();
  100. window.parent.tips.tableRefresh('#table');
  101. });
  102. }
  103. };
  104. tips.ajax(ajaxConfig);
  105. });
  106. laydate.render({
  107. elem: '#order_at', //指定元素
  108. type: 'datetime'
  109. });
  110. </script>
  111. @endsection