Commit fdb1804ebd6143f1eff4061903f816f06042f1fd

Authored by 徐烜
1 parent c25d5846

QPBS-2020-0002 更新2

修改saPlanInfoEdit2指令,修改初始化车辆人员数据逻辑,解决页面需要连续选择两次以上才会修改数据的bug
src/main/resources/static/pages/scheduleApp/module/common/dts2/scheduleplan/saPlanInfoEdit2.js
@@ -57,7 +57,7 @@ angular.module('ScheduleApp').directive( @@ -57,7 +57,7 @@ angular.module('ScheduleApp').directive(
57 var new_dddesc = undefined; // 调度描述 57 var new_dddesc = undefined; // 调度描述
58 58
59 // 表单值,被赋值的次数 59 // 表单值,被赋值的次数
60 - var form_data_assign_count = { 60 + var form_data_assign_count = { // 大于1表示已经初始化过了
61 cl1 : -1, 61 cl1 : -1,
62 cl2 : -1, 62 cl2 : -1,
63 j1 : -1, 63 j1 : -1,
@@ -348,21 +348,20 @@ angular.module('ScheduleApp').directive( @@ -348,21 +348,20 @@ angular.module('ScheduleApp').directive(
348 return scope[ctrlAs].fd.cl1; 348 return scope[ctrlAs].fd.cl1;
349 }, 349 },
350 function(newValue, oldValue) { 350 function(newValue, oldValue) {
351 - // 初始化new_cl1  
352 - if (newValue.id) {  
353 - if (newValue.id && newValue.zbh) {  
354 - new_cl1 = newValue.id + "_" + newValue.zbh; 351 + if (form_data_assign_count.cl1 > 2) {
  352 + if (newValue.id) {
  353 + if (newValue.id && newValue.zbh) {
  354 + new_cl1 = newValue.id + "_" + newValue.zbh;
  355 + } else {
  356 + new_cl1 = undefined;
  357 + }
355 } else { 358 } else {
356 new_cl1 = undefined; 359 new_cl1 = undefined;
357 } 360 }
358 - } else {  
359 - new_cl1 = undefined; 361 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
360 } 362 }
361 363
362 form_data_assign_count.cl1 ++; 364 form_data_assign_count.cl1 ++;
363 - if (form_data_assign_count.cl1 > 1) {  
364 - scope[ctrlAs].$$internal_refresh_dsdata_cl();  
365 - }  
366 }, 365 },
367 true 366 true
368 ); 367 );
@@ -373,21 +372,20 @@ angular.module('ScheduleApp').directive( @@ -373,21 +372,20 @@ angular.module('ScheduleApp').directive(
373 return scope[ctrlAs].fd.cl2; 372 return scope[ctrlAs].fd.cl2;
374 }, 373 },
375 function(newValue, oldValue) { 374 function(newValue, oldValue) {
376 - // 初始化new_cl2  
377 - if (newValue.id) {  
378 - if (newValue.id && newValue.zbh) {  
379 - new_cl2 = newValue.id + "_" + newValue.zbh; 375 + if (form_data_assign_count.cl2 > 2) {
  376 + if (newValue.id) {
  377 + if (newValue.id && newValue.zbh) {
  378 + new_cl2 = newValue.id + "_" + newValue.zbh;
  379 + } else {
  380 + new_cl2 = undefined;
  381 + }
380 } else { 382 } else {
381 new_cl2 = undefined; 383 new_cl2 = undefined;
382 } 384 }
383 - } else {  
384 - new_cl2 = undefined; 385 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
385 } 386 }
386 387
387 form_data_assign_count.cl2 ++; 388 form_data_assign_count.cl2 ++;
388 - if (form_data_assign_count.cl2 > 1) {  
389 - scope[ctrlAs].$$internal_refresh_dsdata_cl();  
390 - }  
391 }, 389 },
392 true 390 true
393 ); 391 );
@@ -398,22 +396,22 @@ angular.module('ScheduleApp').directive( @@ -398,22 +396,22 @@ angular.module('ScheduleApp').directive(
398 return scope[ctrlAs].fd.j1; 396 return scope[ctrlAs].fd.j1;
399 }, 397 },
400 function(newValue, oldValue) { 398 function(newValue, oldValue) {
401 - // 初始化j1  
402 - if (newValue.id) {  
403 - if (newValue.id && newValue.name && newValue.jobCode) {  
404 - new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 399 + if (form_data_assign_count.j1 > 2) {
  400 + if (newValue.id) {
  401 + if (newValue.id && newValue.name && newValue.jobCode) {
  402 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  403 + } else {
  404 + new_j1 = undefined;
  405 + }
405 } else { 406 } else {
406 new_j1 = undefined; 407 new_j1 = undefined;
407 } 408 }
408 - } else {  
409 - new_j1 = undefined;  
410 - }  
411 409
412 - form_data_assign_count.j1 ++;  
413 - if (form_data_assign_count.j1 > 1) {  
414 scope[ctrlAs].$$internal_refresh_dsdata_j(); 410 scope[ctrlAs].$$internal_refresh_dsdata_j();
415 scope[ctrlAs].$$internal_refresh_dsdata_s(); 411 scope[ctrlAs].$$internal_refresh_dsdata_s();
416 } 412 }
  413 +
  414 + form_data_assign_count.j1 ++;
417 }, 415 },
418 true 416 true
419 ); 417 );
@@ -424,22 +422,22 @@ angular.module('ScheduleApp').directive( @@ -424,22 +422,22 @@ angular.module('ScheduleApp').directive(
424 return scope[ctrlAs].fd.s1; 422 return scope[ctrlAs].fd.s1;
425 }, 423 },
426 function(newValue, oldValue) { 424 function(newValue, oldValue) {
427 - // 初始化s1  
428 - if (newValue.id) {  
429 - if (newValue.id && newValue.name && newValue.jobCode) {  
430 - new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 425 + if (form_data_assign_count.s1 > 2) {
  426 + if (newValue.id) {
  427 + if (newValue.id && newValue.name && newValue.jobCode) {
  428 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  429 + } else {
  430 + new_s1 = undefined;
  431 + }
431 } else { 432 } else {
432 new_s1 = undefined; 433 new_s1 = undefined;
433 } 434 }
434 - } else {  
435 - new_s1 = undefined;  
436 - }  
437 435
438 - form_data_assign_count.s1 ++;  
439 - if (form_data_assign_count.s1 > 1) {  
440 scope[ctrlAs].$$internal_refresh_dsdata_j(); 436 scope[ctrlAs].$$internal_refresh_dsdata_j();
441 scope[ctrlAs].$$internal_refresh_dsdata_s(); 437 scope[ctrlAs].$$internal_refresh_dsdata_s();
442 } 438 }
  439 +
  440 + form_data_assign_count.s1 ++;
443 }, 441 },
444 true 442 true
445 ); 443 );
@@ -450,22 +448,22 @@ angular.module('ScheduleApp').directive( @@ -450,22 +448,22 @@ angular.module('ScheduleApp').directive(
450 return scope[ctrlAs].fd.j2; 448 return scope[ctrlAs].fd.j2;
451 }, 449 },
452 function(newValue, oldValue) { 450 function(newValue, oldValue) {
453 - // 初始化j2  
454 - if (newValue.id) {  
455 - if (newValue.id && newValue.name && newValue.jobCode) {  
456 - new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 451 + if (form_data_assign_count.j2 > 2) {
  452 + if (newValue.id) {
  453 + if (newValue.id && newValue.name && newValue.jobCode) {
  454 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  455 + } else {
  456 + new_j2 = undefined;
  457 + }
457 } else { 458 } else {
458 new_j2 = undefined; 459 new_j2 = undefined;
459 } 460 }
460 - } else {  
461 - new_j2 = undefined;  
462 - }  
463 461
464 - form_data_assign_count.j2 ++;  
465 - if (form_data_assign_count.j2 > 1) {  
466 scope[ctrlAs].$$internal_refresh_dsdata_j(); 462 scope[ctrlAs].$$internal_refresh_dsdata_j();
467 scope[ctrlAs].$$internal_refresh_dsdata_s(); 463 scope[ctrlAs].$$internal_refresh_dsdata_s();
468 } 464 }
  465 +
  466 + form_data_assign_count.j2 ++;
469 }, 467 },
470 true 468 true
471 ); 469 );
@@ -476,22 +474,22 @@ angular.module('ScheduleApp').directive( @@ -476,22 +474,22 @@ angular.module('ScheduleApp').directive(
476 return scope[ctrlAs].fd.s2; 474 return scope[ctrlAs].fd.s2;
477 }, 475 },
478 function(newValue, oldValue) { 476 function(newValue, oldValue) {
479 - // 初始化s2  
480 - if (newValue && newValue.id) {  
481 - if (newValue.id && newValue.name && newValue.jobCode) {  
482 - new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 477 + if (form_data_assign_count.s2 > 2) {
  478 + if (newValue && newValue.id) {
  479 + if (newValue.id && newValue.name && newValue.jobCode) {
  480 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  481 + } else {
  482 + new_s2 = undefined;
  483 + }
483 } else { 484 } else {
484 new_s2 = undefined; 485 new_s2 = undefined;
485 } 486 }
486 - } else {  
487 - new_s2 = undefined;  
488 - }  
489 487
490 - form_data_assign_count.s2 ++;  
491 - if (form_data_assign_count.s2 > 1) {  
492 scope[ctrlAs].$$internal_refresh_dsdata_j(); 488 scope[ctrlAs].$$internal_refresh_dsdata_j();
493 scope[ctrlAs].$$internal_refresh_dsdata_s(); 489 scope[ctrlAs].$$internal_refresh_dsdata_s();
494 } 490 }
  491 +
  492 + form_data_assign_count.s2 ++;
495 }, 493 },
496 true 494 true
497 ); 495 );
@@ -505,8 +503,8 @@ angular.module('ScheduleApp').directive( @@ -505,8 +503,8 @@ angular.module('ScheduleApp').directive(
505 if (newValue && newValue.length > 0) { 503 if (newValue && newValue.length > 0) {
506 var j1 = newValue[0].j; 504 var j1 = newValue[0].j;
507 505
508 - var cl_ids = []; // 车辆ids数组(有顺序)  
509 - var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序) 506 + var cl_idFlags = []; // 车辆idFlags数组(有顺序)
  507 + var j_s_idFlags = []; // 驾驶员idFlags,售票员idFlags,[{j:idFlag,s:idFlag},...](有顺序)
510 var addreason = []; // 营运调度的原因 508 var addreason = []; // 营运调度的原因
511 var adddesc = []; // 营运导读的备注 509 var adddesc = []; // 营运导读的备注
512 var isRepeat = false; 510 var isRepeat = false;
@@ -572,30 +570,30 @@ angular.module('ScheduleApp').directive( @@ -572,30 +570,30 @@ angular.module('ScheduleApp').directive(
572 // 车辆处理 570 // 车辆处理
573 isRepeat = false; 571 isRepeat = false;
574 if (obj.cl) { 572 if (obj.cl) {
575 - for (i = 0; i < cl_ids.length; i++) {  
576 - if (cl_ids[i] == obj.cl) { 573 + for (i = 0; i < cl_idFlags.length; i++) {
  574 + if (cl_idFlags[i] == (obj.cl + "_" + obj.clZbh)) {
577 isRepeat = true; 575 isRepeat = true;
578 break; 576 break;
579 } 577 }
580 } 578 }
581 if (!isRepeat) { 579 if (!isRepeat) {
582 - cl_ids.push(obj.cl); 580 + cl_idFlags.push(obj.cl + "_" + obj.clZbh);
583 } 581 }
584 } 582 }
585 583
586 // 人员处理(以驾驶员id为主,没有的话,售票员不管了) 584 // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
587 isRepeat = false; 585 isRepeat = false;
588 if (obj.j) { 586 if (obj.j) {
589 - for (i = 0; i < j_s_ids.length; i++) {  
590 - if (j_s_ids[i].j == obj.j) { 587 + for (i = 0; i < j_s_idFlags.length; i++) {
  588 + if (j_s_idFlags[i].j == (obj.j + "_" + obj.jName + "_" + obj.jGh)) {
591 isRepeat = true; 589 isRepeat = true;
592 break; 590 break;
593 } 591 }
594 } 592 }
595 if (!isRepeat) { 593 if (!isRepeat) {
596 - j_s_ids.push({  
597 - j: obj.j,  
598 - s: !obj.s? undefined: obj.s 594 + j_s_idFlags.push({
  595 + j: obj.j + "_" + obj.jName + "_" + obj.jGh,
  596 + s: !obj.s? undefined: (obj.s + "_" + obj.sName + "_" + obj.sGh)
599 }); 597 });
600 } 598 }
601 } 599 }
@@ -634,25 +632,66 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -634,25 +632,66 @@ angular.module(&#39;ScheduleApp&#39;).directive(
634 old_half_bcs = newValue.length / 2; 632 old_half_bcs = newValue.length / 2;
635 633
636 // 更新formdata 634 // 更新formdata
637 - for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆  
638 - if (i >= 2) { 635 + for (i = 0; i < cl_idFlags.length; i++) { // 车辆更新前两辆
  636 + if (i == 0) { // 第一组车
  637 + scope[ctrlAs].fd["cl1"].id = cl_idFlags[i].split("_")[0];
  638 + new_cl1 = cl_idFlags[i];
  639 + } else if (i == 1) { // 第二组车
  640 + scope[ctrlAs].fd["cl2"].id = cl_idFlags[i].split("_")[0];
  641 + new_cl2 = cl_idFlags[i];
  642 + } else { // 第三组及以上车全部忽略
639 break; 643 break;
640 - } else {  
641 - form_data_assign_count["cl" + (i + 1)] = 0;  
642 - scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];  
643 } 644 }
644 } 645 }
645 - for (i = 0; i < j_s_ids.length; i++) { // 人员更新  
646 - if (i >= 3) { 646 + for (i = 0; i < j_s_idFlags.length; i++) { // 人员更新
  647 + if (i == 0) { // 第一组人员
  648 + scope[ctrlAs].fd["j1"].id = j_s_idFlags[i].j.split("_")[0];
  649 + scope[ctrlAs].fd["s1"].id = j_s_idFlags[i].s && j_s_idFlags[i].s.split("_")[0];
  650 + new_j1 = j_s_idFlags[i].j;
  651 + new_s1 = j_s_idFlags[i].s;
  652 +
  653 + } else if (i == 1) { // 第二组人员
  654 + scope[ctrlAs].fd["j2"].id = j_s_idFlags[i].j.split("_")[0];
  655 + scope[ctrlAs].fd["s2"].id = j_s_idFlags[i].s && j_s_idFlags[i].s.split("_")[0];
  656 + new_j2 = j_s_idFlags[i].j;
  657 + new_s2 = j_s_idFlags[i].s;
  658 + } else { // 第三组及以上全部忽律
647 break; 659 break;
648 - } else {  
649 - form_data_assign_count["j" + (i + 1)] = 0;  
650 - scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;  
651 -  
652 - form_data_assign_count["s" + (i + 1)] = 0;  
653 - scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;  
654 } 660 }
655 } 661 }
  662 + // 更新form_data_assign_count,有值设置成2,没值设置成3,表示已经从ds处初始化完毕
  663 + if (new_cl1) {
  664 + form_data_assign_count["cl1"] = 2;
  665 + } else {
  666 + form_data_assign_count["cl1"] = 3;
  667 + }
  668 + if (new_cl2) {
  669 + form_data_assign_count["cl2"] = 2;
  670 + } else {
  671 + form_data_assign_count["cl2"] = 3;
  672 + }
  673 + if (new_j1) {
  674 + form_data_assign_count["j1"] = 2;
  675 + } else {
  676 + form_data_assign_count["j1"] = 3;
  677 + }
  678 + if (new_j2) {
  679 + form_data_assign_count["j2"] = 2;
  680 + } else {
  681 + form_data_assign_count["j2"] = 3;
  682 + }
  683 + if (new_s1) {
  684 + form_data_assign_count["s1"] = 2;
  685 + } else {
  686 + form_data_assign_count["s1"] = 3;
  687 + }
  688 + if (new_s2) {
  689 + form_data_assign_count["s2"] = 2;
  690 + } else {
  691 + form_data_assign_count["s2"] = 3;
  692 + }
  693 +
  694 +
656 for (i = 0; i < addreason.length; i++) { // 调度原因更新 695 for (i = 0; i < addreason.length; i++) { // 调度原因更新
657 if (i > 1) { // 有多个,只更新第一个 696 if (i > 1) { // 有多个,只更新第一个
658 break; 697 break;
src/main/resources/static/pages/scheduleApp/module/common/prj-common-directive.js
@@ -5939,7 +5939,7 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5939,7 +5939,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5939 var new_dddesc = undefined; // 调度描述 5939 var new_dddesc = undefined; // 调度描述
5940 5940
5941 // 表单值,被赋值的次数 5941 // 表单值,被赋值的次数
5942 - var form_data_assign_count = { 5942 + var form_data_assign_count = { // 大于1表示已经初始化过了
5943 cl1 : -1, 5943 cl1 : -1,
5944 cl2 : -1, 5944 cl2 : -1,
5945 j1 : -1, 5945 j1 : -1,
@@ -6230,21 +6230,20 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6230,21 +6230,20 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6230 return scope[ctrlAs].fd.cl1; 6230 return scope[ctrlAs].fd.cl1;
6231 }, 6231 },
6232 function(newValue, oldValue) { 6232 function(newValue, oldValue) {
6233 - // 初始化new_cl1  
6234 - if (newValue.id) {  
6235 - if (newValue.id && newValue.zbh) {  
6236 - new_cl1 = newValue.id + "_" + newValue.zbh; 6233 + if (form_data_assign_count.cl1 > 2) {
  6234 + if (newValue.id) {
  6235 + if (newValue.id && newValue.zbh) {
  6236 + new_cl1 = newValue.id + "_" + newValue.zbh;
  6237 + } else {
  6238 + new_cl1 = undefined;
  6239 + }
6237 } else { 6240 } else {
6238 new_cl1 = undefined; 6241 new_cl1 = undefined;
6239 } 6242 }
6240 - } else {  
6241 - new_cl1 = undefined; 6243 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
6242 } 6244 }
6243 6245
6244 form_data_assign_count.cl1 ++; 6246 form_data_assign_count.cl1 ++;
6245 - if (form_data_assign_count.cl1 > 1) {  
6246 - scope[ctrlAs].$$internal_refresh_dsdata_cl();  
6247 - }  
6248 }, 6247 },
6249 true 6248 true
6250 ); 6249 );
@@ -6255,21 +6254,20 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6255,21 +6254,20 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6255 return scope[ctrlAs].fd.cl2; 6254 return scope[ctrlAs].fd.cl2;
6256 }, 6255 },
6257 function(newValue, oldValue) { 6256 function(newValue, oldValue) {
6258 - // 初始化new_cl2  
6259 - if (newValue.id) {  
6260 - if (newValue.id && newValue.zbh) {  
6261 - new_cl2 = newValue.id + "_" + newValue.zbh; 6257 + if (form_data_assign_count.cl2 > 2) {
  6258 + if (newValue.id) {
  6259 + if (newValue.id && newValue.zbh) {
  6260 + new_cl2 = newValue.id + "_" + newValue.zbh;
  6261 + } else {
  6262 + new_cl2 = undefined;
  6263 + }
6262 } else { 6264 } else {
6263 new_cl2 = undefined; 6265 new_cl2 = undefined;
6264 } 6266 }
6265 - } else {  
6266 - new_cl2 = undefined; 6267 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
6267 } 6268 }
6268 6269
6269 form_data_assign_count.cl2 ++; 6270 form_data_assign_count.cl2 ++;
6270 - if (form_data_assign_count.cl2 > 1) {  
6271 - scope[ctrlAs].$$internal_refresh_dsdata_cl();  
6272 - }  
6273 }, 6271 },
6274 true 6272 true
6275 ); 6273 );
@@ -6280,22 +6278,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6280,22 +6278,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6280 return scope[ctrlAs].fd.j1; 6278 return scope[ctrlAs].fd.j1;
6281 }, 6279 },
6282 function(newValue, oldValue) { 6280 function(newValue, oldValue) {
6283 - // 初始化j1  
6284 - if (newValue.id) {  
6285 - if (newValue.id && newValue.name && newValue.jobCode) {  
6286 - new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 6281 + if (form_data_assign_count.j1 > 2) {
  6282 + if (newValue.id) {
  6283 + if (newValue.id && newValue.name && newValue.jobCode) {
  6284 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  6285 + } else {
  6286 + new_j1 = undefined;
  6287 + }
6287 } else { 6288 } else {
6288 new_j1 = undefined; 6289 new_j1 = undefined;
6289 } 6290 }
6290 - } else {  
6291 - new_j1 = undefined;  
6292 - }  
6293 6291
6294 - form_data_assign_count.j1 ++;  
6295 - if (form_data_assign_count.j1 > 1) {  
6296 scope[ctrlAs].$$internal_refresh_dsdata_j(); 6292 scope[ctrlAs].$$internal_refresh_dsdata_j();
6297 scope[ctrlAs].$$internal_refresh_dsdata_s(); 6293 scope[ctrlAs].$$internal_refresh_dsdata_s();
6298 } 6294 }
  6295 +
  6296 + form_data_assign_count.j1 ++;
6299 }, 6297 },
6300 true 6298 true
6301 ); 6299 );
@@ -6306,22 +6304,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6306,22 +6304,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6306 return scope[ctrlAs].fd.s1; 6304 return scope[ctrlAs].fd.s1;
6307 }, 6305 },
6308 function(newValue, oldValue) { 6306 function(newValue, oldValue) {
6309 - // 初始化s1  
6310 - if (newValue.id) {  
6311 - if (newValue.id && newValue.name && newValue.jobCode) {  
6312 - new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 6307 + if (form_data_assign_count.s1 > 2) {
  6308 + if (newValue.id) {
  6309 + if (newValue.id && newValue.name && newValue.jobCode) {
  6310 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  6311 + } else {
  6312 + new_s1 = undefined;
  6313 + }
6313 } else { 6314 } else {
6314 new_s1 = undefined; 6315 new_s1 = undefined;
6315 } 6316 }
6316 - } else {  
6317 - new_s1 = undefined;  
6318 - }  
6319 6317
6320 - form_data_assign_count.s1 ++;  
6321 - if (form_data_assign_count.s1 > 1) {  
6322 scope[ctrlAs].$$internal_refresh_dsdata_j(); 6318 scope[ctrlAs].$$internal_refresh_dsdata_j();
6323 scope[ctrlAs].$$internal_refresh_dsdata_s(); 6319 scope[ctrlAs].$$internal_refresh_dsdata_s();
6324 } 6320 }
  6321 +
  6322 + form_data_assign_count.s1 ++;
6325 }, 6323 },
6326 true 6324 true
6327 ); 6325 );
@@ -6332,22 +6330,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6332,22 +6330,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6332 return scope[ctrlAs].fd.j2; 6330 return scope[ctrlAs].fd.j2;
6333 }, 6331 },
6334 function(newValue, oldValue) { 6332 function(newValue, oldValue) {
6335 - // 初始化j2  
6336 - if (newValue.id) {  
6337 - if (newValue.id && newValue.name && newValue.jobCode) {  
6338 - new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 6333 + if (form_data_assign_count.j2 > 2) {
  6334 + if (newValue.id) {
  6335 + if (newValue.id && newValue.name && newValue.jobCode) {
  6336 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  6337 + } else {
  6338 + new_j2 = undefined;
  6339 + }
6339 } else { 6340 } else {
6340 new_j2 = undefined; 6341 new_j2 = undefined;
6341 } 6342 }
6342 - } else {  
6343 - new_j2 = undefined;  
6344 - }  
6345 6343
6346 - form_data_assign_count.j2 ++;  
6347 - if (form_data_assign_count.j2 > 1) {  
6348 scope[ctrlAs].$$internal_refresh_dsdata_j(); 6344 scope[ctrlAs].$$internal_refresh_dsdata_j();
6349 scope[ctrlAs].$$internal_refresh_dsdata_s(); 6345 scope[ctrlAs].$$internal_refresh_dsdata_s();
6350 } 6346 }
  6347 +
  6348 + form_data_assign_count.j2 ++;
6351 }, 6349 },
6352 true 6350 true
6353 ); 6351 );
@@ -6358,22 +6356,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6358,22 +6356,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6358 return scope[ctrlAs].fd.s2; 6356 return scope[ctrlAs].fd.s2;
6359 }, 6357 },
6360 function(newValue, oldValue) { 6358 function(newValue, oldValue) {
6361 - // 初始化s2  
6362 - if (newValue && newValue.id) {  
6363 - if (newValue.id && newValue.name && newValue.jobCode) {  
6364 - new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 6359 + if (form_data_assign_count.s2 > 2) {
  6360 + if (newValue && newValue.id) {
  6361 + if (newValue.id && newValue.name && newValue.jobCode) {
  6362 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  6363 + } else {
  6364 + new_s2 = undefined;
  6365 + }
6365 } else { 6366 } else {
6366 new_s2 = undefined; 6367 new_s2 = undefined;
6367 } 6368 }
6368 - } else {  
6369 - new_s2 = undefined;  
6370 - }  
6371 6369
6372 - form_data_assign_count.s2 ++;  
6373 - if (form_data_assign_count.s2 > 1) {  
6374 scope[ctrlAs].$$internal_refresh_dsdata_j(); 6370 scope[ctrlAs].$$internal_refresh_dsdata_j();
6375 scope[ctrlAs].$$internal_refresh_dsdata_s(); 6371 scope[ctrlAs].$$internal_refresh_dsdata_s();
6376 } 6372 }
  6373 +
  6374 + form_data_assign_count.s2 ++;
6377 }, 6375 },
6378 true 6376 true
6379 ); 6377 );
@@ -6387,8 +6385,8 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6387,8 +6385,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6387 if (newValue && newValue.length > 0) { 6385 if (newValue && newValue.length > 0) {
6388 var j1 = newValue[0].j; 6386 var j1 = newValue[0].j;
6389 6387
6390 - var cl_ids = []; // 车辆ids数组(有顺序)  
6391 - var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序) 6388 + var cl_idFlags = []; // 车辆idFlags数组(有顺序)
  6389 + var j_s_idFlags = []; // 驾驶员idFlags,售票员idFlags,[{j:idFlag,s:idFlag},...](有顺序)
6392 var addreason = []; // 营运调度的原因 6390 var addreason = []; // 营运调度的原因
6393 var adddesc = []; // 营运导读的备注 6391 var adddesc = []; // 营运导读的备注
6394 var isRepeat = false; 6392 var isRepeat = false;
@@ -6454,30 +6452,30 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6454,30 +6452,30 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6454 // 车辆处理 6452 // 车辆处理
6455 isRepeat = false; 6453 isRepeat = false;
6456 if (obj.cl) { 6454 if (obj.cl) {
6457 - for (i = 0; i < cl_ids.length; i++) {  
6458 - if (cl_ids[i] == obj.cl) { 6455 + for (i = 0; i < cl_idFlags.length; i++) {
  6456 + if (cl_idFlags[i] == (obj.cl + "_" + obj.clZbh)) {
6459 isRepeat = true; 6457 isRepeat = true;
6460 break; 6458 break;
6461 } 6459 }
6462 } 6460 }
6463 if (!isRepeat) { 6461 if (!isRepeat) {
6464 - cl_ids.push(obj.cl); 6462 + cl_idFlags.push(obj.cl + "_" + obj.clZbh);
6465 } 6463 }
6466 } 6464 }
6467 6465
6468 // 人员处理(以驾驶员id为主,没有的话,售票员不管了) 6466 // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
6469 isRepeat = false; 6467 isRepeat = false;
6470 if (obj.j) { 6468 if (obj.j) {
6471 - for (i = 0; i < j_s_ids.length; i++) {  
6472 - if (j_s_ids[i].j == obj.j) { 6469 + for (i = 0; i < j_s_idFlags.length; i++) {
  6470 + if (j_s_idFlags[i].j == (obj.j + "_" + obj.jName + "_" + obj.jGh)) {
6473 isRepeat = true; 6471 isRepeat = true;
6474 break; 6472 break;
6475 } 6473 }
6476 } 6474 }
6477 if (!isRepeat) { 6475 if (!isRepeat) {
6478 - j_s_ids.push({  
6479 - j: obj.j,  
6480 - s: !obj.s? undefined: obj.s 6476 + j_s_idFlags.push({
  6477 + j: obj.j + "_" + obj.jName + "_" + obj.jGh,
  6478 + s: !obj.s? undefined: (obj.s + "_" + obj.sName + "_" + obj.sGh)
6481 }); 6479 });
6482 } 6480 }
6483 } 6481 }
@@ -6516,25 +6514,66 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6516,25 +6514,66 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6516 old_half_bcs = newValue.length / 2; 6514 old_half_bcs = newValue.length / 2;
6517 6515
6518 // 更新formdata 6516 // 更新formdata
6519 - for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆  
6520 - if (i >= 2) { 6517 + for (i = 0; i < cl_idFlags.length; i++) { // 车辆更新前两辆
  6518 + if (i == 0) { // 第一组车
  6519 + scope[ctrlAs].fd["cl1"].id = cl_idFlags[i].split("_")[0];
  6520 + new_cl1 = cl_idFlags[i];
  6521 + } else if (i == 1) { // 第二组车
  6522 + scope[ctrlAs].fd["cl2"].id = cl_idFlags[i].split("_")[0];
  6523 + new_cl2 = cl_idFlags[i];
  6524 + } else { // 第三组及以上车全部忽略
6521 break; 6525 break;
6522 - } else {  
6523 - form_data_assign_count["cl" + (i + 1)] = 0;  
6524 - scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];  
6525 } 6526 }
6526 } 6527 }
6527 - for (i = 0; i < j_s_ids.length; i++) { // 人员更新  
6528 - if (i >= 3) { 6528 + for (i = 0; i < j_s_idFlags.length; i++) { // 人员更新
  6529 + if (i == 0) { // 第一组人员
  6530 + scope[ctrlAs].fd["j1"].id = j_s_idFlags[i].j.split("_")[0];
  6531 + scope[ctrlAs].fd["s1"].id = j_s_idFlags[i].s && j_s_idFlags[i].s.split("_")[0];
  6532 + new_j1 = j_s_idFlags[i].j;
  6533 + new_s1 = j_s_idFlags[i].s;
  6534 +
  6535 + } else if (i == 1) { // 第二组人员
  6536 + scope[ctrlAs].fd["j2"].id = j_s_idFlags[i].j.split("_")[0];
  6537 + scope[ctrlAs].fd["s2"].id = j_s_idFlags[i].s && j_s_idFlags[i].s.split("_")[0];
  6538 + new_j2 = j_s_idFlags[i].j;
  6539 + new_s2 = j_s_idFlags[i].s;
  6540 + } else { // 第三组及以上全部忽律
6529 break; 6541 break;
6530 - } else {  
6531 - form_data_assign_count["j" + (i + 1)] = 0;  
6532 - scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;  
6533 -  
6534 - form_data_assign_count["s" + (i + 1)] = 0;  
6535 - scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;  
6536 } 6542 }
6537 } 6543 }
  6544 + // 更新form_data_assign_count,有值设置成2,没值设置成3,表示已经从ds处初始化完毕
  6545 + if (new_cl1) {
  6546 + form_data_assign_count["cl1"] = 2;
  6547 + } else {
  6548 + form_data_assign_count["cl1"] = 3;
  6549 + }
  6550 + if (new_cl2) {
  6551 + form_data_assign_count["cl2"] = 2;
  6552 + } else {
  6553 + form_data_assign_count["cl2"] = 3;
  6554 + }
  6555 + if (new_j1) {
  6556 + form_data_assign_count["j1"] = 2;
  6557 + } else {
  6558 + form_data_assign_count["j1"] = 3;
  6559 + }
  6560 + if (new_j2) {
  6561 + form_data_assign_count["j2"] = 2;
  6562 + } else {
  6563 + form_data_assign_count["j2"] = 3;
  6564 + }
  6565 + if (new_s1) {
  6566 + form_data_assign_count["s1"] = 2;
  6567 + } else {
  6568 + form_data_assign_count["s1"] = 3;
  6569 + }
  6570 + if (new_s2) {
  6571 + form_data_assign_count["s2"] = 2;
  6572 + } else {
  6573 + form_data_assign_count["s2"] = 3;
  6574 + }
  6575 +
  6576 +
6538 for (i = 0; i < addreason.length; i++) { // 调度原因更新 6577 for (i = 0; i < addreason.length; i++) { // 调度原因更新
6539 if (i > 1) { // 有多个,只更新第一个 6578 if (i > 1) { // 有多个,只更新第一个
6540 break; 6579 break;