global.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  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-actionsTwo', function () {
  194. var buttons1 = [
  195. {
  196. text: '其他类型',
  197. label: true
  198. },
  199. //{
  200. // text: '调休',
  201. // bold: true,
  202. // onClick: function() {
  203. // $('#otherholidayshow').attr('placeholder','其他类型 [ 调休 ]');
  204. // $('#otherholidayshow').val('调休');
  205. // $('#holidaytype').val(11);
  206. // $('.align-top').show();
  207. // $('#holidayshow').hide();
  208. // $('.tab').removeClass('active');
  209. // $('.tab').find('input').attr('disabled',true);
  210. // $('.tab').find('textarea').attr('disabled',true);
  211. // $('#tab2').addClass('active');
  212. // $('#tab2').find('input').removeAttr('disabled');
  213. // $('#tab2').find('textarea').removeAttr('disabled');
  214. // $('#typenum').val(2);
  215. // }
  216. //},
  217. {
  218. text: '值班',
  219. onClick: function() {
  220. $('#otherholidayshow').attr('placeholder','假期类型 [ 值班 ]');
  221. $('#otherholidayshow').val('值班');
  222. $('#holidaytype').val(5);
  223. $('.tab').removeClass('active');
  224. $('.align-top').show();
  225. $('#holidayshow').hide();
  226. $('.haveholidaynum').hide();
  227. $('.tab').find('input').attr('disabled',true);
  228. $('.tab').find('textarea').attr('disabled',true);
  229. $('#tab1').addClass('active');
  230. $('#tab1').find('input').removeAttr('disabled');
  231. $('#tab1').find('textarea').removeAttr('disabled');
  232. $('.tabtitle').text('值班');
  233. $('#typenum').val(1);
  234. }
  235. },
  236. {
  237. text: '婚假',
  238. onClick: function() {
  239. $('#otherholidayshow').attr('placeholder','其他类型 [ 婚假 ]');
  240. $('#otherholidayshow').val('婚假');
  241. $('#holidaytype').val(6);
  242. $('.tab').removeClass('active');
  243. $('.align-top').show();
  244. $('#holidayshow').hide();
  245. $('.tab').find('input').attr('disabled',true);
  246. $('.tab').find('textarea').attr('disabled',true);
  247. $('#tab3').addClass('active');
  248. $('#tab3').find('input').removeAttr('disabled');
  249. $('#tab3').find('textarea').removeAttr('disabled');
  250. $('.tabtitle').text('婚假');
  251. $('#typenum').val(3);
  252. $('#othernumshow').val('您的假期 '+$('#hunjia').val()+' 天');
  253. $('#othernum').val($('#hunjia').val());
  254. if($('#hunjia').val() == 0){
  255. $('#holidayshow span').text('婚假');
  256. $('#holidayshow').show();
  257. }
  258. }
  259. },
  260. {
  261. text: '产假',
  262. onClick: function() {
  263. $('#otherholidayshow').attr('placeholder','其他类型 [ 产假 ]');
  264. $('#otherholidayshow').val('产假');
  265. $('#holidaytype').val(7);
  266. $('.tab').removeClass('active');
  267. $('.align-top').show();
  268. $('#holidayshow').hide();
  269. $('.tab').find('input').attr('disabled',true);
  270. $('.tab').find('textarea').attr('disabled',true);
  271. $('#tab3').addClass('active');
  272. $('#tab3').find('input').removeAttr('disabled');
  273. $('#tab3').find('textarea').removeAttr('disabled');
  274. $('.tabtitle').text('产假');
  275. $('#typenum').val(3);
  276. $('#othernumshow').val('您的假期 '+$('#chanjia').val()+' 天');
  277. $('#othernum').val($('#chanjia').val());
  278. if($('#chanjia').val() == 0){
  279. $('#holidayshow span').text('产假');
  280. $('#holidayshow').show();
  281. }
  282. }
  283. },
  284. {
  285. text: '丧假',
  286. onClick: function() {
  287. $('#otherholidayshow').attr('placeholder','其他类型 [ 丧假 ]');
  288. $('#otherholidayshow').val('丧假');
  289. $('#holidaytype').val(8);
  290. $('.tab').removeClass('active');
  291. $('.align-top').show();
  292. $('#holidayshow').hide();
  293. $('.tab').find('input').attr('disabled',true);
  294. $('.tab').find('textarea').attr('disabled',true);
  295. $('#tab3').addClass('active');
  296. $('#tab3').find('input').removeAttr('disabled');
  297. $('#tab3').find('textarea').removeAttr('disabled');
  298. $('.tabtitle').text('丧假');
  299. $('#typenum').val(3);
  300. $('#othernumshow').val('您的假期 '+$('#sangjia').val()+' 天');
  301. $('#othernum').val($('#sangjia').val());
  302. if($('#sangjia').val() == 0){
  303. $('#holidayshow span').text('丧假');
  304. $('#holidayshow').show();
  305. }
  306. }
  307. },
  308. {
  309. text: '工伤假',
  310. onClick: function() {
  311. $('#otherholidayshow').attr('placeholder','其他类型 [ 工伤假 ]');
  312. $('#otherholidayshow').val('工伤假');
  313. $('#holidaytype').val(9);
  314. $('.tab').removeClass('active');
  315. $('.align-top').show();
  316. $('#holidayshow').hide();
  317. $('.tab').find('input').attr('disabled',true);
  318. $('.tab').find('textarea').attr('disabled',true);
  319. $('#tab3').addClass('active');
  320. $('#tab3').find('input').removeAttr('disabled');
  321. $('#tab3').find('textarea').removeAttr('disabled');
  322. $('.tabtitle').text('工伤假');
  323. $('#typenum').val(3);
  324. $('#othernumshow').val('您的假期 '+$('#gongjia').val()+' 天');
  325. $('#othernum').val($('#gongjia').val());
  326. if($('#gongjia').val() == 0){
  327. $('#holidayshow span').text('工伤假');
  328. $('#holidayshow').show();
  329. }
  330. }
  331. }
  332. ];
  333. var buttons2 = [
  334. {
  335. text: '取消'
  336. }
  337. ];
  338. var groups = [buttons1, buttons2];
  339. $.actions(groups);
  340. });
  341. // var date = new Date();
  342. // var year = date.getFullYear();
  343. // var month = date.getMonth() + 1;
  344. // var day = date.getDate();
  345. //$("#datetime-picker-star").datetimePicker({
  346. // toolbarTemplate: '<header class="bar bar-nav">\
  347. //<button class="button button-link pull-right close-picker">确定</button>\
  348. //<h1 class="title">请选择开始时间</h1>\
  349. //</header>',
  350. // value: [year, month, day, '8', '30']
  351. //});
  352. $("#datetime-picker-star").calendar({
  353. onChange : function(e,value,day){
  354. $.alert(e);
  355. }
  356. });
  357. $("#datetime-picker-end").calendar({
  358. onChange : function(e,value){
  359. }
  360. });
  361. //$("#datetime-picker-end").datetimePicker({
  362. // toolbarTemplate: '<header class="bar bar-nav">\
  363. //<button class="button button-link pull-right close-picker">确定</button>\
  364. //<h1 class="title">请选择结束时间</h1>\
  365. //</header>',
  366. //});
  367. $(document).on('click','.confirm-ok', function () {
  368. $.prompt('填写你的审批意见', function (value) {
  369. $.alert('你的审批意见: ' + value , function(){
  370. ajaxapproval(2,value);
  371. });
  372. });
  373. });
  374. $(document).on('click','.confirm-cancel', function () {
  375. $.prompt('不同意原因', function (value) {
  376. $.alert('你的审批意见:' + value , function(){
  377. ajaxapproval(3,value);
  378. });
  379. });
  380. });
  381. function ajaxapproval(isagree,value){
  382. $.ajax({
  383. type: 'post',
  384. url: '/approvalrequest/'+$('#hid').val(),
  385. data: {isagree: isagree, description: value},
  386. dataType: 'json',
  387. success: function(data){
  388. if(data.code == 200){
  389. if(isagree == 2){
  390. var text = '同意';
  391. }else{
  392. var text = '不同意';
  393. }
  394. $('#thisapprover').children('.item-after').text(text);
  395. if(value.length > 10){
  396. $('#thisapprover').children('.itemView').text(value.substring(0,10)+"...");
  397. }else{
  398. $('#thisapprover').children('.itemView').text(value);
  399. }
  400. $('#thisapprover').children('.itemView').attr('longmsg',value);
  401. $('.barBig').remove();
  402. $.toast('已审批');
  403. if(parseInt($('.badge').text())-1 == 0){
  404. $('.badge').remove();
  405. }else{
  406. $('.badge').text(parseInt($('.badge').text())-1);
  407. }
  408. }else{
  409. $.alert(data.msg);
  410. }
  411. }
  412. });
  413. }
  414. //$(document).on('click','.open-about', function () {
  415. // $.popup('.popup-aboutTime');
  416. //});
  417. $(document).on('click','.itemView',function () {
  418. $.alert($(this).attr('longmsg'));
  419. });
  420. $(document).on("pageInit", "#page-city-picker", function(e) {
  421. $("#city-picker").cityPicker({
  422. value: ['广东', '珠海','香洲区']
  423. });
  424. });
  425. $.init();
  426. $("#pickerOffice").picker({
  427. toolbarTemplate: '<header class="bar bar-nav">\
  428. <button class="button button-link pull-right close-picker">确定</button>\
  429. <h1 class="title">请选择你的办事处</h1>\
  430. </header>',
  431. cols: [
  432. {
  433. textAlign: 'center',
  434. values: category
  435. }
  436. ]
  437. });
  438. $("#pickerInvoice").picker({
  439. toolbarTemplate: '<header class="bar bar-nav">\
  440. <button class="button button-link pull-right close-picker">确定</button>\
  441. <h1 class="title">请选择开票内容</h1>\
  442. </header>',
  443. cols: [
  444. {
  445. textAlign: 'center',
  446. values: element
  447. }
  448. ]
  449. });
  450. $(document).on('click','.invoiceType', function () {
  451. var buttons1 = [
  452. {
  453. text: '发票类型',
  454. label: true,
  455. },
  456. {
  457. text: '增值税普通发票',
  458. bold: true,
  459. onClick: function() {
  460. $('#plainInvoice_box').show();
  461. $('#specialInvoice_box').hide();
  462. $('#invoiceTypeName').val('增值税普通发票');
  463. $('#invoiceType').val(0);
  464. }
  465. },
  466. {
  467. text: '增值税专用发票',
  468. onClick: function() {
  469. $('#plainInvoice_box').hide();
  470. $('#specialInvoice_box').show();
  471. $('#invoiceTypeName').val('增值税专用发票');
  472. $('#invoiceType').val(1);
  473. }
  474. }
  475. ];
  476. var buttons2 = [
  477. {
  478. text: '取消',
  479. }
  480. ];
  481. var groups = [buttons1, buttons2];
  482. $.actions(groups);
  483. });
  484. $(document).on('click','.invoiceMail', function () {
  485. var buttons1 = [
  486. {
  487. text: '是否邮寄',
  488. label: true,
  489. },
  490. {
  491. text: '是 ',
  492. bold: true,
  493. onClick: function() {
  494. $('#mail_box').show();
  495. $('#doPostName').val('是 ');
  496. $('#doPost').val(1);
  497. }
  498. },
  499. {
  500. text: '否',
  501. onClick: function() {
  502. $('#mail_box').hide();
  503. $('#doPostName').val('否 ');
  504. $('#doPost').val(0);
  505. }
  506. }
  507. ];
  508. var buttons2 = [
  509. {
  510. text: '取消',
  511. }
  512. ];
  513. var groups = [buttons1, buttons2];
  514. $.actions(groups);
  515. });
  516. });
  517. $(document).on('click','.invoiceExpress', function () {
  518. var buttons1 = [
  519. {
  520. text: '选择快递公司',
  521. label: true,
  522. },
  523. {
  524. text: 'EMS快递',
  525. bold: true,
  526. onClick: function() {
  527. $('#untreadCompanyName').val('EMS快递');
  528. $('#untreadCompany').val('EMS快递:ems');
  529. }
  530. },
  531. {
  532. text: '顺丰快递',
  533. onClick: function() {
  534. $('#untreadCompanyName').val('顺丰速运');
  535. $('#untreadCompany').val('顺丰速运:shunfeng');
  536. }
  537. }
  538. ];
  539. var buttons2 = [
  540. {
  541. text: '取消',
  542. }
  543. ];
  544. var groups = [buttons1, buttons2];
  545. $.actions(groups);
  546. });
  547. $(function(){
  548. var t = $('#myinput');
  549. t.css("color","#A9A9A9");
  550. t.val("请输入内容");
  551. var default_value = t.val();
  552. t.focus(function() {
  553. t.css("color","black");
  554. if (t.val() == default_value) {
  555. t.val('');
  556. }
  557. });
  558. t.blur(function() {
  559. t.css("color","black");
  560. if (t.val() == '') {
  561. t.val(default_value);
  562. t.css("color","#A9A9A9");
  563. }
  564. });
  565. });
  566. $(function(){
  567. var k = $('#myinput1');
  568. k.css("color","#A9A9A9");
  569. k.val("请输入内容");
  570. var default_value = k.val();
  571. k.focus(function() {
  572. k.css("color","black");
  573. if (k.val() == default_value) {
  574. k.val('');
  575. }
  576. });
  577. k.blur(function() {
  578. k.css("color","black");
  579. if (k.val() == '') {
  580. k.val(default_value);
  581. k.css("color","#A9A9A9");
  582. }
  583. });
  584. });
  585. $(function(){
  586. var p = $('#myinput2');
  587. p.css("color","#A9A9A9");
  588. p.val("请输入内容");
  589. var default_value = p.val();
  590. p.focus(function() {
  591. p.css("color","black");
  592. if (p.val() == default_value) {
  593. p.val('');
  594. }
  595. });
  596. p.blur(function() {
  597. p.css("color","black");
  598. if (p.val() == '') {
  599. p.val(default_value);
  600. p.css("color","#A9A9A9");
  601. }
  602. });
  603. $(document).on('click','.button-end', function () {
  604. $.confirm('终止审批', function () {
  605. $.alert('您终止审批');
  606. });
  607. });
  608. $(document).on('click','.button-return', function () {
  609. $.confirm('退回审批', function () {
  610. $.alert('您退回审批');
  611. });
  612. });
  613. $(document).on('click','.button-agree', function () {
  614. $.confirm('同意审批', function () {
  615. $.alert('您同意审批');
  616. });
  617. });
  618. });
  619. $(document).on('click','.invoiceaccounts', function () {
  620. var buttons1 = [
  621. {
  622. text: '请选择',
  623. label: true
  624. },
  625. {
  626. text: '软件销售',
  627. },
  628. {
  629. text: '培训班',
  630. }
  631. ];
  632. var buttons2 = [
  633. {
  634. text: '取消',
  635. bg: 'danger'
  636. }
  637. ];
  638. var groups = [buttons1, buttons2];
  639. $.actions(groups);
  640. });
  641. $(document).on('click','.invoicetrainexpenses', function () {
  642. var buttons1 = [
  643. {
  644. text: '请选择',
  645. label: true
  646. },
  647. {
  648. text: '交通费',
  649. },
  650. {
  651. text: '讲课费',
  652. },
  653. {
  654. text: '住宿费',
  655. },
  656. {
  657. text: '场租费',
  658. },
  659. {
  660. text: '办公费',
  661. },
  662. {
  663. text: '电话费',
  664. },
  665. {
  666. text: '邮寄费',
  667. },
  668. {
  669. text: '公关费',
  670. },
  671. {
  672. text: '其他',
  673. },
  674. {
  675. text: '税款',
  676. },
  677. {
  678. text: '研究中心经费',
  679. }
  680. ];
  681. var buttons2 = [
  682. {
  683. text: '取消',
  684. bg: 'danger'
  685. }
  686. ];
  687. var groups = [buttons1, buttons2];
  688. $.actions(groups);
  689. });
  690. $(document).ready(function(){
  691. //加的效果
  692. $(".add").click(function(){
  693. var n=$(this).prev().val();
  694. var num=parseInt(n)+1;
  695. if(num==0){ return;}
  696. $(this).prev().val(num);
  697. });
  698. //减的效果
  699. $(".jian").click(function(){
  700. var n=$(this).next().val();
  701. var num=parseInt(n)-1;
  702. if(num==0){ return}
  703. $(this).next().val(num);
  704. });
  705. });