• js获取当前日期


    var myDate = new Date();


    myDate.getYear(); //获取当前年份(2位)
    myDate.getFullYear(); //获取完整的年份(4位,1970-????)
    myDate.getMonth(); //获取当前月份(0-11,0代表1月)
    myDate.getDate(); //获取当前日(1-31)
    myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
    myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数)
    myDate.getHours(); //获取当前小时数(0-23)
    myDate.getMinutes(); //获取当前分钟数(0-59)
    myDate.getSeconds(); //获取当前秒数(0-59)
    myDate.getMilliseconds(); //获取当前毫秒数(0-999)
    myDate.toLocaleDateString(); //获取当前日期
    var mytime=myDate.toLocaleTimeString(); //获取当前时间
    myDate.toLocaleString( ); //获取日期与时间

    function getCurTime() {
    var date = new Date();
    return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + date.getHours() + ':' + date.getMinutes()+':' +date.getSeconds();

    }

    $(function () {
    var curUserId = $("input[name='curUserId']").val();
    var curUserName = $("input[name='curUserName']").val();
    var currentNode = $("input[name='currentNode']").val();
    //审核
    if(currentNode=='UserTask1'){
    $("input[name='m:STANO_CALCULATE_PROC:AUDITOR']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:AUDIT_OPINION']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:AUDIT_TIME']").val(getCurTime());
    //定值单整定
    }else if(currentNode=='UserTask2'){
    //$("input[name='m:STANO_CALCULATE_PROC:AUDITOR']").val(curUserName);
    //$("textarea[name='m:STANO_CALCULATE_PROC:AUDIT_OPINION']").text('同意');
    //$("input[name='m:STANO_CALCULATE_PROC:AUDIT_TIME']").val(getCurTime());
    //批准
    }else if(currentNode=='UserTask3'){
    $("input[name='m:STANO_CALCULATE_PROC:APPROVER']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:APPROVAL_OPINION']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:APPROVAL_TIME']").val(getCurTime());
    //下发定值单
    }else if(currentNode=='UserTask4'){
    $("input[name='m:STANO_CALCULATE_PROC:ISSUED_MAN']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:ISSUED_OPINION']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:ISSUED_TIME']").val(getCurTime());
    //调度签收
    }else if(currentNode=='UserTask5'){
    $("input[name='m:STANO_CALCULATE_PROC:SCHEDULER_SIGN_MAN']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:SCHEDUL_SIGN_OPINION']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:SCHEDULER_SIGN_TIME']").val(getCurTime());
    //调度执行
    }else if(currentNode=='UserTask6'){
    $("input[name='m:STANO_CALCULATE_PROC:SCHEDULER']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:SCHEDUL_IMPL_OPINION']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:SCHEDULER_IMPL_TIME']").val(getCurTime());
    //接收定值单
    }else if(currentNode=='UserTask7'){
    //$("input[name='m:STANO_CALCULATE_PROC:AUDITOR']").val(curUserName);
    //$("textarea[name='m:STANO_CALCULATE_PROC:AUDIT_OPINION']").text('同意');
    //$("input[name='m:STANO_CALCULATE_PROC:AUDIT_TIME']").val(getCurTime());
    //整定计算确认
    }else if(currentNode=='UserTask8'){
    $("input[name='m:STANO_CALCULATE_PROC:SET_CALCULATION_MAN']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:SET_CALCULAT_OPINION']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:SET_CALCULATION_TIME']").val(getCurTime());
    //校对
    }else if(currentNode=='UserTask9'){
    $("input[name='m:STANO_CALCULATE_PROC:xdr']").val(curUserName);
    $("textarea[name='m:STANO_CALCULATE_PROC:xdyj']").text('同意');
    $("input[name='m:STANO_CALCULATE_PROC:xdsj']").val(getCurTime());
    }

    });

  • 相关阅读:
    企业应用的互联网化(2010年2月)
    Flex的危局,还是HTML5的盛宴?
    在MBP上自由切换显卡
    Django的中文编码问题
    Jenkins+Maven+SVN快速搭建持续集成环境(转)
    解决 phpmyadmin #2002 无法登录 MySQL 服务器
    Spring框架中获得DataSource对象的方法(转)
    jetty 源代码地址
    eclipse中js文件报missing semicolon
    等额本息贷款月付款额的推导公式
  • 原文地址:https://www.cnblogs.com/rdchen/p/10115148.html
Copyright © 2020-2023  润新知