Under the background of the wide application of condition-based maintenance (CBM) in maintenance practice, the joint optimization of maintenance and spare parts inventory is becoming a hot research to take full advantage of CBM and reduce the operational cost. In order to avoid both the high inventory level and the shortage of spare parts, an appointment policy of spare parts is first proposed based on the prediction of remaining useful lifetime, and then a corresponding joint optimization model of preventive maintenance and spare parts inventory is established. Due to the complexity of the model, the combination method of genetic algorithm and Monte Carlo is presented to get the optimal maximum inventory level, safety inventory level, potential failure threshold, and appointment threshold to minimize the cost rate. Finally, the proposed model is studied through a case study and compared with both the separate optimization and the joint optimization without appointment policy, and the results show that the proposed model is more effective. In addition, the sensitivity analysis shows that the proposed model is consistent with the actual situation of maintenance practices and inventory management.