12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427 |
- //绑定查询框,bindTable需要绑定的table,copy的对象,需要查询的表
- function bindQueryInput(copyFromTr,queryTable,trOnly){
- var trStr = "<tr>";
- var totalTr = "<tr id='detailTotal'>";
- $(copyFromTr).find("label,input,select").each(
- function (){
- var widthStr = $(this).attr("width");
- if($(this).attr("type") && $(this).attr("type") == 'checkbox'){
- trStr=trStr+"<td width='"+widthStr+"'> </td>";
- totalTr = totalTr + "<td>合计</td>";
- }else{
- if($(this).attr("unUseOrder")!="Y"){
-
- var tdStr = "<td width='"+widthStr+"'><input style='width: 100%' type='text' name='"+$(this).attr("name")+"' id='"+$(this).attr("name")+"' onkeydown='javascript:doBindQueryInput(this)'/></td>"
- var totalTd = "<td><label name='"+$(this).attr("name")+"'></label></td>";
- trStr=trStr+tdStr;
- totalTr = totalTr+totalTd;
- }
- }
- }
- );
- trStr=trStr+"</tr>";
- totalTr=totalTr+"</tr>";
- $("#"+queryTable).find("tr:first").before(trStr);
- // $("#"+queryTable).find("tr:last").append(totalTr);
- }
- function bindQueryInput_(copyFromTr,queryTable,trOnly){
- var trStr = "<tr>";
- var totalTr = "<tr id='detailTotal'>";
- $(copyFromTr).find("label,input").each(
- function (){
- var widthStr = $(this).attr("width");
- if($(this).attr("type") && $(this).attr("type") == 'checkbox'){
- trStr=trStr+"<td width='"+widthStr+"'> </td>";
- totalTr = totalTr + "<td>合计</td>";
- }else{
- if($(this).attr("unUseOrder")!="Y"){
-
- var tdStr = "<td width='"+widthStr+"'><input style='width: 100%' queryTable='"+queryTable+"' trOnly='"+trOnly+"' type='text' name='tablesearch_"+$(this).attr("name")+"' id='tablesearch_"+$(this).attr("name")+"' onkeydown='javascript:doBindQueryInput_(this)'/></td>"
- var totalTd = "<td><label name='"+$(this).attr("name")+"'></label></td>";
- trStr=trStr+tdStr;
- totalTr = totalTr+totalTd;
- }
- }
- }
- );
- trStr=trStr+"</tr>";
- totalTr=totalTr+"</tr>";
- $("#"+queryTable).find("tr:first").before(trStr);
- }
- function doBindQueryInput_(obj,evt){
- var queryTable = $(obj).attr("queryTable");
- var trOnly = $(obj).attr("trOnly");
-
- evt = (evt) ? evt : ((window.event) ? window.event : "");
- var keyCode = evt.keyCode ? evt.keyCode : (evt.which ? evt.which : evt.charCode);
- if(keyCode==13){
- $("#"+queryTable).find("tr").each(
- function (){
- if($(this).attr(trOnly)){
- $(this).css("display","");
- }
- }
- );
- $(obj).parent().parent().find("input").each(
- function (){
- if($(this).val()){
- var inputValue = $(this).val();
- var attrName = ($(this).attr("name")).replace("tablesearch_","");
-
- $("#"+queryTable).find("tr").each(
- function (){
- if($(this).css("display") != "none"){
- if($(this).attr(trOnly)){
- $(this).find("label[name="+attrName+"]").each(
- function (){
- if($(this).text().indexOf(inputValue) >= 0){
- $(this).parent().parent().css("display","");
- }else{
- $(this).parent().parent().css("display","none");
- }
- }
- );
- }
- }
- }
- );
- }
- }
- );
- }
- }
- // 公共信息变更函数
- function contentChange(contentChangeList, _this) {
- try {
- if (!$.isArray(contentChangeList) || !_this) {
- return;
- }
- // no change的标志
- if ($(_this).attr("noChange") == "true" || $(_this).attr("noChange") == true) {
- return;
- }
-
- if ( $(_this).attr("name") != undefined
- && $(_this).attr("name") != ""
- && $.inArray($(_this).attr("name"),contentChangeList) == -1 ) {
- contentChangeList.push($(_this).attr("name"));
- }else if( $(_this).attr("comboname") != undefined
- && $(_this).attr("comboname") != ""
- && $.inArray($(_this).attr("comboname"),contentChangeList) == -1 ){
- contentChangeList.push($(_this).attr("comboname"));
- } else if( $(_this).attr("numberboxname") != undefined
- && $(_this).attr("numberboxname") != ""
- && $.inArray($(_this).attr("numberboxname"),contentChangeList) == -1 ){
- contentChangeList.push($(_this).attr("numberboxname"));
- }
- else if ($(_this).attr("nativeChangeField") != undefined && $(_this).attr("nativeChangeField") != "" && $.inArray($(_this).attr("nativeChangeField"),contentChangeList) == -1) {
- contentChangeList.push($(_this).attr("nativeChangeField"));
- }
- } catch (e) {
- // do nothing
- }
- }
- function isObject(v) {
- return typeof v == 'object' && v.constructor == Object ? true : false;
- };
- function isJQuery(v) {
- return typeof v.jquery != 'undefined';
- }
- // bind jQueryDatepicker to <input/>
- function initDatePicker(selector) {
- if (!isJQuery(selector || {})) {
- return;
- }
- $.loadJQueryDatepickerWidegt();
- selector.each(function() {
- // alert(this.outerHTML);
- _this = $(this);
- $(this).datepicker({
- showDateFormater : true,
- changeMonth : true, // 设置可选 mouth
- changeYear : true, // 设置可选 year
- showButtonPanel : true, // 显示 下方 今天、关闭 button
- // numberOfMonths: 3, // 同时显示3列datepicker
- showOn : '', // 取消 自动 show
- duration : 0
- // 取消动态效果
- });
- $(this).next(".time_img").click(function() {
- try {
- // alert($(this).prev(".hasDatepicker").get(0).outerHTML);
- $(this).prev(".hasDatepicker").datepicker('show');
- } catch (e) {
- // it is not a datepicker
- }
- });
- })
- }
- (function($) {
-
- $.fn.getFormValue = function() {
- var o = {};
- $(this).find('input,select,textarea').each(function() {
- if ($(this).attr("name") != "") {
- if ($(this).val() || $(this).val() == 0) {
- if ($(this).val() == "") {
- if(typeof($(this).attr("editType")) != 'undefined' && $(this).attr("editType").toUpperCase() == "CKEDITOR") {
- o[$(this).attr("name")] = CKEDITOR.instances[$(this).attr("name")].getData();
- }else {
- o[$(this).attr("name")] = null;
- }
- } else {
- if ($(this).attr("editType") == "suggestBox") {
- o[$(this).attr("name")] = $(this).attr("hiddenValue");
- o[$(this).attr("name") + "_name"] = $(this).val();
- } else if ($(this).attr("editType") == "simpleCheckbox") {
- if ($(this).attr("checked")) {
- o[$(this).attr("name")] = 1;
- } else {
- o[$(this).attr("name")] = 0;
- }
- } else if(typeof($(this).attr("editType")) != 'undefined' && $(this).attr("editType").toUpperCase() == "CKEDITOR") {
- o[$(this).attr("name")] = CKEDITOR.instances[$(this).attr("name")].getData();
- }else {
-
-
- if( $(this).attr("class")=="easyui-numberbox numberbox-f validatebox-text" ) {//数值型
- var field = $(this).attr("numberboxname");
- var value = $(this).next().val();
- o[field] = value;
- }else if( $(this).attr("class")=="easyui-datebox datebox-f combo-f" ) {//日期型
- var field = $(this).attr("comboname");
- var value = $(this).next()[0].children[2].value;
- o[field] = value;
- }else if( $(this).hasClass("easyui-combobox")){//下拉框
- var field = $(this).attr("comboname");
- var value = $(".combo-value[name="+field+"]").val();
- o[field] = value;
- }else if( $(this).attr("type")=="checkbox" ){//复选框
- var field = $(this).attr("name");
- var value = $(this).val();
- if( this.checked ) {
- o[field] = ( value=="on" ? 1:value );
- }else{
- o[field] = 0;
- }
- }else if( $(this).attr("type")=="radio" ){//单选框
- var field = $(this).attr("name");
- var value = $(this).val();
- if( this.checked ) {
- o[field] = ( value=="on" ? 1:value );
- }else{
- o[field] = 0;
- }
- }
- else{
- //解决IE8下 时间控件的值为"NULL"的问题
- if ("null" == $(this).val())
- {
- o[$(this).attr("name")] = null;
- }
- else
- {
- o[$(this).attr("name")] = $(this).attr("hiddenValue") || $.trim($(this).val());
- }
-
- }
- }
- }
- }
- }
- });
- return o;
- };
-
- $.fn.fillForm = function( data ) {
- $(this).form("load", data);
- $(this).find('input').each(function() {
- if ($(this).attr("name") != "") {
- var name = $(this).attr("name") ;
- if( $(this).attr("type")=="checkbox" || $(this).attr("type")=="radio" ){//复选框
- var value = $(this).val();
- if( ( value == data[name] || data[name] ==1) && data[name] !=0 ){
- this.checked = true;
- }
- }
- }
- });
-
- $(this).find("input[myType='easyui-combobox']").each(function(i){
- var a = this;
-
- var comboname = $(a).attr("comboname");
-
- if (comboname != "")
- {
- var lastSub = comboname.substring(comboname.length-2,comboname.length);
-
- var textName = "";
-
- if ("Id" == lastSub)
- {
- textName = comboname.replace("Id","Name");
- }
- else
- {
- textName = comboname + "Name";
- }
-
- if (!data[textName])
- {
- data[textName]=data[comboname];
- }
-
- $(a).combobox('setValue',data[comboname]);
-
- if ($(a).combobox('getText') == $(a).combobox('getValue'))
- {
- $(a).combobox('setText',data[textName]);
- }
- }
- });
-
- $(this).find("input[myType='easyui-combogrid']").each(function(i){
- var a = this;
-
- var comboname = $(a).attr("comboname");
-
- if (comboname != "")
- {
- var lastSub = comboname.substring(comboname.length-2,comboname.length);
-
- var textName = "";
-
- if ("Id" == lastSub)
- {
- textName = comboname.replace("Id","Name");
- }
- else
- {
- textName = comboname + "Name";
- }
-
- if (!data[textName])
- {
- data[textName]=data[comboname];
- }
-
- var opts = $(a).combogrid('options');
-
- var ele = {};
- ele[opts.idField] = data[comboname];
- ele[opts.textField] = data[textName];
-
- // $(a).combogrid('grid').datagrid({data:[ele]});
-
- $(a).combogrid('setValue',data[comboname]);
-
- if (!$(a).combogrid('getText'))
- {
- $(a).combogrid('setText',data[textName]);
- }
- //$(".combo-value[name="+comboname+"]").val(data[comboname]);
- }
- });
- };
-
- $.fn.disabledContentFeild = function(fields) {
- $(this).find('input,select,textarea').each(
- function() {
- var isDisabled = true;
- if (fields == "all") {
- $(this).attr("disabled", true);
- } else if (fields[0] == "all") {
- $(this).attr("disabled", true);
- } else if (fields.contains($(this).attr("name")) || fields.contains($(this).attr("nativeChangeField"))) {
- $(this).attr("disabled", true);
- } else {
- isDisabled = false;
- }
- if (isDisabled && $(this).hasClass("hasDatepicker")) {
- $(this).next(".time_img").unbind("click");
- }
-
- if (isDisabled && $(this).attr("editType") == "comment") {
- //$(this).next(".commentClass").css("display", 'none');
- $(this).next(".commentClass").attr("disabled", true);
- }
-
- if (isDisabled && $(this).attr("editType") == "suggestBox" && $(this).attr("hasShowTrigger") == true) {
- //$(this).next(".suggestbox-trigger-img").css("display", 'none');
- $(this).next(".suggestbox-trigger-img").attr("disabled", true);
- }
- });
- }
- })(jQuery);
- /**
- * 绑定DOM对象的事件
- * @param {} _scope 绑定范围
- */
- function bindEditTypeEvent(_scope) {
- if (!_scope) {
- _scope = $("body");
- }
- $(_scope).find('input,textarea,select').each(function() {
- if ($(this).attr("notBlank") && ($(this).parent(0).prev().text()).indexOf("*") == -1) {
- $(this).parent(0).prev().html("<font color='red'>*</font>"+$(this).parent(0).prev().text());
- }
-
- if(typeof($(this).attr("editType")) != 'undefined') {
- if ($(this).attr("editType") == "int") {
- $(this).bindIntKeyDown();
- }
- else if ($(this).attr("editType") == "float") {
- $(this).bindDecimalKeyDown();
- }
- else if ($(this).attr("editType") == "combo") {
- if (typeof(dictionary) != 'undefined' && dictionary) {
- if (dictionary[$(this).attr("name")]) {
-
- if (!$(this).attr("notBlank") || $(this).attr("emptyOption")) {
- var op = new Option('', '');
- $(this).get(0).options.add(op);
- $(this).val('');
- }
-
- var dictionaryList = dictionary[$(this).attr("name")];
- for (var i = 0; i < dictionaryList.length; i++) {
- var op = new Option(dictionaryList[i]['dictionaryName'],dictionaryList[i]['dictionaryId']);
- $(this).get(0).options.add(op);
- }
-
- // 扩展defaultValue属性
- if($(this).attr("defaultValue")) {
- $(this).val($(this).attr("defaultValue"));
- }
- }
- }
- }
- else if ($(this).attr("editType") == "date" || $(this).attr("editType") == "dateTime") {
- $(this).nextAll('.hh').attr("maxLength",2);
- $(this).nextAll('.mm').attr("maxLength",2);
- }
- else if ($(this).attr("editType") == "comment") {
- if ($(this).nextAll(".commentClass").length == 0) {
- $(this).after("<button class='commentClass'>添加备注</button>");
- var _field = $(this).attr("id");
- $(this).nextAll(".commentClass").click(function() { addCommentDetail(_field);});
- $(this).attr("readonly",true);
- }
- }
- else if ($(this).attr("editType").toLowerCase() == "signedint") {
- $(this).bindSignedIntKeyDown();
- }
- else if ($(this).attr("editType").toLowerCase() == "signedfloat") {
- $(this).bindSignedDecimalKeyDown();
- }
-
- }
- if($(this).attr("maxLength") == 'undefined' && $(this).attr("tagName").toUpperCase() == "TEXTAREA") {
- $(this).attr("maxLength",65534);
- }
- });
- }
- // 校验和取得日期控件的值
- function generatDateTimeFromInput(object, fileds, tag) {
- var isOk = true;
- for (var i = 0; i < fileds.length; i++) {
- var fieldName = fileds[i];
- if (object[fieldName] != "" && object[fieldName] != undefined && object[fieldName] != null) {
- var dateFormat = /^(\d{4})\-(\d{2})\-(\d{2}) ([01]{0,1}[0-9]|2[0-3]):([0-5]{0,1}[0-9]):(\d{2})$/;
- var _this = $(tag).find("input[name='" + fieldName + "']");
- $(_this).each(function() {
- var hh = $(this).nextAll('.hh').val();
- var mm = $(this).nextAll('.mm').val();
- var ss = "00";
- if (hh == null || hh == "") {
- hh = "00";
- }
- if (mm == null || mm == "") {
- mm = "00";
- }
- object[fieldName] = object[fieldName] + " " + hh + ":" + mm + ":" + ss;
- if (!dateFormat.test(object[fieldName])) {
- commonErrorPrompt($(this).attr("promptName")==undefined?"必填项":$(this).attr("promptName") + "日期格式不正确");
- _this.focus();
- isOk = false;
- }
- });
- }
- }
- return isOk;
- }
- /**
- * 验证表单数据
- * @param {} _scope 查找域
- * @return {}
- */
- function validateValue(_scope) {
-
- var result = true;
- $(_scope).each(function() {
- if (result) {
- var _thisObject=$(this);
- if($(this).attr("editType")){
- var t_editType = $(this).attr("editType").toLowerCase();
- if(t_editType=='int'||t_editType=='float'||t_editType=='signedint'||t_editType=='signedfloat'){
- if($(this).val()){
- if(isNaN($(this).val())){
- result = false;
- _thisObject.focus();
- commonErrorPrompt($(this).attr("promptName") + "数值类型不正确");
- return;
- }
- if (typeof($(this).attr("maxValue")) == 'undefined') {
- $(this).attr("maxValue","999999999");
- }
- if (typeof($(this).attr("minValue")) == 'undefined') {
- $(this).attr("minValue","-999999999");
- }
- }
- }
- if(t_editType=='simplecheckbox'){
- if ($(this).attr("notBlank") && !$(this).attr("checked")) {
- result = false;
- commonErrorPrompt(($(this).attr("promptName")==undefined?"必填项":$(this).attr("promptName")) + "不能为空");
- return _thisObject.focus();
- }
- }
- }
-
- if ($(this).attr("notBlank")) {
- if (typeof($(this).val()) == 'undefined' || $(this).val() == null || $(this).val().trim() == "") {
- result = false;
- commonErrorPrompt(($(this).attr("promptName")==undefined?"必填项":$(this).attr("promptName")) + "不能为空");
- return _thisObject.focus();
- }
- }
- if ($(this).val() != null && $(this).val() != "null" ) {
- if ($(this).attr("minValue")) {
- if ($(this).val() != "") {
- if (!isNaN($(this).attr("minValue")
- && !isNaN($(this).val()))) {
- if (parseFloat($(this).attr("minValue")) > parseFloat($(this).val())) {
- //alert($(this).val());
- result = false;
- _thisObject.focus();
- commonErrorPrompt($(this).attr("promptName") + "不能小于" + $(this).attr("minValue"));
- return;
- }
- }
- }
- }
- if ($(this).attr("maxValue")) {
- if ($(this).val() != "") {
- if (!isNaN($(this).attr("maxValue")
- && !isNaN($(this).val()))) {
- if (parseFloat($(this).attr("maxValue")) < parseFloat($(this).val())) {
- result = false;
- _thisObject.focus();
- commonErrorPrompt($(this).attr("promptName") + "不能大于" + $(this).attr("maxValue"));
- return;
- }
- }
- }
- }
- if ($(this).attr("maxLength")&&$(this).attr("maxLength")<65535) {
- if ($(this).val() != "") {
- if ($(this).val().length > $(this).attr("maxLength")) {
- result = false;
- _thisObject.focus();
- commonErrorPrompt($(this).attr("promptName") + "长度不能大于"+ $(this).attr("maxLength"));
- return;
- }
- }
- }else{
- if ($(this).val() != "") {
- if ($(this).val().length > 30 && $(this).attr("editType")!="suggestBox") {
- result = false;
- _thisObject.focus();
- commonErrorPrompt($(this).attr("promptName") + "长度不能大于"+ 30);
- return;
- }
- }
-
- }
- if ($(this).attr("regularExpression")) {
- if ($(this).val() != "") {
- var target = $(this).val();
- if (!$.jquery_Utils_FormVTypes[$(this).attr("regularExpression")](target,this)) {
- result = false;
- commonErrorPrompt($.i18n('adageCommonAllJS',$(this).attr("regularExpression")+ "Text"));
- return _thisObject.focus();
- };
- }
- }
- }
- }
- });
- return result;
- }
- /**
- * 勾选表格
- * @param {} _this
- * @param {} objStr
- */
- function checkAllForTable(_this, objStr) {
- var isChecked = false;
- if (_this.checked) {
- isChecked = true;
- }
- var checkboxs = document.getElementsByName(objStr);
- for (var i = 0; i < checkboxs.length; i++) {
- checkboxs[i].checked = isChecked;
- }
- }
- /**
- * 获取表单内的数值
- * @param {} _this
- * @return {}
- */
- function getFormValue(_this) {
- var o = {};
- $(_this).each(function() {
- if ($(this).attr("name") != "") {
- if ($(this).val() || $(this).val() == 0) {
- if ($(this).val() == "") {
- if(typeof($(this).attr("editType")) != 'undefined' && $(this).attr("editType").toUpperCase() == "CKEDITOR") {
- o[$(this).attr("name")] = CKEDITOR.instances[$(this).attr("name")].getData();
- }else {
- o[$(this).attr("name")] = null;
- }
- } else {
- if ($(this).attr("editType") == "suggestBox") {
- o[$(this).attr("name")] = $(this).attr("hiddenValue");
- o[$(this).attr("name") + "_name"] = $(this).val();
- } else if ($(this).attr("editType") == "simpleCheckbox") {
- if ($(this).attr("checked")) {
- o[$(this).attr("name")] = 1;
- } else {
- o[$(this).attr("name")] = 0;
- }
- } else if(typeof($(this).attr("editType")) != 'undefined' && $(this).attr("editType").toUpperCase() == "CKEDITOR") {
- o[$(this).attr("name")] = CKEDITOR.instances[$(this).attr("name")].getData();
- }else {
- o[$(this).attr("name")] = $(this).attr("hiddenValue") || $(this).val().trim();
- }
- }
- }
- }
- });
- return o;
- }
- // 获得日期类型的控件
- function getDateTimeFields(_this) {
- var returnArray = [];
- var inputArray = $(_this).find("input[editType=dateTime],input[editType=date]");
- $(inputArray).each(function() {
- if ($(this).attr("name")) {
- returnArray.push($(this).attr("name"));
- }
- });
- return returnArray;
- }
- // 处理时间填充
- function fillFieldWithDateTime(_this, dateValue) {
- var dateArray = dateValue.split(" ");
- $(_this).val(dateArray[0]);
- var hhMMArray = dateArray[1].split(":");
- $(_this).nextAll('.hh').val(hhMMArray[0]);
- $(_this).nextAll('.mm').val(hhMMArray[1]);
- }
- // 处理时间填充
- function fillFieldWithDate(_this, dateValue) {
- var dateArray = dateValue.split(" ");
- $(_this).val(dateArray[0]);
- }
- // 根据组件类型来进行赋值
- function fillingData(_this, information) {
- $(_this).find('input,select,textarea').each(function() {
- if (information[$(this).attr("name")]
- || information[$(this).attr("name")] == 0) {
- if ($(this).attr("editType") == "suggestBox") {
- $(this).attr("hiddenValue", information[$(this).attr("name")]);
- $(this).val(information[$(this).attr("name") + "_name"]);
- } else if ($(this).attr("editType") == "dateTime") {
- fillFieldWithDateTime(this, information[$(this).attr("name")]);
- } else if ($(this).attr("editType") == "date") {
- fillFieldWithDate(this, information[$(this).attr("name")]);
- } else if ($(this).attr("editType") == "simpleCheckbox") {
- if (information[$(this).attr("name")] == 1 || information[$(this).attr("name")] == "1") {
- $(this).attr("checked", true);
- } else {
- $(this).attr("checked", false);
- }
- }
- else if ($(this).attr("editType") == "my97Date")
- {
- if($(this).attr("dateFmt") == "yyyy-MM-dd HH:mm:ss")
- {
- var strTime = information[$(this).attr("name")];
- var datTime = new Date(Date.parse(strTime.replace(/-/g, "/")));
- var mon = datTime.getMonth().toString().length ==1 ? "0"+(datTime.getMonth()+1).toString():(datTime.getMonth()+1).toString();
- var d = datTime.getDate().toString().length ==1 ? "0"+datTime.getDate().toString():datTime.getDate().toString();
- var h = datTime.getHours().toString().length ==1 ? "0"+datTime.getHours().toString():datTime.getHours().toString();
- var m = datTime.getMinutes().toString().length ==1 ? "0"+datTime.getMinutes().toString():datTime.getMinutes().toString();
- var s = datTime.getSeconds().toString().length ==1 ? "0"+datTime.getSeconds().toString():datTime.getSeconds().toString();
- $(this).val(datTime.getFullYear()+"-"+mon+"-"+d+" "+h+":"+m+":"+s);
- }
- else if($(this).attr("dateFmt") == "yyyy-MM-dd HH:mm")
- {
- var strTime = information[$(this).attr("name")];
- var datTime = new Date(Date.parse(strTime.replace(/-/g, "/")));
- var mon = datTime.getMonth().toString().length ==1 ? "0"+(datTime.getMonth()+1).toString():(datTime.getMonth()+1).toString();
- var d = datTime.getDate().toString().length ==1 ? "0"+datTime.getDate().toString():datTime.getDate().toString();
- var h = datTime.getHours().toString().length ==1 ? "0"+datTime.getHours().toString():datTime.getHours().toString();
- var m = datTime.getMinutes().toString().length ==1 ? "0"+datTime.getMinutes().toString():datTime.getMinutes().toString();
- var s = datTime.getSeconds().toString().length ==1 ? "0"+datTime.getSeconds().toString():datTime.getSeconds().toString();
- $(this).val(datTime.getFullYear()+"-"+mon+"-"+d+" "+h+":"+m);
- }
- else if($(this).attr("dateFmt") == "yyyy-MM-dd")
- {
- var strTime = information[$(this).attr("name")];
- var datTime = new Date(Date.parse(strTime.replace(/-/g, "/")));
- var mon = datTime.getMonth().toString().length ==1 ? "0"+(datTime.getMonth()+1).toString():(datTime.getMonth()+1).toString();
- var d = datTime.getDate().toString().length ==1 ? "0"+datTime.getDate().toString():datTime.getDate().toString();
- $(this).val(datTime.getFullYear()+"-"+mon+"-"+d);
- }
- }
- else {
- $(this).val(information[$(this).attr("name")]);
- }
- }
- });
- }
- // 不可编辑操作
- function disabledFeild(_scope, fields) {
- $(_scope).each(function() {
- if (fields == "all") {
- $(this).attr("disabled", true);
- } else if (fields[0] == "all") {
- $(this).attr("disabled", true);
- } else if (fields.contains($(this).attr("name"))
- || fields.contains($(this).attr("nativeChangeField"))) {
- $(this).attr("disabled", true);
- }
- })
- }
- /**
- * <p>
- * Description:[设置页面不可编辑属性]
- * </p>
- * @param {} _scope
- * @param {} fields
- */
- function disabledAttributes(_scope, fields) {
- if(fields.hasOwnProperty("unEditableFields")) {
- _scope.find('input,select,textarea').each(function() {
- var isDisabled = true;
- if (fields["unEditableFields"] == "all") {
- isDisabled = true;
- //$(this).attr("disabled", true);
- } else if (fields["unEditableFields"][0] == "all") {
- isDisabled = true;
- //$(this).attr("disabled", true);
- } else if (fields["unEditableFields"].contains($(this).attr("name"))) {
- isDisabled = true;
- } else if (fields["unEditableFields"].contains($(this).attr("numberboxname"))
- || fields["unEditableFields"].contains($(this).attr("comboname"))) {
- isDisabled = true;
- }else {
- isDisabled = false;
- }
-
- if(isDisabled) {
- var bgFlg = true;
- if($(this).hasClass("combo-value")) {
- var $ele = $(this).parent().prev();
- if ($ele.attr("myType") == 'easyui-combobox' || $ele.hasClass("easyui-combobox"))
- {
- $ele.combobox('disable');
- }
- else if ($ele.attr("myType") == 'easyui-combogrid' || $ele.hasClass("easyui-combogrid"))
- {
- $ele.combogrid('disable');
- $ele.attr("disabled", "disabled");
- }
- else
- {
- $ele.attr("disabled", "disabled");
- }
- }
- else if($(this).hasClass("easyui-numberbox")) {
- $(this).numberbox('disable');
- }
- else if($(this).hasClass("easyui-datebox")) {
- $(this).datebox('disable');
- }
- else if($(this).attr("myType") == 'easyui-combogrid') {
- $(this).combogrid('disable');
- $(this).attr("disabled", "disabled");
- }
- else if($(this).attr("type") == 'hidden')
- {
- // $(this).removeAttr("disabled");
- }
- else
- {
- $(this).attr("disabled", "disabled");
- }
- }
- });
- }
-
- if(fields.hasOwnProperty("unEditableButtons")) {
- _scope.find('a').each(function() {
- if ($(this).hasClass("easyui-linkbutton"))
- {
- if (fields["unEditableButtons"] == "all") {
- $(this).hide();
- } else if (fields["unEditableButtons"][0] == "all") {
- $(this).hide();
- } else if (fields["unEditableButtons"].contains($(this).attr("id"))) {
- $(this).hide();
- }
- }
- });
- }
- }
- /**
- * <p>
- * Description:[设置页面可编辑属性]
- * </p>
- * @param {} _scope
- * @param {} fields
- */
- function unDisabledAttributes(_scope, fields) {
- if(fields.hasOwnProperty("editableFields")) {
- _scope.find('input,select,textarea').each(function() {
- var isDisabled = true;
- if (fields["editableFields"] == "all") {
- $(this).attr("disabled", false);
- } else if (fields["editableFields"][0] == "all") {
- $(this).attr("disabled", false);
- } else if (fields["editableFields"].contains($(this).attr("name"))
- || fields["editableFields"].contains($(this).attr("nativeChangeField"))) {
- $(this).attr("disabled", false);
- } else {
- isDisabled = false;
- }
-
- if(isDisabled) {
- var bgFlg = true;
- if($(this).attr("tagName").toUpperCase() == 'TEXTAREA') {
- $(this).attr('readonly',false);
- $(this).next(".commentClass").attr("disabled", false);
- isDisabled = false;
- }
- else if ($(this).attr("editType") == "suggestBox") {
- //$(this).next(".suggestbox-trigger-img").css("display", 'none');
- $(this).next(".suggestbox-trigger-img").attr("disabled", false);
- }
- else if(isDisabled && $(this).attr("editType") == "container") {
- $(this).next().attr("disabled", false);
- }
- else if (isDisabled && $(this).hasClass("hasDatepicker")) {
- $(this).next(".time_img").unbind("click");
- $(this).next(".time_img").attr("disabled",false);
- }
- else if($(this).attr("editType") == "simpleCheckbox") {
- bgFlg = false;
- }
-
- if(isDisabled) {
- $(this).attr("disabled", false);
- }
- if(bgFlg) {
- $(this).css('background','');
- }
- }
- });
- }
-
- if(fields.hasOwnProperty("editableButtons")) {
- _scope.find('button').each(function() {
- if (fields["editableButtons"] == "all") {
- $(this).attr("disabled", false);
- } else if (fields["editableButtons"][0] == "all") {
- $(this).attr("disabled", false);
- } else if (fields["editableButtons"].contains($(this).attr("name"))) {
- $(this).attr("disabled", false);
- }
- });
- _scope.find('input[type=button]').each(function() {
- if (fields["editableButtons"] == "all") {
- $(this).attr("disabled", false);
- } else if (fields["editableButtons"][0] == "all") {
- $(this).attr("disabled", false);
- } else if (fields["editableButtons"].contains($(this).attr("name"))) {
- $(this).attr("disabled", false);
- }
- });
- }
- }
- /**
- * 添加备注浮层
- * @param {} _field 绑定的textarea
- */
- function addCommentDetail(_field) {
- $.Window.showWindow('addCommentDetailForCommentFormate', {
- intervalLoad : true,
- width : '310px',
- height : '40%',
- onRender : function(config, winId) {// set comment window's
- // z-index for over other
- // window
- $("#" + winId).find("#__jWin_mask-msg").css("z-index",90000);
- },
- url : 'addCommentDetailForCommentFormate.action',
- params : {
- field : _field
- },
- waitText : 'load...'
- }, function(data) {
- });
- }
- function openCommonQueryPage(pageName, action, _params, width, height,fieldUseScope) {
- $.Window.showWindow(pageName, {
- intervalLoad : true,
- width : width,
- height : height,
- onRender : function(config, winId) {// set comment window's
- // z-index for over other
- // window
- $("#" + winId).find("#__jWin_mask-msg").css("z-index",90000);
- },
- url : action,
- params : _params,
- waitText : 'load...'
- }, function(data) {
- _fieldUseScope = fieldUseScope;
- });
- }
- /**
- * <p>
- * Description:[前台js浮点数-乘法]
- * </p>
- * @param {} arg1
- * @param {} arg2
- * @return {}
- */
- function accMul(arg1,arg2){
- var m=0,s1=arg1.toString(),s2=arg2.toString();
- try{m+=s1.split(".")[1].length;}catch(e){}
- try{m+=s2.split(".")[1].length;}catch(e){}
- return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m);
- }
- /**
- * <p>
- * Description:[前台js浮点数-除法]
- * </p>
- * @param {} arg1
- * @param {} arg2
- * @return {}
- */
- function accDiv(arg1,arg2){
- var t1=0,t2=0,r1,r2;
- try{t1=arg1.toString().split(".")[1].length}catch(e){}
- try{t2=arg2.toString().split(".")[1].length}catch(e){}
- with(Math){
- r1=Number(arg1.toString().replace(".",""))
- r2=Number(arg2.toString().replace(".",""))
- return (r1/r2)*pow(10,t2-t1);
- }
- }
- /**
- * <p>
- * Description:[前台js浮点数-加法和减法]
- * </p>
- * @param {} arg1
- * @param {} arg2
- * @return {}
- */
- function accAdd(arg1, arg2) {
- var r1, r2, m;
- try {r1 = arg1.toString().split(".")[1].length} catch (e) {r1 = 0}
- try {r2 = arg2.toString().split(".")[1].length} catch (e) {r2 = 0}
- m = Math.pow(10, Math.max(r1, r2))
- return (arg1 * m + arg2 * m) / m;
- }
- /**
- * <p>
- * Description:[suggestBox附加信息填充]
- * </p>
- *
- * @param {} _data 选择SuggestBox行数据
- * @param {} _scope 设值范围
- * @param {} _mappingExtend 映射关系
- */
- function fillSuggestBoxExtraData(_data,_scope,_mappingExtend) {
- var _params = _data["params"];
- if(typeof(_params) != 'undefined' && _params != null) {
- for(var _filed in _mappingExtend) {
- // 首先先清空之前的数据
- $(_scope).find("input[name='"+_filed+"'],select[name='"+_filed+"'],textarea[name='"+_filed+"']").each(
- function() {
- if ($(this).attr("editType") == "suggestBox") {
- $(this).attr("hiddenValue", "");
- $(this).val("");
- } else if ($(this).attr("editType") == "dateTime") {
- fillFieldWithDateTime(this, "");
- } else if ($(this).attr("editType") == "date") {
- fillFieldWithDate(this, "");
- } else if ($(this).attr("editType") == "simpleCheckbox") {
- $(this).attr("checked", false);
-
- } else {
- $(this).val("");
- }
- $(this).change();
- }
- );
- $(_scope).find("input[name='"+_filed+"'],select[name='"+_filed+"'],textarea[name='"+_filed+"']").each(
- function() {
- var __value__ = _params[_mappingExtend[_filed]];
- if(typeof(__value__) == 'undefined' || __value__ == null || __value__== 'null') {
- __value__ = "";
- }
- if($(this).attr("tagName").toUpperCase() == "SELECT" && !(typeof($(this).attr("defaultValue")) =="undefined" || $(this).attr("defaultValue") == null) && __value__ == "") {
- __value__ = $(this).attr("defaultValue");
- }
-
- if ($(this).attr("editType") == "suggestBox") {
- $(this).attr("hiddenValue", __value__);
- $(this).val(_params[_mappingExtend[_filed + "_name"]]);
- } else if ($(this).attr("editType") == "dateTime") {
- fillFieldWithDateTime(this, __value__);
- } else if ($(this).attr("editType") == "date") {
- fillFieldWithDate(this, __value__);
- } else if ($(this).attr("editType") == "simpleCheckbox") {
- if (__value__ == 1 || __value__ == "1") {
- $(this).attr("checked", true);
- } else {
- $(this).attr("checked", false);
- }
-
- } else {
- $(this).val(__value__);
- }
- $(this).change();
- }
- );
- }
- }
- }
- /**
- * 比较开始时间和结束时间的大小。
- * 如果有一个为空,不比较,并返回true。
- * @param _scope
- * @param dateFrom
- * @param dateTo
- * @returns {Boolean}
- */
- function compareDate(_scope,dateFrom,dateTo){
- var fromV;
- var toV;
- var from = $(_scope).find("input[name="+dateFrom+"]");
- var to = $(_scope).find("input[name="+dateTo+"]");
- if (from.val() == null || from.val() == undefined || from.val() == null) {
- return true;
- }else{
- fromV = from.val();
- var hh = $(from).nextAll('.hh').val();
- var mm = $(from).nextAll('.mm').val();
- var ss = "00";
- if (hh == null || hh == "") {
- hh = "00";
- }
- if (mm == null || mm == "") {
- mm = "00";
- }
- fromV = fromV + " "+hh+":"+mm+":"+ss;
- }
- if (to.val() == "" || to.val() == undefined || to.val() == null) {
- return true;
- }else{
- toV = to.val();
- var hh = $(to).nextAll('.hh').val();
- var mm = $(to).nextAll('.mm').val();
- var ss = "00";
- if (hh == null || hh == "") {
- hh = "00";
- }
- if (mm == null || mm == "") {
- mm = "00";
- }
- toV = toV + " "+hh+":"+mm+":"+ss;
- }
- if(fromV > toV){
- commonErrorPrompt(from.attr("promptName") + "不能大于" + to.attr("promptName"));
- return false;
- }
- return true;
- }
- /**
- * 比较开始时间和结束时间的大小。
- * 如果有一个为空,不比较,并返回true。
- * @param _scope
- * @param dateFrom
- * @param dateTo
- * @returns {Boolean}
- */
- function compareNowDate(_scope,dateFrom,dateTo){
- var fromV;
- var toV;
- var from = $(_scope).find("input[name="+dateFrom+"]");
- var to = $(_scope).find("input[name="+dateTo+"]");
- if (from.val() == null || from.val() == undefined || from.val() == null) {
- return true;
- }else{
- fromV = from.val();
- var hh = $(from).nextAll('.hh').val();
- var mm = $(from).nextAll('.mm').val();
- var ss = "00";
- if (hh == null || hh == "") {
- hh = "00";
- }
- if (mm == null || mm == "") {
- mm = "00";
- }
- fromV = fromV + " "+hh+":"+mm+":"+ss;
- }
- if (to.val() == "" || to.val() == undefined || to.val() == null) {
- return true;
- }else{
- toV = to.val();
- var hh = $(to).nextAll('.hh').val();
- var mm = $(to).nextAll('.mm').val();
- var ss = "00";
- if (hh == null || hh == "") {
- hh = "00";
- }
- if (mm == null || mm == "") {
- mm = "00";
- }
- toV = toV + " "+hh+":"+mm+":"+ss;
- }
- if(fromV > toV){
- commonErrorPrompt(to.attr("promptName") + "不能小于" + from.attr("promptName"));
- return false;
- }
- return true;
- }
- /**
- *
- * @param _scope
- * @param dateFrom
- * @return
- */
- function compareCurrentDate(_scope,dateFrom){
- var fromV;
- var from = $(_scope).find("input[name="+dateFrom+"]");
- if (from.val() == null || from.val() == undefined) {
- return true;
- }else{
- fromV = from.val();
- var hh = $(from).nextAll('.hh').val();
- var mm = $(from).nextAll('.mm').val();
- var ss = "00";
- if (hh == null || hh == "") {
- hh = "00";
- }
- if (mm == null || mm == "") {
- mm = "00";
- }
- fromV = fromV + " "+hh+":"+mm+":"+ss;
- }
-
- var current = new Date();
-
- //过滤统一时间,分钟格式
- var month = current.getMonth()+1;
- var day = current.getDate();
- if(month<10){
- month = "0"+month;
- }
- if(day<10){
- day="0"+day;
- }
- var l = current.getFullYear()+"-"+month+"-"+day+" "+current.getHours()+":"+current.getMinutes()+":"+current.getSeconds();
- if(fromV<l){
- commonErrorPrompt(from.attr("promptName") + "必须大于当前日期");
- return false;
- }
- return true;
- }
- /**
- * 刷新调用js
- */
- function refreshDataPart(_scope,df){
- fillingData(_scope,df);
- }
- /**
- *
- * @param {} _scope 设置范围
- * @param {} privilegeConfig 权限配置
- */
- function hiddenOrDisabledWithPrivilege(_scope,privilegeConfig) {
-
- if(typeof(privilegeConfig) == 'undefined') {
- return;
- }
- if(privilegeConfig.hasOwnProperty("hiddenTabs")) {
- $(_scope).find('li').each(function() {
- if (privilegeConfig["hiddenTabs"].contains($(this).attr("name"))) {
- $(this).css("display", "none");
- // 隐藏Tab 映射对应的DIV
- var tab_div = $(this).find("a").eq(0).attr("href");
- if(typeof(tab_div) !="undefined" && tab_div.length !=0) {
- $(_scope).find(tab_div).css("display", "none");
- }
- }
- });
-
- $(_scope).find("div").each(function(){
-
- if (privilegeConfig["hiddenTabs"].contains($(this).attr("name"))) {
- $(this).css("display", "none");
- // 隐藏Tab 映射对应的DIV
- }
- })
-
- $(_scope).find("tr").each(function(){
- if (privilegeConfig["hiddenTabs"].contains($(this).attr("name"))) {
- $(this).css("display", "none");
- // 隐藏Tab 映射对应的DIV
- }
- })
- }
-
-
- if(privilegeConfig.hasOwnProperty("hiddenProperties")) {
- var hidden_properties = privilegeConfig["hiddenProperties"];
- $(_scope).find('input,select,textarea,button').each(function() {
- if (hidden_properties.contains($(this).attr("name"))) {
- // if($(this).attr("tagName").toUpperCase()=="BUTTON") {
- // $(this).css("display", "none");
- //
- // if($(this).parent(0).attr("tagName").toUpperCase()=="LI") {
- // $(this).parent(0).css("display", "none");
- // }
- // }
- // else {
- // $(this).parent().prev().css("display", "none");
- // $(this).parent().css("display", "none");
- // }
- $(this).css("display", "none");
-
- // remove 已处理的属性
- var _property_name = $(this).attr("name");
- hidden_properties = $.grep(hidden_properties,function(n,i) {
- return $.inArray(_property_name,hidden_properties) != -1;
- },false);
- }
- });
- }
-
- if(privilegeConfig.hasOwnProperty("disabledProperties")) {
-
- var _disabled_properties = privilegeConfig["disabledProperties"]
- $(_scope).find('input,select,textarea,button').each(function() {
- var isDisabled = true;
- var _property_name;
- if (_disabled_properties.contains($(this).attr("name")) ) {
- $(this).attr("disabled", true);
- _property_name = $(this).attr("name");
- }
- else if (_disabled_properties.contains($(this).attr("nativeChangeField"))) {
- $(this).attr("disabled", true);
- _property_name = $(this).attr("nativeChangeField");
- }
- else {
- isDisabled = false;
- }
-
- if(isDisabled) {
- // remove 已处理的属性
- _disabled_properties = $.grep(_disabled_properties,function(n,i) {
- return $.inArray(_property_name,_disabled_properties) != -1;
- },false);
- }
- if (isDisabled && $(this).hasClass("hasDatepicker")) {
- $(this).next(".time_img").unbind("click");
- $(this).next(".time_img").attr("disabled",true);
- }
-
- if (isDisabled && $(this).attr("editType") == "comment") {
- //$(this).next(".commentClass").css("display", 'none');
- $(this).next(".commentClass").attr("disabled", true);
- }
-
- if (isDisabled && $(this).attr("editType") == "suggestBox" && $(this).attr("hasShowTrigger") == true) {
- //$(this).next(".suggestbox-trigger-img").css("display", 'none');
- $(this).next(".suggestbox-trigger-img").attr("disabled", true);
- }
-
- //if (isDisabled && $(this).attr("tagName").toUpperCase() == 'INPUT') {
- if (isDisabled) {
- $(this).css('background','#eeeeee');
- }
- });
- }
- }
- function fillingLabelData(_this, information) {
- $(_this).find('label').each(function() {
- if (information[$(this).attr("name")] || information[$(this).attr("name")] != 0) {
- $(this).text(information[$(this).attr("name")]);
- }
- });
- }
- function timeBasic(timeName)
- {
- if ($("#"+timeName).attr("name") != "") {
- if (!basicChangeList.contains($("#"+timeName).attr("name"))) {
- basicChangeList.push($("#"+timeName).attr("name"));
- }
- } else if ($("#"+timeName).attr("nativeChangeField") != "") {
- if (!basicChangeList.contains($("#"+timeName).attr("nativeChangeField"))) {
- basicChangeList.push($("#"+timeName).attr("nativeChangeField"));
- }
- }
- }
- function timeBasicDetail(timeName)
- {
- if ($("#"+timeName).attr("name") != "") {
- if (!batchChangeList.contains($("#"+timeName).attr("name"))) {
- batchChangeList.push($("#"+timeName).attr("name"));
- }
- } else if ($("#"+timeName).attr("nativeChangeField") != "") {
- if (!batchChangeList.contains($("#"+timeName).attr("nativeChangeField"))) {
- batchChangeList.push($("#"+timeName).attr("nativeChangeField"));
- }
- }
- }
- function timeBasicDetail2(timeName)
- {
- if ($("#"+timeName).attr("name") != "") {
- if (!detailChangeList.contains($("#"+timeName).attr("name"))) {
- detailChangeList.push($("#"+timeName).attr("name"));
- }
- } else if ($("#"+timeName).attr("nativeChangeField") != "") {
- if (!detailChangeList.contains($("#"+timeName).attr("nativeChangeField"))) {
- detailChangeList.push($("#"+timeName).attr("nativeChangeField"));
- }
- }
- }
- //获取当前时间
- function GetCurrentDate()
- {
- var year=0;
- var Month=0;
- var day=0;
- var CurrentDate = new Date();
- return ChangeDateToString(CurrentDate);
- }
- function ChangeDateToString(DateIn)
- {
- var Year=0;
- var Month=0;
- var Day=0;
- var CurrentDate="";
- //初始化时间
- Year = DateIn.getYear();
- Month = DateIn.getMonth()+1;
- Day = DateIn.getDate();
- CurrentDate = Year + "-";
- if (Month >= 10 ){
- CurrentDate = CurrentDate + Month + "-";
- }else{
- CurrentDate = CurrentDate + "0" + Month + "-";
- }
- if (Day >= 10 ){
- CurrentDate = CurrentDate + Day ;
- }else{
- CurrentDate = CurrentDate + "0" + Day ;
- }
- return CurrentDate;
- }
- /**
- * 自动click收放内容
- */
- function autoTRClick(array){
- for (i = 0; i < array.length; i++)
- {
- var rid = array[i];
-
- $("#"+rid).click();
- }
- }
- /**
- * tr信息收放
- * @param rid
- * @return
- */
- function toggerTR(obj){
- var rid = $(obj).attr("id");
- $("tr[name="+rid+"]").toggle();
- }
|