customer_service_task.blade.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. @extends('admin/layout')
  2. @section('header')
  3. <link href="{{asset('css/plugins/switchery/switchery.css')}}" rel="stylesheet">
  4. <style>
  5. .btn-primary {
  6. background: #2a94e0 !important;
  7. border-color: #2a94e0 !important;
  8. }
  9. </style>
  10. @endsection
  11. @section('content')
  12. <body class="gray-bg">
  13. <div class="wrapper wrapper-content animated fadeInRight">
  14. <div class="row">
  15. <div class="col-sm-12">
  16. <div class="ibox float-e-margins">
  17. <div class="ibox-content">
  18. <form class="row" id="searchForm" onsubmit="units.search();return false;">
  19. <div class="col-md-4">
  20. <div class="input-group">
  21. <span class="input-group-btn">
  22. <button type="button" class="btn btn-md btn-primary"
  23. onclick="units.add()"> 添加</button>
  24. </span>
  25. </div>
  26. </div>
  27. <div class="input-group">
  28. <select data-placeholder="请选择客服..." class="form-control"
  29. style="width:150px;float: right"
  30. name="projectStewardId"
  31. id="projectStewardId" onchange="tips.selectPage();">
  32. <option value="" selected>请选择客服</option>
  33. @foreach ($projectSteward as $key => $value)
  34. <option value="{{$key}}">{{$value}}</option>
  35. @endforeach
  36. </select>
  37. <select data-placeholder="请选择任务状态..." class="form-control"
  38. style="width:150px;float: right" name="fulfil" id="fulfil"
  39. onchange="tips.selectPage();">
  40. <option value="" selected>请选择任务状态</option>
  41. <option value="1">未完成</option>
  42. <option value="2">完成</option>
  43. </select>
  44. <select name="status" id="status" title="" class="form-control"
  45. style="width: 150px;float: right" onchange="tips.selectPage();">
  46. <option value="">请选择项目状态</option>
  47. @foreach(\App\Http\Models\Site::STATUS_MAP as $key=>$item)
  48. @if(!in_array($key,[5,6]))
  49. <option value="{{$key}}">{{$item}}</option>
  50. @endif
  51. @endforeach
  52. </select>
  53. <input type="text" placeholder="请输入域名或项目名称" class="input-md form-control"
  54. name="keyword"
  55. id="keyword" style="width: 200px;float: right">
  56. <span class="input-group-btn">
  57. <button type="button" class="btn btn-md btn-primary"
  58. onclick="units.search()"> 搜索
  59. </button>
  60. <button type="button" class="btn btn-md" style="margin-left: 10px"
  61. name="btnReset"> 重置
  62. </button>
  63. </span>
  64. </div>
  65. </form>
  66. <hr>
  67. <div class="table-responsive">
  68. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </body>
  76. @endsection
  77. @section('footer')
  78. <script>
  79. var units = {
  80. search: function () {
  81. tips.selectPage();
  82. },
  83. save: function (siteId, statusId, taskId) {
  84. tips.ajax({
  85. url: '/admin/analyze/index/customerServiceTaskCarryOut/type/1/siteId/' + siteId + '/status/' + statusId + '/taskId/' + taskId,
  86. type: 'get',
  87. tableRefresh: '#table'
  88. });
  89. },
  90. del: function (siteId, statusId, taskId) {
  91. layer.confirm('您确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
  92. layer.close(index);
  93. tips.ajax({
  94. url: '/admin/analyze/index/customerServiceTaskCarryOut/type/2/siteId/' + siteId + '/status/' + statusId + '/taskId/' + taskId,
  95. type: 'get',
  96. tableRefresh: '#table'
  97. });
  98. });
  99. },
  100. add: function () {
  101. layer.open({
  102. type: 2,
  103. content: ['/admin/work-task/site-task'],
  104. area: ['70%', '60%'],
  105. title: '保存'
  106. });
  107. },
  108. openDetail: function (id, title) {
  109. tips.page('/admin/sites/' + id + '/overview', title);
  110. }
  111. };
  112. var config = {};
  113. config.url = '/admin/analyze/index/customerServiceTask';
  114. config.showColumns = false;
  115. config.columns = [ //字段
  116. {
  117. title: '序号', align: 'center', formatter: function (value, item, index) {
  118. return index + 1;
  119. },
  120. width: '20px'
  121. },
  122. {title: '项目名称', field: 'siteName', align: 'center'},
  123. {title: '项目状态', field: 'status', align: 'center'},
  124. {title: '任务标题', field: 'title', align: 'center'},
  125. {title: '任务内容', field: 'data', align: 'center'},
  126. {title: '是否完成', field: 'fulfil', align: 'center'},
  127. {title: '安排时间', field: 'initial_date', align: 'center'},
  128. {title: '完成时间', field: 'flow_except_date', align: 'center'},
  129. {title: '任务执行人', field: 'user', align: 'center'},
  130. {
  131. title: '操作', field: 'id', align: 'center',
  132. formatter: function (value, rows) {
  133. var str = '';
  134. if (rows.fulfil === '未完成') {
  135. str += '<button onclick="units.save(' + rows.siteId + ',' + rows.statusId + ',' + rows.taskId + ')" class="btn btn-md btn-primary">完成</button>&nbsp;';
  136. }
  137. str += '<button onclick="units.del(' + rows.siteId + ',' + rows.statusId + ',' + rows.taskId + ')" class="btn btn-md btn-danger">删除</button>&nbsp;';
  138. str +='<button onclick="units.openDetail(' + rows.siteId + ',\'' + rows.siteName + '\')" class="btn btn-xs"><span class="glyphicon glyphicon-menu-hamburger"></span>详情</button>';
  139. return str;
  140. },
  141. cellStyle: function () {
  142. return {css: {'display': 'flex'}};
  143. }
  144. }
  145. ];
  146. tips.bootstrapTable(config);
  147. </script>
  148. @endsection