invoice.js 23 KB

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