From 3556889a2d5e76c1fbf9acee9e0e38b9d5628a49 Mon Sep 17 00:00:00 2001 From: kamoa457 Date: Thu, 9 Nov 2023 02:09:18 +0700 Subject: [PATCH] update room --- appserver/building.json | 518 +++++++----------- appserver/history.json | 2 +- appserver/report.json | 2 +- appserver/ro.json | 132 ----- appserver/rooms.json | 316 +++++++++-- appserver/server.js | 33 +- appserver/test.json | 348 ++++++++++++ appserver/users.json | 194 +++---- webapp/package.json | 1 + webapp/src/views/Queue/QueueView.vue | 4 +- webapp/src/views/Restroom/DetailRoomPage.vue | 87 ++- webapp/src/views/Restroom/RoomView.vue | 229 +++++--- webapp/src/views/Restroom/UpdateRoom.vue | 168 ++---- .../src/views/RoomLayout/RoomLayoutView.vue | 39 +- 14 files changed, 1198 insertions(+), 875 deletions(-) delete mode 100644 appserver/ro.json create mode 100644 appserver/test.json diff --git a/appserver/building.json b/appserver/building.json index 64202a3..40f1e99 100644 --- a/appserver/building.json +++ b/appserver/building.json @@ -1,347 +1,243 @@ [ { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/11", - "sumroom": "24", - "committee": " มารุช ดีงาม , บารมี ดีงาม", - "floor": "4", + "buil": "test023", + "name": "023", + "sumroom": 7, + "floor": "2", "roomnumber": "", - "type": "ช.2", + "type": "", + "committee":"", "listRoom": [ { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "name": "023", "floor": 1, "rooms": [ { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "f5c54b45-9f9f-459d-891f-838c3a7ff41c", + "name": "023", + "floor": 1, "index": 1, "numberRoom": 1, - "ranks": "ส.ต.ต.", - "firstName": "ปิติ2", - "laststName": "มีดี", - "Affiliation": "ฝอ. 2", - "typeRoom": "ช1", - "status": "unavailable" + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomStatus": "free" }, { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "a10eff34-cbe2-4a71-a44e-0d95bfe33410", + "name": "023", + "floor": 1, "index": 2, "numberRoom": 2, "ranks": "", "firstName": "", "laststName": "", "Affiliation": "", - "typeRoom": "ช1", - "status": "free" + "typeRoom": "", + "roomStatus": "free" }, { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "03dc297e-ea5e-4852-8e49-6c9f3d2d47d4", + "name": "023", + "floor": 1, "index": 3, "numberRoom": 3, - "ranks": "ส.ต.ต.", - "firstName": "ปิติ2", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช2", - "status": "return" + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomStatus": "free" }, { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "76f80b9e-a31e-4e7a-92d2-6d857c90fc81", + "name": "023", + "floor": 1, "index": 4, "numberRoom": 4, - "ranks": "ส.ต.ต.", - "firstName": "ปิติ3", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช2", - "status": "unavailable" - }, - { - "index": 5, - "numberRoom": 5, "ranks": "", "firstName": "", "laststName": "", "Affiliation": "", - "typeRoom": "ช1", - "status": "free" - } - ], - "sumroom": 5 - }, - { - "floor": 2, - "rooms": [ - { - "index": 1, - "numberRoom": 1, - "ranks": "ส.ต.ต.", - "firstName": "ปิติ9", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช3", - "status": "special" - }, - { - "index": 2, - "numberRoom": 2, - "ranks": "ส.ต.ต.", - "firstName": "ปิติ6", - "laststName": "มีดี", - "Affiliation": "ฝอ. 7", - "typeRoom": "ช2", - "status": "waiting" - }, - { - "index": 3, - "numberRoom": 3, - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช2", - "status": "free" - } - ], - "sumroom": 3 - } - ] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/12", - "sumroom": "20", - "committee": "", - "floor": "4", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/13", - "sumroom": "24", - "committee": "", - "floor": "4", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/14", - "committee": "", - "sumroom": "18", - "floor": "3", - "roomnumber": "", - "type": "ช.3", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/15", - "committee": "", - "sumroom": "32", - "floor": "4", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/16", - "committee": "", - "sumroom": "24", - "floor": "4", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/17", - "committee": "", - "sumroom": "32", - "floor": "4", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "อาคารแฟลต 1/18", - "sumroom": "60", - "committee": "", - "floor": "5", - "roomnumber": "", - "type": "-", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "แฟลตลือชา 1", - "committee": "", - "sumroom": "50", - "floor": "5", - "roomnumber": "", - "type": "-", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "แฟลตลือชา 2", - "committee": "", - "sumroom": "50", - "floor": "5", - "roomnumber": "", - "type": "-", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "แฟลตลือชา 3", - "sumroom": "40", - "floor": "5", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "แฟลตบางเขน 1", - "committee": "", - "sumroom": "50", - "floor": "5", - "roomnumber": "", - "type": "-", - "listRoom":[] - }, - { - "buil": "อาคารบ้านพัก บช. ตชด.", - "name": "แฟลตบางเขน 2", - "committee": "", - "sumroom": "50", - "floor": "5", - "roomnumber": "", - "type": "ช.2", - "listRoom":[] - }, - { - "id": "745a7d08-5333-40ef-8c2c-5bcdf1e2a392", - "buil": "บช", - "name": "ลือชา15", - "committee": " มารุช ดีงาม , บารมี ดีงาม", - "sumroom": 8, - "floor": "2", - "roomnumber": "", - "type": "", - "listRoom": [ - { - "floor": 1, - "rooms": [ - { - "index": 1, - "numberRoom": 1 - }, - { - "index": 2, - "numberRoom": 2 - }, - { - "index": 3, - "numberRoom": 3 - }, - { - "index": 4, - "numberRoom": 4 - }, - { - "index": 5, - "numberRoom": 5 - } - ], - "sumroom": 5 - }, - { - "floor": 2, - "rooms": [ - { - "index": 1, - "numberRoom": 1 - }, - { - "index": 2, - "numberRoom": 2 - }, - { - "index": 3, - "numberRoom": 3 - } - ], - "sumroom": 3 - } - ] - }, - { - "id": "4f82fe70-ac26-473d-b9ec-e8724e9fa5a9", - "buil": "test", - "name": "ลือชา 4/5", - "committee": " มารุช ดีงาม , บารมี ดีงาม", - "sumroom": 11, - "floor": "2", - "roomnumber": "", - "type": "", - "listRoom": [ - { - "floor": 1, - "rooms": [ - { - "index": 1, - "numberRoom": 1 - }, - { - "index": 2, - "numberRoom": 2 - }, - { - "index": 3, - "numberRoom": 3 - }, - { - "index": 4, - "numberRoom": 4 - }, - { - "index": 5, - "numberRoom": 5 - }, - { - "index": 6, - "numberRoom": 6 - }, - { - "index": 7, - "numberRoom": 7 - } - ], - "sumroom": 7 - }, - { - "floor": 2, - "rooms": [ - { - "index": 1, - "numberRoom": 1 - }, - { - "index": 2, - "numberRoom": 2 - }, - { - "index": 3, - "numberRoom": 3 - }, - { - "index": 4, - "numberRoom": 4 + "typeRoom": "", + "roomStatus": "free" } ], "sumroom": 4 + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "name": "023", + "floor": 2, + "rooms": [ + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "ffe28ac7-d4e3-4ad3-bec4-7d4744660027", + "name": "023", + "floor": 2, + "index": 1, + "numberRoom": 1, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomStatus": "free" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "ee69339f-529d-443a-b387-cf67102b4a23", + "name": "023", + "floor": 2, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomStatus": "free" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "728100ee-a335-4c77-a226-a63c4de6088a", + "name": "023", + "floor": 2, + "index": 3, + "numberRoom": 3, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomStatus": "free" + } + ], + "sumroom": 3 + } + ] + }, + { + "buil": "test02", + "name": "01", + "sumroom": 6, + "floor": "2", + "roomnumber": "", + "type": "", + "committee":"", + "listRoom": [ + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "name": "01", + "floor": 1, + "rooms": [ + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "bcfb5f40-8b1e-4b69-b64e-4d8ca15db8bb", + "name": "01", + "floor": 1, + "index": 1, + "numberRoom": 1, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "3e8b5594-f735-46cf-b71f-14ba3b955c27", + "name": "01", + "floor": 1, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "cb5942ce-8ba9-4084-9e6a-cd202c238cbe", + "name": "01", + "floor": 1, + "index": 3, + "numberRoom": 3, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "f0ed9596-ee93-4781-a2aa-14d76472d314", + "name": "01", + "floor": 1, + "index": 4, + "numberRoom": 4, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + } + ], + "sumroom": 4 + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "name": "01", + "floor": 2, + "rooms": [ + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "67473bca-fd63-40e5-ad21-87598a77471d", + "name": "01", + "floor": 2, + "index": 1, + "numberRoom": 1, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "932d8efa-e1f7-4529-ad3f-54c109d9f69e", + "name": "01", + "floor": 2, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + } + ], + "sumroom": 2 } ] } diff --git a/appserver/history.json b/appserver/history.json index ac28f3b..ec2abcb 100644 --- a/appserver/history.json +++ b/appserver/history.json @@ -1 +1 @@ -[{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","no":1,"firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"1234","queue":"inqueue","roomnumber":"201","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"ebd367bf-396f-4bae-8130-1ce3fa130d38","no":2,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","queue":"inqueue","roomnumber":"202","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"507e0867-4d56-4f4e-81d1-f3a1ab0d0fde","no":1,"firstName":"มานา","lastName":"มานี","affiliation":"ลูกจ้าง","rank":"นาย","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","queue":"inroom","roomnumber":"209","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"2c388c78-b2a3-4ea2-bca5-48521eb7e5db","no":3,"firstName":"มานี","lastName":"มานอน","affiliation":"ลูกจ้าง","rank":"ส.ต.ต.","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ประทวน","typeUser":"ตร.","bookNumber":"1234","queue":"inqueue","roomnumber":"204","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"1cb479fa-e217-422d-938e-47f6fc9b9f32","no":4,"firstName":"มานพ","lastName":"มานี","affiliation":"ฝอ.2","rank":"ร.ต.ต.","idcard":"13404441144555","phone":"0325647845","status":"สมรส","typeAffiliation":"บก.อก.","typeRanks":"สัญญาบัตร","typeUser":"บช.ตชด.","bookNumber":"1234","queue":"inqueue","roomnumber":"206","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"fc3710ca-c3af-4781-9c8f-4aa6657ddff4","no":5,"firstName":"สมาน788","lastName":"แสงสุข7","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"13404441144","phone":"0325647847","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"14","queue":"none","roomnumber":"205","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","no":1,"firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"1234","queue":"inroom","contract":"12/4/55","checkintime":"2","maintenance":"100","insurance":"1200","installments":"5"}] \ No newline at end of file +[{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","no":1,"firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"1234","queue":"inqueue","roomnumber":"201","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"ebd367bf-396f-4bae-8130-1ce3fa130d38","no":2,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","queue":"inqueue","roomnumber":"202","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"507e0867-4d56-4f4e-81d1-f3a1ab0d0fde","no":1,"firstName":"มานา","lastName":"มานี","affiliation":"ลูกจ้าง","rank":"นาย","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","queue":"inroom","roomnumber":"209","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"2c388c78-b2a3-4ea2-bca5-48521eb7e5db","no":3,"firstName":"มานี","lastName":"มานอน","affiliation":"ลูกจ้าง","rank":"ส.ต.ต.","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ประทวน","typeUser":"ตร.","bookNumber":"1234","queue":"inqueue","roomnumber":"204","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"1cb479fa-e217-422d-938e-47f6fc9b9f32","no":4,"firstName":"มานพ","lastName":"มานี","affiliation":"ฝอ.2","rank":"ร.ต.ต.","idcard":"13404441144555","phone":"0325647845","status":"สมรส","typeAffiliation":"บก.อก.","typeRanks":"สัญญาบัตร","typeUser":"บช.ตชด.","bookNumber":"1234","queue":"inqueue","roomnumber":"206","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"fc3710ca-c3af-4781-9c8f-4aa6657ddff4","no":5,"firstName":"สมาน788","lastName":"แสงสุข7","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"13404441144","phone":"0325647847","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"14","queue":"none","roomnumber":"205","insurancecost":254,"installments":266,"waterbill":150,"electricitybill":945,"central":500,"costs":200,"sumCost":1000,"typeContract":"หักได้","contract":"...","Checkintime":"","Maintenance":"","insurance":""},{"id":"2c388c78-b2a3-4ea2-bca5-48521eb7e5db","no":3,"firstName":"มานี","lastName":"มานอน","affiliation":"ลูกจ้าง","rank":"ส.ต.ต.","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ประทวน","typeUser":"ตร.","bookNumber":"1234","typeRoom":"ช2","queue":"inroom","contract":"123","checkintime":"5","maintenance":"200","insurance":"2000","installments":"5","pickedBook":"2023-11-02T14:10:26.374Z"}] \ No newline at end of file diff --git a/appserver/report.json b/appserver/report.json index 5b5d6a2..3db000a 100644 --- a/appserver/report.json +++ b/appserver/report.json @@ -1 +1 @@ -[{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","no":1,"firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"1234","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"ebd367bf-396f-4bae-8130-1ce3fa130d38","no":2,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"507e0867-4d56-4f4e-81d1-f3a1ab0d0fde","no":1,"firstName":"มานา","lastName":"มานี","affiliation":"ลูกจ้าง","rank":"นาย","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","queue":"inroom","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"2c388c78-b2a3-4ea2-bca5-48521eb7e5db","no":3,"firstName":"มานี","lastName":"มานอน","affiliation":"ลูกจ้าง","rank":"ส.ต.ต.","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ประทวน","typeUser":"ตร.","bookNumber":"1234","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"1cb479fa-e217-422d-938e-47f6fc9b9f32","no":4,"firstName":"มานพ","lastName":"มานี","affiliation":"ฝอ.2","rank":"ร.ต.ต.","idcard":"13404441144555","phone":"0325647845","status":"สมรส","typeAffiliation":"บก.อก.","typeRanks":"สัญญาบัตร","typeUser":"บช.ตชด.","bookNumber":"1234","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"fc3710ca-c3af-4781-9c8f-4aa6657ddff4","no":5,"firstName":"สมาน788","lastName":"แสงสุข7","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"13404441144","phone":"0325647847","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"14","queue":"none","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"967bf9a7-047e-4951-ba2a-190f42045715","no":5,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ฝสสน.1","rank":"ส.ต.ท.","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"บก.สนน.","typeRanks":"ประทวน","typeUser":"บช.ตชด.","bookNumber":"456","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"fae8c402-f815-44cc-8702-bf843dc97db4","firstName":"กนกวรรณ","lastName":"เจริญเจริญ","affiliation":"ฝอ.1","rank":"พ.ต.อ.หญิง","idcard":"134044411441178","phone":"0974543655","status":"สมรส","typeAffiliation":"บก.อก.","typeRanks":"สัญญาบัตร","typeUser":"ตร.","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"8e81c39a-d50c-42f5-85c0-f9f773c2a4aa","no":0,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"บช.ตซด.","rank":"ส.ต.อ.","idcard":"134044411441178","phone":"0325647845","typeAffiliation":"บช.ตซด.","typeRanks":"ประทวน","typeUser":"บช.ตชด.","bookNumber":"1234","queue":"none","status":"โสด","contract":"","checkintime":"","maintenance":"","insurance":"","installments":""},{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","no":1,"firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"1234","queue":"inroom","contract":"12/4/55","checkintime":"2","maintenance":"100","insurance":"1200","installments":"5"}] \ No newline at end of file +[{"id":"507e0867-4d56-4f4e-81d1-f3a1ab0d0fde","no":1,"firstName":"มานา","lastName":"มานี","affiliation":"ลูกจ้าง","rank":"นาย","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"","typeRoom":"ช2","queue":"inroom","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-03T14:10:26.374Z"},{"id":"2c388c78-b2a3-4ea2-bca5-48521eb7e5db","no":3,"firstName":"มานี","lastName":"มานอน","affiliation":"ลูกจ้าง","rank":"ส.ต.ต.","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ประทวน","typeUser":"ตร.","bookNumber":"1234","typeRoom":"ช2","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-02T14:10:26.374Z"},{"id":"1cb479fa-e217-422d-938e-47f6fc9b9f32","no":4,"firstName":"มานพ","lastName":"มานี","affiliation":"ฝอ.2","rank":"ร.ต.ต.","idcard":"13404441144555","phone":"0325647845","status":"สมรส","typeRoom":"ช2","typeAffiliation":"บก.อก.","typeRanks":"สัญญาบัตร","typeUser":"บช.ตชด.","bookNumber":"1234","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-07T14:10:26.374Z"},{"id":"fae8c402-f815-44cc-8702-bf843dc97db4","no":6,"firstName":"กนกวรรณ","lastName":"เจริญเจริญ","affiliation":"ฝอ.1","rank":"พ.ต.อ.หญิง","idcard":"134044411441178","phone":"0974543655","status":"สมรส","typeRoom":"ช3","typeAffiliation":"บก.อก.","typeRanks":"สัญญาบัตร","typeUser":"ตร.","queue":"none","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-08T10:10:26.374Z"},{"id":"fc3710ca-c3af-4781-9c8f-4aa6657ddff4","no":7,"firstName":"สมาน788","lastName":"แสงสุข7","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"13404441144","phone":"0325647847","status":"โสด","typeRoom":"ช1","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"14","queue":"none","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-08T14:10:26.374Z"},{"id":"8e81c39a-d50c-42f5-85c0-f9f773c2a4aa","no":6,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"บช.ตซด.","rank":"ส.ต.อ.","idcard":"134044411441178","phone":"0325647845","typeAffiliation":"บช.ตซด.","typeRanks":"ประทวน","typeUser":"บช.ตชด.","bookNumber":"123","queue":"none","status":"โสด","typeRoom":"ช1","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-08T12:10:26.374Z"},{"id":"ebd367bf-396f-4bae-8130-1ce3fa130d38","no":2,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","typeRoom":"ช1","bookNumber":"","queue":"inqueue","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-01T14:10:26.374Z"},{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","no":1,"firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","typeUser":"ตร.","bookNumber":"1234","queue":"inroom","typeRoom":"ช1","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-10-08T14:10:26.374Z"},{"id":"967bf9a7-047e-4951-ba2a-190f42045715","no":5,"firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ฝสสน.1","rank":"ส.ต.ท.","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeRoom":"ช1","typeAffiliation":"บก.สนน.","typeRanks":"ประทวน","typeUser":"บช.ตชด.","bookNumber":"456","queue":"inroom","contract":"","checkintime":"","maintenance":"","insurance":"","installments":"","pickedBook":"2023-11-08T14:10:26.374Z"},{"id":"2c388c78-b2a3-4ea2-bca5-48521eb7e5db","no":3,"firstName":"มานี","lastName":"มานอน","affiliation":"ลูกจ้าง","rank":"ส.ต.ต.","idcard":"134044411441178","phone":"0325647845","status":"สมรส","typeAffiliation":"ลูกจ้าง","typeRanks":"ประทวน","typeUser":"ตร.","bookNumber":"1234","typeRoom":"ช2","queue":"inroom","contract":"123","checkintime":"5","maintenance":"200","insurance":"2000","installments":"5","pickedBook":"2023-11-02T14:10:26.374Z"}] \ No newline at end of file diff --git a/appserver/ro.json b/appserver/ro.json deleted file mode 100644 index 383ca7f..0000000 --- a/appserver/ro.json +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "title": "ห้อง 1", - "dataIndex": "1", - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช1", - "status": "free" - }, - { - "title": "ห้อง 2", - "dataIndex": "2", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ2", - "laststName": "มีดี", - "Affiliation": "ฝอ. 2", - "typeRoom": "ช1", - "status": "unavailable" - }, - { - "title": "ห้อง 3", - "dataIndex": "3", - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช1", - "status": "free" - }, - { - "title": "ห้อง 4", - "dataIndex": "4", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ2", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช2", - "status": "return" - }, - { - "title": "ห้อง 5", - "dataIndex": "5", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ3", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช2", - "status": "unavailable" - }, - { - "title": "ห้อง 6", - "dataIndex": "6", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ4", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช3", - "status": "waiting" - }, - { - "title": "ห้อง 7", - "dataIndex": "7", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ3", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช1", - "status": "return" - }, - { - "title": "ห้อง 8", - "dataIndex": "8", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ9", - "laststName": "มีดี", - "Affiliation": "ฝอ. 1", - "typeRoom": "ช3", - "status": "special" - }, - { - "title": "ห้อง 9", - "dataIndex": "9", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ5", - "laststName": "มีดี", - "Affiliation": "ฝอ. 4", - "typeRoom": "ช2", - "status": "unavailable" - }, - { - "title": "ห้อง 10", - "dataIndex": "10", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ6", - "laststName": "มีดี", - "Affiliation": "ฝอ. 7", - "typeRoom": "ช2", - "status": "waiting" - }, - { - "title": "ห้อง 11", - "dataIndex": "11", - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช1", - "status": "free" - }, - { - "title": "ห้อง 12", - "dataIndex": "12", - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช2", - "status": "free" - }, - { - "title": "ห้อง 13", - "dataIndex": "13", - "ranks": "ส.ต.ต.", - "firstName": "ปิติ7", - "laststName": "มีดี", - "Affiliation": "ฝอ. 2", - "typeRoom": "ช3", - "status": "special" - } -] \ No newline at end of file diff --git a/appserver/rooms.json b/appserver/rooms.json index 1b0c745..844b08b 100644 --- a/appserver/rooms.json +++ b/appserver/rooms.json @@ -1,5 +1,6 @@ [ { + "id": "2c388c78-b2a3-4ea2-bca5-48521eb7e5db", "index": 1, "floor": 1, "numberRoom": 1, @@ -8,22 +9,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 2", "typeRoom": "ช1", - "Roomconditions": "ปกติ", - "status": "unavailable" - }, - { - "index": 2, - "floor": 1, - "numberRoom": 2, - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช1", - "Roomconditions": "ชำรุด", - "status": "free" + "roomconditions": "ปกติ", + "roomStatus": "unavailable" }, { + "id": "2c389c78-b2a3-4ea2-bca5-48521eb7e5db", "index": 3, "floor": 1, "numberRoom": 3, @@ -32,10 +22,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 1", "typeRoom": "ช2", - "Roomconditions": "ปกติ", - "status": "return" + "roomconditions": "ปกติ", + "roomStatus": "return" }, { + "id": "2c388c78-b2a3-4ea2-bca5-57521eb7e5db", "index": 4, "floor": 1, "numberRoom": 4, @@ -44,22 +35,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 1", "typeRoom": "ช2", - "Roomconditions": "ปกติ", - "status": "unavailable" - }, - { - "index": 5, - "floor": 1, - "numberRoom": 5, - "ranks": "", - "firstName": "", - "laststName": "", - "Affiliation": "", - "typeRoom": "ช1", - "Roomconditions": "ปกติ", - "status": "free" + "roomconditions": "ปกติ", + "roomStatus": "unavailable" }, { + "id": "2c388c78-b2v3-4ea2-bca5-48521eb7e5db", "index": 6, "floor": 2, "numberRoom": 1, @@ -68,10 +48,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 1", "typeRoom": "ช3", - "Roomconditions": "ปกติ", - "status": "special" + "roomconditions": "ปกติ", + "roomStatus": "special" }, { + "id": "2c787c78-b2a3-4ea2-bca5-48521eb7e5db", "index": 7, "floor": 2, "numberRoom": 2, @@ -80,10 +61,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 7", "typeRoom": "ช2", - "Roomconditions": "ชำรุด", - "status": "waiting" + "roomconditions": "ชำรุด", + "roomStatus": "waiting" }, { + "id": "2c388c78-q2a3-4ea2-bca5-48521eb7e5db", "index": 8, "floor": 2, "numberRoom": 3, @@ -92,10 +74,11 @@ "laststName": "", "Affiliation": "", "typeRoom": "ช2", - "Roomconditions": "ปกติ", - "status": "free" + "roomconditions": "ปกติ", + "roomStatus": "free" }, { + "id": "2c388c36-b2a3-4ea2-bca5-48521eb7e5db", "index": 5, "floor": 1, "numberRoom": 5, @@ -104,10 +87,11 @@ "laststName": "", "Affiliation": "", "typeRoom": "ช1", - "Roomconditions": "ปกติ", - "status": "free" + "roomconditions": "ปกติ", + "roomStatus": "free" }, { + "id": "2c388c41-b2a3-4ea2-bca5-48521eb7e5db", "index": 6, "floor": 2, "numberRoom": 1, @@ -116,10 +100,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 1", "typeRoom": "ช3", - "Roomconditions": "ปกติ", - "status": "special" + "roomconditions": "ปกติ", + "roomStatus": "special" }, { + "id": "2c388c99-b2a3-4ea2-bca5-48521eb7e5db", "index": 7, "floor": 2, "numberRoom": 2, @@ -128,10 +113,11 @@ "laststName": "มีดี", "Affiliation": "ฝอ. 7", "typeRoom": "ช2", - "Roomconditions": "ชำรุด", - "status": "waiting" + "roomconditions": "ชำรุด", + "roomStatus": "waiting" }, { + "id": "2c988c78-b2a3-4ea2-bca5-48521eb7e5db", "index": 8, "floor": 2, "numberRoom": 3, @@ -140,7 +126,249 @@ "laststName": "", "Affiliation": "", "typeRoom": "ช2", - "Roomconditions": "ปกติ", - "status": "free" + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "id": "2c388c78-b2a3-4ea2-bca5-47821eb7e5db", + "index": 8, + "floor": 1, + "numberRoom": 2, + "ranks": "", + "firstName": "สมชัย14", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช1", + "roomconditions": "ปกติ", + "roomStatus": "unavailable", + "lastName": "แสงสุข", + "affiliation": "ลูกจ้าง", + "idcard": "134044411441178", + "phone": "0325647845", + "status": "โสด", + "typeAffiliation": "ลูกจ้าง", + "typeRanks": "ลูกจ้าง" + }, + { + "id": "2c388c78-b2a3-4ea2-bca5-48981eb7e5db", + "index": 5, + "floor": 1, + "numberRoom": 5, + "ranks": "", + "firstName": "สมชัย", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช1", + "roomconditions": "ปกติ", + "roomStatus": "unavailable", + "lastName": "แสงสุข", + "affiliation": "ฝสสน.1", + "idcard": "134044411441178", + "phone": "0325647845", + "status": "โสด", + "typeAffiliation": "บก.สนน.", + "typeRanks": "ประทวน" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "ee69339f-529d-443a-b387-cf67102b4a23", + "name": "023", + "floor": 2, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "roomconditions": "ปกติ", + "typeRoom": "ช1", + "roomStatus": "free" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "a10eff34-cbe2-4a71-a44e-0d95bfe33410", + "name": "023", + "floor": 1, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "roomconditions": "ปกติ", + "typeRoom": "ช1", + "roomStatus": "free" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "03dc297e-ea5e-4852-8e49-6c9f3d2d47d4", + "name": "023", + "floor": 1, + "index": 3, + "numberRoom": 3, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช2", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "ffe28ac7-d4e3-4ad3-bec4-7d4744660027", + "name": "023", + "floor": 2, + "index": 1, + "numberRoom": 1, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช1", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "f5c54b45-9f9f-459d-891f-838c3a7ff41c", + "name": "023", + "floor": 1, + "index": 1, + "numberRoom": "112", + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "roomconditions": "ชำรุด", + "typeRoom": "ช2", + "roomStatus": "free" + }, + { + "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": "ประทวน" + }, + { + "buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3", + "id": "728100ee-a335-4c77-a226-a63c4de6088a", + "name": "023", + "floor": 2, + "index": 3, + "numberRoom": "23", + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช1", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "bcfb5f40-8b1e-4b69-b64e-4d8ca15db8bb", + "name": "01", + "floor": 1, + "index": 1, + "numberRoom": 1, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "3e8b5594-f735-46cf-b71f-14ba3b955c27", + "name": "01", + "floor": 1, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "cb5942ce-8ba9-4084-9e6a-cd202c238cbe", + "name": "01", + "floor": 1, + "index": 3, + "numberRoom": 3, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "f0ed9596-ee93-4781-a2aa-14d76472d314", + "name": "01", + "floor": 1, + "index": 4, + "numberRoom": 4, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "67473bca-fd63-40e5-ad21-87598a77471d", + "name": "01", + "floor": 2, + "index": 1, + "numberRoom": 1, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" + }, + { + "buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c", + "id": "932d8efa-e1f7-4529-ad3f-54c109d9f69e", + "name": "01", + "floor": 2, + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "", + "roomconditions": "ปกติ", + "roomStatus": "free" } ] \ No newline at end of file diff --git a/appserver/server.js b/appserver/server.js index dbd9946..905da27 100644 --- a/appserver/server.js +++ b/appserver/server.js @@ -65,6 +65,7 @@ app.put('/users/:id', (req, res) => { if (req.body.bookNumber) parsedData.bookNumber = req.body.bookNumber 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 filterdata.push(parsedData) fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => { if (err) { @@ -84,16 +85,14 @@ app.get('/buildings', (req, res) => { res.header("Access-Control-Allow-Origin", "*"); res.json(building) }) -app.get('/buildings/:name', (req, res) => { - res.header("Access-Control-Allow-Origin", "*"); - res.json(building.find(user => user.name === (req.params.name))) -}) +// app.get('/buildings/:buildingId', (req, res) => { +// res.header("Access-Control-Allow-Origin", "*"); +// res.json(building.find(buildings => buildings.buildingId === (req.params.buildingId))) +// }) app.post('/buildings', (req, res) => { res.header("Access-Control-Allow-Origin", "*"); - let id = uuidv4(); let body = req.body - let data = { id: id, ...body } - building.push(data) + building.push(body) fs.writeFile('./building.json', JSON.stringify(building), err => { if (err) { console.log('Error writing file', err) @@ -131,15 +130,18 @@ app.get('/rooms', (req, res) => { }) app.get('/rooms/:id', (req, res) => { res.header("Access-Control-Allow-Origin", "*"); - console.log(req.params.id); - res.json(rooms.find(room => room.index == (req.params.id))) + res.json(rooms.find(room => room.id == (req.params.id))) }) + +app.get('/buildings/:buildingId', (req, res) => { + res.header("Access-Control-Allow-Origin", "*"); + res.json(rooms.find(room => room.buildingId === (req.params.buildingId))) +}) + app.post('/rooms', (req, res) => { res.header("Access-Control-Allow-Origin", "*"); - let id = uuidv4(); let body = req.body - let data = { id: id, ...body } - rooms.push(data) + rooms.push(body) fs.writeFile('./rooms.json', JSON.stringify(rooms), err => { if (err) { console.log('Error writing file', err) @@ -155,15 +157,20 @@ app.put('/rooms/:id', (req, res) => { let dataOld = rooms[updateIndex] let filterdata = rooms.filter(user => user.id !== (req.params.id)) const parsedData = dataOld; + if (req.body.floor) parsedData.floor = req.body.floor if (req.body.firstName) parsedData.firstName = req.body.firstName if (req.body.lastName) parsedData.lastName = req.body.lastName + if (req.body.numberRoom) parsedData.numberRoom = req.body.numberRoom if (req.body.affiliation) parsedData.affiliation = req.body.affiliation - if (req.body.rank) parsedData.rank = req.body.rank + if (req.body.ranks) parsedData.ranks = req.body.ranks if (req.body.idcard) parsedData.idcard = req.body.idcard if (req.body.phone) parsedData.phone = req.body.phone if (req.body.status) parsedData.status = req.body.status + if (req.body.roomStatus) parsedData.roomStatus = req.body.roomStatus if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks + if (req.body.typeRoom) parsedData.typeRoom = req.body.typeRoom + if (req.body.roomconditions) parsedData.roomconditions = req.body.roomconditions filterdata.push(parsedData) fs.writeFile('./rooms.json', JSON.stringify(filterdata, null, 2), (err) => { if (err) { diff --git a/appserver/test.json b/appserver/test.json new file mode 100644 index 0000000..8e546f4 --- /dev/null +++ b/appserver/test.json @@ -0,0 +1,348 @@ +[ + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/11", + "sumroom": "24", + "committee": " มารุช ดีงาม , บารมี ดีงาม", + "floor": "4", + "roomnumber": "", + "type": "ช.2", + "listRoom": [ + { + "floor": 1, + "rooms": [ + { + "index": 1, + "numberRoom": 1, + "ranks": "ส.ต.ต.", + "firstName": "ปิติ2", + "laststName": "มีดี", + "Affiliation": "ฝอ. 2", + "typeRoom": "ช1", + "roomStatus": "unavailable" + }, + { + "index": 2, + "numberRoom": 2, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช1", + "roomStatus": "free" + }, + { + "index": 3, + "numberRoom": 3, + "ranks": "ส.ต.ต.", + "firstName": "ปิติ2", + "laststName": "มีดี", + "Affiliation": "ฝอ. 1", + "typeRoom": "ช2", + "roomStatus": "return" + }, + { + "index": 4, + "numberRoom": 4, + "ranks": "ส.ต.ต.", + "firstName": "ปิติ3", + "laststName": "มีดี", + "Affiliation": "ฝอ. 1", + "typeRoom": "ช2", + "roomStatus": "unavailable" + }, + { + "index": 5, + "numberRoom": 5, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช1", + "roomStatus": "free" + } + ], + "sumroom": 5 + }, + { + "floor": 2, + "rooms": [ + { + "index": 1, + "numberRoom": 1, + "ranks": "ส.ต.ต.", + "firstName": "ปิติ9", + "laststName": "มีดี", + "Affiliation": "ฝอ. 1", + "typeRoom": "ช3", + "roomStatus": "special" + }, + { + "index": 2, + "numberRoom": 2, + "ranks": "ส.ต.ต.", + "firstName": "ปิติ6", + "laststName": "มีดี", + "Affiliation": "ฝอ. 7", + "typeRoom": "ช2", + "roomStatus": "waiting" + }, + { + "index": 3, + "numberRoom": 3, + "ranks": "", + "firstName": "", + "laststName": "", + "Affiliation": "", + "typeRoom": "ช2", + "roomStatus": "free" + } + ], + "sumroom": 3 + } + ] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/12", + "sumroom": "20", + "committee": "", + "floor": "4", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/13", + "sumroom": "24", + "committee": "", + "floor": "4", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/14", + "committee": "", + "sumroom": "18", + "floor": "3", + "roomnumber": "", + "type": "ช.3", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/15", + "committee": "", + "sumroom": "32", + "floor": "4", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/16", + "committee": "", + "sumroom": "24", + "floor": "4", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/17", + "committee": "", + "sumroom": "32", + "floor": "4", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "อาคารแฟลต 1/18", + "sumroom": "60", + "committee": "", + "floor": "5", + "roomnumber": "", + "type": "-", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "แฟลตลือชา 1", + "committee": "", + "sumroom": "50", + "floor": "5", + "roomnumber": "", + "type": "-", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "แฟลตลือชา 2", + "committee": "", + "sumroom": "50", + "floor": "5", + "roomnumber": "", + "type": "-", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "แฟลตลือชา 3", + "sumroom": "40", + "floor": "5", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "แฟลตบางเขน 1", + "committee": "", + "sumroom": "50", + "floor": "5", + "roomnumber": "", + "type": "-", + "listRoom": [] + }, + { + "buil": "อาคารบ้านพัก บช. ตชด.", + "name": "แฟลตบางเขน 2", + "committee": "", + "sumroom": "50", + "floor": "5", + "roomnumber": "", + "type": "ช.2", + "listRoom": [] + }, + { + "id": "745a7d08-5333-40ef-8c2c-5bcdf1e2a392", + "buil": "บช", + "name": "ลือชา15", + "committee": " มารุช ดีงาม , บารมี ดีงาม", + "sumroom": 8, + "floor": "2", + "roomnumber": "", + "type": "", + "listRoom": [ + { + "floor": 1, + "rooms": [ + { + "index": 1, + "numberRoom": 1 + }, + { + "index": 2, + "numberRoom": 2 + }, + { + "index": 3, + "numberRoom": 3 + }, + { + "index": 4, + "numberRoom": 4 + }, + { + "index": 5, + "numberRoom": 5 + } + ], + "sumroom": 5 + }, + { + "floor": 2, + "rooms": [ + { + "index": 1, + "numberRoom": 1 + }, + { + "index": 2, + "numberRoom": 2 + }, + { + "index": 3, + "numberRoom": 3 + } + ], + "sumroom": 3 + } + ] + }, + { + "id": "4f82fe70-ac26-473d-b9ec-e8724e9fa5a9", + "buil": "test", + "name": "ลือชา 4/5", + "committee": " มารุช ดีงาม , บารมี ดีงาม", + "sumroom": 11, + "floor": "2", + "roomnumber": "", + "type": "", + "listRoom": [ + { + "floor": 1, + "rooms": [ + { + "index": 1, + "numberRoom": 1 + }, + { + "index": 2, + "numberRoom": 2 + }, + { + "index": 3, + "numberRoom": 3 + }, + { + "index": 4, + "numberRoom": 4 + }, + { + "index": 5, + "numberRoom": 5 + }, + { + "index": 6, + "numberRoom": 6 + }, + { + "index": 7, + "numberRoom": 7 + } + ], + "sumroom": 7 + }, + { + "floor": 2, + "rooms": [ + { + "index": 1, + "numberRoom": 1 + }, + { + "index": 2, + "numberRoom": 2 + }, + { + "index": 3, + "numberRoom": 3 + }, + { + "index": 4, + "numberRoom": 4 + } + ], + "sumroom": 4 + } + ] + } +] \ No newline at end of file diff --git a/appserver/users.json b/appserver/users.json index 3bdf30f..733f8ed 100644 --- a/appserver/users.json +++ b/appserver/users.json @@ -1,50 +1,4 @@ [ - { - "id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61", - "no": 1, - "firstName": "สมชัย14", - "lastName": "แสงสุข", - "affiliation": "ลูกจ้าง", - "rank": "นาง", - "idcard": "134044411441178", - "phone": "0325647845", - "status": "โสด", - "typeAffiliation": "ลูกจ้าง", - "typeRanks": "ลูกจ้าง", - "typeUser": "ตร.", - "bookNumber": "1234", - "queue": "inqueue", - "typeRoom": "ช1", - "contract": "", - "checkintime": "", - "maintenance": "", - "insurance": "", - "installments": "", - "pickedBook":"2023-10-08T14:10:26.374Z" - }, - { - "id": "ebd367bf-396f-4bae-8130-1ce3fa130d38", - "no": 2, - "firstName": "สมชัย", - "lastName": "แสงสุข", - "affiliation": "ลูกจ้าง", - "rank": "นาง", - "idcard": "134044411441178", - "phone": "0325647845", - "status": "โสด", - "typeAffiliation": "ลูกจ้าง", - "typeRanks": "ลูกจ้าง", - "typeUser": "ตร.", - "typeRoom": "ช1", - "bookNumber": "", - "queue": "inqueue", - "contract": "", - "checkintime": "", - "maintenance": "", - "insurance": "", - "installments": "", - "pickedBook":"2023-11-01T14:10:26.374Z" - }, { "id": "507e0867-4d56-4f4e-81d1-f3a1ab0d0fde", "no": 1, @@ -66,30 +20,7 @@ "maintenance": "", "insurance": "", "installments": "", - "pickedBook":"2023-11-03T14:10:26.374Z" - }, - { - "id": "2c388c78-b2a3-4ea2-bca5-48521eb7e5db", - "no": 3, - "firstName": "มานี", - "lastName": "มานอน", - "affiliation": "ลูกจ้าง", - "rank": "ส.ต.ต.", - "idcard": "134044411441178", - "phone": "0325647845", - "status": "สมรส", - "typeAffiliation": "ลูกจ้าง", - "typeRanks": "ประทวน", - "typeUser": "ตร.", - "bookNumber": "1234", - "typeRoom": "ช2", - "queue": "inqueue", - "contract": "", - "checkintime": "", - "maintenance": "", - "insurance": "", - "installments": "", - "pickedBook":"2023-11-02T14:10:26.374Z" + "pickedBook": "2023-11-03T14:10:26.374Z" }, { "id": "1cb479fa-e217-422d-938e-47f6fc9b9f32", @@ -112,30 +43,7 @@ "maintenance": "", "insurance": "", "installments": "", - "pickedBook":"2023-11-07T14:10:26.374Z" - }, - { - "id": "967bf9a7-047e-4951-ba2a-190f42045715", - "no": 5, - "firstName": "สมชัย", - "lastName": "แสงสุข", - "affiliation": "ฝสสน.1", - "rank": "ส.ต.ท.", - "idcard": "134044411441178", - "phone": "0325647845", - "status": "โสด", - "typeRoom": "ช1", - "typeAffiliation": "บก.สนน.", - "typeRanks": "ประทวน", - "typeUser": "บช.ตชด.", - "bookNumber": "456", - "queue": "inqueue", - "contract": "", - "checkintime": "", - "maintenance": "", - "insurance": "", - "installments": "", - "pickedBook":"2023-11-08T14:10:26.374Z" + "pickedBook": "2023-11-07T14:10:26.374Z" }, { "id": "fae8c402-f815-44cc-8702-bf843dc97db4", @@ -157,7 +65,7 @@ "maintenance": "", "insurance": "", "installments": "", - "pickedBook":"2023-11-08T10:10:26.374Z" + "pickedBook": "2023-11-08T10:10:26.374Z" }, { "id": "fc3710ca-c3af-4781-9c8f-4aa6657ddff4", @@ -180,7 +88,7 @@ "maintenance": "", "insurance": "", "installments": "", - "pickedBook":"2023-11-08T14:10:26.374Z" + "pickedBook": "2023-11-08T14:10:26.374Z" }, { "id": "8e81c39a-d50c-42f5-85c0-f9f773c2a4aa", @@ -203,6 +111,98 @@ "maintenance": "", "insurance": "", "installments": "", - "pickedBook":"2023-11-08T12:10:26.374Z" + "pickedBook": "2023-11-08T12:10:26.374Z" + }, + { + "id": "ebd367bf-396f-4bae-8130-1ce3fa130d38", + "no": 2, + "firstName": "สมชัย", + "lastName": "แสงสุข", + "affiliation": "ลูกจ้าง", + "rank": "นาง", + "idcard": "134044411441178", + "phone": "0325647845", + "status": "โสด", + "typeAffiliation": "ลูกจ้าง", + "typeRanks": "ลูกจ้าง", + "typeUser": "ตร.", + "typeRoom": "ช1", + "bookNumber": "", + "queue": "inqueue", + "contract": "", + "checkintime": "", + "maintenance": "", + "insurance": "", + "installments": "", + "pickedBook": "2023-11-01T14:10:26.374Z" + }, + { + "id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61", + "no": 1, + "firstName": "สมชัย14", + "lastName": "แสงสุข", + "affiliation": "ลูกจ้าง", + "rank": "นาง", + "idcard": "134044411441178", + "phone": "0325647845", + "status": "โสด", + "typeAffiliation": "ลูกจ้าง", + "typeRanks": "ลูกจ้าง", + "typeUser": "ตร.", + "bookNumber": "1234", + "queue": "inroom", + "typeRoom": "ช1", + "contract": "", + "checkintime": "", + "maintenance": "", + "insurance": "", + "installments": "", + "pickedBook": "2023-10-08T14:10:26.374Z" + }, + { + "id": "967bf9a7-047e-4951-ba2a-190f42045715", + "no": 5, + "firstName": "สมชัย", + "lastName": "แสงสุข", + "affiliation": "ฝสสน.1", + "rank": "ส.ต.ท.", + "idcard": "134044411441178", + "phone": "0325647845", + "status": "โสด", + "typeRoom": "ช1", + "typeAffiliation": "บก.สนน.", + "typeRanks": "ประทวน", + "typeUser": "บช.ตชด.", + "bookNumber": "456", + "queue": "inroom", + "contract": "", + "checkintime": "", + "maintenance": "", + "insurance": "", + "installments": "", + "pickedBook": "2023-11-08T14:10:26.374Z" + }, + { + "id": "2c388c78-b2a3-4ea2-bca5-48521eb7e5db", + "no": 3, + "firstName": "มานี", + "lastName": "มานอน", + "affiliation": "ลูกจ้าง", + "rank": "ส.ต.ต.", + "idcard": "134044411441178", + "phone": "0325647845", + "status": "สมรส", + "typeAffiliation": "ลูกจ้าง", + "typeRanks": "ประทวน", + "typeUser": "ตร.", + "bookNumber": "1234", + "typeRoom": "ช2", + "queue": "inroom", + "contract": "", + "checkintime": "", + "maintenance": "", + "insurance": "", + "installments": "", + "pickedBook": "2023-11-02T14:10:26.374Z" } ] \ No newline at end of file diff --git a/webapp/package.json b/webapp/package.json index 7623df6..a4111a7 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -17,6 +17,7 @@ "pinia": "2.0.14", "prismjs": "1.28.0", "typed.js": "2.0.12", + "uuid": "^9.0.1", "vue": "3.2.36", "vue-clipboard3": "2.0.0", "vue-count-to": "1.0.13", diff --git a/webapp/src/views/Queue/QueueView.vue b/webapp/src/views/Queue/QueueView.vue index f942bc7..4787842 100644 --- a/webapp/src/views/Queue/QueueView.vue +++ b/webapp/src/views/Queue/QueueView.vue @@ -70,7 +70,7 @@ export default { }, editTypeRoom(event) { - console.log(event); + // console.log(event); this.typeroomByqueue = event; }, @@ -116,7 +116,7 @@ export default { this.userByid = data; }) .catch((err) => { - console.log(err.response); + console.log(err); }); } catch (error) { console.error(error); diff --git a/webapp/src/views/Restroom/DetailRoomPage.vue b/webapp/src/views/Restroom/DetailRoomPage.vue index df7185b..d18cb70 100644 --- a/webapp/src/views/Restroom/DetailRoomPage.vue +++ b/webapp/src/views/Restroom/DetailRoomPage.vue @@ -7,36 +7,7 @@ import MaterialButton from "@/components/MaterialButton.vue"; import Breadcrumbs from "@/examples/Breadcrumbs.vue"; import axios from "axios"; -const userlist = [ - { - dataIndex: "1", - firstName: "สมชาย", - lastName: "แสงทอง", - Affiliation: "ฝอ.2", //สังกัด - rank: "ส.ต.ต.", - idcard: "134044411441122", - phone: "0325647846", - bookNumber: "1234", - ContractDate: "12/11/2566", //สังกัด - Lengthofstay: "3 เดือน", //ยศ - InsuranceMoney: "10,000", - Status: "รอคิว", - }, - { - dataIndex: "2", - firstName: "สมชัย", - lastName: "แสงสุข", - Affiliation: "ฝอ.2", //สังกัด - rank: "ส.ต.ต.", - idcard: "134044411441178", - phone: "0325647845", - bookNumber: "1234", - ContractDate: "12/11/2566", //สังกัด - Lengthofstay: "3 เดือน", //ยศ - InsuranceMoney: "10,000", - Status: "รอคิว", - }, -]; + export default { components: { MaterialInput, @@ -45,8 +16,7 @@ export default { }, setup() { return { - vueMkHeader, - userlist, + vueMkHeader }; }, @@ -85,16 +55,10 @@ export default { this.id = this.$route.params.id; this.getroomByid(this.id); } - this.getAllqueue(); - // this.$route.query }, methods: { gotoAction() { - // if (this.mode == "edit") { this.$router.push({ path: `/room/update/${this.id}`, query: { mode: this.mode } }); - // } else { - // this.$router.push({ path: `/addUserRoom` , query: { mode: this.mode } }); - // } }, getAllqueue() { try { @@ -102,7 +66,8 @@ export default { .get(`http://localhost:3001/queue/inqueue`) .then((res) => { this.queueList = res.data; - this.queuefilter = this.queueList.filter((e) => e.status === this.typeroom); + console.log(this.queueList); + this.queuefilter = this.queueList.filter((e) => e.typeRoom === this.typeroom); }) .catch((err) => { console.log(err.response); @@ -115,10 +80,12 @@ export default { try { axios.get(`http://localhost:3001/rooms/${id}`).then((res) => { this.data = res.data; - console.log(this.data); - if (this.data.typeRoom == "ช1") this.typeroom = "โสด"; - if (this.data.typeRoom == "ช2") this.typeroom = "สมรส"; - if (this.data.typeRoom == "ช3") this.typeroom = "ทั่วไป"; + // console.log(this.data); + // if (this.data.typeRoom == "ช1") this.typeroom = "โสด"; + // if (this.data.typeRoom == "ช2") this.typeroom = "สมรส"; + // if (this.data.typeRoom == "ช3") this.typeroom = "ทั่วไป"; + this.typeroom = this.data.typeRoom + this.getAllqueue() }); } catch (e) { console.error(e); @@ -156,7 +123,6 @@ export default { await axios .post(`http://localhost:3001/history`, body, { headers: { - // remove headers "Access-Control-Allow-Origin": "*", "Content-Type": "application/json", }, @@ -164,7 +130,7 @@ export default { .then((res) => { this.submitForm2() this.submitForm3() - this.getAllqueue(); + this.submitFormRoom() }) .catch((err) => { console.log(err); @@ -185,17 +151,10 @@ export default { await axios .post(`http://localhost:3001/report`, body, { headers: { - // remove headers "Access-Control-Allow-Origin": "*", "Content-Type": "application/json", }, }) - .then((res) => { - this.getAllqueue(); - }) - .catch((err) => { - console.log(err); - }); }, async submitForm3() { @@ -210,15 +169,35 @@ export default { }; await axios - .put(`http://localhost:3001/queue/${this.id}`, body, { + .put(`http://localhost:3001/queue/${this.userId}`, body, { + headers: { + "Access-Control-Allow-Origin": "*", + "Content-Type": "application/json", + }, + }) + }, + async submitFormRoom() { + let body = { + ...this.userByid, + queue: "inroom", + roomStatus: 'unavailable', + contract: this.contract, + checkintime: this.Checkintime, + maintenance: this.Maintenance, + insurance: this.insurance, + installments: this.installments, + }; + + await axios + .put(`http://localhost:3001/rooms/${this.id}`, body, { headers: { - // remove headers "Access-Control-Allow-Origin": "*", "Content-Type": "application/json", }, }) .then((res) => { this.getAllqueue(); + this.$router.push({ path: `/room` }); }) .catch((err) => { console.log(err); diff --git a/webapp/src/views/Restroom/RoomView.vue b/webapp/src/views/Restroom/RoomView.vue index 95fa3a0..71c48d0 100644 --- a/webapp/src/views/Restroom/RoomView.vue +++ b/webapp/src/views/Restroom/RoomView.vue @@ -32,13 +32,13 @@ export default { ], listRoom: [], - selectedtypeRoom: "ช1", + selectedtypeRoom: "ทั้งหมด", selectedColor: "", statusfree: false, statusreturn: false, statuseunavailable: false, statusewaiting: false, - selectedlistRoom: { label: "อาคารแฟลต 1/11", value: "อาคารแฟลต 1/11" }, + selectedlistRoom: "", committee: "", selectedStatus: "", selectedReturn: "", @@ -47,6 +47,9 @@ export default { selectedScaple: "", roomData: [], buildingList: [], + roomList: [], + roomListOld: [], + buidingId: "", }; }, created() { @@ -57,43 +60,37 @@ export default { console.error(e); } - this.getRooms(); + // this.getRooms(); this.getBuildings(); }, watch: { selectedtypeRoom: function (newValue) { - this.roomData = this.oldData; + this.roomList = this.roomListOld; + let filldata = []; if (newValue !== null) { if (newValue.value !== "ทั้งหมด") { - const typeRoom = this.roomData.filter( - (tagreturn) => tagreturn.typeRoom === newValue.value - ); - this.roomData = typeRoom; + filldata = this.roomList.map((ele, i) => { + return ele.data.filter((c) => c.typeRoom == newValue.value); + }); + let t = Object.keys(filldata).map((ele) => { + return { + floor: parseInt(ele) + 1, + data: filldata[ele] || [], + }; + }); + this.roomList = t; } else { - this.roomData = this.oldData; + this.roomList = this.roomListOld; } } }, - // selectedtypeRoom: async function (newValue) { - // // this.dataBuilding["listRoom"] = []; - // let buildingList = []; - // buildingList = this.oldData - // let datalist = [] - // if (newValue !== null) { - // if (newValue.value !== "ทั้งหมด") { - // datalist = buildingList["listRoom"].map((ele, i) => { - // ele.rooms = ele.rooms.filter((c) => c.typeRoom == newValue.value); - // return ele; // return ele; - // }); - - // this.dataBuilding["listRoom"] = datalist; - // console.log(this.dataBuilding); - // } else { - // // this.roomData = this.oldData; - // } - // } - // }, + selectedlistRoom: async function (newValue) { + let arr = [] + arr = this.buildingList.find(e => e.buil == newValue.value ) + this.buidingId = arr.listRoom[0].buildingId + this.buildById(this.buidingId); + }, }, methods: { gotodetail(id, index) { @@ -133,8 +130,8 @@ export default { .get("http://localhost:3001/rooms") .then((res) => { this.roomData = res.data; - console.log(this.roomData); this.oldData = this.roomData; + this.buildById(this.buidingId); }) .catch((err) => { console.log(err); @@ -143,24 +140,44 @@ export default { console.error(error); } }, + async buildById(id) { + try { + axios.get(`http://localhost:3001/rooms/`).then((res) => { + let broom = []; + let buidingRoom = res.data; + // let buidingRoomOld = buidingRoom; + broom = buidingRoom.filter((e) => e.buildingId == id); + const groupByCategory = Object.groupBy(broom, (product) => { + return product.floor; + }); + this.roomList = Object.keys(groupByCategory).map((ele) => { + return { + floor: parseInt(ele), + data: groupByCategory[ele].sort((a, b) => a.index - b.index), + }; + }); + this.roomListOld = this.roomList; + }); + } catch (e) { + console.error(e); + } + }, async getBuildings() { try { axios.get(`http://localhost:3001/buildings/`).then((res) => { this.buildingList = res.data; - // this.oldData = res.data - let roomValue = this.buildingList.find( - (el) => el.name == this.selectedlistRoom.value - ); - this.committee = roomValue.committee; - this.dataBuilding = { ...roomValue }; - // this.oldData = { ...roomValue }; - // console.log(this.dataBuilding); - this.listRoom = this.buildingList.map((ele) => { + this.listRoom = this.buildingList.map(e => { return { - label: ele.name, - value: ele.name, - }; - }); + label: e.buil, + value: e.buil + } + }) + let roomValue = this.buildingList[0]; + this.committee = roomValue.committee; + this.selectedlistRoom = { label: roomValue.buil, value: roomValue.buil }; + this.buidingId = roomValue.listRoom[0].buildingId; + this.dataBuilding = { ...roomValue }; + this.getRooms(); }); } catch (e) { console.error(e); @@ -187,39 +204,72 @@ export default { }); }, onChangeEvent(e, event, selectedStatus) { - this.roomData = this.oldData; + this.roomList = this.roomListOld; + let filldata = []; if (e == "free") { if (event.target.checked) { - const free = this.roomData.filter((tagfree) => tagfree.status === "free"); - this.roomData = free; + filldata = this.roomList.map((ele, i) => { + return ele.data.filter((c) => c.roomStatus == "free"); + }); + let t = Object.keys(filldata).map((ele) => { + return { + floor: parseInt(ele) + 1, + data: filldata[ele] || [], + }; + }); + this.roomList = t; } } else if (e == "unavailable") { if (event.target.checked) { - const statuseunavailable = this.roomData.filter( - (tagun) => tagun.status === "unavailable" - ); - this.roomData = statuseunavailable; + filldata = this.roomList.map((ele, i) => { + return ele.data.filter((c) => c.roomStatus == "unavailable"); + }); + let t = Object.keys(filldata).map((ele) => { + return { + floor: parseInt(ele) + 1, + data: filldata[ele] || [], + }; + }); + this.roomList = t; } } else if (e == "waiting") { if (event.target.checked) { - const waiting = this.roomData.filter( - (tagwaiting) => tagwaiting.status === "waiting" - ); - this.roomData = waiting; + filldata = this.roomList.map((ele, i) => { + return ele.data.filter((c) => c.roomconditions == "ชำรุด"); + }); + let t = Object.keys(filldata).map((ele) => { + return { + floor: parseInt(ele) + 1, + data: filldata[ele] || [], + }; + }); + this.roomList = t; } } else if (e == "return") { if (event.target.checked) { - const returns = this.roomData.filter( - (tagreturn) => tagreturn.status === "return" - ); - this.roomData = returns; + filldata = this.roomList.map((ele, i) => { + return ele.data.filter((c) => c.roomStatus == "return"); + }); + let t = Object.keys(filldata).map((ele) => { + return { + floor: parseInt(ele) + 1, + data: filldata[ele] || [], + }; + }); + this.roomList = t; } } else if (e == "special") { if (event.target.checked) { - const specials = this.roomData.filter( - (tagreturn) => tagreturn.status === "special" - ); - this.roomData = specials; + filldata = this.roomList.map((ele, i) => { + return ele.data.filter((c) => c.roomStatus == "special"); + }); + let t = Object.keys(filldata).map((ele) => { + return { + floor: parseInt(ele) + 1, + data: filldata[ele] || [], + }; + }); + this.roomList = t; } } }, @@ -233,7 +283,7 @@ export default { :style="`background-image: url(${vueMkHeader})`" loading="lazy" > -
+
title
@@ -299,7 +349,7 @@ export default {
- + ผ่อนผัน - - รอคืนเงินประกัน - -
+

@@ -394,22 +436,24 @@ export default {

-
+

{{ "ว่าง" }}

{{ "ไม่ว่าง" }}

{{ "ชำรุด" }}

@@ -458,13 +505,23 @@ export default {

{{ item2?.Affiliation }} {{ "กรณีพิเศษ" }}

diff --git a/webapp/src/views/Restroom/UpdateRoom.vue b/webapp/src/views/Restroom/UpdateRoom.vue index 4650e02..4228ec9 100644 --- a/webapp/src/views/Restroom/UpdateRoom.vue +++ b/webapp/src/views/Restroom/UpdateRoom.vue @@ -11,97 +11,9 @@ import Breadcrumbs from "@/examples/Breadcrumbs.vue"; import MaterialButton from "@/components/MaterialButton.vue"; // material-input import setMaterialInput from "@/assets/js/material-input"; -// onMounted(() => { -// setMaterialInput(); -// }); + import axios from "axios"; -const listRoom = [ - { title: "ตึก 1" }, - { title: "ตึก 2" }, - { title: "ตึก 3" }, - { title: "ตึก 4" }, - { title: "ตึก 5" }, - { title: "ตึก 6" }, - { title: "ตึก 7" }, -]; -const NoRoom = [ - { title: "ชั้น 1" }, - { title: "ชั้น 2" }, - { title: "ชั้น 3" }, - { title: "ชั้น 4" }, - { title: "ชั้น 5" }, - { title: "ชั้น 6" }, - { title: "ชั้น 7" }, -]; - -const landingColumns = [ - { - title: "ห้อง 1", - dataIndex: "1", - status: true, - }, - { - title: "ห้อง 2", - dataIndex: "2", - status: false, - }, - { - title: "ห้อง 3", - dataIndex: "3", - status: true, - }, - { - title: "ห้อง 4", - dataIndex: "4", - status: true, - }, - { - title: "ห้อง 5", - dataIndex: "5", - status: false, - }, - { - title: "ห้อง 6", - dataIndex: "6", - status: false, - }, - { - title: "ห้อง 7", - dataIndex: "7", - status: true, - }, - { - title: "ห้อง 8", - dataIndex: "8", - status: false, - }, - { - title: "ห้อง 9", - dataIndex: "9", - status: false, - }, - { - title: "ห้อง 10", - dataIndex: "10", - status: false, - }, - { - title: "ห้อง 11", - dataIndex: "11", - status: true, - }, - { - title: "ห้อง 12", - dataIndex: "12", - status: false, - }, - { - title: "ห้อง 13", - dataIndex: "13", - status: false, - }, -]; const userlist = [ { dataIndex: "1", @@ -134,8 +46,6 @@ export default { }, setup() { return { - listRoom, - NoRoom, vueMkHeader, userlist, }; @@ -143,7 +53,6 @@ export default { data() { return { - value: { name: "Vue.js", language: "JavaScript" }, options: [ { label: "มกราคม", value: "01" }, { label: "กุมภาพันธ์", value: "02" }, @@ -240,6 +149,10 @@ export default { console.log(event); // this.selected = event; }, + queuetypefilter(e) { + if (e.target) this.Roomconditions = e.target.value; + }, + async getRooms(id) { try { await axios @@ -247,6 +160,9 @@ export default { .then((res) => { this.roomData = res.data; console.log(this.roomData); + this.numberRoom = this.roomData.numberRoom; + this.selectedRoomtype = this.roomData.typeRoom + // this.oldData = this.roomData; }) .catch((err) => { @@ -259,17 +175,24 @@ export default { submitForm() { let body = { - firstName: this.firstName, - lastName: this.lastName, - Affiliation: this.Affiliation, - rank: this.rank, - idcard: this.idcard, - phone: this.phone, + numberRoom: this.numberRoom, + typeRoom: this.selectedRoomtype.label, + roomconditions: this.Roomconditions, }; - // let b = [] - // b.push(body) - // this.userlist.push(body) - // console.log(this.userlist); + 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); + }) + .catch((err) => { + console.log(err); + }); }, }, }; @@ -373,7 +296,7 @@ export default { >
-
แก้ไขรายละเอียด ห้อง 2
+
แก้ไขรายละเอียด ห้อง {{ numberRoom }}
- +
- +
- บันทึก
@@ -561,27 +492,6 @@ export default { />
-
-
- - -
-
{ + this.submitRoom(); this.getBuildings(); }) .catch((err) => { console.log(err); }); - await axios - .post(`http://localhost:3001/rooms`, body, { + }, + + async submitRoom() { + let floorsList = []; + await this.FloorsList.forEach((e) => { + e.rooms.forEach((ele) => { + floorsList.push(ele); + }); + }); + // let body = floorsList + console.log(floorsList); + await floorsList.forEach(x => { + axios + .post(`http://localhost:3001/rooms`, x, { headers: { // remove headers "Access-Control-Allow-Origin": "*", "Content-Type": "application/json", }, }) + }) }, + // buildings async getBuildings() { try { @@ -141,7 +170,7 @@ export default { };