The global health crisis caused by SARS-CoV-2 since 2019 has emphasized the critical significance of effective disease detection and treatment in minimizing infection rates and fatalities, as well as halting the spread of pandemics. During an outbreak, individuals suspected of being infected require a significant amount of testing resources, while those confirmed to be infected demand substantial treatment resources. Hence, this paper is dedicated to presenting a new pandemic model that enables joint forecasting and allocation of resources for testing and treatment. The proposed model in this paper is an innovative agent-based epidemic compartmental model, which also incorporates a mixed integer model. It integrates novel features based on crucial disease characteristics, such as self-healing for asymptomatic or mild-symptomatic cases, varying infection risk levels among different groups, and the inclusion of secondary infections. Moreover, the solutions of the joint allocation model are compared with those of the independent allocation model, which entails considering resource interactions rather than allocating each resource independently. Furthermore, the validity of this model was confirmed through real-world data obtained during the SARS-CoV-2 outbreak in China. The findings offer valuable insights into the impact of intervention levels and duration, joint allocation schemes, as well as optimal allocation of test and treatment resources on cross-regional transmission of the pandemic.