invoice.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823
  1. var notify = null;
  2. var isNotifyShowing = false;
  3. var isError = false;
  4. $(function() {
  5. Notification.requestPermission(function(status) {});
  6. // 轮询查找是否有未处理的审批
  7. var permission = Notification.permission;
  8. if (permission === 'granted') {
  9. var interval = setInterval(checkNotify, 90000);//
  10. if (isError) {
  11. clearInterval(interval);
  12. }
  13. }
  14. });
  15. /**
  16. * 获取未审批数量
  17. */
  18. function checkNotify() {
  19. $.ajax({
  20. url: '/ajaxInvoicePushNotice',
  21. type: 'get',
  22. data: '',
  23. dataType: 'json',
  24. error: function() {
  25. console.log('数据错误');
  26. isError = true;
  27. },
  28. success: function(response) {
  29. var isNotice = response.isNotice;
  30. if (isNotice && !isNotifyShowing) {
  31. notify = new Notification("你有发票需要审批", {
  32. // icon: '/global/img/wen.png111',
  33. body: '点击本消息可跳转至审批页',
  34. silent: true
  35. });
  36. notify.onclick = function() {
  37. notify.close();
  38. window.location.href = '/invoiceApproval';
  39. };
  40. notify.onshow = function () {
  41. isNotifyShowing = true;
  42. };
  43. notify.onclose = function () {
  44. isNotifyShowing = false;
  45. };
  46. }
  47. }
  48. });
  49. }
  50. //
  51. function receiptYear(){
  52. var form = $('#up');
  53. $('#year').val($('#Y').val());
  54. form.submit();
  55. }
  56. function sures()
  57. {
  58. if(confirm('请确认核销该发票,核销后不可更改!'))
  59. return true;
  60. else
  61. return false;
  62. }
  63. $(function() {
  64. $('select[node-itSChange]').change(function() {
  65. var itsStatus=$(this).val();
  66. var action = $('#its').attr("action");
  67. action=encodeURI(action+'?trainStatus='+itsStatus);
  68. $('#its').attr("action",action);
  69. $('#its').submit();
  70. });
  71. $('select[node-iryChange]').change(function() {
  72. var year=$(this).val();
  73. var month="All";
  74. var irmMebSea=$('input[data-irmMebSea]').val();
  75. var action = $('#iras').attr("action");
  76. action=encodeURI(action+'/'+year+'/'+month+"/"+irmMebSea);
  77. $('#iras').attr("action",action);
  78. $('#iras').submit();
  79. });
  80. $('select[node-irmChange]').change(function() {
  81. var month=$(this).val();
  82. var year=$('select[node-iryChange]').val();
  83. var irmMebSea=$('input[data-irmMebSea]').val();
  84. var action = $('#iras').attr("action");
  85. action=encodeURI(action+'/'+year+'/'+month+"/"+irmMebSea);
  86. $('#iras').attr("action",action);
  87. $('#iras').submit();
  88. });
  89. /**
  90. * 废弃方法
  91. $('button[node-irmMebSea]').click(function() {
  92. var month=$('select[node-irmChange]').val();
  93. var year=$('select[node-iryChange]').val();
  94. var irmMebSea=$('input[data-irmMebSea]').val();
  95. var action = $('#iras').attr("action");
  96. action=encodeURI(action+'/'+year+'/'+month+"/"+irmMebSea);
  97. $('#iras').attr("action",action);
  98. $('#iras').submit();
  99. });
  100. */
  101. $('input[refreshData=time]').click(function() {
  102. $('#iras').submit();
  103. });
  104. $('button[node-iramMebSea]').click(function() {
  105. var irmMebSea=$('input[data-irmMebSea]').val();
  106. var action = $('#ira').attr("action");
  107. action=encodeURI(action+"/"+irmMebSea);
  108. $('#ira').attr("action",action);
  109. $('#ira').submit();
  110. });
  111. $('a[node-express="untread"]').click(function() {
  112. $('td[node-express="msg"]').html($(this).attr('title'));
  113. });
  114. $("input[name='untreadPost']").click(function() {
  115. $("table[post-box='ture']").hide();
  116. });
  117. $("input[node-untread='post']").click(function() {
  118. //$("table[post-box='ture']").show();
  119. });
  120. $("a[node-approval^='approval']").click(function() {
  121. $("input[name='status']").val($(this).attr("diss-data"));
  122. $("form[name='invoiceApproval']").submit();
  123. });
  124. $("a[node-invoice='droppedInvoice']").click(function() {
  125. $("input[name='droppedIidKey']").val($(this).attr("diss-data"));
  126. });
  127. $("a[node-invoice='untreadInvoice']").click(function() {
  128. $("input[name='untreadIidKey']").val($(this).attr("diss-data"));
  129. });
  130. $('a[bind-receivables="true"]').click(function() {
  131. console.log('ddd');
  132. });
  133. $("button[invoice-search='title']").click(function() {
  134. var title=$("input[name='searchTitle']").val();
  135. if(title==''){
  136. alert('请填写开票单位');
  137. return '';
  138. }
  139. $("div[node-invoiceHtml='true']").html('');
  140. var url = "/ajaxGetInvoiceReceivablesByTitle";
  141. $.ajax({
  142. url : url,
  143. type : "post",
  144. cache : false,
  145. dataType : "json",
  146. data : {
  147. title : title
  148. },
  149. global : true,
  150. success : function(data) {
  151. if (data.status == 1) {
  152. $("div[node-invoiceHtml='true']").html(data.invoiceHtml);
  153. }
  154. },
  155. error : function(err) {
  156. }
  157. });
  158. });
  159. //
  160. $("a[bind-invoice='receivables']").click(function() {
  161. var key = $(this).attr("node-key");
  162. $("input[name='key']").val('');
  163. $("div[node-receivablesHtml='true']").html('');
  164. $("div[node-invoiceHtml='true']").html('');
  165. $("blockquote[node-search='invoice']").hide();
  166. var url = "/ajaxGetInvoiceReceivablesByIrid";
  167. $.ajax({
  168. url : url,
  169. type : "post",
  170. cache : false,
  171. dataType : "json",
  172. data : {
  173. irid : key
  174. },
  175. global : true,
  176. success : function(data) {
  177. if (data.status == 1) {
  178. $("div[node-receivablesHtml='true']").html(data.receivablesHtml);
  179. $("div[node-invoiceHtml='true']").html(data.invoiceHtml);
  180. $("input[name='key']").val(data.irkey);
  181. if(data.isInvoice)
  182. $("blockquote[node-search='invoice']").show();
  183. else
  184. $("blockquote[node-search='invoice']").hide();
  185. } else{
  186. $("input[name='key']").val('');
  187. $("div[node-receivablesHtml='true']").html('');
  188. $("div[node-invoiceHtml='true']").html('');
  189. $("blockquote[node-search='invoice']").hide();
  190. }
  191. },
  192. error : function(err) {
  193. }
  194. });
  195. });
  196. $("a[node-post='express']").click(function() {
  197. var postData = $(this).attr("post-data");
  198. $("input[name='iidKey']").val(postData);
  199. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  200. var url = "/ajaxGetInvoicePostDetail";
  201. $.ajax({
  202. url : url,
  203. type : "post",
  204. cache : false,
  205. dataType : "json",
  206. data : {
  207. iidKey : postData
  208. },
  209. global : true,
  210. success : function(data) {
  211. if (data.status == 1) {
  212. $("td[recipients-data='true']").html(data.invoiceDetail.recipients);
  213. $("td[recipientsPhone-data='true']").html(data.invoiceDetail.recipientsPhone);
  214. $("td[recipientsAddress-data='true']").html(data.invoiceDetail.recipientsAddress);
  215. $("td[mailItems-data='true']").html(data.invoiceDetail.mailItems);
  216. $("div[loading-msg='true']").html("");
  217. } else
  218. $("div[loading-msg='true']").html("illegal request");
  219. },
  220. error : function(err) {
  221. }
  222. });
  223. });
  224. $("a[node-post='express-msg']").click(function() {
  225. var postData = $(this).attr("post-data");
  226. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  227. var url = "/ajaxGetInvoicePostDetail";
  228. $.ajax({
  229. url : url,
  230. type : "post",
  231. cache : false,
  232. dataType : "json",
  233. data : {
  234. iidKey : postData
  235. },
  236. global : true,
  237. success : function(data) {
  238. if (data.status == 1) {
  239. $("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
  240. $("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
  241. $("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
  242. $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  243. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  244. $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
  245. $("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>");
  246. $("div[loading-msg='express-msg']").html("");
  247. } else
  248. $("div[loading-msg='express-msg']").html("illegal request");
  249. },
  250. error : function(err) {
  251. }
  252. });
  253. });
  254. $("a[node-post='expressActual-msg']").click(function() {
  255. var postData = $(this).attr("post-data");
  256. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  257. var url = "/ajaxGetInvoicePostDetail";
  258. $.ajax({
  259. url : url,
  260. type : "post",
  261. cache : false,
  262. dataType : "json",
  263. data : {
  264. iidKey : postData
  265. },
  266. global : true,
  267. success : function(data) {
  268. if (data.status == 1) {
  269. $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  270. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  271. $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany+"&nbsp;<a target='_blank' href='http://www.kuaidi100.com/chaxun?com="+data.invoiceDetail.expressCom+"&nu="+data.invoiceDetail.expressNumber+"'>点击查询快递信息</a>");
  272. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  273. // $("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
  274. // $("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
  275. // $("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
  276. // $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  277. // $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  278. // $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
  279. // $("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>");
  280. $("div[loading-msg='express-msg']").html("");
  281. } else
  282. $("div[loading-msg='express-msg']").html("illegal request");
  283. },
  284. error : function(err) {
  285. }
  286. });
  287. });
  288. $("select[name='receivablesCategory']").click(function() {
  289. var cid = $("select[name='receivablesCategory'] option:selected").attr("post-data");
  290. var url = "/ajaxGetStaffByCategory";
  291. $.ajax({
  292. url : url,
  293. type : "post",
  294. cache : false,
  295. dataType : "json",
  296. data : {
  297. cid : cid
  298. },
  299. global : true,
  300. success : function(data) {
  301. if (data.status == 1) {
  302. $("select[name='receivablesStaff']").html(data.html);
  303. }
  304. //else
  305. // $("div[loading-msg='true']").html("illegal request");
  306. },
  307. error : function(err) {
  308. }
  309. });
  310. });
  311. $('a[node-receivables="true"]').click(function() {
  312. var postData = $(this).attr("data-key");
  313. var url = "/ajaxGetInvoiceReceivables";
  314. $.ajax({
  315. url : url,
  316. type : "post",
  317. cache : false,
  318. dataType : "json",
  319. data : {
  320. key : postData
  321. },
  322. global : true,
  323. success : function(data) {
  324. if (data.status == 1) {
  325. $("input[name='key']").val(postData);
  326. $("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
  327. $("td[node-inputStaff]").html(data.detail.inputStaff+"&nbsp;"+data.detail.date);
  328. $("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
  329. $("td[node-message]").html(data.detail.receivablesMessage);
  330. $("td[node-bank]").html(data.detail.receivablesBank);
  331. $("td[node-date]").html(data.detail.receivablesDate);
  332. }
  333. },
  334. error : function(err) {
  335. }
  336. });
  337. });
  338. /**
  339. * 废弃
  340. $('a[node-recording="true"]').click(function() {
  341. var postData = $(this).attr("data-key");
  342. $("input[name='key']").val(postData);
  343. $("input[name='invoiceKey']").val("");
  344. $("p[node-msg='true']").hide();
  345. $("p[node-loading='true']").hide();
  346. $('tbody[data-invoice="myClaim"]').html("");
  347. var url = "/ajaxGetInvoiceByStaff";
  348. $.ajax({
  349. url : url,
  350. type : "post",
  351. cache : false,
  352. dataType : "json",
  353. data : {
  354. key : postData
  355. },
  356. global : true,
  357. success : function(data) {
  358. if (data.status == 1) {
  359. $('tbody[data-invoice="myClaim"]').html(data.html);
  360. }
  361. },
  362. error : function(err) {
  363. }
  364. });
  365. });
  366. */
  367. /**
  368. * 废弃
  369. $('a[node-receivalbles="bind"]').click(function() {
  370. var postData = $(this).attr("diss-data");
  371. $("input[name='key']").val(postData);
  372. $("input[name='invoiceKey']").val("");
  373. $("p[node-msg='true']").hide();
  374. $("p[node-msg='true2']").hide();
  375. $("p[node-loading='true']").hide();
  376. $('tbody[data-invoice="myReceivables"]').html("");
  377. var url = "/ajaxGetReceivalblesByStaff";
  378. $.ajax({
  379. url : url,
  380. type : "post",
  381. cache : false,
  382. dataType : "json",
  383. data : {
  384. key : postData
  385. },
  386. global : true,
  387. success : function(data) {
  388. if (data.status == 1) {
  389. $('tbody[data-invoice="myReceivables"]').html(data.html);
  390. $('tbody[box-enter="true"]').html(data.html2);
  391. if(data.priceStatus == 1){
  392. $('p[node-msg="true"]').html("收款金额超出开票金额 ¥"+data.price+"元,请谨慎操作。");
  393. $('p[node-msg="true"]').show();
  394. }else if(data.priceStatus == 2&& data.isReceivables != 0){
  395. $('p[node-msg="true"]').html("收款金额少于开票金额 ¥"+data.price+"元,请谨慎操作。");
  396. $('p[node-msg="true"]').show();
  397. }
  398. if(data.isReceivables == 0){
  399. $('p[node-msg="true2"]').html("该发票还没有入账,请先进行选择收款入账");
  400. $('p[node-msg="true2"]').show();
  401. }
  402. }
  403. },
  404. error : function(err) {
  405. }
  406. });
  407. });
  408. */
  409. $("a[node-invoiceReceivables='INFO']").click(function() {
  410. var postData = $(this).attr("data-isKey");
  411. var po='IRTC';
  412. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  413. var url = "/ajaxGetInvoiceInfoByType";
  414. $.ajax({
  415. url : url,
  416. type : "post",
  417. cache : false,
  418. dataType : "json",
  419. data : {
  420. serial : postData,
  421. type:po
  422. },
  423. global : true,
  424. success : function(data) {
  425. if (data.status == 1) {
  426. $("div[loading-msg='true']").html("");
  427. $("#inKey").val(data.iidKey);
  428. $("#irtc").html(data.html);
  429. $("input[name=receivablesPrice]").val(data.receivablesPrice);
  430. $("input[name=receivablesMessage]").val(data.receivablesMessage);
  431. $("input[name=receivablesDate]").val(data.receivablesDate);
  432. } else
  433. $("div[loading-msg='true']").html("illegal request");
  434. },
  435. error : function(err) {
  436. $("div[loading-msg='true']").html("");
  437. }
  438. });
  439. });
  440. $("a[node-invoiceLoss='INFO']").click(function() {
  441. var postData = $(this).attr("data-isKey");
  442. var po='IRTC';
  443. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  444. var url = "/ajaxGetInvoiceInfoByType";
  445. $.ajax({
  446. url : url,
  447. type : "post",
  448. cache : false,
  449. dataType : "json",
  450. data : {
  451. serial : postData,
  452. loss:true,
  453. type:po
  454. },
  455. global : true,
  456. success : function(data) {
  457. if (data.status == 1) {
  458. $("div[loading-msg='true']").html("");
  459. $("#inKey").val(data.iidKey);
  460. $("#irtc").html(data.html);
  461. $("input[name=receivablesPrice]").val(data.receivablesPrice);
  462. $("input[name=receivablesMessage]").val(data.receivablesMessage);
  463. $("input[name=receivablesDate]").val(data.receivablesDate);
  464. } else
  465. $("div[loading-msg='true']").html("illegal request");
  466. },
  467. error : function(err) {
  468. $("div[loading-msg='true']").html("");
  469. }
  470. });
  471. });
  472. $("a[node-invoice='INFO']").click(function() {
  473. var postData = $(this).attr("data-isKey");
  474. var type =$(this).attr("data-type");
  475. var po='INVOICE';
  476. if(type=='receivables')
  477. po='RECEIVABLES';
  478. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  479. var url = "/ajaxGetInvoiceInfoByType";
  480. $.ajax({
  481. url : url,
  482. type : "post",
  483. cache : false,
  484. dataType : "json",
  485. data : {
  486. serial : postData,
  487. type:po
  488. },
  489. global : true,
  490. success : function(data) {
  491. if (data.status == 1) {
  492. $("div[loading-msg='true']").html("");
  493. if(type=='receivables')
  494. $("#nr").html(data.html);
  495. else
  496. $("#nc").html(data.html);
  497. } else
  498. $("div[loading-msg='true']").html("illegal request");
  499. },
  500. error : function(err) {
  501. $("div[loading-msg='true']").html("");
  502. }
  503. });
  504. });
  505. $("a[node-alter]").click(function() {
  506. var postData = $(this).attr("data-isKey");
  507. //$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  508. var url = "/ajaxGetInvoiceReceivablesByStaff";
  509. $.ajax({
  510. url : url,
  511. type : "post",
  512. cache : false,
  513. dataType : "json",
  514. data : {
  515. postData : postData
  516. },
  517. global : true,
  518. success : function(data) {
  519. if (data.status == 1) {
  520. $("input[name='claimKey']").val(postData);
  521. $("select[html-category]").html(data.categoryHtml);
  522. $("select[html-staff]").html(data.staffHtml);
  523. } else
  524. $("div[loading-msg='categoryStaff']").html("illegal request");
  525. },
  526. error : function(err) {
  527. $("div[loading-msg='true']").html("");
  528. }
  529. });
  530. });
  531. $("a[node-unBundLing]").click(function() {
  532. var postData = $(this).attr("data-isKey");
  533. $("input[id='unBundKey']").val(postData);
  534. });
  535. $("a[node-irUpdate]").click(function() {
  536. var postData = $(this).attr("data-isKey");
  537. //$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  538. var url = "/ajaxGetInvoiceReceivablesByStaff";
  539. $.ajax({
  540. url : url,
  541. type : "post",
  542. cache : false,
  543. dataType : "json",
  544. data : {
  545. postData : postData
  546. },
  547. global : true,
  548. success : function(data) {
  549. if (data.status == 1) {
  550. $("input[name='receivablesPrice']").val(data.detail.receivablesPrice);
  551. $("input[name='receivablesMessage']").val(data.detail.receivablesMessage);
  552. $("input[name='receivablesDate']").val(data.detail.receivablesDate);
  553. $("select[html-rbank]").html(data.rbankHtml);
  554. $("input[id='claimuKey']").val(postData);
  555. $("select[html-rcategory]").html(data.categoryHtml);
  556. $("select[html-rstaff]").html(data.staffHtml);
  557. } else
  558. $("div[loading-msg='categoryStaff']").html("illegal request");
  559. },
  560. error : function(err) {
  561. $("div[loading-msg='true']").html("");
  562. }
  563. });
  564. });
  565. $("a[node-post='upEm']").click(function() {
  566. var postData = $(this).attr("post-data");
  567. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  568. var url = "/ajaxGetInvoicePostDetail";
  569. $.ajax({
  570. url : url,
  571. type : "post",
  572. cache : false,
  573. dataType : "json",
  574. data : {
  575. iidKey : postData
  576. },
  577. global : true,
  578. success : function(data) {
  579. if (data.status == 1) {
  580. $("input[name='iidKey']").val(postData);
  581. $("td[recipients-data='express-msgU']").html(data.invoiceDetail.recipients);
  582. $("td[recipientsPhone-data='express-msgU']").html(data.invoiceDetail.recipientsPhone);
  583. $("td[recipientsAddress-data='express-msgU']").html(data.invoiceDetail.recipientsAddress);
  584. $("td[mailItems-data='express-msgU']").html(data.invoiceDetail.mailItems);
  585. $("textarea[actualItems-data='express-msgU']").val(data.invoiceDetail.actualItems);
  586. $("select[name='express']").html(data.invoiceDetail.eaHtml);
  587. $("input[expressNumber-data='express-msgU']").val(data.invoiceDetail.expressNumber);
  588. $("div[loading-msg='express-msg']").html("");
  589. } else
  590. $("div[loading-msg='express-msg']").html("illegal request");
  591. },
  592. error : function(err) {
  593. }
  594. });
  595. });
  596. $("select[node-notification]").change(function(){
  597. var notificationType=$(this).attr('data');
  598. var notificationValue=$(this).val();
  599. var url="/ajaxSetNotificationConf";
  600. $.ajax({
  601. url:url,
  602. type:"post",
  603. cache:false,
  604. dataType:"json",
  605. data:{
  606. notificationType:notificationType,
  607. notificationValue:notificationValue
  608. },
  609. global:true,
  610. success:function(data){
  611. if(data.status!=1){
  612. $("#"+data.msgType+"Msg").addClass("colRed");
  613. $("#"+data.msgType+"Msg").html("设置失败").show(300).delay(3000).hide(300);
  614. }else{
  615. $("#"+data.msgType+"Msg").addClass("colGreen");
  616. $("#"+data.msgType+"Msg").html("设置成功").show(300).delay(3000).hide(300);
  617. }
  618. },
  619. error:function(err){
  620. }
  621. });
  622. });
  623. // $("a[node-iStore=del]").click(function() {
  624. // var iStoreKey = $(this).attr("data-key");
  625. // $("input[id=iStoreKey]").val(iStoreKey);
  626. // });
  627. $("a[node-store=batchDel]").click(function() {
  628. var id_array=new Array();
  629. $('input[name="isBox"]:checked').each(function(){
  630. id_array.push($(this).val());//向数组中添加元素
  631. });
  632. var idstr=id_array.join(',');//将数组元素连接起来以构建一个字符串
  633. $("input[id=batchStoreKey]").val(idstr);
  634. });
  635. $("a[node-store=batchMail]").click(function() {
  636. var id_array=new Array();
  637. $('input[name="isBox"]:checked').each(function(){
  638. id_array.push($(this).val());
  639. });
  640. var idstr=id_array.join(',');
  641. $("input[id=BatchMailStoreKey]").val(idstr);
  642. });
  643. $("a[node-store=batchApproval]").click(function() {
  644. var id_array=new Array();
  645. $('input[name="isBox"]:checked').each(function(){
  646. id_array.push($(this).val());
  647. });
  648. var idstr=id_array.join(',');
  649. $("input[id=appBatchStoreKey]").val(idstr);
  650. });
  651. $("a[node-training=del]").click(function() {
  652. var trainingKey = $(this).attr("data-key");
  653. $("input[id='trainingKey']").val(trainingKey);
  654. });
  655. })
  656. function invoiceStoreMail(Key){
  657. $("input[id=MailStoreKey]").val(Key);
  658. // var url="/ajaxGetMailItemByIstore";
  659. // $.ajax({
  660. // url:url,
  661. // type:"post",
  662. // cache:false,
  663. // dataType:"json",
  664. // data:{
  665. // storeKey:iStroreKey
  666. // },
  667. // global:true,
  668. // success:function(data){
  669. //
  670. // console.log(data);
  671. //
  672. // if(data!='null'){
  673. //
  674. // }
  675. //
  676. // if(data.status!=1){
  677. // $("#"+data.msgType+"Msg").addClass("colRed");
  678. // $("#"+data.msgType+"Msg").html("设置失败").show(300).delay(3000).hide(300);
  679. // }else{
  680. // $("#"+data.msgType+"Msg").addClass("colGreen");
  681. // $("#"+data.msgType+"Msg").html("设置成功").show(300).delay(3000).hide(300);
  682. // }
  683. // },
  684. // error:function(err){
  685. //
  686. // }
  687. // });
  688. }
  689. function invoiceStoreDel(iStoreKey){
  690. //var iStoreKey = $(this).attr("data-key");
  691. $("input[id=iStoreKey]").val(iStoreKey);
  692. }
  693. function invoiceStoreApproval(iStoreKey){
  694. $("input[id=appStoreKey]").val(iStoreKey);
  695. }