window.check_handle = function (ele) { var target = $(ele), args = queryToJson(target.attr('arg')); var office_tips = $('#office_tips'), v = $.trim(office_tips.val()); if (v == '') { // ui.error('请添加详细说明'); // return false; } if (target.attr('loading') == 'true') { return false; } target.attr('loading', 'true'); args.remark = v; senRequestHandle('/index.php?mod=shenpi&op=index&act=application_check', args, function () { target.attr('loading', 'false'); $('[node_id="' + args.id + '"]', approveBox).find('.office_status_8').replaceWith(tpl.checked('已核销')); ui.box.close(); }, function () { ui.box.close(); target.attr('loading', 'false'); }); };
window.agree_reject_handle = function (ele) { var target = $(ele), args = queryToJson(target.attr('arg')); var office_tips = $('#office_tips'), v = $.trim(office_tips.val()); if (v == '') { // ui.error('请添加详细说明'); // return false; } if (target.attr('loading') == 'true') { return false; } target.attr('loading', 'true'); args.remark = v; senRequestHandle('/index.php?mod=shenpi&op=index&act=application_approve', args, function (result) { target.attr('loading', 'false'); if (result.data == 1) { if (args.status == 2) { $('[node_id="' + args.id + '"]', approveBox).find('.office_status_8').replaceWith(tpl.approve('已通过')); } else { $('[node_id="' + args.id + '"]', approveBox).find('.office_status_8').replaceWith(tpl.rejected('已驳回')); } } else { $('[node_id="' + args.id + '"]', approveBox).find('.office_status_8').replaceWith(tpl.wait_approve('待审批')); } ui.box.close(); }, function () { ui.box.close(); target.attr('loading', 'false'); }); };
box.delegate('a[node_type="del_process"]', 'click', function () { var target = $(this), args = queryToJson(target.attr('node_args')); ui.confirm(target, '确定要删除吗', function () { senRequestHandle('/index.php?mod=shenpi&op=index&act=application_delete', args, function () { target.closest('.ioffice-item').remove(); }); }); });
create_menu_btn.delegate('a', 'click', function () { var target = $(this), data = target.attr('node_data'), template_id = queryToJson(data).template_id; var url = o.scheme + ':' + o.slash + o.host + '/' + o.path; //调用创建审批的方法 createForm.show(template_id); // window.history.pushState({ // title: target.attr('title') // }, '', url+ '?template_id=' + template_id); create_menu_btn.hide(); return false; });
office_process_drop.delegate('li', 'click', function () { var target = $(this), data = target.find('a').attr('node_data'), box = $('#show_office_list'); box.html(tpl.loading); $('#office_process').html(target.html()); typeClassify.find('span').eq(1).removeClass('ico-angle-up').addClass('ico-angle-down'); getHTML(queryToJson(data), function (data) { if (data.html[index]) { box.html(data.html[index]); } else { box.html(tpl.nodata); } }, '', function (args) { $('#export').attr('href','/index.php?mod=shenpi&op=index&act=application_indexOutput&' + jsonToQuery(args)); }); });