function funCheckRepeat() { var ids = $(gridId).jqGrid('getGridParam', 'selarrrow'); if (ids.length == 0) { alert("请选择服务项目!"); return; } var dataList = new Array(); for (i = 0; i < ids.length; i++) { var json = $(gridId).getRowData(ids[i]); dataList[i] = json; } var s_json = JSON.stringify(dataList); for (i = 0; i < ids.length; i++) { var fjh=dataList[i].DRFJXX_FJH; var reg = s_json.match(eval('/"DRFJXX_FJH":"' + fjh + '"/g')); if (null != reg) { var reg1 = s_json.match(eval('/("DRFJXX_FJH":"' + fjh + '",)(.*?)(")/g')); if (reg1 != null) { if (reg1.length > 1) { alert("相同的飞机号【"+fjh+"】只能选择一个!"); return false; } } } } return true; }