'
+ ''
+ ''+m+' | '
+ ''+data.list[i].station_res_name+' | '
+ ''
+ ''
+ ' | '
+ ''
+ '分'
+ ' | '
+ ''
+ '公里'
+ ' | '
+ ''
+ ''
+ ' | '
+ ''
+ ''
+ ' | '
+ '删除 | '
+ ''
m++;
}
$("#line_list_info").append(temp);
for(var i=0;i'+data.list[i].poi_name[j].area_name_list+''
}
$("#select_poi"+(i+1)).append(temp1);
if(i==0){
$("#time_out"+(i+1)).attr("readonly","true")
}
}
for(var i=0;i'+data.list[i].checkport_res[j].checkport_res_name+''
}
$("#teller_station"+(i+1)).append(temp2);
}
}
}
//得到url上的参数
function getPar(par){
var local_url = document.location.href;
local_url = decodeURI(local_url);
var get = local_url.indexOf(par +"=");
if(get == -1){
return false;
}
var get_par = local_url.slice(par.length + get + 1);
var nextPar = get_par.indexOf("&");
if(nextPar != -1){
get_par = get_par.slice(0, nextPar);
}
return get_par;
}
//添加一条线路
function addOneLine(){
var line_list = $('#line_list').val();
if (line_list == "") {
alert('未选择站点信息!');
return;
}
var stationId = $('#station_select').val();
var poiAry = '';
var checkPortAry = '';
var poiIdAry = '';
var checkPortIdAry = '';
var ifHasCheckport = '';
//站点id对应每一条站点信息
// var stationId = '';
//请求站点相关的数据
$.ajax({
url:'./st-xm/Model/linemanager/stationInfo.php', //请求地址
type: "post",
data:{stationId:stationId},
async:false,
dataType: "json",
success: function (data) {
console.log(data);
if(data.code == 0){
//(poi)
var poiListStr = data.list.parent_area_name_list;
//得到截取后返回的数组(poi)
poiAry = intercept(poiListStr);
//(poi)id
var poiListIdStr = data.list.parent_area_id_list;
//得到截取后返回的数组(poi)
poiIdAry = intercept(poiListIdStr);
ifHasCheckport = data.list.checkport_res_name;
if (data.list.checkport_res_id != 0) {
//检票口数组
checkPortAry = data.list.checkport_res_name.split(',');
//检票口id数组
checkPortIdAry = data.list.checkport_res_id.split(',');
}
//站点proid
stationId = data.list.res_id;
}
},
fail: function (data) {
}
});
//tbody
var line = document.getElementById('line_list_info');
//tr
var tr = document.createElement("tr");
tr.id = m;
var newHtml = '';
var tempHTML = $('#tr_replace').html();
tempHTML = tempHTML.replace('[途径顺序]',m);
tempHTML = tempHTML.replace('[orderid]','orderid'+m);
tempHTML = tempHTML.replace('[站点]',$('#line_list').val());
tempHTML = tempHTML.replace('[station_type_td]','station_type_td'+m);
tempHTML = tempHTML.replace('[select_poi]','select_poi'+m);
tempHTML = tempHTML.replace('[teller]','teller'+m);
tempHTML = tempHTML.replace('[teller_station]','teller_station'+m);
tempHTML = tempHTML.replace('[stationid]','stationid'+m);
tempHTML = tempHTML.replace('[timeid]','timeid'+m);
tempHTML = tempHTML.replace('[updown]','updown'+m);
tempHTML = tempHTML.replace('[del]',m);
tempHTML = tempHTML.replace('time_out','time_out'+m);
tempHTML = tempHTML.replace('distance','distance'+m);
tempHTML = tempHTML.replace('[station_type]','station_type'+m);
tempHTML = tempHTML.replace('[hideid]','hideid'+m);
tempHTML = tempHTML.replace('[hideid_id]',stationId);
line.appendChild(tr);
var str = '删除';
tempHTML = tempHTML.replace('[删除]',str);
tr.innerHTML = tempHTML;
//替换poi
var poiHTML = '';
for (var i = poiAry.length-1; i>=0;i --) {
var tempHTML1 = '';
tempHTML1 = tempHTML1.replace('请选择',poiAry[i]);
tempHTML1 = tempHTML1.replace('0',poiIdAry[i]);
poiHTML += tempHTML1;
}
$('#select_poi'+m).html(poiHTML);
//替换检票口
if (ifHasCheckport=='') {
$('#teller'+m).html('-');
}else{
var checkportHTML = '';
for (var i = 0; i 1){
// for (var i = 0 ; i