invoice.js 23 KB

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