On spectral numerical method for variable-order partial differential equations