payments.js 10 KB

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