invoice.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. $(function() {
  2. $('a[node-express="untread"]').click(function() {
  3. $('td[node-express="msg"]').html($(this).attr('title'));
  4. });
  5. $("input[name='untreadPost']").click(function() {
  6. $("table[post-box='ture']").hide();
  7. });
  8. $("input[node-untread='post']").click(function() {
  9. $("table[post-box='ture']").show();
  10. });
  11. $("a[node-approval^='approval']").click(function() {
  12. $("input[name='status']").val($(this).attr("diss-data"));
  13. $("form[name='invoiceApproval']").submit();
  14. });
  15. $("a[node-invoice='droppedInvoice']").click(function() {
  16. $("input[name='droppedIidKey']").val($(this).attr("diss-data"));
  17. });
  18. $("a[node-invoice='untreadInvoice']").click(function() {
  19. $("input[name='untreadIidKey']").val($(this).attr("diss-data"));
  20. });
  21. $("a[node-post='express']").click(function() {
  22. var postData = $(this).attr("post-data");
  23. $("input[name='iidKey']").val(postData);
  24. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  25. var url = "/ajaxGetInvoicePostDetail";
  26. $.ajax({
  27. url : url,
  28. type : "post",
  29. cache : false,
  30. dataType : "json",
  31. data : {
  32. iidKey : postData
  33. },
  34. global : true,
  35. success : function(data) {
  36. if (data.status == 1) {
  37. $("td[recipients-data='true']").html(data.invoiceDetail.recipients);
  38. $("td[recipientsPhone-data='true']").html(data.invoiceDetail.recipientsPhone);
  39. $("td[recipientsAddress-data='true']").html(data.invoiceDetail.recipientsAddress);
  40. $("td[mailItems-data='true']").html(data.invoiceDetail.mailItems);
  41. $("div[loading-msg='true']").html("");
  42. } else
  43. $("div[loading-msg='true']").html("illegal request");
  44. },
  45. error : function(err) {
  46. }
  47. });
  48. });
  49. $("a[node-post='express-msg']").click(function() {
  50. var postData = $(this).attr("post-data");
  51. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  52. var url = "/ajaxGetInvoicePostDetail";
  53. $.ajax({
  54. url : url,
  55. type : "post",
  56. cache : false,
  57. dataType : "json",
  58. data : {
  59. iidKey : postData
  60. },
  61. global : true,
  62. success : function(data) {
  63. if (data.status == 1) {
  64. $("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
  65. $("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
  66. $("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
  67. $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  68. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  69. $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
  70. $("td[expressNumber-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='http://www.kuaidi100.com/chaxun?com="+data.invoiceDetail.expressCom+"&nu="+data.invoiceDetail.expressNumber+"'>点击查询快递信息</a>");
  71. $("div[loading-msg='express-msg']").html("");
  72. } else
  73. $("div[loading-msg='express-msg']").html("illegal request");
  74. },
  75. error : function(err) {
  76. }
  77. });
  78. });
  79. $("select[name='receivablesCategory']").click(function() {
  80. var cid = $("select[name='receivablesCategory'] option:selected").attr("post-data");
  81. var url = "/ajaxGetStaffByCategory";
  82. $.ajax({
  83. url : url,
  84. type : "post",
  85. cache : false,
  86. dataType : "json",
  87. data : {
  88. cid : cid
  89. },
  90. global : true,
  91. success : function(data) {
  92. if (data.status == 1) {
  93. $("select[name='receivablesStaff']").html(data.html);
  94. }
  95. //else
  96. // $("div[loading-msg='true']").html("illegal request");
  97. },
  98. error : function(err) {
  99. }
  100. });
  101. });
  102. $('a[node-receivables="true"]').click(function() {
  103. var postData = $(this).attr("data-key");
  104. var url = "/ajaxGetInvoiceReceivables";
  105. $.ajax({
  106. url : url,
  107. type : "post",
  108. cache : false,
  109. dataType : "json",
  110. data : {
  111. key : postData
  112. },
  113. global : true,
  114. success : function(data) {
  115. if (data.status == 1) {
  116. $("input[name='key']").val(postData);
  117. $("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
  118. $("td[node-inputStaff]").html(data.detail.inputStaff+"&nbsp;"+data.detail.date);
  119. $("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
  120. $("td[node-message]").html(data.detail.receivablesMessage);
  121. $("td[node-bank]").html(data.detail.receivablesBank);
  122. $("td[node-date]").html(data.detail.receivablesDate);
  123. }
  124. },
  125. error : function(err) {
  126. }
  127. });
  128. });
  129. $('a[node-recording="true"]').click(function() {
  130. var postData = $(this).attr("data-key");
  131. var url = "/ajaxGetInvoiceByStaff";
  132. $.ajax({
  133. url : url,
  134. type : "post",
  135. cache : false,
  136. dataType : "json",
  137. data : {
  138. key : postData
  139. },
  140. global : true,
  141. success : function(data) {
  142. // if (data.status == 1) {
  143. // $("input[name='key']").val(postData);
  144. //
  145. // $("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
  146. // $("td[node-inputStaff]").html(data.detail.inputStaff+"&nbsp;"+data.detail.date);
  147. // $("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
  148. // $("td[node-message]").html(data.detail.receivablesMessage);
  149. // $("td[node-bank]").html(data.detail.receivablesBank);
  150. // $("td[node-date]").html(data.detail.receivablesDate);
  151. // }
  152. //else
  153. // $("div[loading-msg='true']").html("illegal request");
  154. },
  155. error : function(err) {
  156. }
  157. });
  158. });
  159. })