|
|
@@ -0,0 +1,160 @@
|
|
|
+
|
|
|
+ function initApplyPage(){
|
|
|
+ // 仅选择日期
|
|
|
+ $("#start-time").datetimepicker(
|
|
|
+ {
|
|
|
+ language: "zh-CN",
|
|
|
+ weekStart: 1,
|
|
|
+ todayBtn: 1,
|
|
|
+ autoclose: 1,
|
|
|
+ todayHighlight: 1,
|
|
|
+ startView: 2,
|
|
|
+ minView: 2,
|
|
|
+ forceParse: 0,
|
|
|
+ format: "yyyy-mm-dd"
|
|
|
+ });
|
|
|
+ // 仅选择日期
|
|
|
+ $("#end-time").datetimepicker(
|
|
|
+ {
|
|
|
+ language: "zh-CN",
|
|
|
+ weekStart: 1,
|
|
|
+ todayBtn: 1,
|
|
|
+ autoclose: 1,
|
|
|
+ todayHighlight: 1,
|
|
|
+ startView: 2,
|
|
|
+ minView: 2,
|
|
|
+ forceParse: 0,
|
|
|
+ format: "yyyy-mm-dd"
|
|
|
+ });
|
|
|
+ setFeSelect("#fsList");
|
|
|
+ //获取页面参数
|
|
|
+ var page_params = $.zui.store.get("page_params");
|
|
|
+ if(page_params && page_params.status) {
|
|
|
+ cur_status = page_params.status;
|
|
|
+ }
|
|
|
+
|
|
|
+ queryUnexaminedTask();
|
|
|
+ }
|
|
|
+//初始化表行按钮
|
|
|
+function initTableRowBtn() {
|
|
|
+ $.zui.store.set("task_table_btn_21_"+ROLE_JICHA_ADMIN,[{func:'showApplyDetail',text:'处理',icon_class:'icon-eye-open'}]);
|
|
|
+ $.zui.store.set("task_table_btn_21_"+ROLE_JICHA,[{func:'showApplyDetail1',text:'详情',icon_class:'icon-eye-open'}]);
|
|
|
+ $.zui.store.set("task_table_btn_22",[{func:'showApplyDetail1',text:'详情',icon_class:'icon-tasks'}]);
|
|
|
+ $.zui.store.set("task_table_btn_23",[{func:'showApplyDetail1',text:'详情',icon_class:'icon-tasks'}]);
|
|
|
+}
|
|
|
+
|
|
|
+function queryUnexaminedTask(){
|
|
|
+ initTableRowBtn();
|
|
|
+ var data = {
|
|
|
+ "start_time": $("#start_time").val(),
|
|
|
+ "end_time": $("#end_time").val(),
|
|
|
+ "checked_dept": $("#fsList").val(),
|
|
|
+ "check_status":cur_status
|
|
|
+ }
|
|
|
+ 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 colFunc = {width: 120, text: '操作', type: 'string', flex: true, field: 'id'};
|
|
|
+ if(cur_status==21){
|
|
|
+ if(hasRole(ROLE_JICHA)){
|
|
|
+ colFunc.oper = $.zui.store.get("task_table_btn_"+cur_status+"_"+ROLE_JICHA);
|
|
|
+ }else if(ROLE_JICHA_ADMIN){
|
|
|
+ colFunc.oper = $.zui.store.get("task_table_btn_"+cur_status+"_"+ROLE_JICHA_ADMIN);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ colFunc.oper = $.zui.store.get("task_table_btn_"+cur_status);
|
|
|
+ }
|
|
|
+ console.log(colFunc.oper);
|
|
|
+ cols.push(colFunc);
|
|
|
+ // var pager = {
|
|
|
+ // page_size:10
|
|
|
+ // }
|
|
|
+ $('#unexamined_datatable').mytable({'cols':cols,
|
|
|
+ 'url':"/task/getTaskList/",
|
|
|
+ 'param':data}
|
|
|
+ );
|
|
|
+}
|
|
|
+function showApplyDetail1(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){
|
|
|
+ layer.close(index);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ var param = {
|
|
|
+ 'id':id
|
|
|
+ };
|
|
|
+ post_common_service('/checkApply/getByTaskId', param, function(data) {
|
|
|
+ $('#apply_man').val(data.apply_man_name);
|
|
|
+ $('#apply_time').val(data.apply_time);
|
|
|
+ $('#apply_reason').val(data.apply_reason);
|
|
|
+ $('#apply_id').val(data.id);
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+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_name);
|
|
|
+ $('#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);
|
|
|
+}
|