The invention relates to the field of machining, in particular to a machining method of a swinging shaft. The method comprises the following steps of drawing lines, pre-arranging and uniformly distributing blanks, drawing cross central lines on a workpiece, drawing the lines on six surfaces respectively, drawing the lines at two end surfaces of the overall length, and lengthening the right end surface of the overall length for 30mm; boring a central hole in the left end; clamping the right end, pushing the left end, and roughly turning each part, wherein the allowance of the left end surface of the overall length is 3mm, each of the allowances of the outer circle of a threaded head and the outer circle of a hole is 5-6mm, and the allowance of each of the other end surfaces is 3mm; erecting the outer circle at the left end, finishing the central hole, and reserving scraps for testing; performing end milling, performing line connection alignment, and milling each surface, wherein each allowance is 5mm; performing face milling, milling the right end surface of the overall length, and lengthening the right end surface for 30mm, wherein the allowance of the left end surface of the overall length is 3mm; drawing the lines, drawing the cross central lines on the workpiece, and lengthening the right end surface of the overall length for 30mm; drawing left and right through hole machining lines, a small circular hole machining line, two surface machining lines, an inclined surface machining line, a groove machining line, a circular arc machining line and a surface process tabletop machining line. According to the machining method of the rocking shaft, the machining accuracy can be guaranteed, the production difficulty is reduced, and the machining efficiency is high.