12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067 |
- /**
- * 增加命名空间方法<br>
- * <p>
- * 用法:$.namespace("a.b.c"); a.b.c.testFunction=function(...);
- */
- $.extend($, {
- namespace : function() {
- var o, d;
- for (var i = 0, len = arguments.length; i < len; i++) {
- d = arguments[i].split(".");
- o = window[d[0]] = window[d[0]] || {};
- var left = d.slice(1);
- for (var i = 0, len = left.length; i < len; i++) {
- o = o[left[i]] = o[left[i]] || {};
- }
- }
- return o;
- },
- SUCCESS : "success",
- ERROR : "error",
- BLANK_UUID : "00"
- });
- //供左侧菜单使用
- function iFrameHeight(){
-
- var screen =$(window).height()-59;
- var left = $('#sidebar').height();
- var main = $('#content').height();
- if(left<screen){
- left = screen;
- }
- if(main<screen){
- main=screen;
- }
- if(left>main){
- main=left;
- }else{
- left = main;
- }
- $('#mainContent').height(left);
- $('#sidebar').height(left);
- $('#content').height(main-5);
- }
- //供iframe使用
- function iFrameHeightIframe(menucode){
- var h = $(window.parent.document).find('#content').height();
- if(menucode!=null&&menucode!=''){
- $(window.parent.document).find('#'+menucode).height(h-36-30);
- }
- if($(window.parent.document).find('#_my97DP')){
- // $(window.parent.document).find('#_my97DP iframe').css("width","202px");
- // $(window.parent.document).find('#_my97DP iframe').css("height","217px");
- // alert("w");
- }
- }
- //供iframe内的iframe使用
- function tabiFrameHeightIframe(menucode){
- var h = $(window.document).find('#mycontent').height();
- $(window.parent.document).find('#'+menucode+'iframe').height(h-230);
- }
- //分页共通
- function pageinfo(form){
- $("#pagesize").change(function() {
- $("#pagejump").val(1);
- form.submit();
- });
- $("#pagesize").val($("#pagesize").attr("num"));
- $("#pagefirst").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(1);
- form.submit();
- }
- });
- $("#pageprev").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) - 1);
- form.submit();
- }
- });
- $("#pagejump").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- form.submit();
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) + 1);
- form.submit();
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val($("#pagetotal").val());
- form.submit();
- }
- });
-
- $("#pagenow").click(function() {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- form.submit();
- });
- }
- //构建所在地的下拉
- //参数说明依次,1(必须)存放下拉的div的id,2(非必须)下拉初始选中的值,没有传没有传空字符串,3(非必须)下拉change事件,根据需要添加4(必须)下拉框的长度
- //此下拉如果跟着form一起提交后台的话,对应的是szd属性,
- function initszdSelect(divid,existVal,changefunc,width,jyr){
- var jsonJyr = null;
- if(jyr!=null&&jyr!=''){
- jsonJyr = $.parseJSON(jyr);
- }
- $.post($.app + "/selectSzd", {
-
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='szdselectpicker' name='szdid' onchange='"+changefunc+"()' id='szdid'>";
- }else{
- str+="<select class='szdselectpicker' name='szdid' onchange='"+changefunc+"()' id='szdid'>";
- }
- }else{
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='szdselectpicker' name='szdid' id='szdid'>";
- }else{
- str+="<select class='szdselectpicker' name='szdid' id='szdid'>";
- }
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var szd = data[i];
- if(szd.val==existVal||szd.id==(jsonJyr!=null?jsonJyr.szd:'')){
- str+=" <option selected='selected' value='"+szd.id+"' >"+szd.text+"</option>";
- }else{
- str+=" <option value='"+szd.id+"' >"+szd.text+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.szdselectpicker').selectpicker({
- width:width
- });
-
- }, "json");
- }
- //构建港口的下拉
- //参数说明依次,1(必须)存放下拉的div的id,2(非必须)下拉初始选中的值,没有传空字符串,3(非必须)参数,根据所在地过滤结果,一般级联需要4(非必须)下拉change事件5(必须)下拉框的长度
- //此下拉如果跟着form一起提交后台的话,对应的是szd属性,
- function initgkSelect(divid,existVal,szd,changefunc,width,jyr){
- var jsonJyr = null;
- if(jyr!=null&&jyr!=''){
- jsonJyr = $.parseJSON(jyr);
- szd=jsonJyr.szd;
- }
- $.post($.app + "/selectGk", {
- szd:szd
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gkselectpicker' name='szgkid' onchange='"+changefunc+"()' id='szgkid'>";
- }else{
- str+="<select class='gkselectpicker' name='szgkid' onchange='"+changefunc+"()' id='szgkid'>";
- }
-
- }else{
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gkselectpicker' name='szgkid' id='szgkid'>";
- }else{
- str+="<select class='gkselectpicker' name='szgkid' id='szgkid'>";
- }
- }
-
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var gk = data[i];
- if(gk.id==existVal||gk.id==(jsonJyr!=null?jsonJyr.szgk:'')){
- str+=" <option id='"+gk.zyid+"' selected='selected' value='"+gk.id+"' >"+gk.gkmc+"</option>";
- }else{
- str+=" <option id='"+gk.zyid+"' value='"+gk.id+"' >"+gk.gkmc+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.gkselectpicker').selectpicker({
- width:width
- });
- //如果所在地选择为空,重置港区select;
- }, "json");
- }
- //构建港区的下拉
- //参数说明依次,1(必须)存放下拉的div的id,2(非必须)下拉初始选中的值,没有传空字符串,3(非必须)参数,根据所在地过滤结果,一般级联需要4(非必须)下拉change事件5(必须)下拉框的长度
- //此下拉如果跟着form一起提交后台的话,对应的是szd属性,
- function initgqSelect(divid,existVal,szd,gk,changefunc,width,jyr){
- var jsonJyr = null;
- if(jyr!=null&&jyr!=''){
- jsonJyr = $.parseJSON(jyr);
- szd=jsonJyr.szd;
- gk = jsonJyr.szgk;
- }
- $.post($.app + "/selectGq", {
- szd:szd,
- szgk:gk
- }, function(data) {
- var str = "";
- if(changefunc!=null&&changefunc!=""){
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gqselectpicker' name='szgqid' onchange='"+changefunc+"()' id='szgqid'>";
- }else{
- str+="<select class='gqselectpicker' name='szgqid' onchange='"+changefunc+"()' id='szgqid'>";
- }
- }else{
- if(jyr!=null&&jyr!=''){
- str+="<select disabled class='gqselectpicker' name='szgqid' id='szgqid'>";
- }else{
- str+="<select class='gqselectpicker' name='szgqid' id='szgqid'>";
- }
- }
-
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var gq = data[i];
- if(gq.id==existVal||gq.id==(jsonJyr!=null?jsonJyr.szgq:'')){
- str+=" <option id='"+gq.zyid+"' selected='selected' value='"+gq.id+"' >"+gq.gqmc+"</option>";
- }else{
- str+=" <option id='"+gq.zyid+"' value='"+gq.id+"' >"+gq.gqmc+"</option>";
- }
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.gqselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //经营人共通选择,需要调用的页面必须引入jyrselect.jsp,
- //传入回调方法的名称
- function jyrselpop(selectFunc,flag){
- // if(isEmpty($('#szgqid').val())){
- // $.alert({
- // title: '提示',
- // content: '港区不能为空!',
- // });
- // return false;
- // }
- if(!isEmpty(flag)){
- $("#pagejump").val(1);
- }
- //pageinfo2();
- $('#jyrselectmaskdiv').fadeIn(100);
- $('#jyrselectdiv').slideDown(0);
- var gkjyr=$('#gkjyrmc').val();
- var szd = $('.szdselectpicker').val();
- var szgk = $('.gkselectpicker').val();
- var szgq = $('.gqselectpicker').val();
-
- $.ajax({
- url:$.app+"/selectJyr",
- type:"post",
- data:{
- szd:szd,
- szgk:szgk,
- szgq:szgq,
- gkjyr:gkjyr,
- page:$('#pagejump').val()
- },
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data) {
- var str="";
- for(var i=0;i<data.attrs.list.length;i++){
- var jyr = data.attrs.list[i];
- str+="<tr>";
- str+="<td>"+(i+1)+"</td>";
- str+="<td>"+jyr.gkjyr+"</td>";
- str+="<td > " +
- "<a class='btn btn-default btn-xs' href='#' onclick=\""+selectFunc+"('"+jyr.id+"')\">"+
- "<i class='glyphicon glyphicon-wrench'></i>选择</a> "+
- "</td>";
- str+="</tr>";
- }
- $("#jyr").empty();
- $("#jyr").append(str);
-
- $("#pagejump").val(data.attrs.page);
- $("#gongpage").html(data.attrs.gongpage);
- $("#nowshow").html(data.attrs.nowshow);
- $("#gongsize").html(data.attrs.gongsize);
- $("#pagecur").val(data.attrs.page);
- $("#pagetotal").val(data.attrs.totalpage);
- $("#pagesort").val(data.attrs.sort);
- $("#pageorder").val(data.attrs.order);
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- //流程历史
- function hisList(data,lx){
- $.ajax({
- url:$.app+"/hisList",
- type:"post",
- data:{
- id:data,
- lx:lx
- },
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data) {
- var str="";
- for(var i=0;i<data.length;i++){
- var task = data[i];
- str+="<tr>";
- str+="<td>"+(i+1)+"</td>";
- str+="<td >"+task.auditUsername +"</td>";
- str+="<td >"+task.auditTime +"</td>";
- str+="<td>"+task.currName+"</td>";
- if(task.auditResult =="true"){
- str+="<td>同意</td>";
- } else if(task.auditResult == "false"){
- str+="<td>退回</td>";
- }else{
- str+="<td></td>";
- }
-
- str+="<td>"+task.auditMsg+"</td>";
- str+="</tr>";
- }
- $("#hisList").empty();
- $("#hisList").append(str);
- $('.theme-popover-mask').fadeIn(100);
- $('.theme-popover').slideDown(0);
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- //关闭选择经营人的弹出框
- function guanbipop(){
- $('#jyrselectmaskdiv').fadeOut(100);
- $('#jyrselectdiv').slideUp(0);
- }
- //关闭选择船名的弹出框
- function cbguanbipop(){
- $('#cbselectmaskdiv').fadeOut(100);
- $('#cbselectdiv').slideUp(0);
- }
- /**
- * 匹配中文 数字 字母 下划线
- */
- function checkInput(str) {
- var pattern = /^[\w\u4e00-\u9fa5]+$/gi;
- if (pattern.test(str)) { return false; }
- return true;
- }
- // 备注长度限制
- function limitTextArea(field) {
- var maxlimit = 250;
- if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit);
- }
- // 根据数据库中字段的长度要求截取文本输入框中输入的字符串
- function limitTextArea(field, maxLength) {
- if (field.value.length > maxLength) field.value = field.value.substring(0, maxLength);
- }
- // 判断页面中是否存在重复的ID的方法
- function checkDuplicate() {
- var i = 0;
- var duplicateIds = new Array();
- $("body [id]").each(function() {
- var id = $(this).attr("id");
- if (id != "" && $("body [id=" + id + "]").length >= 2) {
- // 判断是否已记录重复的值
- if (!contains(duplicateIds, id)) {
- duplicateIds[i] = id;
- $.messager.alert("提示", "id为" + id + "的重复了。");
- }
- }
- i++;
- });
- if (duplicateIds.length == 0) {
- $.messager.alert("提示", "HTML DOM中没有重复的ID");
- }
- return duplicateIds;
- }
- function scrolldate(){
- if($(window.parent.document).find('#_my97DP')){
- $(window.parent.document).find('#_my97DP').css("display","none");
- }
- }
- // 判断某个e元素是否存在于数组a中
- function contains(a, e) {
- for (var j = 0; j < a.length; j++)
- if (a[j] == e) return true;
- return false;
- }
- //作业区选择
- function initzyqSelect(divid,zyqid,gkid,changefunc,width){
- $.post($.app+"/zyq/selZyq",{
- gkid:gkid
- },function(data) {
- var str="";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='zyqselectpicker' name='zyqid' onchange='"+changefunc+"()' id='zyqid'>";
- }else{
- str+="<select class='zyqselectpicker' name='zyqid' id='zyqid' >";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var zyq = data[i];
- if(zyqid == zyq.id){
- str+=" <option id='"+zyq.zyid+"' selected value='"+zyq.id+"' >"+zyq.zyqmc+"</option>";
- }else{
- str+=" <option id='"+zyq.zyid+"' value='"+zyq.id+"' >"+zyq.zyqmc+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.zyqselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //泊位选择
- function initbwSelect(divid,bwid,jyrid,changefunc,width){
- $.post($.app+"/bw/selBw",{
- jyrid:jyrid
- },function(data) {
- var str="";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='bwselectpicker' name='bwid' onchange='"+changefunc+"()' id='bwid'>";
- }else{
- str+="<select class='bwselectpicker' name='bwid' id='bwid' >";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var bw = data[i];
- if(bwid == bw.id){
- str+=" <option id='"+bw.zyid+"' selected value='"+bw.id+"' >"+bw.bwmc+"</option>";
- }else{
- str+=" <option id='"+bw.zyid+"' value='"+bw.id+"' >"+bw.bwmc+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.bwselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //码头选择
- function initmtSelect(divid,mtid,jyrid,changefunc,width){
- $.post($.app+"/mt/selMt",{
- jyrid:jyrid
- },function(data) {
- var str="";
- if(changefunc!=null&&changefunc!=""){
- str+="<select class='mtselectpicker' name='mtid' onchange='"+changefunc+"()' id='mtid'>";
- }else{
- str+="<select class='mtselectpicker' name='mtid' id='mtid' >";
- }
- str+="<option></option>";
- if(data){
- for(var i=0;i<data.length;i++){
- var mt = data[i];
- if(mtid == mt.id){
- str+=" <option id='"+mt.zyid+"' selected value='"+mt.id+"' >"+mt.mtmc+"</option>";
- }else{
- str+=" <option id='"+mt.zyid+"' value='"+mt.id+"' >"+mt.mtmc+"</option>";
- }
-
- }
- }
- str+="</select>";
- $("#"+divid).empty();
- $("#"+divid).append(str);
- $('.mtselectpicker').selectpicker({
- width:width
- });
- }, "json");
- }
- //让HTML元素的字符内容保留换行和添加滚动条
- function newLine(){
- var idname= arguments[0] ||'#bzhh';
- var elements = $(idname);
- for(var i=0;i<elements.length;i++){
- var userStr=elements.eq(i).text();
- //showEachCode(userStr);
- userStr=trimBoth(userStr);
- //showEachCode(userStr);
- userStr=userStr.replace(/\n/g,"<br> ");
- //showEachCode(userStr);
- elements.eq(i).html("<div style='height:80px;overflow:auto;padding:30px 0;'></div>");
- elements.eq(i).children('div').html(userStr);
- }
-
- };
- //显示每个字符
- function showEachCode(userStr){
- var temp="";
- for(var i=0;i<userStr.length;i++){
- temp+="第"+i+"个字符("+userStr[i]+")的编码是:"+userStr.charCodeAt(i)+"\n";
- }
- alert(temp);
- }
- //去除前后空白符(空白符:空格或者换行)
- function trimBoth(userStr){
- return userStr.replace(/(^\s*)|(\s*$)/g, "");
- }
- //提示
- ts = function(message,element){
- $.alert({
- title: '提示',
- content: message,
- confirm: function(){
-
- //如果元素是select,就获取其父元素的子元素button
- if(element){
- if(element[0].tagName=="SELECT"){
- element=element.parent().find("button");
- }
- }
-
- //让元素获取焦点
- element.focus();
- }
- });
- };
- function pageinfo2(){
- $("#pagesize").change(function() {
- $("#pagejump").val(1);
- jyrselpop('jyrSel');
- });
- $("#pagesize").val($("#pagesize").attr("num"));
- $("#pagefirst").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(1);
- jyrselpop('jyrSel');
- }
- });
- $("#pageprev").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) - 1);
- jyrselpop('jyrSel');
- }
- });
- $("#pagejump").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- jyrselpop('jyrSel');
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) + 1);
- jyrselpop('jyrSel');
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val($("#pagetotal").val());
- jyrselpop('jyrSel');
- }
- });
-
- }
- function mapApprove(zyid){
- // 保存审批意见及状态
- $('#mapiframe')[0].contentWindow.gis.edit.syncDataLayer();
- guanbipopmap();
- }
- function mapReject(zyid){
- // 保存审批意见及状态
- guanbipopmap();
- }
- function getValues(){
- var zyarray=[];
- zyarray.push({type:"gk",zyid:''});
- zyarray.push({type:"gq",zyid:''});
- zyarray.push({type:"jyr",zyid:''});
- var obj = document.getElementById("szgkid");
- if(!isEmpty(obj)){
- var m=obj.options[obj.selectedIndex].id;
- if(isEmpty(m)){
- m='';
- }
- zyarray[0].zyid = m;
- }
-
- var obj = document.getElementById("szgqid");
- if(!isEmpty(obj)){
- var m=obj.options[obj.selectedIndex].id;
- if(isEmpty(m)){
- m='';
- }
- zyarray[1].zyid = m;
- }
-
- if(!isEmpty($('#jyrzyid').val())){
- zyarray[2].zyid=$('#jyrzyid').val();
- }
- return zyarray;
- }
- function map(editType,zyid){
- var flag = $('#mapflag').val();
- $('#spDiv').css("display","none");
- $('#mapiframe').attr("width","100%");
- $('#mapdivmask').fadeIn(100);
- $('#mapdiv').slideDown(0);
- if(flag == 0){
- var url = $.app+"/editgis/gisiframe.html?model=gis&treeType=ty&editType="+editType+"&id="+zyid
- $("#mapiframe").attr("src",url);
- $('#mapflag').val("1");
- }
-
-
- }
- function auditMap(editType,zyid,sp){
- map(editType,zyid);
- if(sp){
- $('#spDiv').removeAttr("style");
- $('#spDiv').css("width","50%");
- $('#spDiv').css("float","left");
- $('#mapiframe').attr("width","50%");
- $('#audit').val("");
- $('#approve').attr("onclick","mapApprove('"+zyid+"')");
- $('#reject').attr("onclick","mapReject('"+zyid+"')");
- }
- }
- function guanbipopmap(){
-
- /*iframeObj=document.getElementById("mapiframe");
-
-
- iframeObj.contentWindow.gis.edit.submitToService();*/
- $('#mapdivmask').fadeOut(100);
- $('#mapdiv').slideUp(0);
- }
- function jyrhide(){
- if(($('.szdselectpicker').val()!='')&&($('.gkselectpicker').val()!='')&&($('.gqselectpicker').val()!='')){
- $('#ajyrselect').css('display','inline');
- }else{
- $('#ajyrselect').css('display','none');
- }
- }
- //传入回调方法的名称
- function cbselpop(selectFunc){
- pageinfo3();
- $('#cbselectmaskdiv').fadeIn(100);
- $('#cbselectdiv').slideDown(0);
- var zwcm=$('#zwcm').val();
- $.ajax({
- url:$.app+"/selectCb",
- type:"post",
- data:{
- zwcm:zwcm,
- page:$('#pagejump').val()
- },
- dataType:"json",
- success:function(data){//ajax返回的数据
- if (data) {
- var str="";
- for(var i=0;i<data.attrs.list.length;i++){
- var cb = data.attrs.list[i];
- str+="<tr>";
- str+="<td>"+(i+1)+"</td>";
- str+="<td>"+cb.zwcm+"</td>";
- str+="<td>"+cb.ywcm+"</td>";
- str+="<td > " +
- "<a class='btn btn-default btn-xs' href='#' onclick=\""+selectFunc+"('"+cb.id+"')\">"+
- "<i class='glyphicon glyphicon-wrench'></i>选择</a> "+
- "</td>";
- str+="</tr>";
- }
- $("#cb").empty();
- $("#cb").append(str);
-
- $("#pagejump").val(data.attrs.page);
- $("#gongpage").html(data.attrs.gongpage);
- $("#nowshow").html(data.attrs.nowshow);
- $("#gongsize").html(data.attrs.gongsize);
- $("#pagecur").val(data.attrs.page);
- $("#pagetotal").val(data.attrs.totalpage);
- $("#pagesort").val(data.attrs.sort);
- $("#pageorder").val(data.attrs.order);
- }else {
- $.alert({
- title: '提示',
- content: data.message,
- confirm: function(){
-
- }
- });
- }
- }
- });
- }
- function pageinfo3(){
- $("#pagesize").change(function() {
- $("#pagejump").val(1);
- cbselpop('cbSel');
- });
- $("#pagesize").val($("#pagesize").attr("num"));
- $("#pagefirst").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(1);
- cbselpop('cbSel');
- }
- });
- $("#pageprev").click(function() {
- if ($("#pagecur").val() == 1) {
- $.alert({
- title: '提示',
- content: '已到第一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) - 1);
- cbselpop('cbSel');
- }
- });
- $("#pagejump").keydown(
- function(event, p) {
- if (event.keyCode == 13) {
- if ($.isNumeric($("#pagejump").val()) && (parseInt($("#pagejump").val()) >= 1)
- && (parseInt($("#pagejump").val()) <= parseInt($("#pagetotal").val()))) {
- }
- else {
- $.alert({
- title: '提示',
- content: '请输入有效数字'
- });
- return false;
- }
- cbselpop('cbSel');
- }
- });
- $("#pagenext").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val(parseInt($("#pagecur").val()) + 1);
- cbselpop('cbSel');
- }
- });
- $("#pagelast").click(function() {
- if(parseInt($("#pagetotal").val())<=1){
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- if ($("#pagecur").val() == $("#pagetotal").val()) {
- $.alert({
- title: '提示',
- content: '已到最后一页'
- });
- return;
- }
- else {
- $("#pagejump").val($("#pagetotal").val());
- cbselpop('cbSel');
- }
- });
-
- }
- function expandSearchTable(display){
- //按钮对象
- var buttonObj=$("#searchCond");
- var tableObj=$(".search_table");
- if(display=="none"){
- buttonObj.removeClass("glyphicon glyphicon-minus");
- buttonObj.addClass("glyphicon glyphicon-plus");
- $("#condInfo")[0].innerHTML="显示更多条件";
- }else{
- buttonObj.removeClass("glyphicon glyphicon-plus");
- buttonObj.addClass("glyphicon glyphicon-minus");
- $("#condInfo")[0].innerHTML="隐藏更多条件";
- }
-
- //alert(tableObj.find("tr").prevAll().length);
- //alert(tableObj.find('tr:eq(1)'));
- var col = tableObj.find("tr").prevAll().length;//获取表格列数
- for(var i=2;i<col;i++){
- tableObj.find('tr:eq('+i+')').css("display",display);
- }
- }
- //查询页面折叠收缩实现
- function expandSearch() {
- //$(".search_table").css("display") == "table"
- //<div class="searchdiv" style="overflow:hidden;height: 70px;">
- if(expandFlg == true) {
- expandFlg = false;
- $("#expandSearchLink").removeClass("expandlink");
- $("#expandSearchLink").addClass("collapselink");
- //$(".search_table").css("display","none");
-
- //$(".searchdiv").css("overflow","hidden");
- //$(".searchdiv").css("height","70");
- expandSearchTable("");
- } else {
- expandFlg = true;
- $("#expandSearchLink").removeClass("collapselink");
- $("#expandSearchLink").addClass("expandlink");
- //$(".search_table").css("display","table");
-
- //$(".searchdiv").removeAttr("style");
- expandSearchTable("none");
- }
- }
- //初始化查询页面折叠收缩
- function initExpandSearch() {
- //$(".search_table").css("display") == "table"
- /*
- if(parent.expandFlg == true) {
- $("#expandSearchLink").removeClass("expandlink");
- $("#expandSearchLink").addClass("collapselink");
- $(".search_table").css("display","table");
- } else {
- $("#expandSearchLink").removeClass("collapselink");
- $("#expandSearchLink").addClass("expandlink");
- $(".search_table").css("display","none");
- }
- */
- if(expandFlg == true) {
- $("#expandSearchLink").removeClass("collapselink");
- $("#expandSearchLink").addClass("expandlink");
- //$(".search_table").css("display","none");
-
- //$(".searchdiv").css("overflow","hidden");
- //$(".searchdiv").css("height","70");
- expandSearchTable("none");
- } else {
- $("#expandSearchLink").removeClass("expandlink");
- $("#expandSearchLink").addClass("collapselink");
- //$(".search_table").css("display","table");
-
- //$(".searchdiv").removeAttr("style");
- expandSearchTable("");
- }
- }
- //重置查询表单
- function resetSrchForm() {
- $(".search_table").find(":input").not(":button,:submit,:reset,:hidden").val("").removeAttr("checked").removeAttr("selected");
- $(".search_table").find("select").each(function(){
- //$(this).find("option:first").attr("selected","true");
- //console.info($(this).find("option:first").val());
- $(this).selectpicker('val',$(this).find("option:first").val());
- });
- //$("#"+formId).find(":select").not(":button,:submit,:reset,:hidden").removeAttr("selected");
- //$("select").val().removeAttr("selected");
- //$("[name='checkbox']").attr("checked",'true');//全选
- }
- function num(obj){
- obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
- obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
- obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
- obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
- obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d).*$/,'$1$2.$3'); //只能输入两个小数
- }
- function numInteger(obj){
- obj.value = obj.value.replace(/[^\d]/g,""); //清除"数字"以外的字符
- }
|