invoice.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. function receiptYear(){
  2. var form = $('#up');
  3. $('#year').val($('#Y').val());
  4. form.submit();
  5. }
  6. $(function() {
  7. $('a[node-express="untread"]').click(function() {
  8. $('td[node-express="msg"]').html($(this).attr('title'));
  9. });
  10. $("input[name='untreadPost']").click(function() {
  11. $("table[post-box='ture']").hide();
  12. });
  13. $("input[node-untread='post']").click(function() {
  14. $("table[post-box='ture']").show();
  15. });
  16. $("a[node-approval^='approval']").click(function() {
  17. $("input[name='status']").val($(this).attr("diss-data"));
  18. $("form[name='invoiceApproval']").submit();
  19. });
  20. $("a[node-invoice='droppedInvoice']").click(function() {
  21. $("input[name='droppedIidKey']").val($(this).attr("diss-data"));
  22. });
  23. $("a[node-invoice='untreadInvoice']").click(function() {
  24. $("input[name='untreadIidKey']").val($(this).attr("diss-data"));
  25. });
  26. $("a[node-post='express']").click(function() {
  27. var postData = $(this).attr("post-data");
  28. $("input[name='iidKey']").val(postData);
  29. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  30. var url = "/ajaxGetInvoicePostDetail";
  31. $.ajax({
  32. url : url,
  33. type : "post",
  34. cache : false,
  35. dataType : "json",
  36. data : {
  37. iidKey : postData
  38. },
  39. global : true,
  40. success : function(data) {
  41. if (data.status == 1) {
  42. $("td[recipients-data='true']").html(data.invoiceDetail.recipients);
  43. $("td[recipientsPhone-data='true']").html(data.invoiceDetail.recipientsPhone);
  44. $("td[recipientsAddress-data='true']").html(data.invoiceDetail.recipientsAddress);
  45. $("td[mailItems-data='true']").html(data.invoiceDetail.mailItems);
  46. $("div[loading-msg='true']").html("");
  47. } else
  48. $("div[loading-msg='true']").html("illegal request");
  49. },
  50. error : function(err) {
  51. }
  52. });
  53. });
  54. $("a[node-post='express-msg']").click(function() {
  55. var postData = $(this).attr("post-data");
  56. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  57. var url = "/ajaxGetInvoicePostDetail";
  58. $.ajax({
  59. url : url,
  60. type : "post",
  61. cache : false,
  62. dataType : "json",
  63. data : {
  64. iidKey : postData
  65. },
  66. global : true,
  67. success : function(data) {
  68. if (data.status == 1) {
  69. $("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
  70. $("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
  71. $("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
  72. $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  73. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  74. $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
  75. $("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>");
  76. $("div[loading-msg='express-msg']").html("");
  77. } else
  78. $("div[loading-msg='express-msg']").html("illegal request");
  79. },
  80. error : function(err) {
  81. }
  82. });
  83. });
  84. $("select[name='receivablesCategory']").click(function() {
  85. var cid = $("select[name='receivablesCategory'] option:selected").attr("post-data");
  86. var url = "/ajaxGetStaffByCategory";
  87. $.ajax({
  88. url : url,
  89. type : "post",
  90. cache : false,
  91. dataType : "json",
  92. data : {
  93. cid : cid
  94. },
  95. global : true,
  96. success : function(data) {
  97. if (data.status == 1) {
  98. $("select[name='receivablesStaff']").html(data.html);
  99. }
  100. //else
  101. // $("div[loading-msg='true']").html("illegal request");
  102. },
  103. error : function(err) {
  104. }
  105. });
  106. });
  107. $('a[node-receivables="true"]').click(function() {
  108. var postData = $(this).attr("data-key");
  109. var url = "/ajaxGetInvoiceReceivables";
  110. $.ajax({
  111. url : url,
  112. type : "post",
  113. cache : false,
  114. dataType : "json",
  115. data : {
  116. key : postData
  117. },
  118. global : true,
  119. success : function(data) {
  120. if (data.status == 1) {
  121. $("input[name='key']").val(postData);
  122. $("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
  123. $("td[node-inputStaff]").html(data.detail.inputStaff+"&nbsp;"+data.detail.date);
  124. $("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
  125. $("td[node-message]").html(data.detail.receivablesMessage);
  126. $("td[node-bank]").html(data.detail.receivablesBank);
  127. $("td[node-date]").html(data.detail.receivablesDate);
  128. }
  129. },
  130. error : function(err) {
  131. }
  132. });
  133. });
  134. $('a[node-recording="true"]').click(function() {
  135. var postData = $(this).attr("data-key");
  136. $("input[name='key']").val(postData);
  137. $("input[name='invoiceKey']").val("");
  138. $("p[node-msg='true']").hide();
  139. $("p[node-loading='true']").hide();
  140. $('tbody[data-invoice="myClaim"]').html("");
  141. var url = "/ajaxGetInvoiceByStaff";
  142. $.ajax({
  143. url : url,
  144. type : "post",
  145. cache : false,
  146. dataType : "json",
  147. data : {
  148. key : postData
  149. },
  150. global : true,
  151. success : function(data) {
  152. if (data.status == 1) {
  153. $('tbody[data-invoice="myClaim"]').html(data.html);
  154. }
  155. },
  156. error : function(err) {
  157. }
  158. });
  159. });
  160. $('a[node-receivalbles="bind"]').click(function() {
  161. var postData = $(this).attr("diss-data");
  162. $("input[name='key']").val(postData);
  163. $("input[name='invoiceKey']").val("");
  164. $("p[node-msg='true']").hide();
  165. $("p[node-loading='true']").hide();
  166. $('tbody[data-invoice="myReceivables"]').html("");
  167. var url = "/ajaxGetReceivalblesByStaff";
  168. $.ajax({
  169. url : url,
  170. type : "post",
  171. cache : false,
  172. dataType : "json",
  173. data : {
  174. key : postData
  175. },
  176. global : true,
  177. success : function(data) {
  178. if (data.status == 1) {
  179. $('tbody[data-invoice="myReceivables"]').html(data.html);
  180. $('tbody[box-enter="true"]').html(data.html2);
  181. if(data.priceStatus == 1){
  182. $('p[node-msg="true"]').html("收款金额超出开票金额 ¥"+data.price+"元,请谨慎操作。");
  183. $('p[node-msg="true"]').show();
  184. }
  185. }
  186. },
  187. error : function(err) {
  188. }
  189. });
  190. });
  191. $("a[node-invoice='INFO']").click(function() {
  192. var postData = $(this).attr("data-isKey");
  193. var type =$(this).attr("data-type");
  194. var po='INVOICE';
  195. if(type=='receivables')
  196. po='RECEIVABLES';
  197. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  198. var url = "/ajaxGetInvoiceInfoByType";
  199. $.ajax({
  200. url : url,
  201. type : "post",
  202. cache : false,
  203. dataType : "json",
  204. data : {
  205. serial : postData,
  206. type:po
  207. },
  208. global : true,
  209. success : function(data) {
  210. if (data.status == 1) {
  211. $("div[loading-msg='true']").html("");
  212. if(type=='receivables')
  213. $("#nr").html(data.html);
  214. else
  215. $("#nc").html(data.html);
  216. } else
  217. $("div[loading-msg='true']").html("illegal request");
  218. },
  219. error : function(err) {
  220. $("div[loading-msg='true']").html("");
  221. }
  222. });
  223. });
  224. })