unchecked1111111.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. // var page_size=10;
  2. function queryUncheckedTask(){
  3. var data = {
  4. "start_time": $("#start_time").val(),
  5. "end_time": $("#end_time").val(),
  6. "checked_dept": $("#fsList").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: 'check_period'},
  16. // {width: 100, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  17. {width: 100, text: '操作', type: 'string', flex: true, field: 'id',
  18. oper:[
  19. {func:'showCheck',text:'稽查',icon_class:'icon-eye-open'}
  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. "checked_dept": $("#fsList").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: 'check_period'},
  50. // {width: 120, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  51. {width: 100, text: '操作', type: 'string', flex: true, field: 'id',
  52. oper:[
  53. {func:'showApplyDetail',text:'处理',icon_class:'icon-hand-up'}
  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. "checked_dept": $("#fsList").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: 'check_period'},
  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-tasks'},
  128. {func:'dispatchTaskById',text:'下发',icon_class:'icon-signin'}
  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. layer.confirm('确定下发全部任务?', {
  147. btn: ['确定','取消'] //按钮
  148. }, function(){
  149. var param = {
  150. "start_time": $("#start_time").val(),
  151. "end_time": $("#end_time").val(),
  152. "checked_dept": $("#dept").val(),
  153. "check_status":4
  154. }
  155. no_return_common_service('/task/dispatch', param, function(data){
  156. queryUndispatchedTask();
  157. layer.msg(data, {
  158. time: 2000//20s后自动关闭
  159. });
  160. });
  161. }, function(index){
  162. layer.close(index);
  163. });
  164. }
  165. function dispatchTaskById(id){
  166. layer.confirm('确定下发任务?', {
  167. btn: ['确定','取消'] //按钮
  168. }, function(){
  169. var param = {
  170. "id": id,
  171. "check_status":5
  172. }
  173. no_return_common_service('/task/dispatchById', param, function(data){
  174. queryUndispatchedTask();
  175. layer.msg(data, {
  176. time: 2000//20s后自动关闭
  177. });
  178. });
  179. }, function(index){
  180. layer.close(index);
  181. });
  182. }
  183. function queryDispatchedTask(){
  184. var data = {
  185. "start_time": $("#start_time").val(),
  186. "end_time": $("#end_time").val(),
  187. "checked_dept": $("#fsList").val(),
  188. "check_status":5
  189. }
  190. var hide = false;
  191. if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
  192. hide = true;
  193. }
  194. var cols = [
  195. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  196. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  197. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  198. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  199. {width: 80, text: '稽查人员', type: 'string', flex: true,hide:hide, colClass: '',field: 'checkman_name'},
  200. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
  201. // {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  202. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  203. oper:[
  204. {func:'showTaskDetail1',text:'详情',icon_class:'icon-tasks'}
  205. ]
  206. }
  207. ];
  208. // var pager = {
  209. // page_size:10
  210. // }
  211. $('#dispatched_datatable').mytable({'cols':cols,
  212. 'url':"/task/getTaskList/",
  213. 'param':data}
  214. );
  215. }
  216. function showTaskDetail1(id){
  217. var rowData=getItemByIdFromArr(id,$('#dispatched_datatable').mytable('getTableData'));
  218. $.checkTask = rowData;
  219. changePage("/view/mytask/taskDetail.html");
  220. }
  221. function queryConfirmedTask(){
  222. var data = {
  223. "start_time": $("#start_time").val(),
  224. "end_time": $("#end_time").val(),
  225. "checked_dept": $("#fsList").val(),
  226. "check_status":6
  227. }
  228. var hide = false;
  229. if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
  230. hide = true;
  231. }
  232. var cols = [
  233. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  234. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  235. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  236. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  237. {width: 80, text: '稽查人员', type: 'string', flex: true,hide:hide, colClass: '',field: 'checkman_name'},
  238. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
  239. // {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  240. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  241. oper:[
  242. {func:'showTaskDetail4Confirmed',text:'详情',icon_class:'icon-tasks'}
  243. ]
  244. }
  245. ];
  246. // var pager = {
  247. // page_size:10
  248. // }
  249. $('#confirmed_datatable').mytable({'cols':cols,
  250. 'url':"/task/getTaskList/",
  251. 'param':data}
  252. );
  253. }
  254. function showTaskDetail4Confirmed(id){
  255. var rowData=getItemByIdFromArr(id,$('#confirmed_datatable').mytable('getTableData'));
  256. $.checkTask = rowData;
  257. changePage("/view/mytask/taskDetail.html");
  258. }
  259. function queryUnsubmitTask(){
  260. var data = {
  261. "start_time": $("#start_time").val(),
  262. "end_time": $("#end_time").val(),
  263. "checked_dept": $("#fsList").val(),
  264. "check_status":3
  265. }
  266. var hide = false;
  267. if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
  268. hide = true;
  269. }
  270. var cols = [
  271. {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
  272. {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
  273. {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
  274. {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
  275. {width: 80, text: '稽查人员', type: 'string', flex: true,hide:hide, colClass: '',field: 'checkman_name'},
  276. {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
  277. // {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
  278. {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
  279. oper:[
  280. {func:'showTaskDetail4Confirmed',text:'详情',icon_class:'icon-tasks'}
  281. ]
  282. }
  283. ];
  284. // var pager = {
  285. // page_size:10
  286. // }
  287. $('#submit_datatable').mytable({'cols':cols,
  288. 'url':"/task/getTaskList/",
  289. 'param':data}
  290. );
  291. }
  292. function showTaskDetail4Confirmed(id){
  293. var rowData=getItemByIdFromArr(id,$('#submit_datatable').mytable('getTableData'));
  294. $.checkTask = rowData;
  295. changePage("/view/mytask/taskDetail.html");
  296. }