123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763 |
- $(function(){
- $(document).on('click','.create-actions', function () {
- var buttons1 = [
- {
- text: '请假类型',
- label: true
- },
- {
- text: '事假',
- bold: true,
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 事假 ]');
- $('#holidaytypeshow').val('事假');
- $('#otherholiday').hide();
- $('#holidaytype').val(1);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('事假');
- $('#typenum').val(1);
- }
- },
- {
- text: '病假',
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 病假 ]');
- $('#holidaytypeshow').val('病假');
- $('#otherholiday').hide();
- $('#holidaytype').val(2);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('病假');
- $('#typenum').val(1);
- }
- },
- {
- text: '年假',
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 年假 ]');
- $('#holidaytypeshow').val('年假');
- $('#otherholiday').hide();
- $('#holidaytype').val(12);
- $('#holidayshow').hide();
- $('.tab').removeClass('active');
- //$('.haveholidaynum').show();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab5').addClass('active');
- $('#tab5').find('input').removeAttr('disabled');
- //$('#tab5').find('textarea').removeAttr('disabled');
- //$('.tabtitle').text('年假');
- //$('.holidayname').text('年假');
- //$('#holidaynum').val('你的年假 '+$('#nianjia').val()+' 天');
- //$('.align-top').hide();
- //$('.align-top').find('textarea').attr('disabled',true);
- $('#typenum').val(1);
- if($('#nianjia').val() == 0){
- $('#holidayshow span').text('年假');
- $('#holidayshow').show();
- }
- }
- },
- {
- text: '加班(计假)',
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 加班(计假) ]');
- $('#holidaytypeshow').val('加班(计假)');
- $('#otherholiday').hide();
- $('#holidaytype').val(4);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('加班(计假)');
- $('#typenum').val(1);
- }
- },
- {
- text: '加班(计薪)',
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 加班(计薪) ]');
- $('#holidaytypeshow').val('加班(计薪)');
- $('#otherholiday').hide();
- $('#holidaytype').val(4);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('加班(计薪)');
- $('#typenum').val(1);
- }
- },
- {
- text: '补休',
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 补休 ]');
- $('#holidaytypeshow').val('补休');
- $('#otherholiday').hide();
- $('#holidaytype').val(10);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').show();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('补休');
- $('.holidayname').text('存假');
- $('#holidaynum').val('你的存假 '+$('#cunjia').val()+' 天');
- $('#typenum').val(1);
- if($('#cunjia').val() == 0){
- $('#holidayshow span').text('存假');
- $('#holidayshow').show();
- }
- }
- },
- //{
- // text: '其他',
- // onClick: function() {
- // $('#holidaytypeshow').attr('placeholder','假期类型 [ 其他 ]');
- // $('#holidaytypeshow').val('其他');
- // $('#otherholiday').show();
- // $('#otherholidayshow').attr('placeholder','其他类型 [ 调休 ]');
- // $('#otherholidayshow').val('调休');
- // $('#holidaytype').val(11);
- // $('.align-top').show();
- // $('#holidayshow').hide();
- // $('.tab').removeClass('active');
- // $('.tab').find('input').attr('disabled',true);
- // $('.tab').find('textarea').attr('disabled',true);
- // $('#tab2').addClass('active');
- // $('#tab2').find('input').removeAttr('disabled');
- // $('#tab2').find('textarea').removeAttr('disabled');
- // $('#typenum').val(2);
- // }
- //}
- {
- text: '其他',
- onClick: function() {
- $('#holidaytypeshow').attr('placeholder','假期类型 [ 其他 ]');
- $('#holidaytypeshow').val('其他');
- $('#otherholiday').show();
- $('#otherholidayshow').attr('placeholder','其他类型 [ 值班 ]');
- $('#otherholidayshow').val('值班');
- $('#holidaytype').val(5);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('值班');
- $('#typenum').val(1);
- }
- }
- ];
- var buttons2 = [
- {
- text: '取消'
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- $(document).on('click','.create-office', function () {
- var buttons1 = [
- {
- text: '办事处',
- label: true
- },
- {
- text: '总部'
- },
- {
- text: '广东办'
- }
- ];
- var buttons2 = [
- {
- text: '取消'
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- $(document).on('click','.create-actionsTwo', function () {
- var buttons1 = [
- {
- text: '其他类型',
- label: true
- },
- //{
- // text: '调休',
- // bold: true,
- // onClick: function() {
- // $('#otherholidayshow').attr('placeholder','其他类型 [ 调休 ]');
- // $('#otherholidayshow').val('调休');
- // $('#holidaytype').val(11);
- // $('.align-top').show();
- // $('#holidayshow').hide();
- // $('.tab').removeClass('active');
- // $('.tab').find('input').attr('disabled',true);
- // $('.tab').find('textarea').attr('disabled',true);
- // $('#tab2').addClass('active');
- // $('#tab2').find('input').removeAttr('disabled');
- // $('#tab2').find('textarea').removeAttr('disabled');
- // $('#typenum').val(2);
- // }
- //},
- {
- text: '值班',
- onClick: function() {
- $('#otherholidayshow').attr('placeholder','假期类型 [ 值班 ]');
- $('#otherholidayshow').val('值班');
- $('#holidaytype').val(5);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.haveholidaynum').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab1').addClass('active');
- $('#tab1').find('input').removeAttr('disabled');
- $('#tab1').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('值班');
- $('#typenum').val(1);
- }
- },
- {
- text: '婚假',
- onClick: function() {
- $('#otherholidayshow').attr('placeholder','其他类型 [ 婚假 ]');
- $('#otherholidayshow').val('婚假');
- $('#holidaytype').val(6);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab3').addClass('active');
- $('#tab3').find('input').removeAttr('disabled');
- $('#tab3').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('婚假');
- $('#typenum').val(3);
- $('#othernumshow').val('您的假期 '+$('#hunjia').val()+' 天');
- $('#othernum').val($('#hunjia').val());
- if($('#hunjia').val() == 0){
- $('#holidayshow span').text('婚假');
- $('#holidayshow').show();
- }
- }
- },
- {
- text: '产假',
- onClick: function() {
- $('#otherholidayshow').attr('placeholder','其他类型 [ 产假 ]');
- $('#otherholidayshow').val('产假');
- $('#holidaytype').val(7);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab3').addClass('active');
- $('#tab3').find('input').removeAttr('disabled');
- $('#tab3').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('产假');
- $('#typenum').val(3);
- $('#othernumshow').val('您的假期 '+$('#chanjia').val()+' 天');
- $('#othernum').val($('#chanjia').val());
- if($('#chanjia').val() == 0){
- $('#holidayshow span').text('产假');
- $('#holidayshow').show();
- }
- }
- },
- {
- text: '丧假',
- onClick: function() {
- $('#otherholidayshow').attr('placeholder','其他类型 [ 丧假 ]');
- $('#otherholidayshow').val('丧假');
- $('#holidaytype').val(8);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab3').addClass('active');
- $('#tab3').find('input').removeAttr('disabled');
- $('#tab3').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('丧假');
- $('#typenum').val(3);
- $('#othernumshow').val('您的假期 '+$('#sangjia').val()+' 天');
- $('#othernum').val($('#sangjia').val());
- if($('#sangjia').val() == 0){
- $('#holidayshow span').text('丧假');
- $('#holidayshow').show();
- }
- }
- },
- {
- text: '工伤假',
- onClick: function() {
- $('#otherholidayshow').attr('placeholder','其他类型 [ 工伤假 ]');
- $('#otherholidayshow').val('工伤假');
- $('#holidaytype').val(9);
- $('.tab').removeClass('active');
- $('.align-top').show();
- $('#holidayshow').hide();
- $('.tab').find('input').attr('disabled',true);
- $('.tab').find('textarea').attr('disabled',true);
- $('#tab3').addClass('active');
- $('#tab3').find('input').removeAttr('disabled');
- $('#tab3').find('textarea').removeAttr('disabled');
- $('.tabtitle').text('工伤假');
- $('#typenum').val(3);
- $('#othernumshow').val('您的假期 '+$('#gongjia').val()+' 天');
- $('#othernum').val($('#gongjia').val());
- if($('#gongjia').val() == 0){
- $('#holidayshow span').text('工伤假');
- $('#holidayshow').show();
- }
- }
- }
- ];
- var buttons2 = [
- {
- text: '取消'
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- // var date = new Date();
- // var year = date.getFullYear();
- // var month = date.getMonth() + 1;
- // var day = date.getDate();
- //$("#datetime-picker-star").datetimePicker({
- // toolbarTemplate: '<header class="bar bar-nav">\
- //<button class="button button-link pull-right close-picker">确定</button>\
- //<h1 class="title">请选择开始时间</h1>\
- //</header>',
- // value: [year, month, day, '8', '30']
- //});
- $("#datetime-picker-star").calendar({
- onChange : function(e,value,day){
- $.alert(e);
- }
- });
- $("#datetime-picker-end").calendar({
- onChange : function(e,value){
- }
- });
- //$("#datetime-picker-end").datetimePicker({
- // toolbarTemplate: '<header class="bar bar-nav">\
- //<button class="button button-link pull-right close-picker">确定</button>\
- //<h1 class="title">请选择结束时间</h1>\
- //</header>',
- //});
- $(document).on('click','.confirm-ok', function () {
- $.prompt('填写你的审批意见', function (value) {
- $.alert('你的审批意见: ' + value , function(){
- ajaxapproval(2,value);
- });
- });
- });
- $(document).on('click','.confirm-cancel', function () {
- $.prompt('不同意原因', function (value) {
- $.alert('你的审批意见:' + value , function(){
- ajaxapproval(3,value);
- });
- });
- });
- $(document).on('click','.alert-text', function () {
- $.alert('请联系任务发布者/办事处经理发起加班申请。');
- });
- function ajaxapproval(isagree,value){
- $.ajax({
- type: 'post',
- url: '/approvalrequest/'+$('#hid').val(),
- data: {isagree: isagree, description: value},
- dataType: 'json',
- success: function(data){
- if(data.code == 200){
- if(isagree == 2){
- var text = '同意';
- }else{
- var text = '不同意';
- }
- $('#thisapprover').children('.item-after').text(text);
- if(value.length > 10){
- $('#thisapprover').children('.itemView').text(value.substring(0,10)+"...");
- }else{
- $('#thisapprover').children('.itemView').text(value);
- }
- $('#thisapprover').children('.itemView').attr('longmsg',value);
- $('.barBig').remove();
- $.toast('已审批');
- if(parseInt($('.badge').text())-1 == 0){
- $('.badge').remove();
- }else{
- $('.badge').text(parseInt($('.badge').text())-1);
- }
- }else{
- $.alert(data.msg);
- }
- }
- });
- }
- //$(document).on('click','.open-about', function () {
- // $.popup('.popup-aboutTime');
- //});
- $(document).on('click','.itemView',function () {
- $.alert($(this).attr('longmsg'));
- });
- $(document).on("pageInit", "#page-city-picker", function(e) {
- $("#city-picker").cityPicker({
- value: ['广东', '珠海','香洲区']
- });
- });
- $.init();
-
- $("#pickerOffice").picker({
- toolbarTemplate: '<header class="bar bar-nav">\
- <button class="button button-link pull-right close-picker">确定</button>\
- <h1 class="title">请选择你的办事处</h1>\
- </header>',
- cols: [
- {
- textAlign: 'center',
- values: category
- }
- ]
- });
- $("#pickerInvoice").picker({
- toolbarTemplate: '<header class="bar bar-nav">\
- <button class="button button-link pull-right close-picker">确定</button>\
- <h1 class="title">请选择开票内容</h1>\
- </header>',
- cols: [
- {
- textAlign: 'center',
- values: element
- }
- ]
- });
- $(document).on('click','.invoiceType', function () {
- var buttons1 = [
- {
- text: '发票类型',
- label: true,
- },
- {
- text: '增值税普通发票',
- bold: true,
- onClick: function() {
- $('#plainInvoice_box').show();
- $('#specialInvoice_box').hide();
- $('#invoiceTypeName').val('增值税普通发票');
- $('#invoiceType').val(0);
- }
- },
- {
- text: '增值税专用发票',
- onClick: function() {
- $('#plainInvoice_box').hide();
- $('#specialInvoice_box').show();
- $('#invoiceTypeName').val('增值税专用发票');
- $('#invoiceType').val(1);
- }
- }
- ];
- var buttons2 = [
- {
- text: '取消',
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- $(document).on('click','.invoiceMail', function () {
- var buttons1 = [
- {
- text: '是否邮寄',
- label: true,
- },
- {
- text: '是 ',
- bold: true,
- onClick: function() {
- $('#mail_box').show();
- $('#doPostName').val('是 ');
- $('#doPost').val(1);
-
- }
- },
- {
- text: '否',
- onClick: function() {
- $('#mail_box').hide();
- $('#doPostName').val('否 ');
- $('#doPost').val(0);
-
- }
- }
- ];
- var buttons2 = [
- {
- text: '取消',
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- });
- $(document).on('click','.invoiceExpress', function () {
- var buttons1 = [
- {
- text: '选择快递公司',
- label: true,
- },
- {
- text: 'EMS快递',
- bold: true,
- onClick: function() {
- $('#untreadCompanyName').val('EMS快递');
- $('#untreadCompany').val('EMS快递:ems');
-
- }
- },
- {
- text: '顺丰快递',
- onClick: function() {
- $('#untreadCompanyName').val('顺丰速运');
- $('#untreadCompany').val('顺丰速运:shunfeng');
-
- }
- }
- ];
- var buttons2 = [
- {
- text: '取消',
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- $(function(){
- var t = $('#myinput');
- t.css("color","#A9A9A9");
- t.val("请输入内容");
- var default_value = t.val();
-
- t.focus(function() {
- t.css("color","black");
- if (t.val() == default_value) {
- t.val('');
- }
- });
- t.blur(function() {
- t.css("color","black");
- if (t.val() == '') {
- t.val(default_value);
- t.css("color","#A9A9A9");
- }
- });
- });
- $(function(){
- var k = $('#myinput1');
- k.css("color","#A9A9A9");
- k.val("请输入内容");
- var default_value = k.val();
-
- k.focus(function() {
- k.css("color","black");
- if (k.val() == default_value) {
- k.val('');
- }
- });
- k.blur(function() {
- k.css("color","black");
- if (k.val() == '') {
- k.val(default_value);
- k.css("color","#A9A9A9");
- }
- });
- });
- $(function(){
- var p = $('#myinput2');
- p.css("color","#A9A9A9");
- p.val("请输入内容");
- var default_value = p.val();
-
- p.focus(function() {
- p.css("color","black");
- if (p.val() == default_value) {
- p.val('');
- }
- });
- p.blur(function() {
- p.css("color","black");
- if (p.val() == '') {
- p.val(default_value);
- p.css("color","#A9A9A9");
- }
- });
- $(document).on('click','.button-end', function () {
- $.confirm('终止审批', function () {
- $.alert('您终止审批');
- });
- });
- $(document).on('click','.button-return', function () {
- $.confirm('退回审批', function () {
- $.alert('您退回审批');
- });
- });
- $(document).on('click','.button-agree', function () {
- $.confirm('同意审批', function () {
- $.alert('您同意审批');
- });
- });
- });
- $(document).on('click','.invoiceaccounts', function () {
- var buttons1 = [
- {
- text: '请选择',
- label: true
- },
- {
- text: '软件销售',
- },
- {
- text: '培训班',
- }
- ];
- var buttons2 = [
- {
- text: '取消',
- bg: 'danger'
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- $(document).on('click','.invoicetrainexpenses', function () {
- var buttons1 = [
- {
- text: '请选择',
- label: true
- },
- {
- text: '交通费',
- },
- {
- text: '讲课费',
- },
- {
- text: '住宿费',
- },
- {
- text: '场租费',
- },
- {
- text: '办公费',
- },
- {
- text: '电话费',
- },
- {
- text: '邮寄费',
- },
- {
- text: '公关费',
- },
- {
- text: '其他',
- },
- {
- text: '税款',
- },
- {
- text: '研究中心经费',
- }
- ];
- var buttons2 = [
- {
- text: '取消',
- bg: 'danger'
- }
- ];
- var groups = [buttons1, buttons2];
- $.actions(groups);
- });
- $(document).ready(function(){
- //加的效果
- $(".add").click(function(){
- var n=$(this).prev().val();
- var num=parseInt(n)+1;
- if(num==0){ return;}
- $(this).prev().val(num);
- });
- //减的效果
- $(".jian").click(function(){
- var n=$(this).next().val();
- var num=parseInt(n)-1;
- if(num==0){ return}
- $(this).next().val(num);
- });
- });
|