payments.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. $(function() {
  2. $('select[node-payMentsSelect]').change(function() {
  3. var payVal=$(this).val();
  4. if(payVal=="INCOME"){
  5. $('#INCOMEBox').show();
  6. $('#EXPENDITUREBox').hide();
  7. }else if(payVal=="EXPENDITURE"){
  8. $('#INCOMEBox').hide();
  9. $('#EXPENDITUREBox').show();
  10. }
  11. });
  12. $('select[node-accountTypeSelect]').change(function() {
  13. var payVal=$(this).val();
  14. if(payVal=="1"){
  15. $('div[node-accountMsg1]').show();
  16. $('div[node-accountMsg2]').hide();
  17. $('div[node-accountMsg4]').hide();
  18. $('div[node-accountMsg7]').hide();
  19. $('div[node-accountMsg9]').hide();
  20. }else if(payVal=="2"){
  21. $('div[node-accountMsg1]').hide();
  22. $('div[node-accountMsg2]').show();
  23. $('div[node-accountMsg4]').hide();
  24. $('div[node-accountMsg7]').hide();
  25. $('div[node-accountMsg9]').hide();
  26. }else if(payVal=="4"){
  27. $('div[node-accountMsg1]').hide();
  28. $('div[node-accountMsg2]').hide();
  29. $('div[node-accountMsg4]').show();
  30. $('div[node-accountMsg7]').hide();
  31. $('div[node-accountMsg9]').hide();
  32. }else if(payVal=="7"){
  33. $('div[node-accountMsg1]').hide();
  34. $('div[node-accountMsg2]').hide();
  35. $('div[node-accountMsg4]').hide();
  36. $('div[node-accountMsg7]').show();
  37. $('div[node-accountMsg9]').hide();
  38. }else if(payVal=="9"){
  39. $('div[node-accountMsg1]').hide();
  40. $('div[node-accountMsg2]').hide();
  41. $('div[node-accountMsg4]').hide();
  42. $('div[node-accountMsg7]').hide();
  43. $('div[node-accountMsg9]').show();
  44. }else{
  45. $('div[node-accountMsg1]').hide();
  46. $('div[node-accountMsg2]').hide();
  47. $('div[node-accountMsg4]').hide();
  48. $('div[node-accountMsg7]').hide();
  49. $('div[node-accountMsg9]').hide();
  50. }
  51. });
  52. $('select[node-expenditureTypeSelect]').change(function() {
  53. var payVal=$(this).val();
  54. if(payVal=="3"){
  55. $('div[node-expenditureMsg3]').show();
  56. $('div[node-expenditureMsg4]').hide();
  57. $('div[node-expenditureMsg6]').hide();
  58. }else if(payVal=="4"){
  59. $('div[node-expenditureMsg3]').hide();
  60. $('div[node-expenditureMsg4]').show();
  61. $('div[node-expenditureMsg6]').hide();
  62. }else if(payVal=="6"){
  63. $('div[node-expenditureMsg3]').hide();
  64. $('div[node-expenditureMsg4]').hide();
  65. $('div[node-expenditureMsg6]').show();
  66. }else{
  67. $('div[node-expenditureMsg3]').hide();
  68. $('div[node-expenditureMsg4]').hide();
  69. $('div[node-expenditureMsg6]').hide();
  70. }
  71. });
  72. $('select[node-accountTypeSearch]').change(function() {
  73. $("#submitType").val(1);
  74. $('#iaa').submit();
  75. });
  76. $('select[node-expenditureTypeSearch]').change(function() {
  77. $("#submitType").val(2);
  78. $('#iaa').submit();
  79. });
  80. $('select[select-wasteBook]').change(function() {
  81. $('#ira').submit();
  82. });
  83. $('a[node-income=detail]').click(function() {
  84. var key=$(this).attr("data-isKey");
  85. $('div[node-accountMsg1]').hide();
  86. $('div[node-accountMsg2]').hide();
  87. $('div[node-accountMsg4]').hide();
  88. $('div[node-accountMsg7]').hide();
  89. var url = "/ajaxGetPaymentsByAid";
  90. $.ajax({
  91. url : url,
  92. type : "post",
  93. cache : false,
  94. dataType : "json",
  95. data : {
  96. serial : key,
  97. },
  98. global : true,
  99. success : function(data) {
  100. if (data.status == 1) {
  101. $("#accountTypeEdi").find("option[value='"+data.detail.accountType+"']").attr("selected",true);
  102. $('div[node-accountMsg'+data.detail.accountType+']').show();
  103. $("input[name=accountMsg"+data.detail.accountType+"][value="+data.detail.accountMsg+"]").attr("checked",true);
  104. $("#receivedBank").find("option[value='"+data.detail.receivedBank+"']").attr("selected",true);
  105. $("#receivedPrice").val(data.detail.receivedPrice);
  106. $("#receivedMsg").val(data.detail.receivedMsg);
  107. $("#receivedDate").val(data.detail.receivedDate);
  108. $("#aidKeyIncome").val(data.detail.aidKey);
  109. } else
  110. $("div[loading-msg='true']").html("illegal request");
  111. },
  112. error : function(err) {
  113. $("div[loading-msg='true']").html("");
  114. $("#nr").html('');
  115. }
  116. });
  117. });
  118. $('a[node-EXPENDITURE=detail]').click(function() {
  119. var key=$(this).attr("data-isKey");
  120. $('div[node-expenditureMsg3]').hide();
  121. var url = "/ajaxGetPaymentsByAid";
  122. $.ajax({
  123. url : url,
  124. type : "post",
  125. cache : false,
  126. dataType : "json",
  127. data : {
  128. serial : key,
  129. },
  130. global : true,
  131. success : function(data) {
  132. if (data.status == 1) {
  133. $("#expenditureTypeEdi").find("option[value='"+data.detail.expenditureType+"']").attr("selected",true);
  134. $('div[node-expenditureMsg'+data.detail.expenditureType+']').show();
  135. $("input[name=expenditureMsg"+data.detail.expenditureType+"][value="+data.detail.expenditureMsg+"]").attr("checked",true);
  136. $("#expenditureBank").find("option[value='"+data.detail.expenditureBank+"']").attr("selected",true);
  137. $("#expenditurePrice").val(data.detail.expenditurePrice);
  138. $("#aidKeyExpenditure").val(data.detail.aidKey);
  139. } else
  140. $("div[loading-msg='true']").html("illegal request");
  141. },
  142. error : function(err) {
  143. $("div[loading-msg='true']").html("");
  144. $("#nr").html('');
  145. }
  146. });
  147. });
  148. $('a[del-income=detail]').click(function() {
  149. var key=$(this).attr("data-isKey");
  150. $("#aidKeyDel").val(key);
  151. });
  152. $('a[node-pay=waste]').click(function() {
  153. var key=$(this).attr("data-key");
  154. var url = "/ajaxGetPaymentsByAid";
  155. $.ajax({
  156. url : url,
  157. type : "post",
  158. cache : false,
  159. dataType : "json",
  160. data : {
  161. serial : key,
  162. },
  163. global : true,
  164. success : function(data) {
  165. if (data.status == 1) {
  166. $("#WI-wasteStaff").html(data.detail.staffDetail.username+'-'+data.detail.staffDetail.category);
  167. $("#WI-bookSerial").html(data.detail.bookSerial);
  168. $("#WI-expenditureMsg").html(data.detail.expenditureTypeMsg);
  169. $("#WI-expenditurePrice").html(data.detail.expenditurePrice);
  170. $("#WI-expenditureBank").html(data.detail.expenditureBank);
  171. $("#WI-expenditureDate").html(data.detail.expenditureDate);
  172. $("#WI-remarks").html(data.detail.remarks);
  173. } else
  174. $("div[loading-msg='true']").html("illegal request");
  175. },
  176. error : function(err) {
  177. $("div[loading-msg='true']").html("");
  178. }
  179. });
  180. });
  181. $('a[node-income=waste]').click(function() {
  182. var key=$(this).attr("data-key");
  183. var url = "/ajaxGetPaymentsByAid";
  184. $.ajax({
  185. url : url,
  186. type : "post",
  187. cache : false,
  188. dataType : "json",
  189. data : {
  190. serial : key,
  191. },
  192. global : true,
  193. success : function(data) {
  194. if (data.status == 1) {
  195. $("#IN-wasteStaff").html(data.detail.staffDetail.username+'-'+data.detail.staffDetail.category);
  196. $("#IN-bookSerial").html(data.detail.bookSerial);
  197. $("#IN-expenditureMsg").html(data.detail.incomeTypeMsg);
  198. $("#IN-expenditurePrice").html(data.detail.receivedPrice);
  199. $("#IN-expenditureBank").html(data.detail.receivedBank);
  200. $("#IN-expenditureDate").html(data.detail.receivedDate);
  201. $("#IN-remarks").html(data.detail.remarks);
  202. } else
  203. $("div[loading-msg='true']").html("illegal request");
  204. },
  205. error : function(err) {
  206. $("div[loading-msg='true']").html("");
  207. }
  208. });
  209. });
  210. $('a[node-ir=waste]').click(function() {
  211. var key=$(this).attr("data-key");
  212. var url = "/ajaxGetWasteinvoiceReceivables";
  213. $.ajax({
  214. url : url,
  215. type : "post",
  216. cache : false,
  217. dataType : "json",
  218. data : {
  219. serial : key,
  220. },
  221. global : true,
  222. success : function(data) {
  223. if (data.status == 1) {
  224. $("#IR-wasteStaff").html(data.detail.inputStaff);
  225. $("#IR-bookSerial").html(data.detail.receivablesSerial);
  226. $("#IR-expenditureMsg").html(data.detail.receivablesMessage);
  227. $("#IR-expenditurePrice").html(data.detail.OriginalPrice);
  228. $("#IR-expenditureBank").html(data.detail.receivablesBank);
  229. $("#IR-expenditureDate").html(data.detail.receivablesDate);
  230. } else
  231. $("div[loading-msg='true']").html("illegal request");
  232. },
  233. error : function(err) {
  234. $("div[loading-msg='true']").html("");
  235. }
  236. });
  237. });
  238. $('a[node-i=waste]').click(function() {
  239. var key=$(this).attr("data-key");
  240. var url = "/ajaxGetWasteInvoice";
  241. $.ajax({
  242. url : url,
  243. type : "post",
  244. cache : false,
  245. dataType : "json",
  246. data : {
  247. serial : key,
  248. },
  249. global : true,
  250. success : function(data) {
  251. if (data.status == 1) {
  252. $("#IR-wasteStaff").html(data.detail.userName);
  253. $("#IR-bookSerial").html(data.detail.invoiceNo);
  254. $("#IR-expenditureMsg").html(data.detail.invoiceElement);
  255. $("#IR-expenditurePrice").html(data.detail.invoicePrice);
  256. $("#IR-expenditureBank").html(data.detail.receivablesBank);
  257. $("#IR-expenditureDate").html(data.detail.bindTime);
  258. } else
  259. $("div[loading-msg='true']").html("illegal request");
  260. },
  261. error : function(err) {
  262. $("div[loading-msg='true']").html("");
  263. }
  264. });
  265. });
  266. $('a[node-ir11=waste]').click(function() {
  267. var key=$(this).attr("data-key");
  268. var url = "/ajaxGetWasteinvoiceReceivables";
  269. $.ajax({
  270. url : url,
  271. type : "post",
  272. cache : false,
  273. dataType : "json",
  274. data : {
  275. serial : key,
  276. },
  277. global : true,
  278. success : function(data) {
  279. if (data.status == 1) {
  280. $("#IR11-wasteStaff").html(data.detail.inputStaff);
  281. $("#IR11-bookSerial").html(data.detail.receivablesSerial);
  282. $("#IR11-expenditureMsg").html(data.detail.receivablesMessage);
  283. $("#IR11-expenditurePrice").html(data.detail.refundPrice);
  284. $("#IR11-expenditureBank").html(data.detail.receivablesBank);
  285. $("#IR11-expenditureDate").html(data.detail.receivablesDate);
  286. } else
  287. $("div[loading-msg='true']").html("illegal request");
  288. },
  289. error : function(err) {
  290. $("div[loading-msg='true']").html("");
  291. }
  292. });
  293. });
  294. $('a[node-receipt=waste]').click(function() {
  295. var key=$(this).attr("data-key");
  296. var accountTypeKey=$(this).attr("data-accountTypeKey");
  297. var url = "/ajaxGetWasteReceipt";
  298. $("#wasteReceipt").html('');
  299. $.ajax({
  300. url : url,
  301. type : "post",
  302. cache : false,
  303. dataType : "json",
  304. data : {
  305. serial : key,
  306. accountTypeKey:accountTypeKey
  307. },
  308. global : true,
  309. success : function(data) {
  310. if (data.status == 1) {
  311. $("#wasteReceipt").html(data.html);
  312. } else
  313. $("div[loading-msg='true']").html("illegal request");
  314. },
  315. error : function(err) {
  316. $("div[loading-msg='true']").html("");
  317. }
  318. });
  319. });
  320. })