With the normalization of the global epidemic, shipping has gradually resumed, resulting in a surge in port throughput. Terminal managers are having great difficulty in making container ports be stable, orderly, and efficient. For small and medium-sized ports, making full use of the tidal water level to increase the operation time of large ships significantly improves the efficiency of port operations. Therefore, considering the impact of tidal factors on the operation of container ports, this paper firstly proposes a new berths and quay cranes allocation optimization model, T-B&QC, that minimizes the distance between the actual berthing berth and the preferred berth, the port time cost of ships and the number of quay crane movements as the optimization objectives, under constraints that consider tidal factors. Then, to solve the T-B&QC model using chaotic mapping and quantum theory, the Whale Optimization Algorithm (WOA) is integrated by using the Chaotic Quantum Rotating Gate Algorithm (CQRGA) and the Quantum Not Gate Algorithm (QNGA), whale coding rules are designed, and the Feasible-Integer Processing Algorithm (WF-IP) is established. Afterwards, the Chaotic Quantum Whale Optimization Algorithm, CQWOA, is proposed. Finally, the CQWOA is used to develop a new berth and quay crane allocation optimization method, T-B&QC_CQWOA. Subsequently, data from an actual seaport container port is used to test the reliability and superiority of the proposed distributing approach and the established optimizing algorithm. Numerical results demonstrate that the proposed distributing approach outperforms the classical distribution models that are selected herein, and the CQWOA yields a coordinated schedule of higher quality than the others in the process of solving the model.