Stress diarrhea is a major challenge for weaned piglets and restricts pig production efficiency and incurs massive economic losses. A traditional Chinese medicine prescription (QJC) composed of Astragalus propinquus Schischkin (HQ), Zingiber officinale Roscoe (SJ), and Plantago asiatica L. (CQC) has been developed by our laboratory and shows marked anti-stress diarrhea effect. However, the active compounds, potential targets, and mechanism of this effect remain unclear and warrant further investigation. In our study, we verified the bioactive compounds of QJC and relevant mechanisms underlying the anti-stress diarrhea effect through network pharmacology and in vivo experimental studies. After establishing a successful stress-induced diarrhea model, histomorphology of intestinal mucosa was studied, and Quantitative real-time PCR (RT-qPCR) probe was used for the phosphoinositide 3-kinase (PI3K)–Akt signaling pathway to verify the therapeutic effect of QJC on diarrhea. First, using the network pharmacology approach, we identified 35 active components and 130 Kyoto Encyclopedia of Genes and Genomes (KEGG) pathways in QJC. From among these, we speculated that quercetin, luteolin, kaempferol, scutellarein, and stigmasterol were the main bioactive compounds and assumed that the anti-diarrhea effect of QJC was related to the PI3K–Akt signaling pathway. The RT-qPCR indicated that QJC and its bioactive components increased the expression levels of PI3K and Akt, inhibited the expression of phosphatase and tensin homolog (PTEN), and activated the PI3K–Akt signaling pathway to relieve stress-induced diarrhea. Furthermore, we found that QJC alleviated the pathological condition of small intestine tissue and improved the integrity of the intestinal barrier. Taken together, our study showed that the traditional Chinese medicine QJC, quercetin, luteolin, kaempferol, scutellarein, and stigmasterol alleviated the pathological condition of small intestine tissue and relieved stress-induced diarrhea by increasing the expression levels of PI3K and Akt and inhibiting the expression levels of PTEN.