| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235 |
- var cur_page;
- function initApplyPage() {
- // 仅选择日期
- $.jeDate("#start_time", {
- isinitVal: true,
- format: 'YYYY/MM' // 分隔符可以任意定义,该例子表示只显示年月
- });
- $("#start_time").val(getCurrentRealTimeFormat());
- setSASelect("#fsList");
- var store_params = $.zui.store.get('store_param_' + current_url);
- var checked_dept = null;
- if (store_params) {
- checked_dept = store_params.checked_dept;
- // $("#start_time").val(store_params.end_time.substr(0, 7));
- $("#start_time").val(store_params.end_time.substr(0, 7));
- if(store_params.invalidFrom == -2){
- $("#check_zc").attr("checked", false);
- $("#check_ss").attr("checked", false);
- }else if(store_params.invalidFrom == 1){
- $("#check_zc").attr("checked", false);
- $("#check_ss").attr("checked", true);
- }else if(store_params.invalidFrom == 0){
- $("#check_zc").attr("checked", true);
- $("#check_ss").attr("checked", false);
- }else if(store_params.invalidFrom == -1){
- $("#check_zc").attr("checked", true);
- $("#check_ss").attr("checked", true);
- }
- console.log(store_params);
- var pager = $.zui.store.get("pager");
- console.log(pager);
- cur_page = pager.p_cur;
- } else {
- $("#start_time").val(getCurrentTimeFormat());
- }
- var page_params = $.zui.store.get("page_params");
- if (page_params && page_params.status) {
- cur_status = page_params.status;
- }
- if (cur_status == 21) {
- $("#agreePatchBtn").show();
- }
- $("#check_zc").attr("checked", true);
- $("#check_ss").attr("checked", true);
- queryUnexaminedTask();
- }
- //初始化表行按钮
- function initTableRowBtn() {
- $.zui.store.set("task_table_btn_21_" + ROLE_JICHA_ADMIN, [{ func: 'showCheck', text: '复查', icon_class: 'icon-eye-open' },
- { 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 t = getTimeByMonth($("#start_time").val());
- var check_ss = $("#check_ss").prop("checked");
- var check_zc = $("#check_zc").prop("checked");
- var data = {
- "start_time": getMomentTimeFormat(t.starttime),
- "end_time": getMomentTimeFormat(t.endtime),
- "checked_dept": $("#fsList").val(),
- "checked_person": $("#feePersonList").val(),
- "check_status": cur_status,
- "invalidFrom": (check_ss && check_zc) ? -1 : (check_ss ? 1 : (check_zc ? 0 : -2))
- };
- var hide = false;
- if (hasRole(ROLE_FWQ_ADMIN) || hasRole(ROLE_FWQ) || hasRole(ROLE_JICHA) || roleContains('FWQ')) {
- 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: 160, text: '考核部门', type: 'string', flex: true, sort: 'down', field: 'checked_dept_name' },
- { width: 80, text: '稽查人员', type: 'string', flex: true, hide: hide, 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);
- }
- cols.push(colFunc);
- var checkable = false;
- if (cur_status == 21 && hasRole(ROLE_JICHA_ADMIN)) {
- checkable = true;
- }
- $('#unexamined_datatable').mytable({
- 'cols': cols,
- 'checkable': checkable,
- 'url': "/f/task/getall/",
- 'param': data,
- 'pager': {
- 'p_cur': cur_page
- }
- });
- $.zui.store.set('store_param_' + current_url, data);
- }
- //进入稽查页面
- function showCheck(id) {
- $.checkTask = getItemByIdFromArr(id, $('#unexamined_datatable').mytable('getTableData'));
- if (typeof($.checkTask) != "undefined" && typeof($.checkTask.appeal) != "undefined") {
- $.checkTask.appeal = null;
- }
- //开始稽查
- no_return_common_service('/f/task/update', { "id": $.checkTask.id, "check_status": 21, "record_status": 1, "check_status_name": "复查" });
- changePage("/fwq/view/task/check.html");
- }
- 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
- };
- $('#apply_man').val("");
- $('#apply_time').val("");
- $('#apply_reason').val("");
- $('#apply_id').val("");
- post_common_service('/f/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
- };
- $('#apply_man').val("");
- $('#apply_time').val("");
- $('#apply_reason').val("");
- $('#apply_id').val("");
- post_common_service('/f/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, '/f/checkApply/agree', queryUnexaminedTask);
- }
- function refuseApply(taskId) {
- var param = {
- 'id': $('#apply_id').val(),
- 'task_id': taskId
- };
- addOrUpdateItem4Common(param, '/f/checkApply/refuse', queryUnexaminedTask);
- }
- function agreeApplyTaskPatch() {
- var check_ss = $("#check_ss").prop("checked");
- var check_zc = $("#check_zc").prop("checked");
- var t = getTimeByMonth($("#start_time").val());
- var param = {
- "start_time": new Date(t.starttime),
- "end_time": new Date(t.endtime),
- "checked_dept": $("#fsList").val(),
- "invalidFrom": (check_ss && check_zc) ? -1 : (check_ss ? 1 : (check_zc ? 0 : -2))
- // 'apply_ids': $('#unexamined_datatable').mytable('getTableCheckedIds')
- };
- con=confirm("确定全部无效?");
- if(con == true){
- addOrUpdateItem4Common(param, '/f/checkApply/agreePatch', queryUnexaminedTask);
- }
- }
|