Flavonoid secondary metabolites can treat and prevent many diseases, but systematic studies on regulation of the biosynthesis of such metabolites in aboveground parts of Salvia miltiorrhiza are lacking. In this study, metabonomic and transcriptomic analyses of different S. miltiorrhiza phenotypes were conducted to explore pathways of synthesis, catalysis, accumulation, and transport of the main flavonoid secondary metabolites regulating pigment accumulation. Tissue localization and quantitative analysis of flavonoid secondary metabolites were conducted by laser scanning confocal microscopy (LSCM). A total 3090 differentially expressed genes were obtained from 114,431 full-length unigenes in purple and green phenotypes, and 108 functional genes were involved in flavonoid biosynthesis. Five key phenylpropane structural genes (PAL, 4CL, ANS, 3AT, HCT) were highly differentially expressed, and four transcription factor genes (MYB, WRKY, bHLH, bZiP) were identified. In addition, six GST genes, nine ABC transporters, 22 MATE genes, and three SNARE genes were detected with key roles in flavonoid transport. According to LSCM, flavonoids were mainly distributed in epidermis, cortex, and collenchyma. Thus, comprehensive and systematic analyses were used to determine biosynthesis, accumulation, and transport of flavonoids in stems and leaves of different S. miltiorrhiza phenotypes. The findings will provide a reference for flavonoid production and cultivar selection.