invoice.js 23 KB

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