The searching for the electric dipole moments (EDMs) of neutron (d n ), b quark (d b ) and c quark (d c ) gives strict upper bounds on these quantities. And recently, new upper bounds on d b , d c are obtained by the strict limit on d n . The models of new physics (NP) with additional CP-violating (CPV) sources are constrained strictly by these EDMs. In this work, we focus on the CPV effects on these EDMs in the minimal supersymmetric extension (MSSM) of the SM with local B −L gauge symmetry (B-LSSM). The contributions from one-loop and some two-loop diagrams to the quark EDM are given in general form, which can also be used in the calculation of quark EDM in other models of NP. Considering the constrains from updated experimental data, the numerical results show that the two-loop corrections can make important contributions to these EDMs. Compared with the MSSM, the effects of new CPV phases and new parameters in the B-LSSM on these EDMs are also explored. PACS numbers: