Why doesn't "bpy.ops.wm.save_as_mainfile()" work in UI panel?
Use backslashes (\) instead of forward slashes (/). Also you need to either escape special characters, or use (') instead of (").
The following code should work:

bpy.ops.wm.save_as_mainfile(filepath='D:\ddd\test_v1.blend')


or escaping characters

bpy.ops.wm.save_as_mainfile(filepath="D:\\ddd\\test_v1.blend")