You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

86 lines
2.3 KiB

  1. var HTML = '';
  2. //记录添加的 tr id
  3. var n = 0;
  4. //记录途径顺序
  5. var m = 1;
  6. window.onload = function(){
  7. }
  8. function saveInfo(){
  9. var add_station_res_id = $('#hyk_res_id').attr("value");
  10. var add_station_res_name = $('#hyk_res_name').attr("value");
  11. var add_station_res_zwmc = $('#hyk_zwmc').attr("value");
  12. var add_station_res_zwjc = $('#hyk_zwjc').attr("value");
  13. var add_station_jindu = $('#hyk_jindu').attr("value");
  14. var add_station_weidu = $('#hyk_weidu').attr("value");
  15. var add_station_station_type = $('#hyk_station_type').attr("value");
  16. var urlStr = '';
  17. var checkportUrl = '';
  18. //遍历所有的tr
  19. var trCount = $('#line_list_info').children().length;
  20. if (trCount==1) {
  21. alert('无相关的站点信息,无法保存!');
  22. return;
  23. }
  24. for (var k = 1; k < trCount; k++) {
  25. var seltr = $('#line_list_info').children(k);
  26. var selid = seltr[k].id;
  27. $('#orderid'+selid).html(k);
  28. //取出要传的数据
  29. var updown = $('#station_type'+selid).val();
  30. var order = $('#orderid'+selid).text();
  31. var time = $('#time_out'+selid).val();
  32. if (time=="") {
  33. time = 0;
  34. }
  35. if ($('#teller'+selid).text()=="-") {
  36. checkportUrl = 0;
  37. }else{
  38. checkportUrl = $('#teller_station'+selid).val();
  39. }
  40. var station = $('#hideid'+selid).val();
  41. var poi = $('#select_poi'+selid).val();
  42. if ((poi=='')||(poi==null)) {
  43. poi = 0;
  44. }
  45. urlStr = urlStr +'{'+updown+','+order+','+time+','+checkportUrl+','+station+','+poi+'}';
  46. }
  47. // var saleStyle_company = $('#company input[name="saleStyle_company"]:checked ').val();
  48. var lineStyle = $("input[name='bar_style']:checked").val();
  49. $.ajax({
  50. url:'./st-xm/Model/linemanager/add_station.php', //请求地址
  51. type: "post",
  52. data:{
  53. station_res_id=add_station_res_id;
  54. station_res_name=add_station_res_name;
  55. station_zwmc=add_station_res_zwmc;
  56. station_zwjc=add_station_res_zwjc;
  57. station_jindu=add_station_jindu;
  58. station_weidu=add_station_weidu;
  59. station_type=add_station_station_type;
  60. },
  61. async:false,
  62. dataType: "json",
  63. success: function (data) {
  64. console.log(data);
  65. if(data.code == 0){
  66. alert('保存成功!');
  67. window.location.href="search_line.html"
  68. }
  69. },
  70. fail: function (data) {
  71. alert('保存失败');
  72. }
  73. });
  74. }