Fractional nonlocal integrodifferential equations of mixed type with time-varying generating operators and optimal control