invoice.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  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. if(data.invoiceDetail.expressCom=="SF")
  246. $("td[expressNumber-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='http://www.sf-express.com/cn/sc/dynamic_function/waybill/#search/bill-number/'>点击查询快递信息</a>");
  247. else
  248. $("td[expressNumber-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='/invoiceExpress/"+data.invoiceDetail.expressCom+"/"+data.invoiceDetail.expressNumber+".html'>点击查询快递信息</a>");
  249. $("div[loading-msg='express-msg']").html("");
  250. } else
  251. $("div[loading-msg='express-msg']").html("illegal request");
  252. },
  253. error : function(err) {
  254. }
  255. });
  256. });
  257. $("a[node-post='expressActual-msg']").click(function() {
  258. var postData = $(this).attr("post-data");
  259. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  260. var url = "/ajaxGetInvoicePostDetail";
  261. $.ajax({
  262. url : url,
  263. type : "post",
  264. cache : false,
  265. dataType : "json",
  266. data : {
  267. iidKey : postData
  268. },
  269. global : true,
  270. success : function(data) {
  271. if (data.status == 1) {
  272. $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  273. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  274. if(data.invoiceDetail.expressCom=="SF")
  275. $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressNumber+"&nbsp;<a target='_blank' href='http://www.sf-express.com/cn/sc/dynamic_function/waybill/#search/bill-number/'>点击查询快递信息</a>");
  276. else
  277. $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany+"&nbsp;<a target='_blank' href='/invoiceExpress/"+data.invoiceDetail.expressCom+"/"+data.invoiceDetail.expressNumber+".html'>点击查询快递信息</a>");
  278. $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  279. // $("td[recipients-data='express-msg']").html(data.invoiceDetail.recipients);
  280. // $("td[recipientsPhone-data='express-msg']").html(data.invoiceDetail.recipientsPhone);
  281. // $("td[recipientsAddress-data='express-msg']").html(data.invoiceDetail.recipientsAddress);
  282. // $("td[mailItems-data='express-msg']").html(data.invoiceDetail.mailItems);
  283. // $("td[actualItems-data='express-msg']").html(data.invoiceDetail.actualItems);
  284. // $("td[expressCompany-data='express-msg']").html(data.invoiceDetail.expressCompany);
  285. // $("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>");
  286. $("div[loading-msg='express-msg']").html("");
  287. } else
  288. $("div[loading-msg='express-msg']").html("illegal request");
  289. },
  290. error : function(err) {
  291. }
  292. });
  293. });
  294. $("select[name='receivablesCategory']").click(function() {
  295. var cid = $("select[name='receivablesCategory'] option:selected").attr("post-data");
  296. var url = "/ajaxGetStaffByCategory";
  297. $.ajax({
  298. url : url,
  299. type : "post",
  300. cache : false,
  301. dataType : "json",
  302. data : {
  303. cid : cid
  304. },
  305. global : true,
  306. success : function(data) {
  307. if (data.status == 1) {
  308. $("select[name='receivablesStaff']").html(data.html);
  309. }
  310. //else
  311. // $("div[loading-msg='true']").html("illegal request");
  312. },
  313. error : function(err) {
  314. }
  315. });
  316. });
  317. $('a[node-receivables="true"]').click(function() {
  318. var postData = $(this).attr("data-key");
  319. var url = "/ajaxGetInvoiceReceivables";
  320. $.ajax({
  321. url : url,
  322. type : "post",
  323. cache : false,
  324. dataType : "json",
  325. data : {
  326. key : postData
  327. },
  328. global : true,
  329. success : function(data) {
  330. if (data.status == 1) {
  331. $("input[name='key']").val(postData);
  332. $("td[node-receivablesSerial]").html(data.detail.receivablesSerial);
  333. $("td[node-inputStaff]").html(data.detail.inputStaff+"&nbsp;"+data.detail.date);
  334. $("td[node-price]").html("<b>"+data.detail.receivablesPrice+"</b>");
  335. $("td[node-message]").html(data.detail.receivablesMessage);
  336. $("td[node-bank]").html(data.detail.receivablesBank);
  337. $("td[node-date]").html(data.detail.receivablesDate);
  338. }
  339. },
  340. error : function(err) {
  341. }
  342. });
  343. });
  344. /**
  345. * 废弃
  346. $('a[node-recording="true"]').click(function() {
  347. var postData = $(this).attr("data-key");
  348. $("input[name='key']").val(postData);
  349. $("input[name='invoiceKey']").val("");
  350. $("p[node-msg='true']").hide();
  351. $("p[node-loading='true']").hide();
  352. $('tbody[data-invoice="myClaim"]').html("");
  353. var url = "/ajaxGetInvoiceByStaff";
  354. $.ajax({
  355. url : url,
  356. type : "post",
  357. cache : false,
  358. dataType : "json",
  359. data : {
  360. key : postData
  361. },
  362. global : true,
  363. success : function(data) {
  364. if (data.status == 1) {
  365. $('tbody[data-invoice="myClaim"]').html(data.html);
  366. }
  367. },
  368. error : function(err) {
  369. }
  370. });
  371. });
  372. */
  373. /**
  374. * 废弃
  375. $('a[node-receivalbles="bind"]').click(function() {
  376. var postData = $(this).attr("diss-data");
  377. $("input[name='key']").val(postData);
  378. $("input[name='invoiceKey']").val("");
  379. $("p[node-msg='true']").hide();
  380. $("p[node-msg='true2']").hide();
  381. $("p[node-loading='true']").hide();
  382. $('tbody[data-invoice="myReceivables"]').html("");
  383. var url = "/ajaxGetReceivalblesByStaff";
  384. $.ajax({
  385. url : url,
  386. type : "post",
  387. cache : false,
  388. dataType : "json",
  389. data : {
  390. key : postData
  391. },
  392. global : true,
  393. success : function(data) {
  394. if (data.status == 1) {
  395. $('tbody[data-invoice="myReceivables"]').html(data.html);
  396. $('tbody[box-enter="true"]').html(data.html2);
  397. if(data.priceStatus == 1){
  398. $('p[node-msg="true"]').html("收款金额超出开票金额 ¥"+data.price+"元,请谨慎操作。");
  399. $('p[node-msg="true"]').show();
  400. }else if(data.priceStatus == 2&& data.isReceivables != 0){
  401. $('p[node-msg="true"]').html("收款金额少于开票金额 ¥"+data.price+"元,请谨慎操作。");
  402. $('p[node-msg="true"]').show();
  403. }
  404. if(data.isReceivables == 0){
  405. $('p[node-msg="true2"]').html("该发票还没有入账,请先进行选择收款入账");
  406. $('p[node-msg="true2"]').show();
  407. }
  408. }
  409. },
  410. error : function(err) {
  411. }
  412. });
  413. });
  414. */
  415. $("a[node-invoiceReceivables='INFO']").click(function() {
  416. var postData = $(this).attr("data-isKey");
  417. var po='IRTC';
  418. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  419. var url = "/ajaxGetInvoiceInfoByType";
  420. $.ajax({
  421. url : url,
  422. type : "post",
  423. cache : false,
  424. dataType : "json",
  425. data : {
  426. serial : postData,
  427. type:po
  428. },
  429. global : true,
  430. success : function(data) {
  431. if (data.status == 1) {
  432. $("div[loading-msg='true']").html("");
  433. $("#inKey").val(data.iidKey);
  434. $("#irtc").html(data.html);
  435. $("input[name=receivablesPrice]").val(data.receivablesPrice);
  436. $("input[name=receivablesMessage]").val(data.receivablesMessage);
  437. $("input[name=receivablesDate]").val(data.receivablesDate);
  438. } else
  439. $("div[loading-msg='true']").html("illegal request");
  440. },
  441. error : function(err) {
  442. $("div[loading-msg='true']").html("");
  443. }
  444. });
  445. });
  446. $("a[node-invoiceLoss='INFO']").click(function() {
  447. var postData = $(this).attr("data-isKey");
  448. var po='IRTC';
  449. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  450. var url = "/ajaxGetInvoiceInfoByType";
  451. $.ajax({
  452. url : url,
  453. type : "post",
  454. cache : false,
  455. dataType : "json",
  456. data : {
  457. serial : postData,
  458. loss:true,
  459. type:po
  460. },
  461. global : true,
  462. success : function(data) {
  463. if (data.status == 1) {
  464. $("div[loading-msg='true']").html("");
  465. $("#inKey").val(data.iidKey);
  466. $("#irtc").html(data.html);
  467. $("input[name=receivablesPrice]").val(data.receivablesPrice);
  468. $("input[name=receivablesMessage]").val(data.receivablesMessage);
  469. $("input[name=receivablesDate]").val(data.receivablesDate);
  470. } else
  471. $("div[loading-msg='true']").html("illegal request");
  472. },
  473. error : function(err) {
  474. $("div[loading-msg='true']").html("");
  475. }
  476. });
  477. });
  478. $("a[node-invoice='INFO']").click(function() {
  479. var postData = $(this).attr("data-isKey");
  480. var type =$(this).attr("data-type");
  481. var po='INVOICE';
  482. if(type=='receivables')
  483. po='RECEIVABLES';
  484. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  485. var url = "/ajaxGetInvoiceInfoByType";
  486. $.ajax({
  487. url : url,
  488. type : "post",
  489. cache : false,
  490. dataType : "json",
  491. data : {
  492. serial : postData,
  493. type:po
  494. },
  495. global : true,
  496. success : function(data) {
  497. if (data.status == 1) {
  498. $("div[loading-msg='true']").html("");
  499. if(type=='receivables')
  500. $("#nr").html(data.html);
  501. else
  502. $("#nc").html(data.html);
  503. } else
  504. $("div[loading-msg='true']").html("illegal request");
  505. },
  506. error : function(err) {
  507. $("div[loading-msg='true']").html("");
  508. }
  509. });
  510. });
  511. $("a[node-invoice=PRINT]").click(function() {
  512. var postData = $(this).attr("data-isKey");
  513. var type =$(this).attr("data-type");
  514. $("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  515. var url = "/ajaxGetInvoiceInfoByPrint";
  516. $.ajax({
  517. url : url,
  518. type : "post",
  519. cache : false,
  520. dataType : "json",
  521. data : {
  522. serial : postData
  523. },
  524. global : true,
  525. success : function(data) {
  526. if (data.status == 1) {
  527. $("div[loading-msg='true']").html("");
  528. $("#prIn").html(data.html);
  529. } else
  530. $("div[loading-msg='true']").html("illegal request");
  531. },
  532. error : function(err) {
  533. $("div[loading-msg='true']").html("");
  534. }
  535. });
  536. });
  537. $("a[node-alter]").click(function() {
  538. var postData = $(this).attr("data-isKey");
  539. //$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  540. var url = "/ajaxGetInvoiceReceivablesByStaff";
  541. $.ajax({
  542. url : url,
  543. type : "post",
  544. cache : false,
  545. dataType : "json",
  546. data : {
  547. postData : postData
  548. },
  549. global : true,
  550. success : function(data) {
  551. if (data.status == 1) {
  552. $("input[name='claimKey']").val(postData);
  553. $("select[html-category]").html(data.categoryHtml);
  554. $("select[html-staff]").html(data.staffHtml);
  555. } else
  556. $("div[loading-msg='categoryStaff']").html("illegal request");
  557. },
  558. error : function(err) {
  559. $("div[loading-msg='true']").html("");
  560. }
  561. });
  562. });
  563. $("a[node-unBundLing]").click(function() {
  564. var postData = $(this).attr("data-isKey");
  565. $("input[id='unBundKey']").val(postData);
  566. });
  567. $("a[node-irUpdate]").click(function() {
  568. var postData = $(this).attr("data-isKey");
  569. //$("div[loading-msg='true']").html("<img src='/global/img/loadIco.gif' />");
  570. var url = "/ajaxGetInvoiceReceivablesByStaff";
  571. $.ajax({
  572. url : url,
  573. type : "post",
  574. cache : false,
  575. dataType : "json",
  576. data : {
  577. postData : postData
  578. },
  579. global : true,
  580. success : function(data) {
  581. if (data.status == 1) {
  582. $("input[name='receivablesPrice']").val(data.detail.receivablesPrice);
  583. $("input[name='receivablesMessage']").val(data.detail.receivablesMessage);
  584. $("input[name='receivablesDate']").val(data.detail.receivablesDate);
  585. $("select[html-rbank]").html(data.rbankHtml);
  586. $("input[id='claimuKey']").val(postData);
  587. $("select[html-rcategory]").html(data.categoryHtml);
  588. $("select[html-rstaff]").html(data.staffHtml);
  589. } else
  590. $("div[loading-msg='categoryStaff']").html("illegal request");
  591. },
  592. error : function(err) {
  593. $("div[loading-msg='true']").html("");
  594. }
  595. });
  596. });
  597. $("a[node-post='upEm']").click(function() {
  598. var postData = $(this).attr("post-data");
  599. $("div[loading-msg='express-msg']").html("<img src='/global/img/loadIco.gif' />");
  600. var url = "/ajaxGetInvoicePostDetail";
  601. $.ajax({
  602. url : url,
  603. type : "post",
  604. cache : false,
  605. dataType : "json",
  606. data : {
  607. iidKey : postData
  608. },
  609. global : true,
  610. success : function(data) {
  611. if (data.status == 1) {
  612. $("input[name='iidKey']").val(postData);
  613. $("td[recipients-data='express-msgU']").html(data.invoiceDetail.recipients);
  614. $("td[recipientsPhone-data='express-msgU']").html(data.invoiceDetail.recipientsPhone);
  615. $("td[recipientsAddress-data='express-msgU']").html(data.invoiceDetail.recipientsAddress);
  616. $("td[mailItems-data='express-msgU']").html(data.invoiceDetail.mailItems);
  617. $("textarea[actualItems-data='express-msgU']").val(data.invoiceDetail.actualItems);
  618. $("select[name='express']").html(data.invoiceDetail.eaHtml);
  619. $("input[expressNumber-data='express-msgU']").val(data.invoiceDetail.expressNumber);
  620. $("div[loading-msg='express-msg']").html("");
  621. } else
  622. $("div[loading-msg='express-msg']").html("illegal request");
  623. },
  624. error : function(err) {
  625. }
  626. });
  627. });
  628. $("select[node-notification]").change(function(){
  629. var notificationType=$(this).attr('data');
  630. var notificationValue=$(this).val();
  631. var url="/ajaxSetNotificationConf";
  632. $.ajax({
  633. url:url,
  634. type:"post",
  635. cache:false,
  636. dataType:"json",
  637. data:{
  638. notificationType:notificationType,
  639. notificationValue:notificationValue
  640. },
  641. global:true,
  642. success:function(data){
  643. if(data.status!=1){
  644. $("#"+data.msgType+"Msg").addClass("colRed");
  645. $("#"+data.msgType+"Msg").html("设置失败").show(300).delay(3000).hide(300);
  646. }else{
  647. $("#"+data.msgType+"Msg").addClass("colGreen");
  648. $("#"+data.msgType+"Msg").html("设置成功").show(300).delay(3000).hide(300);
  649. }
  650. },
  651. error:function(err){
  652. }
  653. });
  654. });
  655. // $("a[node-iStore=del]").click(function() {
  656. // var iStoreKey = $(this).attr("data-key");
  657. // $("input[id=iStoreKey]").val(iStoreKey);
  658. // });
  659. $("a[node-store=batchDel]").click(function() {
  660. var id_array=new Array();
  661. $('input[name="isBox"]:checked').each(function(){
  662. id_array.push($(this).val());//向数组中添加元素
  663. });
  664. var idstr=id_array.join(',');//将数组元素连接起来以构建一个字符串
  665. $("input[id=batchStoreKey]").val(idstr);
  666. });
  667. $("a[node-store=batchMail]").click(function() {
  668. var id_array=new Array();
  669. $('input[name="isBox"]:checked').each(function(){
  670. id_array.push($(this).val());
  671. });
  672. var idstr=id_array.join(',');
  673. $("input[id=BatchMailStoreKey]").val(idstr);
  674. });
  675. $("a[node-store=batchApproval]").click(function() {
  676. var id_array=new Array();
  677. $('input[name="isBox"]:checked').each(function(){
  678. id_array.push($(this).val());
  679. });
  680. var idstr=id_array.join(',');
  681. $("input[id=appBatchStoreKey]").val(idstr);
  682. });
  683. $("a[node-training=del]").click(function() {
  684. var trainingKey = $(this).attr("data-key");
  685. $("input[id='trainingKey']").val(trainingKey);
  686. });
  687. })
  688. function invoiceStoreMail(Key){
  689. $("input[id=MailStoreKey]").val(Key);
  690. // var url="/ajaxGetMailItemByIstore";
  691. // $.ajax({
  692. // url:url,
  693. // type:"post",
  694. // cache:false,
  695. // dataType:"json",
  696. // data:{
  697. // storeKey:iStroreKey
  698. // },
  699. // global:true,
  700. // success:function(data){
  701. //
  702. // console.log(data);
  703. //
  704. // if(data!='null'){
  705. //
  706. // }
  707. //
  708. // if(data.status!=1){
  709. // $("#"+data.msgType+"Msg").addClass("colRed");
  710. // $("#"+data.msgType+"Msg").html("设置失败").show(300).delay(3000).hide(300);
  711. // }else{
  712. // $("#"+data.msgType+"Msg").addClass("colGreen");
  713. // $("#"+data.msgType+"Msg").html("设置成功").show(300).delay(3000).hide(300);
  714. // }
  715. // },
  716. // error:function(err){
  717. //
  718. // }
  719. // });
  720. }
  721. function invoiceStoreDel(iStoreKey){
  722. //var iStoreKey = $(this).attr("data-key");
  723. $("input[id=iStoreKey]").val(iStoreKey);
  724. }
  725. function invoiceStoreApproval(iStoreKey){
  726. $("input[id=appStoreKey]").val(iStoreKey);
  727. }