選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

238 行
6.1 KiB

  1. //每页数据的显示个数
  2. var pagesize = 10;
  3. var tttHTML ='';
  4. window.onload = function(){
  5. var cur = "";
  6. var currpage = getPar("currpage");
  7. var keywords = '';
  8. //var lineStyle = '';
  9. if (!currpage) {
  10. cur = 1;
  11. keywords = $('#keywords').val();
  12. // lineStyle = $("#select_bar_style").val()
  13. } else{
  14. cur = currpage;
  15. keywords = getPar('keywords');
  16. $('#keywords').val(keywords);
  17. // lineStyle = getPar('lineStyle');
  18. //$('#select_bar_style').val(lineStyle);
  19. }
  20. tttHTML = $('#list').html();
  21. searchInfo(cur,keywords);
  22. }
  23. //查询
  24. function searchInfo(cur,keywords){
  25. if(!cur){
  26. cur = 1;
  27. }
  28. if(!keywords){
  29. keywords = $('#keywords').val();
  30. // lineStyle = $('#select_bar_style').val();
  31. }
  32. $.ajax({
  33. url:'./st-xm/Model/linemanager/stationManagerList.php',
  34. type: "post",
  35. data:{
  36. //lineStyle:lineStyle,
  37. keywords:keywords,
  38. currpage:cur,
  39. pagesize:pagesize
  40. },
  41. async:false,
  42. dataType: "json",
  43. success: function (data) {
  44. console.log(data);
  45. if(data.code == 1){
  46. console.log(data.info);
  47. var sum = data.totalNum;
  48. if(sum == 0){
  49. alert('没有相关站点');
  50. }
  51. var tag = "test";
  52. var sendurl = './search_station.html?keywords='+keywords;
  53. getPager(sendurl, sum, cur, pagesize,tag,'currpage');
  54. reloadInfo(data);
  55. }
  56. },
  57. fail: function (data) {
  58. alert('加载相关数据失败');
  59. }
  60. });
  61. if(cur!=1){
  62. var keywords = getPar('keywords');
  63. $('#keywords').val(keywords);
  64. // var lineStyle = getPar('lineStyle');
  65. // $('#lineStyle').val(lineStyle);
  66. }
  67. }
  68. //添加线路
  69. function addLine(){
  70. // window.location.href='./add_line.html';
  71. //window.open('./add_station.html');
  72. $.cookie("path_url",cookie_path+"add_station.html",{domain:domain_path});
  73. window.open(system_path);
  74. }
  75. //加载数据
  76. function reloadInfo(data){
  77. console.log( data.list);
  78. var list = data.list;
  79. var newHTML='';
  80. for(var i=0;i<list.length;i++){
  81. var tempHTML=tttHTML;
  82. tempHTML=tempHTML.replace('[RES_NAME]',list[i].RES_NAME);
  83. tempHTML=tempHTML.replace('[中文全称]',list[i].station_quancheng);
  84. tempHTML=tempHTML.replace('[中文简称]',list[i].station_jianchen);
  85. tempHTML=tempHTML.replace('[站点类型]',list[i].station_type);
  86. tempHTML=tempHTML.replace('[经度]',list[i].station_jindu);
  87. tempHTML=tempHTML.replace('[纬度]',list[i].station_weidu);
  88. // tempHTML=tempHTML.replace('[userid_style]','userid_style'+list[i].prod_id);
  89. // tempHTML=tempHTML.replace('[oneCheck]',list[i].prod_id);
  90. // tempHTML=tempHTML.replace('[oneCheckName]',list[i].prod_id);
  91. if(list[i].bus_type==256){
  92. var str = '<a target="_Blank" onclick="open_new_path(this)" go_path="change_line.html?prod_id=' +list[i].prod_id + '&line_name='+list[i].prod_name+'">修改</a>'+'<a target="_Blank" style="margin-left: 20px;" onclick="open_new_path(this)" go_path="sell_manage_shuttlebus.html?prod_id=' +list[i].prod_id+'&lineNameJC='+list[i].property+'&lineName='+list[i].prod_name+'">管理票种</a>';
  93. }else{
  94. var str = '<a target="_Blank" onclick="open_new_path(this)" go_path="change_line.html?prod_id=' +list[i].prod_id + '&line_name='+list[i].prod_name+'">修改</a>'+'<a target="_Blank" style="margin-left: 20px;" onclick="open_new_path(this)" go_path="sell_manage.html?prod_id=' +list[i].prod_id+'&lineNameJC='+list[i].property+'&lineName='+list[i].prod_name+'">管理票种</a>';
  95. }
  96. // tempHTML=tempHTML.replace('[操作]',str);
  97. newHTML+=tempHTML;
  98. }
  99. $('#list').html(newHTML);
  100. $('#count').html('共'+data.totalNum+'条记录');
  101. }
  102. //启用
  103. function startUse(){
  104. var ary = new Array();
  105. $('.ace_check').each(function(index, item) {
  106. if (this.checked && index != 0) {
  107. ary.push($(this).attr('name'));
  108. }
  109. });
  110. if (ary.length <= 0) {
  111. alert('请勾选!!!');
  112. return;
  113. }
  114. var pro_str = ary.join(',');
  115. alert(pro_str);
  116. $.ajax({
  117. url:'./st-xm/control.php', //请求地址
  118. type: "post", //请求方式
  119. data:{
  120. type:"linemanager_start",
  121. id:pro_str
  122. },
  123. async:false,
  124. dataType: "json",
  125. success: function (date1) {
  126. if(date1.code == 0){
  127. $('.ace_check').each(function(index, item) {
  128. if (this.checked && index != 0) {
  129. var stopid = $(this).attr('name');
  130. //改变账号状态
  131. $('#userid_style'+stopid).html('启用');
  132. }
  133. });
  134. }
  135. },
  136. fail: function (date) {
  137. alert('停用失败');
  138. }
  139. });
  140. }
  141. //停用
  142. function stopUse(){
  143. var ary = new Array();
  144. $('.ace_check').each(function(index, item) {
  145. if (this.checked && index != 0) {
  146. ary.push($(this).attr('name'));
  147. }
  148. });
  149. if (ary.length <= 0) {
  150. alert('请勾选!!!');
  151. return;
  152. }
  153. var pro_str = ary.join(',');
  154. alert(pro_str);
  155. $.ajax({
  156. url:'./st-xm/control.php', //请求地址
  157. type: "post", //请求方式
  158. data:{
  159. type:"linemanager_stop",
  160. id:pro_str
  161. },
  162. async:false,
  163. dataType: "json",
  164. success: function (date1) {
  165. if(date1.code == 0){
  166. $('.ace_check').each(function(index, item) {
  167. if (this.checked && index != 0) {
  168. var stopid = $(this).attr('name');
  169. //改变账号状态
  170. $('#userid_style'+stopid).html('停用');
  171. }
  172. });
  173. }
  174. },
  175. fail: function (date) {
  176. alert('停用失败');
  177. }
  178. });
  179. }
  180. //复选框判断
  181. function select_checked(index) {
  182. //index=0最上面的全选 index=1表示的是下面所有的
  183. var cur_check = $('.ace_check')[0];
  184. var checkList = $('.ace_check');
  185. var checkCount = checkList.length - 1;
  186. var true_count = 0;
  187. for (var i = 1; i < checkList.length; i++) {
  188. if (index == '0') {
  189. checkList[i].checked = cur_check.checked;
  190. } else {
  191. if (checkList[i].checked == false) {
  192. cur_check.checked = false
  193. } else {
  194. true_count = true_count + 1;
  195. }
  196. }
  197. }
  198. //判断下面是否选中完
  199. if (checkCount == true_count) {
  200. cur_check.checked = true;
  201. }
  202. }
  203. //得到url上的参数
  204. function getPar(par){
  205. var local_url = document.location.href;
  206. local_url = decodeURI(local_url);
  207. var get = local_url.indexOf(par +"=");
  208. if(get == -1){
  209. return false;
  210. }
  211. var get_par = local_url.slice(par.length + get + 1);
  212. var nextPar = get_par.indexOf("&");
  213. if(nextPar != -1){
  214. get_par = get_par.slice(0, nextPar);
  215. }
  216. return get_par;
  217. }