作者 lianghiu

多选功能添加

@@ -251,15 +251,11 @@ @@ -251,15 +251,11 @@
251 } 251 }
252 }); 252 });
253 $('.time-box').on('click', '.acv', function () { 253 $('.time-box').on('click', '.acv', function () {
254 - for (var i = 0; i < $(".time-box .acv").length; i++) {  
255 - $(".time-box .acv")[i].setAttribute("class", "acv");  
256 - } 254 + if($(this).attr("class") == "acv"){
257 $(this).attr("class", "acv bg-colo"); 255 $(this).attr("class", "acv bg-colo");
258 -// if ($(this).attr('class') == 'acv bg-colo') {  
259 -// $(this).attr('class', 'acv');  
260 -// } else {  
261 -// $(this).attr('class', 'acv bg-colo');  
262 -// } 256 + }else{
  257 + $(this).attr("class", "acv");
  258 + }
263 }); 259 });
264 $('.save').click(function () { 260 $('.save').click(function () {
265 var list = $('.bg-colo'); 261 var list = $('.bg-colo');
@@ -274,13 +270,14 @@ @@ -274,13 +270,14 @@
274 } else { 270 } else {
275 var teacher_id = $('#teacher').val(); 271 var teacher_id = $('#teacher').val();
276 var time_id = $('#time').val().split('-').join(''); 272 var time_id = $('#time').val().split('-').join('');
  273 + for(var q = 0;q<put_list.length;q++){
277 $.ajax({ 274 $.ajax({
278 url: "{:url('seting_do')}", 275 url: "{:url('seting_do')}",
279 data: { 276 data: {
280 teach_id: teacher_id, 277 teach_id: teacher_id,
281 day: time_id.replace(/(\d{4})(\d{2})(\d{2})/, "$1-$2-$3"), 278 day: time_id.replace(/(\d{4})(\d{2})(\d{2})/, "$1-$2-$3"),
282 - begin: parseInt(put_list[0].innerHTML.split("-")[0]),  
283 - end: parseInt(put_list[0].innerHTML.split("-")[1]) 279 + begin: parseInt(put_list[q].innerHTML.split("-")[0]),
  280 + end: parseInt(put_list[q].innerHTML.split("-")[1])
284 }, 281 },
285 success: function (res) { 282 success: function (res) {
286 console.log(res); 283 console.log(res);
@@ -291,6 +288,8 @@ @@ -291,6 +288,8 @@
291 } 288 }
292 }); 289 });
293 } 290 }
  291 +
  292 + }
294 }); 293 });
295 setCookie("refersh_time", 0); 294 setCookie("refersh_time", 0);
296 Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () { 295 Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {