In response to environmental pollution and global warming, electric vehicles (EVs) have been widely applied in supply chain, and lots of researches have been focused on the electric location routing problem (ELRP) to optimize the location of battery-swapping stations (BSSs). However, few studies have simultaneously considered the EV’s collaborative behavior and range anxiety in ELRP. Therefore, this study focuses on formulating an ELRP with battery-swapping stations considering both collaborative behavior and range anxiety. The model takes into account the collaboration between the supply and demand sides to share supply chain resources effectively. The detour probability function is employed to handle the uncertainty caused by drivers’ range anxiety during the trip, which can be evaluated through a proposed range anxiety function. In addition, a new two-dimensional matrix-based solution representation is proposed to explore ELRP optimal solutions intuitively and efficiently. To solve the proposed model effectively, a two-phase adaptive large neighborhood search (TALNS) algorithm that integrates the adaptive large neighborhood search (ALNS) algorithm and the extended binary particle swarm optimization (EBPSO) algorithm is proposed. In the EBPSO algorithm, a new position update mechanism and local search strategy are used to strengthen the local search ability. In the ALNS algorithm, multiple destroy and repair operators are developed for the proposed model. Further, to validate the effectiveness and performance of the proposed algorithm, comparison experiments with the Gurobi optimizer and other baseline heuristic algorithms are conducted.