| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 |
- // var page_size=10;
- function queryUncheckedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "checked_dept": $("#fsList").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: 'check_period'},
- // {width: 100, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 100, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showCheck',text:'稽查',icon_class:'icon-eye-open'}
- ]
- }
- ];
-
- // 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(),
- "checked_dept": $("#fsList").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: 'check_period'},
- // {width: 120, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 100, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showApplyDetail',text:'处理',icon_class:'icon-hand-up'}
- ]
- }
- ];
-
- // 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(),
- "checked_dept": $("#fsList").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: 'check_period'},
- // {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-tasks'},
- {func:'dispatchTaskById',text:'下发',icon_class:'icon-signin'}
- ]
- }
- ];
-
- // 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(){
- layer.confirm('确定下发全部任务?', {
- btn: ['确定','取消'] //按钮
- }, function(){
- var param = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "checked_dept": $("#dept").val(),
- "check_status":4
- }
- no_return_common_service('/task/dispatch', param, function(data){
- queryUndispatchedTask();
- layer.msg(data, {
- time: 2000//20s后自动关闭
- });
- });
- }, function(index){
- layer.close(index);
- });
-
- }
- function dispatchTaskById(id){
- layer.confirm('确定下发任务?', {
- btn: ['确定','取消'] //按钮
- }, function(){
- var param = {
- "id": id,
- "check_status":5
- }
- no_return_common_service('/task/dispatchById', param, function(data){
- queryUndispatchedTask();
- layer.msg(data, {
- time: 2000//20s后自动关闭
- });
- });
- }, function(index){
- layer.close(index);
- });
-
- }
- function queryDispatchedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "checked_dept": $("#fsList").val(),
- "check_status":5
- }
- var hide = false;
- if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
- hide = true;
- }
- 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,hide:hide, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
- // {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-tasks'}
- ]
- }
- ];
-
- // 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");
- }
- function queryConfirmedTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "checked_dept": $("#fsList").val(),
- "check_status":6
- }
- var hide = false;
- if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
- hide = true;
- }
- 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,hide:hide, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
- // {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showTaskDetail4Confirmed',text:'详情',icon_class:'icon-tasks'}
- ]
- }
- ];
-
- // var pager = {
- // page_size:10
- // }
- $('#confirmed_datatable').mytable({'cols':cols,
- 'url':"/task/getTaskList/",
- 'param':data}
- );
- }
- function showTaskDetail4Confirmed(id){
- var rowData=getItemByIdFromArr(id,$('#confirmed_datatable').mytable('getTableData'));
- $.checkTask = rowData;
- changePage("/view/mytask/taskDetail.html");
- }
- function queryUnsubmitTask(){
- var data = {
- "start_time": $("#start_time").val(),
- "end_time": $("#end_time").val(),
- "checked_dept": $("#fsList").val(),
- "check_status":3
- }
- var hide = false;
- if(hasRole(ROLE_STATION_ADMIN) || hasRole(ROLE_STATION)) {
- hide = true;
- }
- 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,hide:hide, colClass: '',field: 'checkman_name'},
- {width: 160, text: '稽查时间段', type: 'string', flex: true, sort: 'down',field: 'check_period'},
- // {width: 80, text: '状态', type: 'string', flex: true, colClass: '',field: 'check_status_name'},
- {width: 160, text: '操作', type: 'string', flex: true, field: 'id',
- oper:[
- {func:'showTaskDetail4Confirmed',text:'详情',icon_class:'icon-tasks'}
- ]
- }
- ];
-
- // var pager = {
- // page_size:10
- // }
- $('#submit_datatable').mytable({'cols':cols,
- 'url':"/task/getTaskList/",
- 'param':data}
- );
- }
- function showTaskDetail4Confirmed(id){
- var rowData=getItemByIdFromArr(id,$('#submit_datatable').mytable('getTableData'));
- $.checkTask = rowData;
- changePage("/view/mytask/taskDetail.html");
- }
|