Several conditions could cause vomiting and weakness in dogs:
Gastrointestinal obstruction. A foreign object may be blocking the digestive tract.
Pancreatitis. Inflammation of the pancreas can cause vomiting, diarrhea, abdominal pain, and weakness.
Addison's disease. Insufficient adrenal hormone production can cause vomiting, diarrhea, weight loss, and weakness.
Other conditions. Kidney disease, liver disease, and cancer can also cause these symptoms.
It is important to take your dog to the vet for diagnosis and treatment. In the meantime, withhold food and water for at least 12 hours, offer small amounts of water periodically to prevent dehydration, and keep your dog in a quiet, comfortable place. If your dog does not improve within 24 hours, or if there is blood in the vomit or diarrhea, seek immediate veterinary care.