Commit b7414acf49fa22c29fd5e7f28df324283b5c6b2a

Authored by 徐烜
1 parent b0ddb170

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
@@ -5543,7 +5543,7 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5543,7 +5543,7 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5543 var new_dddesc = undefined; // 调度描述 5543 var new_dddesc = undefined; // 调度描述
5544 5544
5545 // 表单值,被赋值的次数 5545 // 表单值,被赋值的次数
5546 - var form_data_assign_count = { 5546 + var form_data_assign_count = { // 大于1表示已经初始化过了
5547 cl1 : -1, 5547 cl1 : -1,
5548 cl2 : -1, 5548 cl2 : -1,
5549 j1 : -1, 5549 j1 : -1,
@@ -5834,21 +5834,20 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5834,21 +5834,20 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5834 return scope[ctrlAs].fd.cl1; 5834 return scope[ctrlAs].fd.cl1;
5835 }, 5835 },
5836 function(newValue, oldValue) { 5836 function(newValue, oldValue) {
5837 - // 初始化new_cl1  
5838 - if (newValue.id) {  
5839 - if (newValue.id && newValue.zbh) {  
5840 - new_cl1 = newValue.id + "_" + newValue.zbh; 5837 + if (form_data_assign_count.cl1 > 2) {
  5838 + if (newValue.id) {
  5839 + if (newValue.id && newValue.zbh) {
  5840 + new_cl1 = newValue.id + "_" + newValue.zbh;
  5841 + } else {
  5842 + new_cl1 = undefined;
  5843 + }
5841 } else { 5844 } else {
5842 new_cl1 = undefined; 5845 new_cl1 = undefined;
5843 } 5846 }
5844 - } else {  
5845 - new_cl1 = undefined; 5847 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
5846 } 5848 }
5847 5849
5848 form_data_assign_count.cl1 ++; 5850 form_data_assign_count.cl1 ++;
5849 - if (form_data_assign_count.cl1 > 1) {  
5850 - scope[ctrlAs].$$internal_refresh_dsdata_cl();  
5851 - }  
5852 }, 5851 },
5853 true 5852 true
5854 ); 5853 );
@@ -5859,21 +5858,20 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5859,21 +5858,20 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5859 return scope[ctrlAs].fd.cl2; 5858 return scope[ctrlAs].fd.cl2;
5860 }, 5859 },
5861 function(newValue, oldValue) { 5860 function(newValue, oldValue) {
5862 - // 初始化new_cl2  
5863 - if (newValue.id) {  
5864 - if (newValue.id && newValue.zbh) {  
5865 - new_cl2 = newValue.id + "_" + newValue.zbh; 5861 + if (form_data_assign_count.cl2 > 2) {
  5862 + if (newValue.id) {
  5863 + if (newValue.id && newValue.zbh) {
  5864 + new_cl2 = newValue.id + "_" + newValue.zbh;
  5865 + } else {
  5866 + new_cl2 = undefined;
  5867 + }
5866 } else { 5868 } else {
5867 new_cl2 = undefined; 5869 new_cl2 = undefined;
5868 } 5870 }
5869 - } else {  
5870 - new_cl2 = undefined; 5871 + scope[ctrlAs].$$internal_refresh_dsdata_cl();
5871 } 5872 }
5872 5873
5873 form_data_assign_count.cl2 ++; 5874 form_data_assign_count.cl2 ++;
5874 - if (form_data_assign_count.cl2 > 1) {  
5875 - scope[ctrlAs].$$internal_refresh_dsdata_cl();  
5876 - }  
5877 }, 5875 },
5878 true 5876 true
5879 ); 5877 );
@@ -5884,22 +5882,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5884,22 +5882,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5884 return scope[ctrlAs].fd.j1; 5882 return scope[ctrlAs].fd.j1;
5885 }, 5883 },
5886 function(newValue, oldValue) { 5884 function(newValue, oldValue) {
5887 - // 初始化j1  
5888 - if (newValue.id) {  
5889 - if (newValue.id && newValue.name && newValue.jobCode) {  
5890 - new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 5885 + if (form_data_assign_count.j1 > 2) {
  5886 + if (newValue.id) {
  5887 + if (newValue.id && newValue.name && newValue.jobCode) {
  5888 + new_j1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5889 + } else {
  5890 + new_j1 = undefined;
  5891 + }
5891 } else { 5892 } else {
5892 new_j1 = undefined; 5893 new_j1 = undefined;
5893 } 5894 }
5894 - } else {  
5895 - new_j1 = undefined;  
5896 - }  
5897 5895
5898 - form_data_assign_count.j1 ++;  
5899 - if (form_data_assign_count.j1 > 1) {  
5900 scope[ctrlAs].$$internal_refresh_dsdata_j(); 5896 scope[ctrlAs].$$internal_refresh_dsdata_j();
5901 scope[ctrlAs].$$internal_refresh_dsdata_s(); 5897 scope[ctrlAs].$$internal_refresh_dsdata_s();
5902 } 5898 }
  5899 +
  5900 + form_data_assign_count.j1 ++;
5903 }, 5901 },
5904 true 5902 true
5905 ); 5903 );
@@ -5910,22 +5908,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5910,22 +5908,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5910 return scope[ctrlAs].fd.s1; 5908 return scope[ctrlAs].fd.s1;
5911 }, 5909 },
5912 function(newValue, oldValue) { 5910 function(newValue, oldValue) {
5913 - // 初始化s1  
5914 - if (newValue.id) {  
5915 - if (newValue.id && newValue.name && newValue.jobCode) {  
5916 - new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 5911 + if (form_data_assign_count.s1 > 2) {
  5912 + if (newValue.id) {
  5913 + if (newValue.id && newValue.name && newValue.jobCode) {
  5914 + new_s1 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5915 + } else {
  5916 + new_s1 = undefined;
  5917 + }
5917 } else { 5918 } else {
5918 new_s1 = undefined; 5919 new_s1 = undefined;
5919 } 5920 }
5920 - } else {  
5921 - new_s1 = undefined;  
5922 - }  
5923 5921
5924 - form_data_assign_count.s1 ++;  
5925 - if (form_data_assign_count.s1 > 1) {  
5926 scope[ctrlAs].$$internal_refresh_dsdata_j(); 5922 scope[ctrlAs].$$internal_refresh_dsdata_j();
5927 scope[ctrlAs].$$internal_refresh_dsdata_s(); 5923 scope[ctrlAs].$$internal_refresh_dsdata_s();
5928 } 5924 }
  5925 +
  5926 + form_data_assign_count.s1 ++;
5929 }, 5927 },
5930 true 5928 true
5931 ); 5929 );
@@ -5936,22 +5934,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5936,22 +5934,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5936 return scope[ctrlAs].fd.j2; 5934 return scope[ctrlAs].fd.j2;
5937 }, 5935 },
5938 function(newValue, oldValue) { 5936 function(newValue, oldValue) {
5939 - // 初始化j2  
5940 - if (newValue.id) {  
5941 - if (newValue.id && newValue.name && newValue.jobCode) {  
5942 - new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 5937 + if (form_data_assign_count.j2 > 2) {
  5938 + if (newValue.id) {
  5939 + if (newValue.id && newValue.name && newValue.jobCode) {
  5940 + new_j2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5941 + } else {
  5942 + new_j2 = undefined;
  5943 + }
5943 } else { 5944 } else {
5944 new_j2 = undefined; 5945 new_j2 = undefined;
5945 } 5946 }
5946 - } else {  
5947 - new_j2 = undefined;  
5948 - }  
5949 5947
5950 - form_data_assign_count.j2 ++;  
5951 - if (form_data_assign_count.j2 > 1) {  
5952 scope[ctrlAs].$$internal_refresh_dsdata_j(); 5948 scope[ctrlAs].$$internal_refresh_dsdata_j();
5953 scope[ctrlAs].$$internal_refresh_dsdata_s(); 5949 scope[ctrlAs].$$internal_refresh_dsdata_s();
5954 } 5950 }
  5951 +
  5952 + form_data_assign_count.j2 ++;
5955 }, 5953 },
5956 true 5954 true
5957 ); 5955 );
@@ -5962,22 +5960,22 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5962,22 +5960,22 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5962 return scope[ctrlAs].fd.s2; 5960 return scope[ctrlAs].fd.s2;
5963 }, 5961 },
5964 function(newValue, oldValue) { 5962 function(newValue, oldValue) {
5965 - // 初始化s2  
5966 - if (newValue && newValue.id) {  
5967 - if (newValue.id && newValue.name && newValue.jobCode) {  
5968 - new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode; 5963 + if (form_data_assign_count.s2 > 2) {
  5964 + if (newValue && newValue.id) {
  5965 + if (newValue.id && newValue.name && newValue.jobCode) {
  5966 + new_s2 = newValue.id + "_" + newValue.name + "_" + newValue.jobCode;
  5967 + } else {
  5968 + new_s2 = undefined;
  5969 + }
5969 } else { 5970 } else {
5970 new_s2 = undefined; 5971 new_s2 = undefined;
5971 } 5972 }
5972 - } else {  
5973 - new_s2 = undefined;  
5974 - }  
5975 5973
5976 - form_data_assign_count.s2 ++;  
5977 - if (form_data_assign_count.s2 > 1) {  
5978 scope[ctrlAs].$$internal_refresh_dsdata_j(); 5974 scope[ctrlAs].$$internal_refresh_dsdata_j();
5979 scope[ctrlAs].$$internal_refresh_dsdata_s(); 5975 scope[ctrlAs].$$internal_refresh_dsdata_s();
5980 } 5976 }
  5977 +
  5978 + form_data_assign_count.s2 ++;
5981 }, 5979 },
5982 true 5980 true
5983 ); 5981 );
@@ -5991,8 +5989,8 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -5991,8 +5989,8 @@ angular.module(&#39;ScheduleApp&#39;).directive(
5991 if (newValue && newValue.length > 0) { 5989 if (newValue && newValue.length > 0) {
5992 var j1 = newValue[0].j; 5990 var j1 = newValue[0].j;
5993 5991
5994 - var cl_ids = []; // 车辆ids数组(有顺序)  
5995 - var j_s_ids = []; // 驾驶员ids,售票员ids,[{j:id,s:id},...](有顺序) 5992 + var cl_idFlags = []; // 车辆idFlags数组(有顺序)
  5993 + var j_s_idFlags = []; // 驾驶员idFlags,售票员idFlags,[{j:idFlag,s:idFlag},...](有顺序)
5996 var addreason = []; // 营运调度的原因 5994 var addreason = []; // 营运调度的原因
5997 var adddesc = []; // 营运导读的备注 5995 var adddesc = []; // 营运导读的备注
5998 var isRepeat = false; 5996 var isRepeat = false;
@@ -6058,30 +6056,30 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6058,30 +6056,30 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6058 // 车辆处理 6056 // 车辆处理
6059 isRepeat = false; 6057 isRepeat = false;
6060 if (obj.cl) { 6058 if (obj.cl) {
6061 - for (i = 0; i < cl_ids.length; i++) {  
6062 - if (cl_ids[i] == obj.cl) { 6059 + for (i = 0; i < cl_idFlags.length; i++) {
  6060 + if (cl_idFlags[i] == (obj.cl + "_" + obj.clZbh)) {
6063 isRepeat = true; 6061 isRepeat = true;
6064 break; 6062 break;
6065 } 6063 }
6066 } 6064 }
6067 if (!isRepeat) { 6065 if (!isRepeat) {
6068 - cl_ids.push(obj.cl); 6066 + cl_idFlags.push(obj.cl + "_" + obj.clZbh);
6069 } 6067 }
6070 } 6068 }
6071 6069
6072 // 人员处理(以驾驶员id为主,没有的话,售票员不管了) 6070 // 人员处理(以驾驶员id为主,没有的话,售票员不管了)
6073 isRepeat = false; 6071 isRepeat = false;
6074 if (obj.j) { 6072 if (obj.j) {
6075 - for (i = 0; i < j_s_ids.length; i++) {  
6076 - if (j_s_ids[i].j == obj.j) { 6073 + for (i = 0; i < j_s_idFlags.length; i++) {
  6074 + if (j_s_idFlags[i].j == (obj.j + "_" + obj.jName + "_" + obj.jGh)) {
6077 isRepeat = true; 6075 isRepeat = true;
6078 break; 6076 break;
6079 } 6077 }
6080 } 6078 }
6081 if (!isRepeat) { 6079 if (!isRepeat) {
6082 - j_s_ids.push({  
6083 - j: obj.j,  
6084 - s: !obj.s? undefined: obj.s 6080 + j_s_idFlags.push({
  6081 + j: obj.j + "_" + obj.jName + "_" + obj.jGh,
  6082 + s: !obj.s? undefined: (obj.s + "_" + obj.sName + "_" + obj.sGh)
6085 }); 6083 });
6086 } 6084 }
6087 } 6085 }
@@ -6120,25 +6118,66 @@ angular.module(&#39;ScheduleApp&#39;).directive( @@ -6120,25 +6118,66 @@ angular.module(&#39;ScheduleApp&#39;).directive(
6120 old_half_bcs = newValue.length / 2; 6118 old_half_bcs = newValue.length / 2;
6121 6119
6122 // 更新formdata 6120 // 更新formdata
6123 - for (i = 0; i < cl_ids.length; i++) { // 车辆更新前两辆  
6124 - if (i >= 2) { 6121 + for (i = 0; i < cl_idFlags.length; i++) { // 车辆更新前两辆
  6122 + if (i == 0) { // 第一组车
  6123 + scope[ctrlAs].fd["cl1"].id = cl_idFlags[i].split("_")[0];
  6124 + new_cl1 = cl_idFlags[i];
  6125 + } else if (i == 1) { // 第二组车
  6126 + scope[ctrlAs].fd["cl2"].id = cl_idFlags[i].split("_")[0];
  6127 + new_cl2 = cl_idFlags[i];
  6128 + } else { // 第三组及以上车全部忽略
6125 break; 6129 break;
6126 - } else {  
6127 - form_data_assign_count["cl" + (i + 1)] = 0;  
6128 - scope[ctrlAs].fd["cl" + (i + 1)].id = cl_ids[i];  
6129 } 6130 }
6130 } 6131 }
6131 - for (i = 0; i < j_s_ids.length; i++) { // 人员更新  
6132 - if (i >= 3) { 6132 + for (i = 0; i < j_s_idFlags.length; i++) { // 人员更新
  6133 + if (i == 0) { // 第一组人员
  6134 + scope[ctrlAs].fd["j1"].id = j_s_idFlags[i].j.split("_")[0];
  6135 + scope[ctrlAs].fd["s1"].id = j_s_idFlags[i].s && j_s_idFlags[i].s.split("_")[0];
  6136 + new_j1 = j_s_idFlags[i].j;
  6137 + new_s1 = j_s_idFlags[i].s;
  6138 +
  6139 + } else if (i == 1) { // 第二组人员
  6140 + scope[ctrlAs].fd["j2"].id = j_s_idFlags[i].j.split("_")[0];
  6141 + scope[ctrlAs].fd["s2"].id = j_s_idFlags[i].s && j_s_idFlags[i].s.split("_")[0];
  6142 + new_j2 = j_s_idFlags[i].j;
  6143 + new_s2 = j_s_idFlags[i].s;
  6144 + } else { // 第三组及以上全部忽律
6133 break; 6145 break;
6134 - } else {  
6135 - form_data_assign_count["j" + (i + 1)] = 0;  
6136 - scope[ctrlAs].fd["j" + (i + 1)].id = j_s_ids[i].j;  
6137 -  
6138 - form_data_assign_count["s" + (i + 1)] = 0;  
6139 - scope[ctrlAs].fd["s" + (i + 1)].id = j_s_ids[i].s;  
6140 } 6146 }
6141 } 6147 }
  6148 + // 更新form_data_assign_count,有值设置成2,没值设置成3,表示已经从ds处初始化完毕
  6149 + if (new_cl1) {
  6150 + form_data_assign_count["cl1"] = 2;
  6151 + } else {
  6152 + form_data_assign_count["cl1"] = 3;
  6153 + }
  6154 + if (new_cl2) {
  6155 + form_data_assign_count["cl2"] = 2;
  6156 + } else {
  6157 + form_data_assign_count["cl2"] = 3;
  6158 + }
  6159 + if (new_j1) {
  6160 + form_data_assign_count["j1"] = 2;
  6161 + } else {
  6162 + form_data_assign_count["j1"] = 3;
  6163 + }
  6164 + if (new_j2) {
  6165 + form_data_assign_count["j2"] = 2;
  6166 + } else {
  6167 + form_data_assign_count["j2"] = 3;
  6168 + }
  6169 + if (new_s1) {
  6170 + form_data_assign_count["s1"] = 2;
  6171 + } else {
  6172 + form_data_assign_count["s1"] = 3;
  6173 + }
  6174 + if (new_s2) {
  6175 + form_data_assign_count["s2"] = 2;
  6176 + } else {
  6177 + form_data_assign_count["s2"] = 3;
  6178 + }
  6179 +
  6180 +
6142 for (i = 0; i < addreason.length; i++) { // 调度原因更新 6181 for (i = 0; i < addreason.length; i++) { // 调度原因更新
6143 if (i > 1) { // 有多个,只更新第一个 6182 if (i > 1) { // 有多个,只更新第一个
6144 break; 6183 break;