In order to promote the efficient and intelligent construction of container ports, we focus on the optimization of berth-and-quay-crane (QC) allocation in tidal terminal operations. This paper investigates the quay-crane-profile-(QC-profile)-based assignment problem, and considers the uncertainty in QC profiles regarding QC efficiency for the first time. A mixed-integer programming (MIP) model is established for a discrete berth allocation with a crane-assignment problem (BACAP), considering the tide time window. We aim to minimize the total time loss caused by anchorage and the delay of vessels. Leveraging the theory of uncertainty optimization, the proposed deterministic model is extended into a stochastic programming (SP) model and a distributionally robust optimization (DRO) model, via the consideration of the random QC efficiency. To solve the proposed models, a column generation (CG) algorithm is employed, utilizing the mathematical method and subproblem-solving approach. The numerical experiments with different instances demonstrate that the DRO model yields a smaller variation in the objective function values, and the effectiveness of the CG method. The experimental results verify the robustness of the constructed models, and the efficiency of the proposed algorithm.