global.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. $(function(){
  2. $(document).on('click','.create-actions', function () {
  3. var buttons1 = [
  4. {
  5. text: '请假类型',
  6. label: true
  7. },
  8. {
  9. text: '事假',
  10. bold: true,
  11. onClick: function() {
  12. $('#holidaytypeshow').attr('placeholder','假期类型 [ 事假 ]');
  13. $('#holidaytypeshow').val('事假');
  14. $('#otherholiday').hide();
  15. $('#holidaytype').val(1);
  16. $('.tab').removeClass('active');
  17. $('.align-top').show();
  18. $('#holidayshow').hide();
  19. $('.haveholidaynum').hide();
  20. $('.tab').find('input').attr('disabled',true);
  21. $('.tab').find('textarea').attr('disabled',true);
  22. $('#tab1').addClass('active');
  23. $('#tab1').find('input').removeAttr('disabled');
  24. $('#tab1').find('textarea').removeAttr('disabled');
  25. $('.tabtitle').text('事假');
  26. $('#typenum').val(1);
  27. }
  28. },
  29. {
  30. text: '病假',
  31. onClick: function() {
  32. $('#holidaytypeshow').attr('placeholder','假期类型 [ 病假 ]');
  33. $('#holidaytypeshow').val('病假');
  34. $('#otherholiday').hide();
  35. $('#holidaytype').val(2);
  36. $('.tab').removeClass('active');
  37. $('.align-top').show();
  38. $('#holidayshow').hide();
  39. $('.haveholidaynum').hide();
  40. $('.tab').find('input').attr('disabled',true);
  41. $('.tab').find('textarea').attr('disabled',true);
  42. $('#tab1').addClass('active');
  43. $('#tab1').find('input').removeAttr('disabled');
  44. $('#tab1').find('textarea').removeAttr('disabled');
  45. $('.tabtitle').text('病假');
  46. $('#typenum').val(1);
  47. }
  48. },
  49. {
  50. text: '年假',
  51. onClick: function() {
  52. $('#holidaytypeshow').attr('placeholder','假期类型 [ 年假 ]');
  53. $('#holidaytypeshow').val('年假');
  54. $('#otherholiday').hide();
  55. $('#holidaytype').val(12);
  56. $('#holidayshow').hide();
  57. $('.tab').removeClass('active');
  58. //$('.haveholidaynum').show();
  59. $('.tab').find('input').attr('disabled',true);
  60. $('.tab').find('textarea').attr('disabled',true);
  61. $('#tab5').addClass('active');
  62. $('#tab5').find('input').removeAttr('disabled');
  63. //$('#tab5').find('textarea').removeAttr('disabled');
  64. //$('.tabtitle').text('年假');
  65. //$('.holidayname').text('年假');
  66. //$('#holidaynum').val('你的年假 '+$('#nianjia').val()+' 天');
  67. //$('.align-top').hide();
  68. //$('.align-top').find('textarea').attr('disabled',true);
  69. $('#typenum').val(1);
  70. if($('#nianjia').val() == 0){
  71. $('#holidayshow span').text('年假');
  72. $('#holidayshow').show();
  73. }
  74. }
  75. },
  76. {
  77. text: '加班(计假)',
  78. onClick: function() {
  79. $('#holidaytypeshow').attr('placeholder','假期类型 [ 加班(计假) ]');
  80. $('#holidaytypeshow').val('加班(计假)');
  81. $('#otherholiday').hide();
  82. $('#holidaytype').val(4);
  83. $('.tab').removeClass('active');
  84. $('.align-top').show();
  85. $('#holidayshow').hide();
  86. $('.haveholidaynum').hide();
  87. $('.tab').find('input').attr('disabled',true);
  88. $('.tab').find('textarea').attr('disabled',true);
  89. $('#tab1').addClass('active');
  90. $('#tab1').find('input').removeAttr('disabled');
  91. $('#tab1').find('textarea').removeAttr('disabled');
  92. $('.tabtitle').text('加班(计假)');
  93. $('#typenum').val(1);
  94. }
  95. },
  96. {
  97. text: '加班(计薪)',
  98. onClick: function() {
  99. $('#holidaytypeshow').attr('placeholder','假期类型 [ 加班(计薪) ]');
  100. $('#holidaytypeshow').val('加班(计薪)');
  101. $('#otherholiday').hide();
  102. $('#holidaytype').val(4);
  103. $('.tab').removeClass('active');
  104. $('.align-top').show();
  105. $('#holidayshow').hide();
  106. $('.haveholidaynum').hide();
  107. $('.tab').find('input').attr('disabled',true);
  108. $('.tab').find('textarea').attr('disabled',true);
  109. $('#tab1').addClass('active');
  110. $('#tab1').find('input').removeAttr('disabled');
  111. $('#tab1').find('textarea').removeAttr('disabled');
  112. $('.tabtitle').text('加班(计薪)');
  113. $('#typenum').val(1);
  114. }
  115. },
  116. {
  117. text: '补休',
  118. onClick: function() {
  119. $('#holidaytypeshow').attr('placeholder','假期类型 [ 补休 ]');
  120. $('#holidaytypeshow').val('补休');
  121. $('#otherholiday').hide();
  122. $('#holidaytype').val(10);
  123. $('.tab').removeClass('active');
  124. $('.align-top').show();
  125. $('#holidayshow').hide();
  126. $('.haveholidaynum').show();
  127. $('.tab').find('input').attr('disabled',true);
  128. $('.tab').find('textarea').attr('disabled',true);
  129. $('#tab1').addClass('active');
  130. $('#tab1').find('input').removeAttr('disabled');
  131. $('#tab1').find('textarea').removeAttr('disabled');
  132. $('.tabtitle').text('补休');
  133. $('.holidayname').text('存假');
  134. $('#holidaynum').val('你的存假 '+$('#cunjia').val()+' 天');
  135. $('#typenum').val(1);
  136. if($('#cunjia').val() == 0){
  137. $('#holidayshow span').text('存假');
  138. $('#holidayshow').show();
  139. }
  140. }
  141. },
  142. //{
  143. // text: '其他',
  144. // onClick: function() {
  145. // $('#holidaytypeshow').attr('placeholder','假期类型 [ 其他 ]');
  146. // $('#holidaytypeshow').val('其他');
  147. // $('#otherholiday').show();
  148. // $('#otherholidayshow').attr('placeholder','其他类型 [ 调休 ]');
  149. // $('#otherholidayshow').val('调休');
  150. // $('#holidaytype').val(11);
  151. // $('.align-top').show();
  152. // $('#holidayshow').hide();
  153. // $('.tab').removeClass('active');
  154. // $('.tab').find('input').attr('disabled',true);
  155. // $('.tab').find('textarea').attr('disabled',true);
  156. // $('#tab2').addClass('active');
  157. // $('#tab2').find('input').removeAttr('disabled');
  158. // $('#tab2').find('textarea').removeAttr('disabled');
  159. // $('#typenum').val(2);
  160. // }
  161. //}
  162. {
  163. text: '其他',
  164. onClick: function() {
  165. $('#holidaytypeshow').attr('placeholder','假期类型 [ 其他 ]');
  166. $('#holidaytypeshow').val('其他');
  167. $('#otherholiday').show();
  168. $('#otherholidayshow').attr('placeholder','其他类型 [ 值班 ]');
  169. $('#otherholidayshow').val('值班');
  170. $('#holidaytype').val(5);
  171. $('.tab').removeClass('active');
  172. $('.align-top').show();
  173. $('#holidayshow').hide();
  174. $('.haveholidaynum').hide();
  175. $('.tab').find('input').attr('disabled',true);
  176. $('.tab').find('textarea').attr('disabled',true);
  177. $('#tab1').addClass('active');
  178. $('#tab1').find('input').removeAttr('disabled');
  179. $('#tab1').find('textarea').removeAttr('disabled');
  180. $('.tabtitle').text('值班');
  181. $('#typenum').val(1);
  182. }
  183. }
  184. ];
  185. var buttons2 = [
  186. {
  187. text: '取消'
  188. }
  189. ];
  190. var groups = [buttons1, buttons2];
  191. $.actions(groups);
  192. });
  193. $(document).on('click','.create-office', function () {
  194. var buttons1 = [
  195. {
  196. text: '办事处',
  197. label: true
  198. },
  199. {
  200. text: '总部'
  201. },
  202. {
  203. text: '广东办'
  204. }
  205. ];
  206. var buttons2 = [
  207. {
  208. text: '取消'
  209. }
  210. ];
  211. var groups = [buttons1, buttons2];
  212. $.actions(groups);
  213. });
  214. $(document).on('click','.create-actionsTwo', function () {
  215. var buttons1 = [
  216. {
  217. text: '其他类型',
  218. label: true
  219. },
  220. //{
  221. // text: '调休',
  222. // bold: true,
  223. // onClick: function() {
  224. // $('#otherholidayshow').attr('placeholder','其他类型 [ 调休 ]');
  225. // $('#otherholidayshow').val('调休');
  226. // $('#holidaytype').val(11);
  227. // $('.align-top').show();
  228. // $('#holidayshow').hide();
  229. // $('.tab').removeClass('active');
  230. // $('.tab').find('input').attr('disabled',true);
  231. // $('.tab').find('textarea').attr('disabled',true);
  232. // $('#tab2').addClass('active');
  233. // $('#tab2').find('input').removeAttr('disabled');
  234. // $('#tab2').find('textarea').removeAttr('disabled');
  235. // $('#typenum').val(2);
  236. // }
  237. //},
  238. {
  239. text: '值班',
  240. onClick: function() {
  241. $('#otherholidayshow').attr('placeholder','假期类型 [ 值班 ]');
  242. $('#otherholidayshow').val('值班');
  243. $('#holidaytype').val(5);
  244. $('.tab').removeClass('active');
  245. $('.align-top').show();
  246. $('#holidayshow').hide();
  247. $('.haveholidaynum').hide();
  248. $('.tab').find('input').attr('disabled',true);
  249. $('.tab').find('textarea').attr('disabled',true);
  250. $('#tab1').addClass('active');
  251. $('#tab1').find('input').removeAttr('disabled');
  252. $('#tab1').find('textarea').removeAttr('disabled');
  253. $('.tabtitle').text('值班');
  254. $('#typenum').val(1);
  255. }
  256. },
  257. {
  258. text: '婚假',
  259. onClick: function() {
  260. $('#otherholidayshow').attr('placeholder','其他类型 [ 婚假 ]');
  261. $('#otherholidayshow').val('婚假');
  262. $('#holidaytype').val(6);
  263. $('.tab').removeClass('active');
  264. $('.align-top').show();
  265. $('#holidayshow').hide();
  266. $('.tab').find('input').attr('disabled',true);
  267. $('.tab').find('textarea').attr('disabled',true);
  268. $('#tab3').addClass('active');
  269. $('#tab3').find('input').removeAttr('disabled');
  270. $('#tab3').find('textarea').removeAttr('disabled');
  271. $('.tabtitle').text('婚假');
  272. $('#typenum').val(3);
  273. $('#othernumshow').val('您的假期 '+$('#hunjia').val()+' 天');
  274. $('#othernum').val($('#hunjia').val());
  275. if($('#hunjia').val() == 0){
  276. $('#holidayshow span').text('婚假');
  277. $('#holidayshow').show();
  278. }
  279. }
  280. },
  281. {
  282. text: '产假',
  283. onClick: function() {
  284. $('#otherholidayshow').attr('placeholder','其他类型 [ 产假 ]');
  285. $('#otherholidayshow').val('产假');
  286. $('#holidaytype').val(7);
  287. $('.tab').removeClass('active');
  288. $('.align-top').show();
  289. $('#holidayshow').hide();
  290. $('.tab').find('input').attr('disabled',true);
  291. $('.tab').find('textarea').attr('disabled',true);
  292. $('#tab3').addClass('active');
  293. $('#tab3').find('input').removeAttr('disabled');
  294. $('#tab3').find('textarea').removeAttr('disabled');
  295. $('.tabtitle').text('产假');
  296. $('#typenum').val(3);
  297. $('#othernumshow').val('您的假期 '+$('#chanjia').val()+' 天');
  298. $('#othernum').val($('#chanjia').val());
  299. if($('#chanjia').val() == 0){
  300. $('#holidayshow span').text('产假');
  301. $('#holidayshow').show();
  302. }
  303. }
  304. },
  305. {
  306. text: '丧假',
  307. onClick: function() {
  308. $('#otherholidayshow').attr('placeholder','其他类型 [ 丧假 ]');
  309. $('#otherholidayshow').val('丧假');
  310. $('#holidaytype').val(8);
  311. $('.tab').removeClass('active');
  312. $('.align-top').show();
  313. $('#holidayshow').hide();
  314. $('.tab').find('input').attr('disabled',true);
  315. $('.tab').find('textarea').attr('disabled',true);
  316. $('#tab3').addClass('active');
  317. $('#tab3').find('input').removeAttr('disabled');
  318. $('#tab3').find('textarea').removeAttr('disabled');
  319. $('.tabtitle').text('丧假');
  320. $('#typenum').val(3);
  321. $('#othernumshow').val('您的假期 '+$('#sangjia').val()+' 天');
  322. $('#othernum').val($('#sangjia').val());
  323. if($('#sangjia').val() == 0){
  324. $('#holidayshow span').text('丧假');
  325. $('#holidayshow').show();
  326. }
  327. }
  328. },
  329. {
  330. text: '工伤假',
  331. onClick: function() {
  332. $('#otherholidayshow').attr('placeholder','其他类型 [ 工伤假 ]');
  333. $('#otherholidayshow').val('工伤假');
  334. $('#holidaytype').val(9);
  335. $('.tab').removeClass('active');
  336. $('.align-top').show();
  337. $('#holidayshow').hide();
  338. $('.tab').find('input').attr('disabled',true);
  339. $('.tab').find('textarea').attr('disabled',true);
  340. $('#tab3').addClass('active');
  341. $('#tab3').find('input').removeAttr('disabled');
  342. $('#tab3').find('textarea').removeAttr('disabled');
  343. $('.tabtitle').text('工伤假');
  344. $('#typenum').val(3);
  345. $('#othernumshow').val('您的假期 '+$('#gongjia').val()+' 天');
  346. $('#othernum').val($('#gongjia').val());
  347. if($('#gongjia').val() == 0){
  348. $('#holidayshow span').text('工伤假');
  349. $('#holidayshow').show();
  350. }
  351. }
  352. }
  353. ];
  354. var buttons2 = [
  355. {
  356. text: '取消'
  357. }
  358. ];
  359. var groups = [buttons1, buttons2];
  360. $.actions(groups);
  361. });
  362. // var date = new Date();
  363. // var year = date.getFullYear();
  364. // var month = date.getMonth() + 1;
  365. // var day = date.getDate();
  366. //$("#datetime-picker-star").datetimePicker({
  367. // toolbarTemplate: '<header class="bar bar-nav">\
  368. //<button class="button button-link pull-right close-picker">确定</button>\
  369. //<h1 class="title">请选择开始时间</h1>\
  370. //</header>',
  371. // value: [year, month, day, '8', '30']
  372. //});
  373. $("#datetime-picker-star").calendar({
  374. onChange : function(e,value,day){
  375. $.alert(e);
  376. }
  377. });
  378. $("#datetime-picker-end").calendar({
  379. onChange : function(e,value){
  380. }
  381. });
  382. //$("#datetime-picker-end").datetimePicker({
  383. // toolbarTemplate: '<header class="bar bar-nav">\
  384. //<button class="button button-link pull-right close-picker">确定</button>\
  385. //<h1 class="title">请选择结束时间</h1>\
  386. //</header>',
  387. //});
  388. $(document).on('click','.confirm-ok', function () {
  389. $.prompt('填写你的审批意见', function (value) {
  390. $.alert('你的审批意见: ' + value , function(){
  391. ajaxapproval(2,value);
  392. });
  393. });
  394. });
  395. $(document).on('click','.confirm-cancel', function () {
  396. $.prompt('不同意原因', function (value) {
  397. $.alert('你的审批意见:' + value , function(){
  398. ajaxapproval(3,value);
  399. });
  400. });
  401. });
  402. $(document).on('click','.alert-text', function () {
  403. $.alert('请联系任务发布者/办事处经理发起加班申请。');
  404. });
  405. function ajaxapproval(isagree,value){
  406. $.ajax({
  407. type: 'post',
  408. url: '/approvalrequest/'+$('#hid').val(),
  409. data: {isagree: isagree, description: value},
  410. dataType: 'json',
  411. success: function(data){
  412. if(data.code == 200){
  413. if(isagree == 2){
  414. var text = '同意';
  415. }else{
  416. var text = '不同意';
  417. }
  418. $('#thisapprover').children('.item-after').text(text);
  419. if(value.length > 10){
  420. $('#thisapprover').children('.itemView').text(value.substring(0,10)+"...");
  421. }else{
  422. $('#thisapprover').children('.itemView').text(value);
  423. }
  424. $('#thisapprover').children('.itemView').attr('longmsg',value);
  425. $('.barBig').remove();
  426. $.toast('已审批');
  427. if(parseInt($('.badge').text())-1 == 0){
  428. $('.badge').remove();
  429. }else{
  430. $('.badge').text(parseInt($('.badge').text())-1);
  431. }
  432. }else{
  433. $.alert(data.msg);
  434. }
  435. }
  436. });
  437. }
  438. //$(document).on('click','.open-about', function () {
  439. // $.popup('.popup-aboutTime');
  440. //});
  441. $(document).on('click','.itemView',function () {
  442. $.alert($(this).attr('longmsg'));
  443. });
  444. $(document).on("pageInit", "#page-city-picker", function(e) {
  445. $("#city-picker").cityPicker({
  446. value: ['广东', '珠海','香洲区']
  447. });
  448. });
  449. $.init();
  450. $("#pickerOffice").picker({
  451. toolbarTemplate: '<header class="bar bar-nav">\
  452. <button class="button button-link pull-right close-picker">确定</button>\
  453. <h1 class="title">请选择你的办事处</h1>\
  454. </header>',
  455. cols: [
  456. {
  457. textAlign: 'center',
  458. values: category
  459. }
  460. ]
  461. });
  462. $("#pickerInvoice").picker({
  463. toolbarTemplate: '<header class="bar bar-nav">\
  464. <button class="button button-link pull-right close-picker">确定</button>\
  465. <h1 class="title">请选择开票内容</h1>\
  466. </header>',
  467. cols: [
  468. {
  469. textAlign: 'center',
  470. values: element
  471. }
  472. ]
  473. });
  474. $(document).on('click','.invoiceType', function () {
  475. var buttons1 = [
  476. {
  477. text: '发票类型',
  478. label: true,
  479. },
  480. {
  481. text: '增值税普通发票',
  482. bold: true,
  483. onClick: function() {
  484. $('#plainInvoice_box').show();
  485. $('#specialInvoice_box').hide();
  486. $('#invoiceTypeName').val('增值税普通发票');
  487. $('#invoiceType').val(0);
  488. }
  489. },
  490. {
  491. text: '增值税专用发票',
  492. onClick: function() {
  493. $('#plainInvoice_box').hide();
  494. $('#specialInvoice_box').show();
  495. $('#invoiceTypeName').val('增值税专用发票');
  496. $('#invoiceType').val(1);
  497. }
  498. }
  499. ];
  500. var buttons2 = [
  501. {
  502. text: '取消',
  503. }
  504. ];
  505. var groups = [buttons1, buttons2];
  506. $.actions(groups);
  507. });
  508. $(document).on('click','.invoiceMail', function () {
  509. var buttons1 = [
  510. {
  511. text: '是否邮寄',
  512. label: true,
  513. },
  514. {
  515. text: '是 ',
  516. bold: true,
  517. onClick: function() {
  518. $('#mail_box').show();
  519. $('#doPostName').val('是 ');
  520. $('#doPost').val(1);
  521. }
  522. },
  523. {
  524. text: '否',
  525. onClick: function() {
  526. $('#mail_box').hide();
  527. $('#doPostName').val('否 ');
  528. $('#doPost').val(0);
  529. }
  530. }
  531. ];
  532. var buttons2 = [
  533. {
  534. text: '取消',
  535. }
  536. ];
  537. var groups = [buttons1, buttons2];
  538. $.actions(groups);
  539. });
  540. });
  541. $(document).on('click','.invoiceExpress', function () {
  542. var buttons1 = [
  543. {
  544. text: '选择快递公司',
  545. label: true,
  546. },
  547. {
  548. text: 'EMS快递',
  549. bold: true,
  550. onClick: function() {
  551. $('#untreadCompanyName').val('EMS快递');
  552. $('#untreadCompany').val('EMS快递:ems');
  553. }
  554. },
  555. {
  556. text: '顺丰快递',
  557. onClick: function() {
  558. $('#untreadCompanyName').val('顺丰速运');
  559. $('#untreadCompany').val('顺丰速运:shunfeng');
  560. }
  561. }
  562. ];
  563. var buttons2 = [
  564. {
  565. text: '取消',
  566. }
  567. ];
  568. var groups = [buttons1, buttons2];
  569. $.actions(groups);
  570. });
  571. $(function(){
  572. var t = $('#myinput');
  573. t.css("color","#A9A9A9");
  574. t.val("请输入内容");
  575. var default_value = t.val();
  576. t.focus(function() {
  577. t.css("color","black");
  578. if (t.val() == default_value) {
  579. t.val('');
  580. }
  581. });
  582. t.blur(function() {
  583. t.css("color","black");
  584. if (t.val() == '') {
  585. t.val(default_value);
  586. t.css("color","#A9A9A9");
  587. }
  588. });
  589. });
  590. $(function(){
  591. var k = $('#myinput1');
  592. k.css("color","#A9A9A9");
  593. k.val("请输入内容");
  594. var default_value = k.val();
  595. k.focus(function() {
  596. k.css("color","black");
  597. if (k.val() == default_value) {
  598. k.val('');
  599. }
  600. });
  601. k.blur(function() {
  602. k.css("color","black");
  603. if (k.val() == '') {
  604. k.val(default_value);
  605. k.css("color","#A9A9A9");
  606. }
  607. });
  608. });
  609. $(function(){
  610. var p = $('#myinput2');
  611. p.css("color","#A9A9A9");
  612. p.val("请输入内容");
  613. var default_value = p.val();
  614. p.focus(function() {
  615. p.css("color","black");
  616. if (p.val() == default_value) {
  617. p.val('');
  618. }
  619. });
  620. p.blur(function() {
  621. p.css("color","black");
  622. if (p.val() == '') {
  623. p.val(default_value);
  624. p.css("color","#A9A9A9");
  625. }
  626. });
  627. $(document).on('click','.button-end', function () {
  628. $.confirm('终止审批', function () {
  629. $.alert('您终止审批');
  630. });
  631. });
  632. $(document).on('click','.button-return', function () {
  633. $.confirm('退回审批', function () {
  634. $.alert('您退回审批');
  635. });
  636. });
  637. $(document).on('click','.button-agree', function () {
  638. $.confirm('同意审批', function () {
  639. $.alert('您同意审批');
  640. });
  641. });
  642. });
  643. $(document).on('click','.invoiceaccounts', function () {
  644. var buttons1 = [
  645. {
  646. text: '请选择',
  647. label: true
  648. },
  649. {
  650. text: '软件销售',
  651. },
  652. {
  653. text: '培训班',
  654. }
  655. ];
  656. var buttons2 = [
  657. {
  658. text: '取消',
  659. bg: 'danger'
  660. }
  661. ];
  662. var groups = [buttons1, buttons2];
  663. $.actions(groups);
  664. });
  665. $(document).on('click','.invoicetrainexpenses', function () {
  666. var buttons1 = [
  667. {
  668. text: '请选择',
  669. label: true
  670. },
  671. {
  672. text: '交通费',
  673. },
  674. {
  675. text: '讲课费',
  676. },
  677. {
  678. text: '住宿费',
  679. },
  680. {
  681. text: '场租费',
  682. },
  683. {
  684. text: '办公费',
  685. },
  686. {
  687. text: '电话费',
  688. },
  689. {
  690. text: '邮寄费',
  691. },
  692. {
  693. text: '公关费',
  694. },
  695. {
  696. text: '其他',
  697. },
  698. {
  699. text: '税款',
  700. },
  701. {
  702. text: '研究中心经费',
  703. }
  704. ];
  705. var buttons2 = [
  706. {
  707. text: '取消',
  708. bg: 'danger'
  709. }
  710. ];
  711. var groups = [buttons1, buttons2];
  712. $.actions(groups);
  713. });
  714. $(document).ready(function(){
  715. //加的效果
  716. $(".add").click(function(){
  717. var n=$(this).prev().val();
  718. var num=parseInt(n)+1;
  719. if(num==0){ return;}
  720. $(this).prev().val(num);
  721. });
  722. //减的效果
  723. $(".jian").click(function(){
  724. var n=$(this).next().val();
  725. var num=parseInt(n)-1;
  726. if(num==0){ return}
  727. $(this).next().val(num);
  728. });
  729. });