unchecked.js 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. // var page_size=10;
  2. function queryUncheckedTask(){
  3. var data = {
  4. "start_time": $("#start_time").val(),
  5. "end_time": $("#end_time").val(),
  6. "dept": $("#dept").val(),
  7. "check_status":2
  8. }
  9. var cols = [
  10. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  11. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  12. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  13. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  14. {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
  15. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
  16. {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  17. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  18. oper:[
  19. {func:'showCheck',text:'稽查',icon_class:'icon-edit'}
  20. ]
  21. }
  22. ];
  23. // var pager = {
  24. // page_size:10
  25. // }
  26. $('.datatable').mytable({'cols':cols,
  27. 'url':"/task/getTaskList/",
  28. 'param':data}
  29. );
  30. }
  31. function showCheck(id){
  32. // $('#myModal').modal({name:"dd"});
  33. $.checkTask =getItemByIdFromArr(id,$('.datatable').mytable('getTableData'));
  34. changePage("/view/mytask/check.html");
  35. }
  36. function queryUnexaminedTask(){
  37. var data = {
  38. "start_time": $("#start_time").val(),
  39. "end_time": $("#end_time").val(),
  40. "dept": $("#dept").val(),
  41. "check_status":21
  42. }
  43. var cols = [
  44. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  45. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  46. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  47. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  48. {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
  49. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
  50. {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  51. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  52. oper:[
  53. {func:'showApplyDetail',text:'处理',icon_class:'icon-edit'}
  54. ]
  55. }
  56. ];
  57. // var pager = {
  58. // page_size:10
  59. // }
  60. $('#unexamined_datatable').mytable({'cols':cols,
  61. 'url':"/task/getTaskList/",
  62. 'param':data}
  63. );
  64. }
  65. function showApplyDetail(id){
  66. layer.open({
  67. type: 1,
  68. area: ['400px','500px'],
  69. title: '申请处理',
  70. closeBtn: 1,
  71. shadeClose: true,
  72. skin: 'layui-layer-lan',
  73. content: $('#apply_detail_div'),
  74. btn: ['同意', '拒绝'],
  75. btnAlign: 'c', //按钮居中
  76. shade: 0 ,//不显示遮罩
  77. yes: function(index){
  78. aggreeApply(id,);
  79. layer.close(index);
  80. },
  81. btn2: function(index){
  82. refuseApply(id)
  83. layer.close(index);
  84. }
  85. });
  86. var param = {
  87. 'id':id
  88. };
  89. post_common_service('/checkApply/getByTaskId', param, function(data) {
  90. $('#apply_man').val(data.apply_man);
  91. $('#apply_time').val(data.apply_time);
  92. $('#apply_reason').val(data.apply_reason);
  93. $('#apply_id').val(data.id);
  94. });
  95. }
  96. function aggreeApply(taskId){
  97. var param = {
  98. 'id':$('#apply_id').val(),
  99. 'task_id':taskId
  100. };
  101. addOrUpdateItem4Common(param,'/checkApply/agree',queryUnexaminedTask);
  102. }
  103. function refuseApply(taskId){
  104. var param = {
  105. 'id':$('#apply_id').val(),
  106. 'task_id':taskId
  107. };
  108. addOrUpdateItem4Common(param,'/checkApply/refuse',queryUnexaminedTask);
  109. }
  110. function queryUndispatchedTask(){
  111. var data = {
  112. "start_time": $("#start_time").val(),
  113. "end_time": $("#end_time").val(),
  114. "dept": $("#dept").val(),
  115. "check_status":4
  116. }
  117. var cols = [
  118. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  119. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  120. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  121. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  122. {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
  123. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
  124. {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  125. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  126. oper:[
  127. {func:'showTaskDetail',text:'任务详情',icon_class:'icon-edit'},
  128. {func:'dispatchTaskById',text:'下发',icon_class:'icon-edit'}
  129. ]
  130. }
  131. ];
  132. // var pager = {
  133. // page_size:10
  134. // }
  135. $('#undispatched_datatable').mytable({'cols':cols,
  136. 'url':"/task/getTaskList/",
  137. 'param':data}
  138. );
  139. }
  140. function showTaskDetail(id){
  141. var rowData=getItemByIdFromArr(id,$('#undispatched_datatable').mytable('getTableData'));
  142. $.checkTask = rowData;
  143. changePage("/view/mytask/taskDetail.html");
  144. }
  145. function dispatchTaskPatch(){
  146. var param = {
  147. "start_time": $("#start_time").val(),
  148. "end_time": $("#end_time").val(),
  149. "dept": $("#dept").val(),
  150. "check_status":4
  151. }
  152. no_return_common_service('/task/dispatch', param, function(data){
  153. queryUndispatchedTask();
  154. layer.msg(data, {
  155. time: 2000//20s后自动关闭
  156. });
  157. });
  158. }
  159. function dispatchTaskById(id){
  160. var param = {
  161. "id": id,
  162. "check_status":5
  163. }
  164. no_return_common_service('/task/dispatchById', param, function(data){
  165. queryUndispatchedTask();
  166. layer.msg(data, {
  167. time: 2000//20s后自动关闭
  168. });
  169. });
  170. }
  171. function queryDispatchedTask(){
  172. var data = {
  173. "start_time": $("#start_time").val(),
  174. "end_time": $("#end_time").val(),
  175. "dept": $("#dept").val(),
  176. "check_status":5
  177. }
  178. var cols = [
  179. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  180. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  181. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  182. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  183. {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
  184. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
  185. {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  186. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  187. oper:[
  188. {func:'showTaskDetail1',text:'任务详情',icon_class:'icon-edit'}
  189. ]
  190. }
  191. ];
  192. // var pager = {
  193. // page_size:10
  194. // }
  195. $('#dispatched_datatable').mytable({'cols':cols,
  196. 'url':"/task/getTaskList/",
  197. 'param':data}
  198. );
  199. }
  200. function showTaskDetail1(id){
  201. var rowData=getItemByIdFromArr(id,$('#dispatched_datatable').mytable('getTableData'));
  202. $.checkTask = rowData;
  203. changePage("/view/mytask/taskDetail.html");
  204. }