payments.js 11 KB

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