mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-23 04:04:22 +08:00
update code
This commit is contained in:
parent
9ef2366f72
commit
df45b811eb
@ -261,29 +261,6 @@
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
"id": "76f80b9e-a31e-4e7a-92d2-6d857c90fc81",
|
||||
"name": "023",
|
||||
"floor": 1,
|
||||
"index": 4,
|
||||
"numberRoom": 4,
|
||||
"ranks": "",
|
||||
"firstName": "มานี",
|
||||
"laststName": "",
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "unavailable",
|
||||
"lastName": "มานอน",
|
||||
"affiliation": "ลูกจ้าง",
|
||||
"idcard": "134044411441178",
|
||||
"phone": "0325647845",
|
||||
"status": "สมรส",
|
||||
"typeAffiliation": "ลูกจ้าง",
|
||||
"typeRanks": "ประทวน",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
"id": "728100ee-a335-4c77-a226-a63c4de6088a",
|
||||
@ -395,5 +372,28 @@
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
"id": "76f80b9e-a31e-4e7a-92d2-6d857c90fc81",
|
||||
"name": "023",
|
||||
"floor": 1,
|
||||
"index": 4,
|
||||
"numberRoom": 4,
|
||||
"ranks": " ",
|
||||
"firstName": " ",
|
||||
"laststName": "",
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free",
|
||||
"lastName": "มานอน",
|
||||
"affiliation": "ลูกจ้าง",
|
||||
"idcard": "134044411441178",
|
||||
"phone": "0325647845",
|
||||
"status": "สมรส",
|
||||
"typeAffiliation": "ลูกจ้าง",
|
||||
"typeRanks": "ประทวน",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
}
|
||||
]
|
@ -66,6 +66,7 @@ app.put('/users/:id', (req, res) => {
|
||||
if (req.body.pickedBook) parsedData.pickedBook = req.body.pickedBook
|
||||
if (req.body.typeRoom) parsedData.typeRoom = req.body.typeRoom
|
||||
if (req.body.roomconditions) parsedData.roomconditions = req.body.roomconditions
|
||||
if (req.body.Checkintime) parsedData.Checkintime = req.body.Checkintime
|
||||
filterdata.push(parsedData)
|
||||
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
|
||||
if (err) {
|
||||
@ -172,6 +173,7 @@ app.put('/rooms/:id', (req, res) => {
|
||||
if (req.body.typeRoom) parsedData.typeRoom = req.body.typeRoom
|
||||
if (req.body.pickedBook) parsedData.pickedBook = req.body.pickedBook
|
||||
if (req.body.roomconditions) parsedData.roomconditions = req.body.roomconditions
|
||||
if (req.body.Checkintime) parsedData.Checkintime = req.body.Checkintime
|
||||
filterdata.push(parsedData)
|
||||
fs.writeFile('./rooms.json', JSON.stringify(filterdata, null, 2), (err) => {
|
||||
if (err) {
|
||||
|
@ -127,6 +127,7 @@ export default {
|
||||
let body = {
|
||||
...this.userByid,
|
||||
queue: "inroom",
|
||||
Affiliation: this.Affiliation,
|
||||
contract: this.contract,
|
||||
checkintime: this.Checkintime,
|
||||
maintenance: this.Maintenance,
|
||||
|
@ -194,6 +194,31 @@ export default {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
|
||||
returnsubmitForm() {
|
||||
let body = {
|
||||
roomStatus: 'free',
|
||||
firstName: " ",
|
||||
laststName: " ",
|
||||
ranks: " ",
|
||||
Affiliation: " "
|
||||
};
|
||||
axios
|
||||
.put(`http://localhost:3001/rooms/${this.id}`, body, {
|
||||
headers: {
|
||||
// remove headers
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
this.getRooms(this.id);
|
||||
this.$router.push({ path: `/room/`});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -551,7 +576,7 @@ export default {
|
||||
<MaterialButton
|
||||
variant="gradient"
|
||||
color="success"
|
||||
@click="submitForm"
|
||||
@click="returnsubmitForm"
|
||||
html-type="submit"
|
||||
>บันทึก</MaterialButton
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user