admin.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. function CLEARTUIL(){
  2. $('input[name="staff[]"]:checked').each(function(){
  3. $(this).removeAttr("disabled");
  4. $(this).attr('checked',false);
  5. });
  6. $("#AUTDO").html('');
  7. $('#uidlist').val('');
  8. }
  9. function changeStaff(staff,rid,sid){
  10. $("#oldStaff").val(sid+'_'+staff);
  11. $("#rid").val(rid);
  12. var url='/ajaxRoleStaff';
  13. $.ajax({
  14. url:url,
  15. type: "post",
  16. cache: false,
  17. dataType: "json",
  18. data: {
  19. name:staff
  20. },
  21. global: true,
  22. success: function(data){
  23. $("#roleStaff").html(data['html']);
  24. },
  25. error:function(err){
  26. // document.getElementById('i_commont').innerHTML = err.responseText;
  27. }
  28. });
  29. }
  30. function email(elid){
  31. $('.mailDetail').hide();
  32. $('.mailAddressee').hide();
  33. //$('.send').hide();
  34. $("#html_"+elid).show();
  35. $("#client_"+elid).show();
  36. //$("#send_"+elid).show();
  37. }
  38. function tabC(a,b){
  39. $('#tab'+a).show();
  40. $('#tab'+b).hide();
  41. }
  42. $(function() {
  43. $("select[node='category']").change(function(){
  44. var cidKey=$(this).val();
  45. var categoryStaff = JSON.stringify(invoiceStaff);
  46. categoryStaff=JSON.parse(categoryStaff);
  47. var html='';
  48. for (var i=0;i<categoryStaff[cidKey].length;i++){
  49. html+='<option value="'+categoryStaff[cidKey][i][0]+'" >'+categoryStaff[cidKey][i][1]+'</option>';
  50. }
  51. $("select[node-category='staff']").html(html);
  52. });
  53. $("a[node-iacd]").click(function(){
  54. var cidKey=$(this).attr('data-cidKey');
  55. $("#cidKey").val(cidKey);
  56. $("select[node='category']").val(cidKey);
  57. var categoryStaff = JSON.stringify(invoiceStaff);
  58. categoryStaff=JSON.parse(categoryStaff);
  59. var html='';
  60. for (var i=0;i<categoryStaff[cidKey].length;i++){
  61. html+='<option value="'+categoryStaff[cidKey][i][0]+'" >'+categoryStaff[cidKey][i][1]+'</option>';
  62. }
  63. $("select[node-category='staff']").html(html);
  64. });
  65. $("a[id^='execute_']").click(function(){
  66. var mold=$(this).attr('data');
  67. $("#mold").val(mold);
  68. });
  69. $("a[id^='invoiceManage_']").click(function(){
  70. var mold=$(this).attr('data');
  71. $("#mold").val(mold);
  72. });
  73. $("input[id^='verify_']").click(function(){
  74. var uid=$(this).val();
  75. var uname=$(this).attr('data');
  76. var ischeck=$(this).attr('checked');
  77. if(ischeck==undefined){
  78. alert('请清空重新设置审批流程');
  79. return ;
  80. }else{
  81. $(this).attr("disabled","disabled");
  82. }
  83. var chk_value =[];
  84. $('input[name="staff[]"]:checked').each(function(){
  85. chk_value.push($(this).val());
  86. });
  87. if(chk_value.length==1){
  88. $("#AUTDO").html(uname);
  89. $('#uidlist').val(uid);
  90. }else{
  91. var html2=$("#AUTDO").html();
  92. $("#AUTDO").html(html2+'->'+uname);
  93. var uil=$('#uidlist').val();
  94. $('#uidlist').val(uil+','+uid);
  95. }
  96. return ;
  97. });
  98. $("#natureNULL").click(function(){
  99. if($("#natureNULL").attr("checked")=='checked'){
  100. $("#natureNULL").val('NULL');
  101. $("input[name='nature[]']").attr("disabled",true);
  102. }else{
  103. $("#natureNULL").val('');
  104. $("input[name='nature[]']").attr("disabled",false);
  105. }
  106. });
  107. $("p[id^='send_']").click(function(){
  108. $(this).html('已发送');
  109. });
  110. $("input[id^='title']").keyup(function(){
  111. $("span[name='titleHtml']").html($(this).val());
  112. });
  113. $("input[id^='inlineradio1']").click(function(){
  114. $("#emailTemplate1").show();
  115. $("#emailTemplate2").hide();
  116. $("#emailTemplate3").hide();
  117. });
  118. $("input[id^='inlineradio2']").click(function(){
  119. $("#emailTemplate1").hide();
  120. $("#emailTemplate2").show();
  121. $("#emailTemplate3").hide();
  122. });
  123. $("input[id^='inlineradio3']").click(function(){
  124. $("#emailTemplate1").hide();
  125. $("#emailTemplate2").hide();
  126. $("#emailTemplate3").show();
  127. });
  128. $("textarea[id^='content']").keyup(function(){
  129. $("p[name='contentHtml']").html($(this).val());
  130. });
  131. $("textarea[id^='content']").charCount({
  132. allowed: 59,
  133. warning: 10,
  134. counterText: '剩余为'
  135. });
  136. })