|
@@ -739,6 +739,205 @@ export default {
|
739
|
739
|
getNextWeekList(params).then(response=>{
|
740
|
740
|
if(response.data.state == 1){
|
741
|
741
|
var staffList = response.data.data.staffList
|
|
742
|
+ var sevenStr = ""
|
|
743
|
+ var oneStr = ""
|
|
744
|
+ var twoStr = ""
|
|
745
|
+ var threeStr = ""
|
|
746
|
+ var fourStr = ""
|
|
747
|
+ var fiveStr = ""
|
|
748
|
+ var sixStr = ""
|
|
749
|
+ for(let i=0;i<staffList.length;i++){
|
|
750
|
+ if(staffList[i].schedule_week == 0){
|
|
751
|
+ staffList[i].class_index = 0
|
|
752
|
+ var arr = []
|
|
753
|
+ this.arrZero.push(staffList[i].class_name)
|
|
754
|
+ for(let i=0;i<this.arrZero.length;i++){
|
|
755
|
+ if(this.arrZero[i]!=''){
|
|
756
|
+ arr.push(this.arrZero[i])
|
|
757
|
+ }
|
|
758
|
+ }
|
|
759
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
760
|
+ if (name in allNames) {
|
|
761
|
+ allNames[name]++;
|
|
762
|
+ }
|
|
763
|
+ else {
|
|
764
|
+ allNames[name] = 1;
|
|
765
|
+ }
|
|
766
|
+ return allNames;
|
|
767
|
+ }, {});
|
|
768
|
+ let objKey = Object.keys(countedNames)
|
|
769
|
+ let objVal = Object.values(countedNames)
|
|
770
|
+ var zeroStr = ''
|
|
771
|
+ objKey.map((item,index) => {
|
|
772
|
+ let objVal = Object.values(countedNames)
|
|
773
|
+ zeroStr += item + objVal[index] + '\n'
|
|
774
|
+ })
|
|
775
|
+ sevenStr = zeroStr
|
|
776
|
+ }
|
|
777
|
+ if(staffList[i].schedule_week == 1){
|
|
778
|
+ staffList[i].class_index = 1
|
|
779
|
+ var arr = []
|
|
780
|
+ this.arrOne.push(staffList[i].class_name)
|
|
781
|
+ for(let i=0;i<this.arrOne.length;i++){
|
|
782
|
+ if(this.arrOne[i]!=''){
|
|
783
|
+ arr.push(this.arrOne[i])
|
|
784
|
+ }
|
|
785
|
+ }
|
|
786
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
787
|
+ if (name in allNames) {
|
|
788
|
+ allNames[name]++;
|
|
789
|
+ }
|
|
790
|
+ else {
|
|
791
|
+ allNames[name] = 1;
|
|
792
|
+ }
|
|
793
|
+ return allNames;
|
|
794
|
+ }, {});
|
|
795
|
+ let objKey = Object.keys(countedNames)
|
|
796
|
+ let objVal = Object.values(countedNames)
|
|
797
|
+ let strOne = ''
|
|
798
|
+ objKey.map((item,index) => {
|
|
799
|
+ let objVal = Object.values(countedNames)
|
|
800
|
+ strOne += item + objVal[index] + '\n'
|
|
801
|
+ })
|
|
802
|
+ oneStr = strOne
|
|
803
|
+ }
|
|
804
|
+ if(staffList[i].schedule_week == 2){
|
|
805
|
+ staffList[i].class_index = 2
|
|
806
|
+ var arr = []
|
|
807
|
+ this.arrTwo.push(staffList[i].class_name)
|
|
808
|
+ for(let i=0;i<this.arrTwo.length;i++){
|
|
809
|
+ if(this.arrTwo[i]!=''){
|
|
810
|
+ arr.push(this.arrTwo[i])
|
|
811
|
+ }
|
|
812
|
+ }
|
|
813
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
814
|
+ if (name in allNames) {
|
|
815
|
+ allNames[name]++;
|
|
816
|
+ }
|
|
817
|
+ else {
|
|
818
|
+ allNames[name] = 1;
|
|
819
|
+ }
|
|
820
|
+ return allNames;
|
|
821
|
+ }, {});
|
|
822
|
+ let objKey = Object.keys(countedNames)
|
|
823
|
+ let objVal = Object.values(countedNames)
|
|
824
|
+ let strTwo = ''
|
|
825
|
+ objKey.map((item,index) => {
|
|
826
|
+ let objVal = Object.values(countedNames)
|
|
827
|
+ strTwo += item + objVal[index] + '\n'
|
|
828
|
+ })
|
|
829
|
+ twoStr = strTwo
|
|
830
|
+ }
|
|
831
|
+ if(staffList[i].schedule_week == 3){
|
|
832
|
+ staffList[i].class_index = 3
|
|
833
|
+ var arr = []
|
|
834
|
+ this.arrThree.push(staffList[i].class_name)
|
|
835
|
+ for(let i=0;i<this.arrThree.length;i++){
|
|
836
|
+ if(this.arrThree[i]!=''){
|
|
837
|
+ arr.push(this.arrThree[i])
|
|
838
|
+ }
|
|
839
|
+ }
|
|
840
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
841
|
+ if (name in allNames) {
|
|
842
|
+ allNames[name]++;
|
|
843
|
+ }
|
|
844
|
+ else {
|
|
845
|
+ allNames[name] = 1;
|
|
846
|
+ }
|
|
847
|
+ return allNames;
|
|
848
|
+ }, {});
|
|
849
|
+ let objKey = Object.keys(countedNames)
|
|
850
|
+ let objVal = Object.values(countedNames)
|
|
851
|
+ let strThree = ''
|
|
852
|
+ objKey.map((item,index) => {
|
|
853
|
+ let objVal = Object.values(countedNames)
|
|
854
|
+ strThree += item + objVal[index] + '\n'
|
|
855
|
+ })
|
|
856
|
+ threeStr = strThree
|
|
857
|
+ }
|
|
858
|
+ if(staffList[i].schedule_week == 4){
|
|
859
|
+ staffList[i].class_index = 4
|
|
860
|
+ var arr = []
|
|
861
|
+ this.arrFour.push(staffList[i].class_name)
|
|
862
|
+ for(let i=0;i<this.arrFour.length;i++){
|
|
863
|
+ if(this.arrFour[i]!=''){
|
|
864
|
+ arr.push(this.arrFour[i])
|
|
865
|
+ }
|
|
866
|
+ }
|
|
867
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
868
|
+ if (name in allNames) {
|
|
869
|
+ allNames[name]++;
|
|
870
|
+ }
|
|
871
|
+ else {
|
|
872
|
+ allNames[name] = 1;
|
|
873
|
+ }
|
|
874
|
+ return allNames;
|
|
875
|
+ }, {});
|
|
876
|
+ let objKey = Object.keys(countedNames)
|
|
877
|
+ let objVal = Object.values(countedNames)
|
|
878
|
+ let strFour = ''
|
|
879
|
+ objKey.map((item,index) => {
|
|
880
|
+ let objVal = Object.values(countedNames)
|
|
881
|
+ strFour += item + objVal[index] + '\n'
|
|
882
|
+ })
|
|
883
|
+ fourStr = strFour
|
|
884
|
+ }
|
|
885
|
+ if(staffList[i].schedule_week == 5){
|
|
886
|
+ staffList[i].class_index = 5
|
|
887
|
+
|
|
888
|
+ var arr = []
|
|
889
|
+ this.arrFive.push(staffList[i].class_name)
|
|
890
|
+ for(let i=0;i<this.arrFive.length;i++){
|
|
891
|
+ if(this.arrFive[i]!=''){
|
|
892
|
+ arr.push(this.arrFive[i])
|
|
893
|
+ }
|
|
894
|
+ }
|
|
895
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
896
|
+ if (name in allNames) {
|
|
897
|
+ allNames[name]++;
|
|
898
|
+ }
|
|
899
|
+ else {
|
|
900
|
+ allNames[name] = 1;
|
|
901
|
+ }
|
|
902
|
+ return allNames;
|
|
903
|
+ }, {});
|
|
904
|
+ let objKey = Object.keys(countedNames)
|
|
905
|
+ let objVal = Object.values(countedNames)
|
|
906
|
+ let strFive = ''
|
|
907
|
+ objKey.map((item,index) => {
|
|
908
|
+ let objVal = Object.values(countedNames)
|
|
909
|
+ strFive += item + objVal[index] + '\n'
|
|
910
|
+ })
|
|
911
|
+ fiveStr = strFive
|
|
912
|
+ }
|
|
913
|
+ if(staffList[i].schedule_week == 6){
|
|
914
|
+ staffList[i].class_index = 6
|
|
915
|
+ var arr = []
|
|
916
|
+ this.arrSix.push(staffList[i].class_name)
|
|
917
|
+ for(let i=0;i<this.arrSix.length;i++){
|
|
918
|
+ if(this.arrSix[i]!=''){
|
|
919
|
+ arr.push(this.arrSix[i])
|
|
920
|
+ }
|
|
921
|
+ }
|
|
922
|
+ var countedNames = arr.reduce(function (allNames, name) {
|
|
923
|
+ if (name in allNames) {
|
|
924
|
+ allNames[name]++;
|
|
925
|
+ }
|
|
926
|
+ else {
|
|
927
|
+ allNames[name] = 1;
|
|
928
|
+ }
|
|
929
|
+ return allNames;
|
|
930
|
+ }, {});
|
|
931
|
+ let objKey = Object.keys(countedNames)
|
|
932
|
+ let objVal = Object.values(countedNames)
|
|
933
|
+ let strSix = ''
|
|
934
|
+ objKey.map((item,index) => {
|
|
935
|
+ let objVal = Object.values(countedNames)
|
|
936
|
+ strSix += item + objVal[index] + '\n'
|
|
937
|
+ })
|
|
938
|
+ sixStr = strSix
|
|
939
|
+ }
|
|
940
|
+ }
|
742
|
941
|
let tempArr = [], newArr = []
|
743
|
942
|
for (let i = 0; i < staffList.length; i++) {
|
744
|
943
|
if (tempArr.indexOf(staffList[i].user_name) === -1) {
|
|
@@ -769,6 +968,20 @@ export default {
|
769
|
968
|
}
|
770
|
969
|
})
|
771
|
970
|
arr.sort(this.compare('user_type'))
|
|
971
|
+ let arr2 = []
|
|
972
|
+ arr2.push({class_name:oneStr,schedule_week:1})
|
|
973
|
+ arr2.push({class_name:twoStr,schedule_week:2})
|
|
974
|
+ arr2.push({class_name:threeStr,schedule_week:3})
|
|
975
|
+ arr2.push({class_name:fourStr,schedule_week:4})
|
|
976
|
+ arr2.push({class_name:fiveStr,schedule_week:5})
|
|
977
|
+ arr2.push({class_name:sixStr,schedule_week:6})
|
|
978
|
+ arr2.push({class_name:zeroStr,schedule_week:0})
|
|
979
|
+ var obj = {}
|
|
980
|
+ obj.admin_user_id = "1000000"
|
|
981
|
+ obj.user_name = "合计"
|
|
982
|
+ obj.user_type = 10
|
|
983
|
+ obj.list = arr2
|
|
984
|
+ arr.push(obj)
|
772
|
985
|
this.tableData = arr
|
773
|
986
|
}
|
774
|
987
|
})
|