| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- // var page_size=10;
- function queryUncheckedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "dept": $("#dept").val(),
- "check_status":2
- }
- var cols = [
- {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
- {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
- {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
- {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
- {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
- {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showCheck',text:'稽查',icon_class:'icon-edit'}
- ]
- }
- ];
-
- // var pager = {
- // page_size:10
- // }
- $('.datatable').mytable({'cols':cols,
- 'url':"/task/getTaskList/",
- 'param':data}
- );
- }
- function showCheck(id){
- // $('#myModal').modal({name:"dd"});
- $.checkTask =getItemByIdFromArr(id,$('.datatable').mytable('getTableData'));
- changePage("/view/mytask/check.html");
- }
- function queryUnexaminedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "dept": $("#dept").val(),
- "check_status":21
- }
- var cols = [
- {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
- {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
- {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
- {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
- {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
- {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showApplyDetail',text:'处理',icon_class:'icon-edit'}
- ]
- }
- ];
-
- // var pager = {
- // page_size:10
- // }
- $('#unexamined_datatable').mytable({'cols':cols,
- 'url':"/task/getTaskList/",
- 'param':data}
- );
- }
- function showApplyDetail(id){
- layer.open({
- type: 1,
- area: ['400px','500px'],
- title: '申请处理',
- closeBtn: 1,
- shadeClose: true,
- skin: 'layui-layer-lan',
- content: $('#apply_detail_div'),
- btn: ['同意', '拒绝'],
- btnAlign: 'c', //按钮居中
- shade: 0 ,//不显示遮罩
- yes: function(index){
- aggreeApply(id,);
- layer.close(index);
- },
- btn2: function(index){
- refuseApply(id)
- layer.close(index);
- }
- });
- var param = {
- 'id':id
- };
- post_common_service('/checkApply/getByTaskId', param, function(data) {
- $('#apply_man').val(data.apply_man);
- $('#apply_time').val(data.apply_time);
- $('#apply_reason').val(data.apply_reason);
- $('#apply_id').val(data.id);
- });
- }
- function aggreeApply(taskId){
- var param = {
- 'id':$('#apply_id').val(),
- 'task_id':taskId
- };
- addOrUpdateItem4Common(param,'/checkApply/agree',queryUnexaminedTask);
- }
- function refuseApply(taskId){
- var param = {
- 'id':$('#apply_id').val(),
- 'task_id':taskId
- };
- addOrUpdateItem4Common(param,'/checkApply/refuse',queryUnexaminedTask);
- }
- function queryUndispatchedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "dept": $("#dept").val(),
- "check_status":4
- }
- var cols = [
- {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
- {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
- {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
- {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
- {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
- {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showTaskDetail',text:'任务详情',icon_class:'icon-edit'},
- {func:'dispatchTaskById',text:'下发',icon_class:'icon-edit'}
- ]
- }
- ];
-
- // var pager = {
- // page_size:10
- // }
- $('#undispatched_datatable').mytable({'cols':cols,
- 'url':"/task/getTaskList/",
- 'param':data}
- );
- }
- function showTaskDetail(id){
- var rowData=getItemByIdFromArr(id,$('#undispatched_datatable').mytable('getTableData'));
- $.checkTask = rowData;
- changePage("/view/mytask/taskDetail.html");
- }
- function dispatchTaskPatch(){
- var param = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "dept": $("#dept").val(),
- "check_status":4
- }
- no_return_common_service('/task/dispatch', param, function(data){
- queryUndispatchedTask();
- layer.msg(data, {
- time: 2000//20s后自动关闭
- });
- });
- }
- function dispatchTaskById(id){
- var param = {
- "id": id,
- "check_status":5
- }
- no_return_common_service('/task/dispatchById', param, function(data){
- queryUndispatchedTask();
- layer.msg(data, {
- time: 2000//20s后自动关闭
- });
- });
- }
- function queryDispatchedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "dept": $("#dept").val(),
- "check_status":5
- }
- var cols = [
- {width: 80, text: '序号', type: 'number', flex: true, colClass: 'text-center',field: 'num'},
- {width: 160, text: '任务名称', type: 'string', flex: true, sort: 'down',field: 'name'},
- {width: 80, text: '考核人员', type: 'string', flex: true, colClass: '',field: 'checked_person_name'},
- {width: 160, text: '考核部门', type: 'string', flex: true, sort: 'down',field: 'checked_dept_name'},
- {width: 80, text: '稽查人员', type: 'string', flex: true, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'start_time'},
- {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showTaskDetail1',text:'任务详情',icon_class:'icon-edit'}
- ]
- }
- ];
-
- // var pager = {
- // page_size:10
- // }
- $('#dispatched_datatable').mytable({'cols':cols,
- 'url':"/task/getTaskList/",
- 'param':data}
- );
- }
- function showTaskDetail1(id){
- var rowData=getItemByIdFromArr(id,$('#dispatched_datatable').mytable('getTableData'));
- $.checkTask = rowData;
- changePage("/view/mytask/taskDetail.html");
- }
|