SYs automatically deduct the time and resources required to build the component from the build time/cost of the ship, if said component is present in stockpiles when construction begins. It's not any cheaper to build components with industrial capacity; the only advantage is that it speeds up your shipyards at the expense of other construction. Of course, you could just build more shipyards.
That said, economically there can be an advantage in terms of retooling. A 1 slipway yard supported by factories could build fast enough to compete with a 2 slipway version of the same yard, while having much lower retooling costs.