A company I worked for about 15 years ago had a great system...I will try to describe it for you...
All material was received using a "receiving ticket/inspection report". These were sequentially numbered. After material was accepted, this became the lot number. If the material was "raw material", i.e. bar stock to be used in the machine shop, the lot number became the job number. If we had multiple uses for a particular "lot", we could break it down further by adding "-" numbers to the base lot number, i.e. Material from lot #1234 would be used for job #'s 1234-1, 1234-2 and so on. After all manufacturing of the componenet was complete, or if the part was purchased complete, the parts would be sent to the stock room until pulled for an assembly job. The router for the assembly listed a bill of materials and had a space to record the lot numbers for each item pulled for the assembly job.
This gave us full traceability back to the original mill or component supplier. And, unfortunately, it paid for itself when we had to do a product recall. We new exactly which customers had the defective product.
Good Luck!
CarolX