task_history.blade.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. @extends('admin/layout')
  2. @section('content')
  3. <style>
  4. .btn-danger, .btn-primary, .btn-info {
  5. background: #009688 !important;
  6. border-color: #009688 !important;
  7. }
  8. </style>
  9. <body class="gray-bg">
  10. <div class="wrapper wrapper-content animated fadeInRight">
  11. <div class="row">
  12. <div class="col-sm-12">
  13. <div class="ibox float-e-margins">
  14. <div class="ibox-content">
  15. <form class="row" id="searchForm" onsubmit="units.search();return false;">
  16. <div class="col-md-12">
  17. <div class="input-group">
  18. <select name="duty_id" class="form-control" style="width: 150px;float: right">
  19. <option value="">请选择负责人</option>
  20. @foreach($user as $inx=>$item)
  21. <option value="{{$item->id}}">{{$item->nickname}}</option>
  22. @endforeach
  23. </select>
  24. <select name="user_type" class="form-control" style="width: 150px;float: right">
  25. <option value="">请选择前端</option>
  26. @foreach($web as $inx=>$item)
  27. <option value="{{$item->id}}">{{$item->nickname}}</option>
  28. @endforeach
  29. </select>
  30. <input type="text" placeholder="请输入任务描述" class="form-control"
  31. style="width: 150px;float: right;" name="desc">
  32. <div class="input-group" style="width: 150px;float: right">
  33. <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
  34. <input type="text" class="input-md form-control" id="insert_date"
  35. name="insert_date" placeholder="请选择任务日期" style="width: 150px">
  36. </div>
  37. <span id="webOverdueDay"></span>
  38. <br>
  39. <span id="designOverdueDay"></span>
  40. <span class="input-group-btn">
  41. <button type="button" class="btn btn-md btn-primary" onclick="units.search()" style="border-radius:3px;"> 搜索</button>
  42. <button type="reset" class="btn btn-md btn-primary" style="margin-left: 10px;border-radius:3px;"
  43. name="resetBtn"> 重置</button>
  44. <button type="button" class="btn btn-md btn-primary"
  45. style="margin-left: 10px;border-radius:3px;"
  46. onclick="units.export()"> 导出</button>
  47. </span>
  48. </div>
  49. </div>
  50. </form>
  51. <hr>
  52. <div class="table-responsive">
  53. <table id="table" class="table table-condensed" data-mobile-responsive="true"></table>
  54. <div style="text-align: right;font-weight: bold;display: none" id="totalScore"> 分数:
  55. <span id="num"></span>
  56. <span id="type"></span>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </body>
  64. @endsection
  65. @section('footer')
  66. <script src="{{asset('js/plugins/layDate-v5.0.9/laydate/laydate.js')}}"></script>
  67. <script>
  68. $(function () {
  69. laydate.render({
  70. elem: '#insert_date',
  71. type: 'date'
  72. });
  73. });
  74. var units = {
  75. search: function () {
  76. tips.selectPage();
  77. },
  78. export: function () {
  79. var formValues = tips.getFormValues("#searchForm");
  80. var str = $.param(formValues);
  81. window.open('/admin/plan/week-task/history-export?' + str)
  82. },
  83. save: function (id) {
  84. var check_score = $('#check_score' + id).val();
  85. var url = '/admin/plan/week-task/history-update/' + id;
  86. var type = 'get';
  87. var ajaxConfig = {
  88. url: url,
  89. type: type,
  90. data: {check_score: check_score},
  91. success: function (result) {
  92. layer.msg(result.message, {icon: 6, time: 1500}, function () {
  93. tips.closeParentLayer();
  94. window.parent.tips.tableRefresh('#table');
  95. });
  96. }
  97. };
  98. tips.ajax(ajaxConfig);
  99. },
  100. };
  101. var config = {};
  102. config.url = '/admin/plan/week-task/history';
  103. config.pageSize = 500;
  104. config.columns = [ //字段
  105. {title: '时间', field: 'insert_date', align: 'center'},
  106. {title: '用户', field: 'username', align: 'center'},
  107. {title: '类型', field: 'role_type', align: 'center'},
  108. {title: '任务描述', field: 'describe', align: 'center'},
  109. {title: '负责人', field: 'dutyName', align: 'center'},
  110. {title: '设计', field: 'designerName', align: 'center'},
  111. {title: '前端', field: 'webName', align: 'center'},
  112. {title: '检查类型', field: 'cond_name', align: 'center'},
  113. {title: '截止时间', field: 'deadline', align: 'center'},
  114. {title: '逾期时长', field: 'beOverdueDay', align: 'center'},
  115. {title: '状态', field: 'statusTitle', align: 'center'},
  116. {title: '完成时间', field: 'complete', align: 'center'},
  117. {title: '完成逾期时长', field: 'completeBeOverdueDay', align: 'center'},
  118. {title: '备注', field: 'remark', align: 'center',width: '100px'},
  119. {
  120. title: '检查反馈', field: 'cond_item_id', align: 'center',width: '170px',
  121. formatter: function (value, row) {
  122. var str = '';
  123. str += '' +
  124. '<select class="form-control" id="check_score' + row.id + '">' +
  125. '<option value="0">未评分</option>' +
  126. '<option value="1">非常满意</option>' +
  127. '<option value="2">满意</option>' +
  128. '<option value="3">一般</option>' +
  129. '</select><button onclick="units.save(' + row.id + ')" class="btn btn-primary" style="border-radius:3px;">确定</button>';
  130. str += '<script>' +
  131. '$("#check_score' + row.id + '").val(' + row.check_score + ')';
  132. str += '<\/script>';
  133. return str;
  134. },
  135. cellStyle: function () {
  136. return {css: {'display': 'flex'}};
  137. }
  138. },
  139. ];
  140. config.onLoadSuccess = function (data) {
  141. var totalScore = data.totalScore;
  142. var listCount = data.listCount;
  143. if (typeof totalScore === 'number') {
  144. $("#totalScore").show();
  145. $("#num").text(totalScore);
  146. $("#type").text(listCount);
  147. } else {
  148. $("#totalScore").hide();
  149. }
  150. var webOverdueDay = data.webOverdueDay;
  151. var webTask = data.webTask;
  152. var designOverdueDay = data.designOverdueDay;
  153. var designTask = data.designTask;
  154. $("#webOverdueDay").text('前端已完成任务延期总天数:'+webOverdueDay+',逾期任务总数:'+webTask);
  155. $("#designOverdueDay").text('设计已完成任务延期总天数:'+designOverdueDay+',逾期任务总数:'+designTask);
  156. };
  157. tips.bootstrapTable(config);
  158. </script>
  159. @endsection