seat name from 1 to n

This commit is contained in:
David 2019-05-28 14:58:01 +08:00
parent 4b6a5253b5
commit 6f294f8bbc
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class Room(generics.ListCreateAPIView):
seat_count = data['get_seat_count']
del data['get_seat_count']
room = models.Room.objects.create(**data)
for i in range(100, 100 + seat_count):
for i in range(1, 1 + seat_count):
seat = models.Seat.objects.create(room=room, name=str(i))

View File

@ -145,7 +145,7 @@
},
handleCreate () {
let new_seat = {
name: (this.count + 100).toString(),
name: (this.count + 1).toString(),
room: this.id
}
api.createSeat(new_seat)
@ -159,7 +159,7 @@
let last = this.seatList[0]
api.deleteSeat(last.id)
.then(() => {
this.$notification.success({ message: '成功', description: `成功删除座位 ${last.name}`, key: 'SUCCESS' })
this.$notification.success({ message: '成功', description: `成功删除座位`, key: 'SUCCESS' })
this.getData()
})
} else {