mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-23 21:04:21 +08:00
ง่วงนอนไม่ไหว
This commit is contained in:
parent
659d6099f0
commit
63bb45452e
27
appserver/Expenses.json
Normal file
27
appserver/Expenses.json
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61",
|
||||||
|
"firstName": "สมชัย14",
|
||||||
|
"lastName": "แสงสุข",
|
||||||
|
"affiliation": "ลูกจ้าง",
|
||||||
|
"rank": "นาง",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"status": "โสด",
|
||||||
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
|
"typeRanks": "ลูกจ้าง",
|
||||||
|
"typeUser": "ตร.",
|
||||||
|
"building": "แฟลตบางเขน 1",
|
||||||
|
"floor": "2",
|
||||||
|
"roomnumber": "201",
|
||||||
|
"insurancecost": 254,
|
||||||
|
"installments": 266,
|
||||||
|
"waterbill": 150,
|
||||||
|
"electricitybill": 945,
|
||||||
|
"central": 500,
|
||||||
|
"costs": 200,
|
||||||
|
"sumCost":1000,
|
||||||
|
"typeContract": "หักได้",
|
||||||
|
"contract": "..."
|
||||||
|
}
|
||||||
|
]
|
348
appserver/building.json
Normal file
348
appserver/building.json
Normal file
@ -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",
|
||||||
|
"status": "unavailable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"index": 2,
|
||||||
|
"numberRoom": 2,
|
||||||
|
"ranks": "",
|
||||||
|
"firstName": "",
|
||||||
|
"laststName": "",
|
||||||
|
"Affiliation": "",
|
||||||
|
"typeRoom": "ช1",
|
||||||
|
"status": "free"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"index": 3,
|
||||||
|
"numberRoom": 3,
|
||||||
|
"ranks": "ส.ต.ต.",
|
||||||
|
"firstName": "ปิติ2",
|
||||||
|
"laststName": "มีดี",
|
||||||
|
"Affiliation": "ฝอ. 1",
|
||||||
|
"typeRoom": "ช2",
|
||||||
|
"status": "return"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"sumroom": 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
1
appserver/history.json
Normal file
1
appserver/history.json
Normal file
@ -0,0 +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"}]
|
@ -1 +1,83 @@
|
|||||||
[{"id":"3f7e1c45-a2e9-4b08-a56d-e687ea79ba61","firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"1234"},{"id":"8e81c39a-d50c-42f5-85c0-f9f773c2a4aa","firstName":"สมชัย","lastName":"แสงสุข","affiliation":"บช.ตซด.","rank":"ส.ต.อ.","idcard":"134044411441178","phone":"0325647845","typeAffiliation":"บช.ตซด.","typeRanks":"ประทวน","bookNumber":"1234"},{"id":"ebd367bf-396f-4bae-8130-1ce3fa130d38","firstName":"สมชัย","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"1234"},{"id":"46685cde-8ea0-4cd2-ba94-7d86e6e893bd","firstName":"สมชัย","lastName":"แสงสุข","affiliation":"บช.ตซด.","rank":"ส.ต.อ.","idcard":"134044411441178","phone":"0325647845","typeAffiliation":"บช.ตซด.","typeRanks":"ประทวน","bookNumber":"14578963"},{"id":"e9aa568a-bb68-4ff9-bb3a-3751f275b631","firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"787878"},{"id":"a8e392df-f6e0-4363-9c36-b6c28d6ab8c8","firstName":"สมชัย14","lastName":"แสงสุข","affiliation":"ลูกจ้าง","rank":"นาง","idcard":"134044411441178","phone":"0325647845","status":"โสด","typeAffiliation":"ลูกจ้าง","typeRanks":"ลูกจ้าง","bookNumber":"7889999999"}]
|
[
|
||||||
|
{
|
||||||
|
"id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61",
|
||||||
|
"firstName": "สมชัย14",
|
||||||
|
"lastName": "แสงสุข",
|
||||||
|
"affiliation": "ลูกจ้าง",
|
||||||
|
"rank": "นาง",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"status": "โสด",
|
||||||
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
|
"typeRanks": "ลูกจ้าง",
|
||||||
|
"bookNumber": "1234"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "8e81c39a-d50c-42f5-85c0-f9f773c2a4aa",
|
||||||
|
"firstName": "สมชัย",
|
||||||
|
"lastName": "แสงสุข",
|
||||||
|
"affiliation": "บช.ตซด.",
|
||||||
|
"rank": "ส.ต.อ.",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"status": "โสด",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"typeAffiliation": "บช.ตซด.",
|
||||||
|
"typeRanks": "ประทวน",
|
||||||
|
"bookNumber": "1234"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ebd367bf-396f-4bae-8130-1ce3fa130d38",
|
||||||
|
"firstName": "สมชัย",
|
||||||
|
"lastName": "แสงสุข",
|
||||||
|
"affiliation": "ลูกจ้าง",
|
||||||
|
"rank": "นาง",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"status": "โสด",
|
||||||
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
|
"typeRanks": "ลูกจ้าง",
|
||||||
|
"bookNumber": "1234"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "46685cde-8ea0-4cd2-ba94-7d86e6e893bd",
|
||||||
|
"firstName": "สมชัย",
|
||||||
|
"lastName": "แสงสุข",
|
||||||
|
"affiliation": "บช.ตซด.",
|
||||||
|
"rank": "ส.ต.อ.",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"status": "สมรส",
|
||||||
|
"typeAffiliation": "บช.ตซด.",
|
||||||
|
"typeRanks": "ประทวน",
|
||||||
|
"bookNumber": "14578963"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "f5d0184e-3b79-4005-b873-543a45942c4c",
|
||||||
|
"firstName": "มานา",
|
||||||
|
"lastName": "มานี",
|
||||||
|
"affiliation": "ลูกจ้าง",
|
||||||
|
"rank": "นาย",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"status": "โสด",
|
||||||
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
|
"typeRanks": "ลูกจ้าง",
|
||||||
|
"typeUser": "ตร.",
|
||||||
|
"bookNumber": "กกกกกกกกกก"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "5615b6ac-de82-4ec2-b370-e7ddc830924c",
|
||||||
|
"no": 5,
|
||||||
|
"firstName": "สมชัย",
|
||||||
|
"lastName": "แสงสุข",
|
||||||
|
"affiliation": "บช.ตซด.",
|
||||||
|
"rank": "ส.ต.อ.",
|
||||||
|
"idcard": "134044411441178",
|
||||||
|
"phone": "0325647845",
|
||||||
|
"typeAffiliation": "บช.ตซด.",
|
||||||
|
"typeRanks": "ประทวน",
|
||||||
|
"typeUser": "บช.ตชด.",
|
||||||
|
"bookNumber": "56544444",
|
||||||
|
"queue": "none"
|
||||||
|
}
|
||||||
|
]
|
1
appserver/report.json
Normal file
1
appserver/report.json
Normal file
@ -0,0 +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"}]
|
132
appserver/ro.json
Normal file
132
appserver/ro.json
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
]
|
@ -1,132 +1,98 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"title": "ห้อง 1",
|
"index": 1,
|
||||||
"dataIndex": "1",
|
"floor": 1,
|
||||||
"ranks": "",
|
"numberRoom": 1,
|
||||||
"firstName": "",
|
|
||||||
"laststName": "",
|
|
||||||
"Affiliation": "",
|
|
||||||
"typeRoom": "ช1",
|
|
||||||
"status": "free"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "ห้อง 2",
|
|
||||||
"dataIndex": "2",
|
|
||||||
"ranks": "ส.ต.ต.",
|
"ranks": "ส.ต.ต.",
|
||||||
"firstName": "ปิติ2",
|
"firstName": "ปิติ2",
|
||||||
"laststName": "มีดี",
|
"laststName": "มีดี",
|
||||||
"Affiliation": "ฝอ. 2",
|
"Affiliation": "ฝอ. 2",
|
||||||
"typeRoom": "ช1",
|
"typeRoom": "ช1",
|
||||||
|
"Roomconditions": "ปกติ",
|
||||||
"status": "unavailable"
|
"status": "unavailable"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 3",
|
"index": 2,
|
||||||
"dataIndex": "3",
|
"floor": 1,
|
||||||
|
"numberRoom": 2,
|
||||||
"ranks": "",
|
"ranks": "",
|
||||||
"firstName": "",
|
"firstName": "",
|
||||||
"laststName": "",
|
"laststName": "",
|
||||||
"Affiliation": "",
|
"Affiliation": "",
|
||||||
"typeRoom": "ช1",
|
"typeRoom": "ช1",
|
||||||
|
"Roomconditions": "ชำรุด",
|
||||||
"status": "free"
|
"status": "free"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 4",
|
"index": 3,
|
||||||
"dataIndex": "4",
|
"floor": 1,
|
||||||
|
"numberRoom": 3,
|
||||||
"ranks": "ส.ต.ต.",
|
"ranks": "ส.ต.ต.",
|
||||||
"firstName": "ปิติ2",
|
"firstName": "ปิติ2",
|
||||||
"laststName": "มีดี",
|
"laststName": "มีดี",
|
||||||
"Affiliation": "ฝอ. 1",
|
"Affiliation": "ฝอ. 1",
|
||||||
"typeRoom": "ช2",
|
"typeRoom": "ช2",
|
||||||
|
"Roomconditions": "ปกติ",
|
||||||
"status": "return"
|
"status": "return"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 5",
|
"index": 4,
|
||||||
"dataIndex": "5",
|
"floor": 1,
|
||||||
|
"numberRoom": 4,
|
||||||
"ranks": "ส.ต.ต.",
|
"ranks": "ส.ต.ต.",
|
||||||
"firstName": "ปิติ3",
|
"firstName": "ปิติ3",
|
||||||
"laststName": "มีดี",
|
"laststName": "มีดี",
|
||||||
"Affiliation": "ฝอ. 1",
|
"Affiliation": "ฝอ. 1",
|
||||||
"typeRoom": "ช2",
|
"typeRoom": "ช2",
|
||||||
|
"Roomconditions": "ปกติ",
|
||||||
"status": "unavailable"
|
"status": "unavailable"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 6",
|
"index": 5,
|
||||||
"dataIndex": "6",
|
"floor": 1,
|
||||||
"ranks": "ส.ต.ต.",
|
"numberRoom": 5,
|
||||||
"firstName": "ปิติ4",
|
"ranks": "",
|
||||||
"laststName": "มีดี",
|
"firstName": "",
|
||||||
"Affiliation": "ฝอ. 1",
|
"laststName": "",
|
||||||
"typeRoom": "ช3",
|
"Affiliation": "",
|
||||||
"status": "waiting"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "ห้อง 7",
|
|
||||||
"dataIndex": "7",
|
|
||||||
"ranks": "ส.ต.ต.",
|
|
||||||
"firstName": "ปิติ3",
|
|
||||||
"laststName": "มีดี",
|
|
||||||
"Affiliation": "ฝอ. 1",
|
|
||||||
"typeRoom": "ช1",
|
"typeRoom": "ช1",
|
||||||
"status": "return"
|
"Roomconditions": "ปกติ",
|
||||||
|
"status": "free"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 8",
|
"index": 6,
|
||||||
"dataIndex": "8",
|
"floor": 2,
|
||||||
|
"numberRoom": 1,
|
||||||
"ranks": "ส.ต.ต.",
|
"ranks": "ส.ต.ต.",
|
||||||
"firstName": "ปิติ9",
|
"firstName": "ปิติ9",
|
||||||
"laststName": "มีดี",
|
"laststName": "มีดี",
|
||||||
"Affiliation": "ฝอ. 1",
|
"Affiliation": "ฝอ. 1",
|
||||||
"typeRoom": "ช3",
|
"typeRoom": "ช3",
|
||||||
|
"Roomconditions": "ปกติ",
|
||||||
"status": "special"
|
"status": "special"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 9",
|
"index": 7,
|
||||||
"dataIndex": "9",
|
"floor": 2,
|
||||||
"ranks": "ส.ต.ต.",
|
"numberRoom": 2,
|
||||||
"firstName": "ปิติ5",
|
|
||||||
"laststName": "มีดี",
|
|
||||||
"Affiliation": "ฝอ. 4",
|
|
||||||
"typeRoom": "ช2",
|
|
||||||
"status": "unavailable"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "ห้อง 10",
|
|
||||||
"dataIndex": "10",
|
|
||||||
"ranks": "ส.ต.ต.",
|
"ranks": "ส.ต.ต.",
|
||||||
"firstName": "ปิติ6",
|
"firstName": "ปิติ6",
|
||||||
"laststName": "มีดี",
|
"laststName": "มีดี",
|
||||||
"Affiliation": "ฝอ. 7",
|
"Affiliation": "ฝอ. 7",
|
||||||
"typeRoom": "ช2",
|
"typeRoom": "ช2",
|
||||||
|
"Roomconditions": "ชำรุด",
|
||||||
"status": "waiting"
|
"status": "waiting"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"title": "ห้อง 11",
|
"index": 8,
|
||||||
"dataIndex": "11",
|
"floor": 2,
|
||||||
"ranks": "",
|
"numberRoom": 3,
|
||||||
"firstName": "",
|
|
||||||
"laststName": "",
|
|
||||||
"Affiliation": "",
|
|
||||||
"typeRoom": "ช1",
|
|
||||||
"status": "free"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "ห้อง 12",
|
|
||||||
"dataIndex": "12",
|
|
||||||
"ranks": "",
|
"ranks": "",
|
||||||
"firstName": "",
|
"firstName": "",
|
||||||
"laststName": "",
|
"laststName": "",
|
||||||
"Affiliation": "",
|
"Affiliation": "",
|
||||||
"typeRoom": "ช2",
|
"typeRoom": "ช2",
|
||||||
|
"Roomconditions": "ปกติ",
|
||||||
"status": "free"
|
"status": "free"
|
||||||
},
|
|
||||||
{
|
|
||||||
"title": "ห้อง 13",
|
|
||||||
"dataIndex": "13",
|
|
||||||
"ranks": "ส.ต.ต.",
|
|
||||||
"firstName": "ปิติ7",
|
|
||||||
"laststName": "มีดี",
|
|
||||||
"Affiliation": "ฝอ. 2",
|
|
||||||
"typeRoom": "ช3",
|
|
||||||
"status": "special"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -2,6 +2,10 @@
|
|||||||
const users = require('./users.json')
|
const users = require('./users.json')
|
||||||
const rooms = require('./rooms.json')
|
const rooms = require('./rooms.json')
|
||||||
const queue = require('./queue.json')
|
const queue = require('./queue.json')
|
||||||
|
const building = require('./building.json')
|
||||||
|
const Expenses = require('./Expenses.json')
|
||||||
|
const history = require('./้history.json')
|
||||||
|
const reports = require('./report.json')
|
||||||
const masterData = require('./masterData.json')
|
const masterData = require('./masterData.json')
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const app = express();
|
const app = express();
|
||||||
@ -21,6 +25,7 @@ app.get('/users', (req, res) => {
|
|||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(users)
|
res.json(users)
|
||||||
})
|
})
|
||||||
|
|
||||||
app.get('/users/:id', (req, res) => {
|
app.get('/users/:id', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(users.find(user => user.id === (req.params.id)))
|
res.json(users.find(user => user.id === (req.params.id)))
|
||||||
@ -70,34 +75,80 @@ app.delete('/users/:id', (req, res) => {
|
|||||||
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
|
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
|
||||||
})
|
})
|
||||||
|
|
||||||
app.get('/room', (req, res) => {
|
app.get('/buildings', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(users)
|
res.json(building)
|
||||||
})
|
})
|
||||||
app.get('/room/:id', (req, res) => {
|
app.get('/buildings/:name', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(users.find(user => user.id === (req.params.id)))
|
res.json(building.find(user => user.name === (req.params.name)))
|
||||||
})
|
})
|
||||||
app.post('/room', (req, res) => {
|
app.post('/buildings', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
let id = uuidv4();
|
let id = uuidv4();
|
||||||
let body = req.body
|
let body = req.body
|
||||||
let data = { id: id, ...body }
|
let data = { id: id, ...body }
|
||||||
users.push(data)
|
building.push(data)
|
||||||
fs.writeFile('./users.json', JSON.stringify(users), err => {
|
fs.writeFile('./building.json', JSON.stringify(building), err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error writing file', err)
|
console.log('Error writing file', err)
|
||||||
} else {
|
} else {
|
||||||
console.log('Successfully wrote file', users)
|
console.log('Successfully wrote file', building)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
res.json(users)
|
res.json(building)
|
||||||
})
|
})
|
||||||
app.put('/room/:id', (req, res) => {
|
|
||||||
|
app.get('/expenses', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
const updateIndex = users.findIndex(user => user.id === (req.params.id))
|
res.json(Expenses)
|
||||||
let dataOld = users[updateIndex]
|
})
|
||||||
let filterdata = users.filter(user => user.id !== (req.params.id))
|
|
||||||
|
app.post('/expenses', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
let id = uuidv4();
|
||||||
|
let body = req.body
|
||||||
|
let data = { id: id, ...body }
|
||||||
|
Expenses.push(data)
|
||||||
|
fs.writeFile('./Expenses.json', JSON.stringify(Expenses), err => {
|
||||||
|
if (err) {
|
||||||
|
console.log('Error writing file', err)
|
||||||
|
} else {
|
||||||
|
console.log('Successfully wrote file', Expenses)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
res.json(Expenses)
|
||||||
|
})
|
||||||
|
|
||||||
|
app.get('/rooms', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
res.json(rooms)
|
||||||
|
})
|
||||||
|
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)))
|
||||||
|
})
|
||||||
|
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)
|
||||||
|
fs.writeFile('./rooms.json', JSON.stringify(rooms), err => {
|
||||||
|
if (err) {
|
||||||
|
console.log('Error writing file', err)
|
||||||
|
} else {
|
||||||
|
console.log('Successfully wrote file', rooms)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
res.json(rooms)
|
||||||
|
})
|
||||||
|
app.put('/rooms/:id', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
const updateIndex = rooms.findIndex(user => user.id === (req.params.id))
|
||||||
|
let dataOld = rooms[updateIndex]
|
||||||
|
let filterdata = rooms.filter(user => user.id !== (req.params.id))
|
||||||
const parsedData = dataOld;
|
const parsedData = dataOld;
|
||||||
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
||||||
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
||||||
@ -109,7 +160,7 @@ app.put('/room/:id', (req, res) => {
|
|||||||
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
|
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
|
||||||
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
|
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
|
||||||
filterdata.push(parsedData)
|
filterdata.push(parsedData)
|
||||||
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
|
fs.writeFile('./rooms.json', JSON.stringify(filterdata, null, 2), (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log("Failed to write updated data to file");
|
console.log("Failed to write updated data to file");
|
||||||
return;
|
return;
|
||||||
@ -119,15 +170,16 @@ app.put('/room/:id', (req, res) => {
|
|||||||
res.send(`Update user id: '${req.params.id}' completed.`)
|
res.send(`Update user id: '${req.params.id}' completed.`)
|
||||||
})
|
})
|
||||||
|
|
||||||
app.get('/queue', (req, res) => {
|
app.get('/queue/:name', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(queue)
|
let list = users.filter(user => user.queue === req.params.name)
|
||||||
|
res.json(list)
|
||||||
})
|
})
|
||||||
app.get('/queue/:id', (req, res) => {
|
app.get('/queue/:id', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(queue.find(queue => queue.id === (req.params.id)))
|
res.json(queue.find(queue => queue.id === (req.params.id)))
|
||||||
})
|
})
|
||||||
app.post('/queue', (req, res) => {
|
app.put('/queue', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
let id = uuidv4();
|
let id = uuidv4();
|
||||||
let body = req.body
|
let body = req.body
|
||||||
@ -148,6 +200,7 @@ app.put('/queue/:id', (req, res) => {
|
|||||||
let dataOld = users[updateIndex]
|
let dataOld = users[updateIndex]
|
||||||
let filterdata = users.filter(user => user.id !== (req.params.id))
|
let filterdata = users.filter(user => user.id !== (req.params.id))
|
||||||
const parsedData = dataOld;
|
const parsedData = dataOld;
|
||||||
|
console.log(req.body);
|
||||||
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
||||||
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
||||||
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
|
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
|
||||||
@ -157,6 +210,9 @@ app.put('/queue/:id', (req, res) => {
|
|||||||
if (req.body.status) parsedData.status = req.body.status
|
if (req.body.status) parsedData.status = req.body.status
|
||||||
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
|
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
|
||||||
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
|
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
|
||||||
|
if (req.body.queue) parsedData.queue = req.body.queue
|
||||||
|
if (req.body.no) parsedData.no = req.body.no
|
||||||
|
if (req.body.bookNumber) parsedData.bookNumber = req.body.bookNumber
|
||||||
filterdata.push(parsedData)
|
filterdata.push(parsedData)
|
||||||
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
|
fs.writeFile('./users.json', JSON.stringify(filterdata, null, 2), (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@ -167,8 +223,61 @@ app.put('/queue/:id', (req, res) => {
|
|||||||
});
|
});
|
||||||
res.send(`Update user id: '${req.params.id}' completed.`)
|
res.send(`Update user id: '${req.params.id}' completed.`)
|
||||||
})
|
})
|
||||||
app.delete('/queue/:id', (req, res) => {
|
|
||||||
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
|
app.get('/history', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
let list = users.filter(history => history.queue === req.params.name)
|
||||||
|
res.json(list)
|
||||||
|
})
|
||||||
|
app.get('/history/:id', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
res.json(history.find(history => history.id === (req.params.id)))
|
||||||
|
})
|
||||||
|
app.post('/history', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
let id = uuidv4();
|
||||||
|
let body = req.body
|
||||||
|
let data = { id: id, ...body }
|
||||||
|
history.push(data)
|
||||||
|
fs.writeFile('./history.json', JSON.stringify(history), err => {
|
||||||
|
if (err) {
|
||||||
|
console.log('Error writing file', err)
|
||||||
|
} else {
|
||||||
|
console.log('Successfully wrote file', history)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
res.json(history)
|
||||||
|
})
|
||||||
|
app.put('/history/:id', (req, res) => {
|
||||||
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
|
const updateIndex = history.findIndex(user => user.id === (req.params.id))
|
||||||
|
let dataOld = history[updateIndex]
|
||||||
|
let filterdata = history.filter(user => user.id !== (req.params.id))
|
||||||
|
const parsedData = dataOld;
|
||||||
|
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
||||||
|
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
||||||
|
if (req.body.affiliation) parsedData.affiliation = req.body.affiliation
|
||||||
|
if (req.body.rank) parsedData.rank = req.body.rank
|
||||||
|
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.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
|
||||||
|
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
|
||||||
|
if (req.body.queue) parsedData.queue = req.body.queue
|
||||||
|
if (req.body.no) parsedData.no = req.body.no
|
||||||
|
if (req.body.bookNumber) parsedData.bookNumber = req.body.bookNumber
|
||||||
|
filterdata.push(parsedData)
|
||||||
|
fs.writeFile('./history.json', JSON.stringify(filterdata, null, 2), (err) => {
|
||||||
|
if (err) {
|
||||||
|
console.log("Failed to write updated data to file");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log("Updated file successfully");
|
||||||
|
});
|
||||||
|
res.send(`Update user id: '${req.params.id}' completed.`)
|
||||||
|
})
|
||||||
|
app.delete('/history/:id', (req, res) => {
|
||||||
|
const deletedIndex = history.findIndex(history => user.id === Number(req.params.id))
|
||||||
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
|
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -228,11 +337,11 @@ app.delete('/layout/:id', (req, res) => {
|
|||||||
|
|
||||||
app.get('/report', (req, res) => {
|
app.get('/report', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(users)
|
res.json(reports)
|
||||||
})
|
})
|
||||||
app.get('/report/:id', (req, res) => {
|
app.get('/report/:id', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.json(users.find(user => user.id === (req.params.id)))
|
res.json(reports.find(user => user.id === (req.params.id)))
|
||||||
})
|
})
|
||||||
app.post('/report', (req, res) => {
|
app.post('/report', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
@ -240,20 +349,20 @@ app.post('/report', (req, res) => {
|
|||||||
let body = req.body
|
let body = req.body
|
||||||
let data = { id: id, ...body }
|
let data = { id: id, ...body }
|
||||||
users.push(data)
|
users.push(data)
|
||||||
fs.writeFile('./users.json', JSON.stringify(users), err => {
|
fs.writeFile('./report.json', JSON.stringify(users), err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.log('Error writing file', err)
|
console.log('Error writing file', err)
|
||||||
} else {
|
} else {
|
||||||
console.log('Successfully wrote file', users)
|
console.log('Successfully wrote file', reports)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
res.json(users)
|
res.json(reports)
|
||||||
})
|
})
|
||||||
app.put('/report/:id', (req, res) => {
|
app.put('/report/:id', (req, res) => {
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
const updateIndex = users.findIndex(user => user.id === (req.params.id))
|
const updateIndex = reports.findIndex(user => user.id === (req.params.id))
|
||||||
let dataOld = users[updateIndex]
|
let dataOld = reports[updateIndex]
|
||||||
let filterdata = users.filter(user => user.id !== (req.params.id))
|
let filterdata = reports.filter(user => user.id !== (req.params.id))
|
||||||
const parsedData = dataOld;
|
const parsedData = dataOld;
|
||||||
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
if (req.body.firstName) parsedData.firstName = req.body.firstName
|
||||||
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
if (req.body.lastName) parsedData.lastName = req.body.lastName
|
||||||
@ -275,7 +384,7 @@ app.put('/report/:id', (req, res) => {
|
|||||||
res.send(`Update user id: '${req.params.id}' completed.`)
|
res.send(`Update user id: '${req.params.id}' completed.`)
|
||||||
})
|
})
|
||||||
app.delete('/report/:id', (req, res) => {
|
app.delete('/report/:id', (req, res) => {
|
||||||
const deletedIndex = users.findIndex(user => user.id === Number(req.params.id))
|
const deletedIndex = reports.findIndex(user => user.id === Number(req.params.id))
|
||||||
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
|
res.send(`Delete user '${users[deletedIndex].username}' completed.`)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61",
|
"id": "3f7e1c45-a2e9-4b08-a56d-e687ea79ba61",
|
||||||
|
"no": 1,
|
||||||
"firstName": "สมชัย14",
|
"firstName": "สมชัย14",
|
||||||
"lastName": "แสงสุข",
|
"lastName": "แสงสุข",
|
||||||
"affiliation": "ลูกจ้าง",
|
"affiliation": "ลูกจ้าง",
|
||||||
@ -9,21 +10,19 @@
|
|||||||
"phone": "0325647845",
|
"phone": "0325647845",
|
||||||
"status": "โสด",
|
"status": "โสด",
|
||||||
"typeAffiliation": "ลูกจ้าง",
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
"typeRanks": "ลูกจ้าง"
|
"typeRanks": "ลูกจ้าง",
|
||||||
},
|
"typeUser": "ตร.",
|
||||||
{
|
"bookNumber": "1234",
|
||||||
"id": "8e81c39a-d50c-42f5-85c0-f9f773c2a4aa",
|
"queue": "inqueue",
|
||||||
"firstName": "สมชัย",
|
"contract": "",
|
||||||
"lastName": "แสงสุข",
|
"checkintime": "",
|
||||||
"affiliation": "บช.ตซด.",
|
"maintenance": "",
|
||||||
"rank": "ส.ต.อ.",
|
"insurance": "",
|
||||||
"idcard": "134044411441178",
|
"installments": ""
|
||||||
"phone": "0325647845",
|
|
||||||
"typeAffiliation": "บช.ตซด.",
|
|
||||||
"typeRanks": "ประทวน"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "ebd367bf-396f-4bae-8130-1ce3fa130d38",
|
"id": "ebd367bf-396f-4bae-8130-1ce3fa130d38",
|
||||||
|
"no": 2,
|
||||||
"firstName": "สมชัย",
|
"firstName": "สมชัย",
|
||||||
"lastName": "แสงสุข",
|
"lastName": "แสงสุข",
|
||||||
"affiliation": "ลูกจ้าง",
|
"affiliation": "ลูกจ้าง",
|
||||||
@ -32,10 +31,82 @@
|
|||||||
"phone": "0325647845",
|
"phone": "0325647845",
|
||||||
"status": "โสด",
|
"status": "โสด",
|
||||||
"typeAffiliation": "ลูกจ้าง",
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
"typeRanks": "ลูกจ้าง"
|
"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",
|
"id": "fc3710ca-c3af-4781-9c8f-4aa6657ddff4",
|
||||||
|
"no": 5,
|
||||||
"firstName": "สมาน788",
|
"firstName": "สมาน788",
|
||||||
"lastName": "แสงสุข7",
|
"lastName": "แสงสุข7",
|
||||||
"affiliation": "ลูกจ้าง",
|
"affiliation": "ลูกจ้าง",
|
||||||
@ -44,10 +115,19 @@
|
|||||||
"phone": "0325647847",
|
"phone": "0325647847",
|
||||||
"status": "โสด",
|
"status": "โสด",
|
||||||
"typeAffiliation": "ลูกจ้าง",
|
"typeAffiliation": "ลูกจ้าง",
|
||||||
"typeRanks": "ลูกจ้าง"
|
"typeRanks": "ลูกจ้าง",
|
||||||
|
"typeUser": "ตร.",
|
||||||
|
"bookNumber": "14",
|
||||||
|
"queue": "none",
|
||||||
|
"contract": "",
|
||||||
|
"checkintime": "",
|
||||||
|
"maintenance": "",
|
||||||
|
"insurance": "",
|
||||||
|
"installments": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "967bf9a7-047e-4951-ba2a-190f42045715",
|
"id": "967bf9a7-047e-4951-ba2a-190f42045715",
|
||||||
|
"no": 5,
|
||||||
"firstName": "สมชัย",
|
"firstName": "สมชัย",
|
||||||
"lastName": "แสงสุข",
|
"lastName": "แสงสุข",
|
||||||
"affiliation": "ฝสสน.1",
|
"affiliation": "ฝสสน.1",
|
||||||
@ -56,6 +136,54 @@
|
|||||||
"phone": "0325647845",
|
"phone": "0325647845",
|
||||||
"status": "โสด",
|
"status": "โสด",
|
||||||
"typeAffiliation": "บก.สนน.",
|
"typeAffiliation": "บก.สนน.",
|
||||||
"typeRanks": "ประทวน"
|
"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": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
176
appserver/้history.json
Normal file
176
appserver/้history.json
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"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": ""
|
||||||
|
}
|
||||||
|
]
|
@ -4,26 +4,7 @@ import MaterialButton from "@/components/MaterialButton.vue";
|
|||||||
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
||||||
import vueMkHeader from "@/assets/img/bg.jpg";
|
import vueMkHeader from "@/assets/img/bg.jpg";
|
||||||
import masterData from "@/assets/dataJson/masterData.json";
|
import masterData from "@/assets/dataJson/masterData.json";
|
||||||
|
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 userlist = [
|
const userlist = [
|
||||||
{
|
{
|
||||||
@ -60,8 +41,6 @@ export default {
|
|||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
listRoom,
|
|
||||||
NoRoom,
|
|
||||||
userlist,
|
userlist,
|
||||||
vueMkHeader,
|
vueMkHeader,
|
||||||
masterData,
|
masterData,
|
||||||
@ -70,14 +49,6 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: { name: "Vue.js", language: "JavaScript" },
|
|
||||||
options: [
|
|
||||||
{ label: "Vue.js", value: "JavaScript" },
|
|
||||||
{ label: "Rails", value: "Ruby" },
|
|
||||||
{ label: "Sinatra", value: "Ruby" },
|
|
||||||
{ label: "Laravel", value: "PHP" },
|
|
||||||
{ label: "Phoenix", value: "Elixir" },
|
|
||||||
],
|
|
||||||
optionsBuilding: [
|
optionsBuilding: [
|
||||||
{ label: "อาคารแฟลต 1/11", value: "1" },
|
{ label: "อาคารแฟลต 1/11", value: "1" },
|
||||||
{ label: "อาคารแฟลต 1/12", value: "2" },
|
{ label: "อาคารแฟลต 1/12", value: "2" },
|
||||||
@ -107,6 +78,26 @@ export default {
|
|||||||
{ label: "ห้อง 404", value: "4" },
|
{ label: "ห้อง 404", value: "4" },
|
||||||
{ label: "ห้อง 505", value: "5" },
|
{ label: "ห้อง 505", value: "5" },
|
||||||
],
|
],
|
||||||
|
optionYear: [
|
||||||
|
{ label: "2023", value: "2023" },
|
||||||
|
{ label: "2022", value: "2022" },
|
||||||
|
{ label: "2021", value: "2021" },
|
||||||
|
{ label: "2020", value: "2020" },
|
||||||
|
],
|
||||||
|
optionMonth: [
|
||||||
|
{ label: "มกราคม", value: "มกราคม" },
|
||||||
|
{ label: "กุมภาพันธ์", value: "กุมภาพันธ์" },
|
||||||
|
{ label: "มีนาคม", value: "มีนาคม" },
|
||||||
|
{ label: "เมษายน", value: "เมษายน" },
|
||||||
|
{ label: "พฤษภาคม", value: "พฤษภาคม" },
|
||||||
|
{ label: "มิถุนายน", value: "มิถุนายน" },
|
||||||
|
{ label: "กรกฎาคม", value: "กรกฎาคม" },
|
||||||
|
{ label: "สิงหาคม", value: "สิงหาคม" },
|
||||||
|
{ label: "กันยายน", value: "กันยายน" },
|
||||||
|
{ label: "ตุลาคม", value: "ตุลาคม" },
|
||||||
|
{ label: "พฤศจิกายน", value: "พฤศจิกายน" },
|
||||||
|
{ label: "ธันวาคม", value: "ธันวาคม" },
|
||||||
|
],
|
||||||
selectedBuilding: "อาคารแฟลต 1/11",
|
selectedBuilding: "อาคารแฟลต 1/11",
|
||||||
selectedFloor: "ชั้น 1",
|
selectedFloor: "ชั้น 1",
|
||||||
selectedRoom: "ห้อง 101",
|
selectedRoom: "ห้อง 101",
|
||||||
@ -120,10 +111,17 @@ export default {
|
|||||||
selectedRanks: "ส.ต.ต.",
|
selectedRanks: "ส.ต.ต.",
|
||||||
selectedAffiliation: "ฝอ.2",
|
selectedAffiliation: "ฝอ.2",
|
||||||
birthday: "14/07/2534",
|
birthday: "14/07/2534",
|
||||||
|
typeContract: "หักได้",
|
||||||
|
sumCost: 10000,
|
||||||
|
expensesList: [],
|
||||||
|
searchName: "",
|
||||||
|
selectedMonth: "พฤศจิกายน"
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
console.log(this.masterData);
|
// console.log(this.masterData);
|
||||||
|
this.getBuildings();
|
||||||
|
this.getExpenses();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedColor: function (newValue) {
|
selectedColor: function (newValue) {
|
||||||
@ -131,25 +129,87 @@ export default {
|
|||||||
console.log(newValue);
|
console.log(newValue);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
expensesList() {
|
||||||
|
return this.expensesList.filter((item) =>
|
||||||
|
item.roomnumber.includes(this.searchName)
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changedLabel(event) {
|
changedLabel(event) {
|
||||||
console.log(event);
|
console.log(event);
|
||||||
// this.selected = event;
|
// this.selected = event;
|
||||||
},
|
},
|
||||||
|
typeContractchange(e) {
|
||||||
|
this.typeContract = e.target.value;
|
||||||
|
},
|
||||||
|
async getExpenses() {
|
||||||
|
try {
|
||||||
|
await axios
|
||||||
|
.get("http://localhost:3001/expenses")
|
||||||
|
.then((res) => {
|
||||||
|
this.expensesList = res.data;
|
||||||
|
// console.log(res.data);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getBuildings() {
|
||||||
|
try {
|
||||||
|
await axios
|
||||||
|
.get("http://localhost:3001/buildings")
|
||||||
|
.then((res) => {
|
||||||
|
// this.buildingList = res.data;
|
||||||
|
// console.log(res.data);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getRooms() {
|
||||||
|
try {
|
||||||
|
await axios
|
||||||
|
.get("http://localhost:3001/rooms")
|
||||||
|
.then((res) => {
|
||||||
|
// this.buildingList = res.data;
|
||||||
|
console.log(res.data);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
let body = {
|
let body = {
|
||||||
firstName: this.firstName,
|
firstName: this.firstName,
|
||||||
lastName: this.lastName,
|
lastName: this.lastName,
|
||||||
Affiliation: this.Affiliation,
|
building: this.selectedBuilding.label,
|
||||||
rank: this.rank,
|
floor: this.selectedFloor.label,
|
||||||
idcard: this.idcard,
|
roomnumber: this.selectedRoom.label,
|
||||||
phone: this.phone,
|
insurancecost: this.Insurancecost,
|
||||||
|
installments: this.installments,
|
||||||
|
waterbill: this.Waterbill,
|
||||||
|
electricitybill: this.Electricitybill,
|
||||||
|
central: this.Central,
|
||||||
|
costs: this.Costs,
|
||||||
|
typeContract: this.typeContract,
|
||||||
|
contract: this.contract,
|
||||||
|
sumCost: this.sumCost,
|
||||||
};
|
};
|
||||||
// let b = []
|
// let b = []
|
||||||
// b.push(body)
|
// b.push(body)
|
||||||
this.userlist.push(body);
|
// this.userlist.push(body);
|
||||||
console.log(this.userlist);
|
console.log(body);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -182,13 +242,27 @@ export default {
|
|||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="d-flex justify-content-end align-items-baseline">
|
||||||
|
<div class="mb-3 w-15" style="margin-right: 20px">
|
||||||
|
<label>เดือน</label>
|
||||||
|
<v-select :options="optionMonth" v-model="selectedMonth"></v-select>
|
||||||
|
</div>
|
||||||
|
</div> -->
|
||||||
<div class="d-flex justify-content-end align-items-baseline">
|
<div class="d-flex justify-content-end align-items-baseline">
|
||||||
|
<div class="mb-3 w-15" style="margin-right: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;">
|
||||||
|
<label style="margin-right: 5px;">เดือน</label>
|
||||||
|
<v-select :options="optionMonth" v-model="selectedMonth"></v-select>
|
||||||
|
</div>
|
||||||
<label style="margin-right: 10px">ค้นหาเลขที่ห้อง </label>
|
<label style="margin-right: 10px">ค้นหาเลขที่ห้อง </label>
|
||||||
<MaterialInput
|
<MaterialInput
|
||||||
class="input-group-dynamic w-30"
|
class="input-group-dynamic w-30"
|
||||||
icon="search"
|
icon="search"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
|
:value="searchName"
|
||||||
|
@input="(event) => (searchName = event.target.value)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center pt-4 table-responsive">
|
<div class="text-center pt-4 table-responsive">
|
||||||
@ -216,24 +290,24 @@ export default {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr v-for="(item, index) in expensesList" :key="index">
|
||||||
<th scope="row">1</th>
|
<th scope="row">{{ index + 1 }}</th>
|
||||||
<td>ส.ต.ต.โชคดี มีชัย</td>
|
<td>{{ item?.rank }} {{ item?.firstName }} {{ item?.lastName }}</td>
|
||||||
<td>อาคารแฟลต 1/11</td>
|
<td>{{ item?.building }}</td>
|
||||||
<td>2</td>
|
<td>{{ item?.floor }}</td>
|
||||||
<td>202</td>
|
<td>{{ item?.roomnumber }}</td>
|
||||||
<td>201</td>
|
<td>{{ item?.installments }}</td>
|
||||||
<td>205</td>
|
<td>{{ item?.insurancecost }}</td>
|
||||||
<td>4</td>
|
<td>{{ item?.sumCost }}</td>
|
||||||
<td>8,000</td>
|
<td>{{ item?.waterbill }}</td>
|
||||||
<td>20,000</td>
|
<td>{{ item?.electricitybill }}</td>
|
||||||
<td>8,000</td>
|
<td>{{ item?.central }}</td>
|
||||||
<td>20,000</td>
|
<td>{{ item?.costs }}</td>
|
||||||
<td>10,000</td>
|
<td>{{ item?.roomnumber }}</td>
|
||||||
<td>5/10</td>
|
<td>{{ item?.typeContract }}</td>
|
||||||
<td>/</td>
|
<td>{{ item?.typeContract }}</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>5555</td>
|
<td>{{ item?.contract }}</td>
|
||||||
<td>
|
<td>
|
||||||
<MaterialButton
|
<MaterialButton
|
||||||
style="margin-bottom: 0px"
|
style="margin-bottom: 0px"
|
||||||
@ -358,11 +432,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="mb-3"
|
class="mb-3"
|
||||||
style="
|
style="display: flex; justify-content: flex-start; align-items: center"
|
||||||
display: flex;
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
<input
|
<input
|
||||||
@ -370,7 +440,8 @@ export default {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="inlineRadioOptions"
|
name="inlineRadioOptions"
|
||||||
id="inlineRadio1"
|
id="inlineRadio1"
|
||||||
value="option1"
|
value="หักได้"
|
||||||
|
@change="typeContractchange($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio1">หักได้</label>
|
<label class="form-check-label" for="inlineRadio1">หักได้</label>
|
||||||
</div>
|
</div>
|
||||||
@ -380,11 +451,11 @@ export default {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="inlineRadioOptions"
|
name="inlineRadioOptions"
|
||||||
id="inlineRadio2"
|
id="inlineRadio2"
|
||||||
value="option2"
|
value="หักไม่ได้"
|
||||||
|
@change="typeContractchange($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio2">หักไม่ได้</label>
|
<label class="form-check-label" for="inlineRadio2">หักไม่ได้</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px">
|
||||||
<MaterialInput
|
<MaterialInput
|
||||||
@ -504,7 +575,7 @@ export default {
|
|||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.bg-green {
|
.bg-green {
|
||||||
border: 2px solid #4CBB17 !important;
|
border: 2px solid #4cbb17 !important;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.bg-red {
|
.bg-red {
|
||||||
|
@ -21,13 +21,6 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: { name: "Vue.js", language: "JavaScript" },
|
|
||||||
options: [
|
|
||||||
{ label: "มานพ", value: "มานพ" },
|
|
||||||
{ label: "วิชัย", value: "วิชัย" },
|
|
||||||
{ label: "ธนาพร", value: "ธนาพร" },
|
|
||||||
{ label: "มนตรี", value: "มนตรี" },
|
|
||||||
],
|
|
||||||
selectedUser: "",
|
selectedUser: "",
|
||||||
firstName: "",
|
firstName: "",
|
||||||
lastName: "",
|
lastName: "",
|
||||||
@ -38,19 +31,29 @@ export default {
|
|||||||
bookNumber: "",
|
bookNumber: "",
|
||||||
queueList: [],
|
queueList: [],
|
||||||
userList: [],
|
userList: [],
|
||||||
userByid: {}
|
userByid: {},
|
||||||
|
searchName: "",
|
||||||
|
typeUserByqueue: "โสด",
|
||||||
|
olddatatypeQueue: [],
|
||||||
|
datatypeQueue: [],
|
||||||
|
no: 0,
|
||||||
|
userId: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// console.log(this.masterData);
|
|
||||||
this.getAllqueue();
|
this.getAllqueue();
|
||||||
this.getAllusers()
|
// this.getAllusers();
|
||||||
|
this.getAllNoqueue();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedUser: function (newValue) {
|
selectedUser: function (newValue) {
|
||||||
// this.updateColor(newValue)
|
|
||||||
console.log(newValue.value);
|
console.log(newValue.value);
|
||||||
this.getAllusersByid(newValue.value)
|
this.getAllusersByid(newValue.value);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
queueList() {
|
||||||
|
return this.queueList.filter((item) => item.firstName.includes(this.searchName));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -59,13 +62,28 @@ export default {
|
|||||||
// this.selected = event;
|
// this.selected = event;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
queuefilter(e) {
|
||||||
|
if (e.target) this.typeUserByqueue = e.target.value;
|
||||||
|
else this.typeUserByqueue = e;
|
||||||
|
this.datatypeQueue = this.olddatatypeQueue;
|
||||||
|
if(this.typeUserByqueue !== 'ทั้งหมด'){
|
||||||
|
let dataqueue = this.datatypeQueue.filter((e) => e.status == this.typeUserByqueue);
|
||||||
|
this.queueList = dataqueue;
|
||||||
|
}else if (this.typeUserByqueue == 'ทั้งหมด'){
|
||||||
|
this.queueList = this.datatypeQueue;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
getAllqueue() {
|
getAllqueue() {
|
||||||
try {
|
try {
|
||||||
axios
|
axios
|
||||||
.get("http://localhost:3001/queue")
|
.get(`http://localhost:3001/queue/inqueue`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.queueList = res.data;
|
this.queueList = res.data;
|
||||||
console.log(this.queueList);
|
this.olddatatypeQueue = this.queueList;
|
||||||
|
console.log(res.data);
|
||||||
|
this.no = this.queueList.length+1
|
||||||
|
this.queuefilter("โสด");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err.response);
|
||||||
@ -76,13 +94,33 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getAllusersByid(id) {
|
getAllusersByid(id) {
|
||||||
|
this.userId = id
|
||||||
try {
|
try {
|
||||||
axios
|
axios
|
||||||
.get(`http://localhost:3001/users/${id}`)
|
.get(`http://localhost:3001/users/${id}`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data =res.data
|
let data = res.data;
|
||||||
this.userByid = data
|
this.userByid = data;
|
||||||
// console.log(this.userByid)
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err.response);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getAllNoqueue() {
|
||||||
|
try {
|
||||||
|
axios
|
||||||
|
.get(`http://localhost:3001/queue/none`)
|
||||||
|
.then((res) => {
|
||||||
|
this.userList = res.data.map((ele) => {
|
||||||
|
return {
|
||||||
|
label: ele.rank + " " + ele.firstName + " " + ele.lastName,
|
||||||
|
value: ele.id,
|
||||||
|
};
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err.response);
|
||||||
@ -97,15 +135,15 @@ export default {
|
|||||||
axios
|
axios
|
||||||
.get("http://localhost:3001/users")
|
.get("http://localhost:3001/users")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.userList = res.data.map(ele =>{
|
this.userList = res.data.map((ele) => {
|
||||||
return {
|
return {
|
||||||
label: ele.rank + " " + ele.firstName + " " + ele.lastName,
|
label: ele.rank + " " + ele.firstName + " " + ele.lastName,
|
||||||
value: ele.id,
|
value: ele.id,
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -113,20 +151,15 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
// firstName: this.firstName,
|
|
||||||
// lastName: this.lastName,
|
|
||||||
// Affiliation: this.Affiliation,
|
|
||||||
// rank: this.rank,
|
|
||||||
// idcard: this.idcard,
|
|
||||||
// phone: this.phone,
|
|
||||||
let body = {
|
let body = {
|
||||||
...this.userByid,
|
...this.userByid,
|
||||||
bookNumber: this.bookNumber
|
no: this.no,
|
||||||
|
bookNumber: this.bookNumber,
|
||||||
|
queue: 'inqueue'
|
||||||
};
|
};
|
||||||
delete body.id
|
delete body.id;
|
||||||
console.log(body);
|
|
||||||
axios
|
axios
|
||||||
.post(`http://localhost:3001/queue`, body, {
|
.put(`http://localhost:3001/queue/${this.userId}`, body, {
|
||||||
headers: {
|
headers: {
|
||||||
// remove headers
|
// remove headers
|
||||||
"Access-Control-Allow-Origin": "*",
|
"Access-Control-Allow-Origin": "*",
|
||||||
@ -137,12 +170,8 @@ export default {
|
|||||||
this.getAllqueue();
|
this.getAllqueue();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err);
|
||||||
});
|
});
|
||||||
// let b = []
|
|
||||||
// b.push(body)
|
|
||||||
// this.userlist.push(body);
|
|
||||||
// console.log(this.userlist);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -174,6 +203,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-between align-items-baseline">
|
<div class="d-flex justify-content-between align-items-baseline">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
<label style="margin-right: 20px">สถานภาพ</label>
|
<label style="margin-right: 20px">สถานภาพ</label>
|
||||||
<input
|
<input
|
||||||
@ -182,6 +212,7 @@ export default {
|
|||||||
name="inlineRadioOptions"
|
name="inlineRadioOptions"
|
||||||
id="inlineRadio1"
|
id="inlineRadio1"
|
||||||
value="โสด"
|
value="โสด"
|
||||||
|
@change="queuefilter($event)"
|
||||||
checked
|
checked
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio1">โสด</label>
|
<label class="form-check-label" for="inlineRadio1">โสด</label>
|
||||||
@ -193,9 +224,21 @@ export default {
|
|||||||
name="inlineRadioOptions"
|
name="inlineRadioOptions"
|
||||||
id="inlineRadio2"
|
id="inlineRadio2"
|
||||||
value="สมรส"
|
value="สมรส"
|
||||||
|
@change="queuefilter($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio2">สมรส</label>
|
<label class="form-check-label" for="inlineRadio2">สมรส</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="radio"
|
||||||
|
name="inlineRadioOptions"
|
||||||
|
id="inlineRadio3"
|
||||||
|
value="ทั้งหมด"
|
||||||
|
@change="queuefilter($event)"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="inlineRadio3">ทั้งหมด</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex align-items-baseline">
|
<div class="d-flex align-items-baseline">
|
||||||
<label style="margin-right: 20px">ค้นหาชื่อ </label>
|
<label style="margin-right: 20px">ค้นหาชื่อ </label>
|
||||||
@ -205,6 +248,8 @@ export default {
|
|||||||
icon="search"
|
icon="search"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
|
:value="searchName"
|
||||||
|
@input="(event) => (searchName = event.target.value)"
|
||||||
/>
|
/>
|
||||||
<MaterialButton
|
<MaterialButton
|
||||||
variant="gradient"
|
variant="gradient"
|
||||||
@ -231,7 +276,7 @@ export default {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in queueList" :key="index">
|
<tr v-for="(item, index) in queueList" :key="index">
|
||||||
<th scope="row">{{ index + 1 }}</th>
|
<th scope="row">{{ item?.no }}</th>
|
||||||
<td>{{ item?.rank }} {{ item?.firstName }} {{ item?.lastName }}</td>
|
<td>{{ item?.rank }} {{ item?.firstName }} {{ item?.lastName }}</td>
|
||||||
<td>{{ item?.affiliation }}</td>
|
<td>{{ item?.affiliation }}</td>
|
||||||
<td>{{ item?.status }}</td>
|
<td>{{ item?.status }}</td>
|
||||||
@ -285,8 +330,11 @@ export default {
|
|||||||
<div class="row g-0" v-if="selectedUser !== ''">
|
<div class="row g-0" v-if="selectedUser !== ''">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h5 class="card-title ">รายละเอียดผู้เช่า</h5>
|
<h5 class="card-title">รายละเอียด</h5>
|
||||||
<p class="card-text pt-1">ชือ-สกุล : {{ userByid?.rank }} {{ userByid?.firstName }} {{ userByid?.lastName }}</p>
|
<p class="card-text pt-1">
|
||||||
|
ชือ-สกุล : {{ userByid?.rank }} {{ userByid?.firstName }}
|
||||||
|
{{ userByid?.lastName }}
|
||||||
|
</p>
|
||||||
<p class="card-text">สังกัด : {{ userByid?.affiliation }}</p>
|
<p class="card-text">สังกัด : {{ userByid?.affiliation }}</p>
|
||||||
<p class="card-text">เลขบัตรประชาชน : {{ userByid?.idcard }}</p>
|
<p class="card-text">เลขบัตรประชาชน : {{ userByid?.idcard }}</p>
|
||||||
<p class="card-text">สถานภาพ : {{ userByid?.status }}</p>
|
<p class="card-text">สถานภาพ : {{ userByid?.status }}</p>
|
||||||
@ -316,7 +364,7 @@ export default {
|
|||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.bg-green {
|
.bg-green {
|
||||||
border: 2px solid #4CBB17 !important;
|
border: 2px solid #4cbb17 !important;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.bg-red {
|
.bg-red {
|
||||||
|
@ -195,21 +195,6 @@ export default {
|
|||||||
บันทึกค่าใช้จ่ายบ้านพัก บช.ตชด.
|
บันทึกค่าใช้จ่ายบ้านพัก บช.ตชด.
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
|
||||||
<button
|
|
||||||
class="nav-link"
|
|
||||||
style="color: #57b05b"
|
|
||||||
id="contact-tab"
|
|
||||||
data-bs-toggle="tab"
|
|
||||||
data-bs-target="#contact"
|
|
||||||
type="button"
|
|
||||||
role="tab"
|
|
||||||
aria-controls="contact"
|
|
||||||
aria-selected="false"
|
|
||||||
>
|
|
||||||
สรุปรายงานค่าใช้จ่าย
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content" id="myTabContent">
|
<div class="tab-content" id="myTabContent">
|
||||||
<div
|
<div
|
||||||
@ -261,13 +246,13 @@ export default {
|
|||||||
v-model="selectedMonth"
|
v-model="selectedMonth"
|
||||||
></v-select>
|
></v-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3 w-10 " style="margin-right: 5px">
|
<!-- <div class="mb-3 w-10 " style="margin-right: 5px">
|
||||||
<label>พ.ศ.</label>
|
<label>พ.ศ.</label>
|
||||||
<v-select
|
<v-select
|
||||||
:options="optionYear"
|
:options="optionYear"
|
||||||
v-model="selectedYear"
|
v-model="selectedYear"
|
||||||
></v-select>
|
></v-select>
|
||||||
</div>
|
</div> -->
|
||||||
<div class="mb-3 w-15 ">
|
<div class="mb-3 w-15 ">
|
||||||
<label>สังกัด</label>
|
<label>สังกัด</label>
|
||||||
<v-select
|
<v-select
|
||||||
|
@ -5,6 +5,8 @@ import vueMkHeader from "@/assets/img/bg.jpg";
|
|||||||
import MaterialInput from "@/components/MaterialInput.vue";
|
import MaterialInput from "@/components/MaterialInput.vue";
|
||||||
import MaterialButton from "@/components/MaterialButton.vue";
|
import MaterialButton from "@/components/MaterialButton.vue";
|
||||||
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
const userlist = [
|
const userlist = [
|
||||||
{
|
{
|
||||||
dataIndex: "1",
|
dataIndex: "1",
|
||||||
@ -70,14 +72,20 @@ export default {
|
|||||||
old: "",
|
old: "",
|
||||||
birthday: "",
|
birthday: "",
|
||||||
installments: "",
|
installments: "",
|
||||||
booknumber:""
|
booknumber: "",
|
||||||
|
typeroom: "",
|
||||||
|
data: "",
|
||||||
|
queueList: [],
|
||||||
|
queuefilter: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.mode = this.$route.query.mode;
|
this.mode = this.$route.query.mode;
|
||||||
if (this.$route.params.id) {
|
if (this.$route.params.id) {
|
||||||
this.id = this.$route.params.id;
|
this.id = this.$route.params.id;
|
||||||
|
this.getroomByid(this.id);
|
||||||
}
|
}
|
||||||
|
this.getAllqueue();
|
||||||
// this.$route.query
|
// this.$route.query
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -88,6 +96,134 @@ export default {
|
|||||||
// this.$router.push({ path: `/addUserRoom` , query: { mode: this.mode } });
|
// this.$router.push({ path: `/addUserRoom` , query: { mode: this.mode } });
|
||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
|
getAllqueue() {
|
||||||
|
try {
|
||||||
|
axios
|
||||||
|
.get(`http://localhost:3001/queue/inqueue`)
|
||||||
|
.then((res) => {
|
||||||
|
this.queueList = res.data;
|
||||||
|
this.queuefilter = this.queueList.filter((e) => e.status === this.typeroom);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err.response);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getroomByid(id) {
|
||||||
|
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 = "ทั่วไป";
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
getAllusersByid(id) {
|
||||||
|
this.userId = id;
|
||||||
|
try {
|
||||||
|
axios
|
||||||
|
.get(`http://localhost:3001/users/${id}`)
|
||||||
|
.then((res) => {
|
||||||
|
let data = res.data;
|
||||||
|
this.userByid = data;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err.response);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async submitForm() {
|
||||||
|
let body = {
|
||||||
|
...this.userByid,
|
||||||
|
queue: "inroom",
|
||||||
|
contract: this.contract,
|
||||||
|
checkintime: this.Checkintime,
|
||||||
|
maintenance: this.Maintenance,
|
||||||
|
insurance: this.insurance,
|
||||||
|
installments: this.installments,
|
||||||
|
};
|
||||||
|
console.log(body);
|
||||||
|
await axios
|
||||||
|
.post(`http://localhost:3001/history`, body, {
|
||||||
|
headers: {
|
||||||
|
// remove headers
|
||||||
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.submitForm2()
|
||||||
|
this.submitForm3()
|
||||||
|
this.getAllqueue();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async submitForm2() {
|
||||||
|
let body = {
|
||||||
|
...this.userByid,
|
||||||
|
queue: "inroom",
|
||||||
|
contract: this.contract,
|
||||||
|
checkintime: this.Checkintime,
|
||||||
|
maintenance: this.Maintenance,
|
||||||
|
insurance: this.insurance,
|
||||||
|
installments: this.installments,
|
||||||
|
};
|
||||||
|
|
||||||
|
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() {
|
||||||
|
let body = {
|
||||||
|
...this.userByid,
|
||||||
|
queue: "inroom",
|
||||||
|
contract: this.contract,
|
||||||
|
checkintime: this.Checkintime,
|
||||||
|
maintenance: this.Maintenance,
|
||||||
|
insurance: this.insurance,
|
||||||
|
installments: this.installments,
|
||||||
|
};
|
||||||
|
|
||||||
|
await axios
|
||||||
|
.put(`http://localhost:3001/queue/${this.id}`, body, {
|
||||||
|
headers: {
|
||||||
|
// remove headers
|
||||||
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.getAllqueue();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@ -122,7 +258,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
<!-- d-flex justify-content-between -->
|
<!-- d-flex justify-content-between -->
|
||||||
<div class="d-flex justify-content-between align-items-baseline">
|
<div class="d-flex justify-content-between align-items-baseline">
|
||||||
<h4>รายละเอียดห้องพัก 101</h4>
|
<h4>รายละเอียดห้องพัก {{ data?.numberRoom }}</h4>
|
||||||
<div>
|
<div>
|
||||||
<MaterialButton variant="gradient" color="success" @click="gotoAction()"
|
<MaterialButton variant="gradient" color="success" @click="gotoAction()"
|
||||||
>จัดการห้องพัก</MaterialButton
|
>จัดการห้องพัก</MaterialButton
|
||||||
@ -157,20 +293,11 @@ export default {
|
|||||||
<div class="row" v-if="this.mode !== 'special'">
|
<div class="row" v-if="this.mode !== 'special'">
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
<h5 class="card-title pt-2">รายละเอียดห้องพัก</h5>
|
<h5 class="card-title pt-2">รายละเอียดห้องพัก</h5>
|
||||||
<p class="card-text">ประเภทห้องพัก : ช๓</p>
|
<p class="card-text">ประเภทห้องพัก : {{ data?.typeRoom }}</p>
|
||||||
<!-- <p class="card-text">มิเตอร์น้ำ/ไฟ : 745/546</p> -->
|
<!-- <p class="card-text">มิเตอร์น้ำ/ไฟ : 745/546</p> -->
|
||||||
<p class="card-text">สภาพห้อง : ปกติ</p>
|
<p class="card-text">สภาพห้อง : {{ data?.Roomconditions }}</p>
|
||||||
</div>
|
|
||||||
<div class="col-5">
|
|
||||||
<h5 class="card-title pt-2"></h5>
|
|
||||||
<p class="card-text">เลขที่เริ่มใช้ : 3012</p>
|
|
||||||
<p class="card-text">เดื่อนที่เริ่มใช้ : มกราคม</p>
|
|
||||||
<p class="card-text">ปีที่เริ่มใช้ : 2565</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <p class="card-text">
|
|
||||||
<small class="text-muted">Last updated 3 mins ago</small>
|
|
||||||
</p> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -190,8 +317,8 @@ export default {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in userlist" :key="index">
|
<tr v-for="(item, index) in queuefilter" :key="index">
|
||||||
<th scope="row">{{ index + 1 }}</th>
|
<th scope="row">{{ item.no }}</th>
|
||||||
<td>
|
<td>
|
||||||
{{ item.rank }} {{ item.firstName }} {{ item.lastName }}
|
{{ item.rank }} {{ item.firstName }} {{ item.lastName }}
|
||||||
</td>
|
</td>
|
||||||
@ -205,6 +332,7 @@ export default {
|
|||||||
color="success"
|
color="success"
|
||||||
data-bs-toggle="modal"
|
data-bs-toggle="modal"
|
||||||
data-bs-target="#contractBackdrop"
|
data-bs-target="#contractBackdrop"
|
||||||
|
@click="getAllusersByid(item.id)"
|
||||||
>เพิ่มผู้เช่าห้องพัก</MaterialButton
|
>เพิ่มผู้เช่าห้องพัก</MaterialButton
|
||||||
>
|
>
|
||||||
</td>
|
</td>
|
||||||
@ -293,7 +421,6 @@ export default {
|
|||||||
placeholder="จำนวนงวดเงินค่าประกัน"
|
placeholder="จำนวนงวดเงินค่าประกัน"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
@ -305,6 +432,7 @@ export default {
|
|||||||
color="success"
|
color="success"
|
||||||
@click="submitForm"
|
@click="submitForm"
|
||||||
html-type="submit"
|
html-type="submit"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
>บันทึก</MaterialButton
|
>บันทึก</MaterialButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@ -478,13 +606,11 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.bg-green {
|
.bg-green {
|
||||||
border: 2px solid #4CBB17 !important;
|
border: 2px solid #4cbb17 !important;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.bg-red {
|
.bg-red {
|
||||||
|
@ -4,12 +4,10 @@ import MaterialButton from "@/components/MaterialButton.vue";
|
|||||||
import MaterialCheckbox from "@/components/MaterialCheckbox.vue";
|
import MaterialCheckbox from "@/components/MaterialCheckbox.vue";
|
||||||
import vueMkHeader from "@/assets/img/bg.jpg";
|
import vueMkHeader from "@/assets/img/bg.jpg";
|
||||||
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
||||||
import roomData from "@/assets/dataJson/rooms.json";
|
// import roomData from "@/assets/dataJson/rooms.json";
|
||||||
// import posts from "../posts.json";
|
// import posts from "../posts.json";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
const NoRoom = [{ title: "ชั้น 1" }, { title: "ชั้น 2" }, { title: "ชั้น 3" }];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
MaterialInput,
|
MaterialInput,
|
||||||
@ -21,20 +19,12 @@ export default {
|
|||||||
return {
|
return {
|
||||||
NoRoom,
|
NoRoom,
|
||||||
vueMkHeader,
|
vueMkHeader,
|
||||||
roomData,
|
// roomData,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: { name: "Vue.js", language: "JavaScript" },
|
|
||||||
options: [
|
|
||||||
{ label: "Vue.js", value: "JavaScript" },
|
|
||||||
{ label: "Rails", value: "Ruby" },
|
|
||||||
{ label: "Sinatra", value: "Ruby" },
|
|
||||||
{ label: "Laravel", value: "PHP" },
|
|
||||||
{ label: "Phoenix", value: "Elixir" },
|
|
||||||
],
|
|
||||||
typeRoom: [
|
typeRoom: [
|
||||||
{ label: "ทั้งหมด", value: "ทั้งหมด" },
|
{ label: "ทั้งหมด", value: "ทั้งหมด" },
|
||||||
{ label: "ช1", value: "ช1" },
|
{ label: "ช1", value: "ช1" },
|
||||||
@ -42,39 +32,34 @@ export default {
|
|||||||
{ label: "ช3", value: "ช3" },
|
{ label: "ช3", value: "ช3" },
|
||||||
],
|
],
|
||||||
|
|
||||||
listRoom: [
|
listRoom: [],
|
||||||
{ label: "อาคารแฟลต 1/11", value: "1" },
|
|
||||||
{ label: "อาคารแฟลต 1/12", value: "2" },
|
|
||||||
{ label: "อาคารแฟลต 1/13", value: "3" },
|
|
||||||
{ label: "อาคารแฟลต 1/14", value: "4" },
|
|
||||||
{ label: "อาคารแฟลต 1/15", value: "5" },
|
|
||||||
{ label: "อาคารแฟลต 1/16", value: "3" },
|
|
||||||
{ label: "อาคารแฟลต 1/17", value: "4" },
|
|
||||||
{ label: "อาคารแฟลต 1/18", value: "5" },
|
|
||||||
{ label: "แฟลตลือชา 1", value: "5" },
|
|
||||||
{ label: "แฟลตลือชา 2", value: "3" },
|
|
||||||
{ label: "แฟลตลือชา 3", value: "4" },
|
|
||||||
{ label: "แฟลตบางเขน 1", value: "5" },
|
|
||||||
{ label: "แฟลตบางเขน 2", value: "5" },
|
|
||||||
],
|
|
||||||
selectedtypeRoom: "ช1",
|
selectedtypeRoom: "ช1",
|
||||||
selectedColor: "",
|
selectedColor: "",
|
||||||
statusfree: false,
|
statusfree: false,
|
||||||
statusreturn: false,
|
statusreturn: false,
|
||||||
statuseunavailable: false,
|
statuseunavailable: false,
|
||||||
statusewaiting: false,
|
statusewaiting: false,
|
||||||
selectedlistRoom: "อาคารแฟลต 1/11 ",
|
selectedlistRoom: { label: "อาคารแฟลต 1/11", value: "อาคารแฟลต 1/11" },
|
||||||
|
committee: "",
|
||||||
selectedStatus: "",
|
selectedStatus: "",
|
||||||
|
selectedReturn: "",
|
||||||
|
selectedUnavailable: "",
|
||||||
|
selectedWaiting: "",
|
||||||
|
selectedScaple: "",
|
||||||
|
roomData: [],
|
||||||
|
buildingList: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.$route.query
|
// this.$route.query
|
||||||
try {
|
try {
|
||||||
axios.get(`http://localhost:3001/users/`).then((res) => console.log(res.data));
|
axios.get(`http://localhost:3001/users/`).then();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
this.oldData = this.roomData;
|
|
||||||
|
this.getRooms();
|
||||||
|
this.getBuildings();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedtypeRoom: function (newValue) {
|
selectedtypeRoom: function (newValue) {
|
||||||
@ -90,20 +75,26 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedStatus: function (newValue) {
|
|
||||||
console.log(newValue);
|
// selectedtypeRoom: async function (newValue) {
|
||||||
this.roomData = this.oldData;
|
// // this.dataBuilding["listRoom"] = [];
|
||||||
|
// let buildingList = [];
|
||||||
|
// buildingList = this.oldData
|
||||||
|
// let datalist = []
|
||||||
// if (newValue !== null) {
|
// if (newValue !== null) {
|
||||||
// if (newValue.value !== "ทั้งหมด") {
|
// if (newValue.value !== "ทั้งหมด") {
|
||||||
// const typeRoom = this.roomData.filter(
|
// datalist = buildingList["listRoom"].map((ele, i) => {
|
||||||
// (tagreturn) => tagreturn.typeRoom === newValue.value
|
// ele.rooms = ele.rooms.filter((c) => c.typeRoom == newValue.value);
|
||||||
// );
|
// return ele; // return ele;
|
||||||
// this.roomData = typeRoom;
|
// });
|
||||||
|
|
||||||
|
// this.dataBuilding["listRoom"] = datalist;
|
||||||
|
// console.log(this.dataBuilding);
|
||||||
// } else {
|
// } else {
|
||||||
// this.roomData = this.oldData;
|
// // this.roomData = this.oldData;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
},
|
// },
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
gotodetail(id, index) {
|
gotodetail(id, index) {
|
||||||
@ -115,13 +106,93 @@ export default {
|
|||||||
if (index == "return") action = "return";
|
if (index == "return") action = "return";
|
||||||
this.$router.push({ path: `/room/detail/${id}`, query: { mode: action } });
|
this.$router.push({ path: `/room/detail/${id}`, query: { mode: action } });
|
||||||
},
|
},
|
||||||
onChangeEvent(e, event) {
|
|
||||||
|
async roomType() {
|
||||||
|
this.dataBuilding["listRoom"] = [];
|
||||||
|
let buildingList = [];
|
||||||
|
let datalist = await axios.get(`http://localhost:3001/buildings/`);
|
||||||
|
buildingList = await datalist.data.find(
|
||||||
|
(el) => el.name == this.selectedlistRoom.value
|
||||||
|
);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getRooms() {
|
||||||
|
try {
|
||||||
|
await axios
|
||||||
|
.get("http://localhost:3001/rooms")
|
||||||
|
.then((res) => {
|
||||||
|
this.roomData = res.data;
|
||||||
|
console.log(this.roomData);
|
||||||
|
this.oldData = this.roomData;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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) => {
|
||||||
|
return {
|
||||||
|
label: ele.name,
|
||||||
|
value: ele.name,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async EdituserForm() {
|
||||||
|
let body = {
|
||||||
|
committee: this.committee,
|
||||||
|
};
|
||||||
|
axios
|
||||||
|
.put(`http://localhost:3001/buildings`, body, {
|
||||||
|
headers: {
|
||||||
|
// remove headers
|
||||||
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.getBuildings();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onChangeEvent(e, event, selectedStatus) {
|
||||||
this.roomData = this.oldData;
|
this.roomData = this.oldData;
|
||||||
if (e == "free") {
|
if (e == "free") {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
const free = this.roomData.filter((tagfree) => tagfree.status === "free");
|
const free = this.roomData.filter((tagfree) => tagfree.status === "free");
|
||||||
this.roomData = free;
|
this.roomData = free;
|
||||||
console.log(this.roomData);
|
|
||||||
}
|
}
|
||||||
} else if (e == "unavailable") {
|
} else if (e == "unavailable") {
|
||||||
if (event.target.checked) {
|
if (event.target.checked) {
|
||||||
@ -199,14 +270,11 @@ export default {
|
|||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div class="d-flex justify-content-end align-items-baseline">
|
<div class="d-flex justify-content-end align-items-baseline">
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
<!-- <MaterialCheckbox id="terms5" checked>
|
<!-- <MaterialCheckbox id="terms6">
|
||||||
<a href="javascript:;" class="font-weight-bolder"> รายตึก</a>
|
|
||||||
</MaterialCheckbox> -->
|
|
||||||
<MaterialCheckbox id="terms6">
|
|
||||||
<a href="javascript:;" class="font-weight-bolder"> ตึกทั้งหมด</a>
|
<a href="javascript:;" class="font-weight-bolder"> ตึกทั้งหมด</a>
|
||||||
</MaterialCheckbox>
|
</MaterialCheckbox> -->
|
||||||
</div>
|
</div>
|
||||||
<label style="margin-right: 10px; margin-left: 20px"
|
<!-- <label style="margin-right: 10px; margin-left: 20px"
|
||||||
>ค้นหาชื่อหรือเลขห้อง
|
>ค้นหาชื่อหรือเลขห้อง
|
||||||
</label>
|
</label>
|
||||||
<MaterialInput
|
<MaterialInput
|
||||||
@ -214,7 +282,7 @@ export default {
|
|||||||
icon="search"
|
icon="search"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
/>
|
/> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -231,11 +299,11 @@ export default {
|
|||||||
<div class="d-flex justify-content-between align-items-baseline p-2">
|
<div class="d-flex justify-content-between align-items-baseline p-2">
|
||||||
<div class="text-start">
|
<div class="text-start">
|
||||||
<p class="d-flex align-items-baseline p-2">
|
<p class="d-flex align-items-baseline p-2">
|
||||||
|
<a data-bs-toggle="modal" data-bs-target="#Edituser">
|
||||||
<span style="font-weight: bold; text-decoration: underline">
|
<span style="font-weight: bold; text-decoration: underline">
|
||||||
คณะกรรมการประจําตึก : มารุช ดีงาม , บารมี ดีงาม</span
|
คณะกรรมการประจําตึก : {{ committee || "เพิ่มชื่อ" }}</span
|
||||||
>
|
>
|
||||||
<a data-bs-toggle="modal" data-bs-target="#Edituser"
|
<i
|
||||||
><i
|
|
||||||
class="material-icons"
|
class="material-icons"
|
||||||
style="cursor: pointer; margin-left: 10px"
|
style="cursor: pointer; margin-left: 10px"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
@ -252,7 +320,7 @@ export default {
|
|||||||
color="green"
|
color="green"
|
||||||
:checked="statusfree"
|
:checked="statusfree"
|
||||||
v-model="selectedStatus"
|
v-model="selectedStatus"
|
||||||
@change="onChangeEvent('free', $event)"
|
@click="onChangeEvent('free', $event, selectedStatus)"
|
||||||
>
|
>
|
||||||
<a href="javascript:;" class="font-weight-bolder"> ว่าง</a>
|
<a href="javascript:;" class="font-weight-bolder"> ว่าง</a>
|
||||||
</MaterialCheckbox>
|
</MaterialCheckbox>
|
||||||
@ -260,7 +328,8 @@ export default {
|
|||||||
id="terms2"
|
id="terms2"
|
||||||
color="red"
|
color="red"
|
||||||
:checked="statuseunavailable"
|
:checked="statuseunavailable"
|
||||||
@change="onChangeEvent('unavailable', $event)"
|
v-model="selectedUnavailable"
|
||||||
|
@click="onChangeEvent('unavailable', $event)"
|
||||||
>
|
>
|
||||||
<a href="javascript:;" class="font-weight-bolder"> ไม่ว่าง</a>
|
<a href="javascript:;" class="font-weight-bolder"> ไม่ว่าง</a>
|
||||||
</MaterialCheckbox>
|
</MaterialCheckbox>
|
||||||
@ -291,7 +360,7 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- v-for="(item, index) in NoRoom" :key="index" -->
|
<!-- v-for="(item, index) in NoRoom" :key="index" -->
|
||||||
<div v-for="(item, index) in NoRoom" :key="index">
|
<div v-for="(item, index) in dataBuilding?.listRoom" :key="index">
|
||||||
<div class="card mb-2">
|
<div class="card mb-2">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p class="text-start">
|
<p class="text-start">
|
||||||
@ -302,27 +371,27 @@ export default {
|
|||||||
href="#collapseExample"
|
href="#collapseExample"
|
||||||
aria-expanded="false"
|
aria-expanded="false"
|
||||||
aria-controls="collapseExample"
|
aria-controls="collapseExample"
|
||||||
>{{ item?.title }}</MaterialButton
|
>ชั้น {{ item?.floor }}</MaterialButton
|
||||||
>
|
>
|
||||||
</p>
|
</p>
|
||||||
<div class="collapse show" id="collapseExample" aria-expanded="true">
|
<div class="collapse show" id="collapseExample" aria-expanded="true">
|
||||||
<div class="flex-container">
|
<div class="flex-container">
|
||||||
<div v-for="(item, index) in roomData" :key="index">
|
<div v-for="(item2, index) in roomData" :key="index">
|
||||||
<div
|
<div
|
||||||
class="card mb-2"
|
class="card mb-2"
|
||||||
:class="{
|
:class="{
|
||||||
'bg-red': item?.status == 'unavailable',
|
'bg-red': item2?.status == 'unavailable',
|
||||||
'bg-green': item?.status == 'free',
|
'bg-green': item2?.status == 'free',
|
||||||
'bg-warning2': item?.status == 'waiting',
|
'bg-warning2': item2?.status == 'waiting',
|
||||||
'bg-return': item?.status == 'return',
|
'bg-return': item2?.status == 'return',
|
||||||
'bgg-red': item?.status == 'special',
|
'bgg-red': item2?.status == 'special',
|
||||||
}"
|
}"
|
||||||
:style="{ width: `220px`, height: `170px` }"
|
:style="{ width: `220px`, height: `170px` }"
|
||||||
>
|
>
|
||||||
<div class="card-body p-1">
|
<div class="card-body p-1">
|
||||||
<a
|
<a
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
@click="gotodetail(item?.dataIndex, item?.status)"
|
@click="gotodetail(item2?.index, item2?.status)"
|
||||||
>
|
>
|
||||||
<p
|
<p
|
||||||
class="card-title"
|
class="card-title"
|
||||||
@ -333,48 +402,50 @@ export default {
|
|||||||
background: white;
|
background: white;
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a style="font-size: medium">{{ item?.title }}</a>
|
<a style="font-size: medium"
|
||||||
|
>ห้อง {{ item2?.numberRoom }}</a
|
||||||
|
>
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
v-if="item?.status == 'free'"
|
v-if="item2?.status == 'free'"
|
||||||
class="card-title bgg-green"
|
class="card-title bgg-green"
|
||||||
style="font-size: 16px"
|
style="font-size: 16px"
|
||||||
>
|
>
|
||||||
{{ "ว่าง" }}
|
{{ "ว่าง" }}
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
v-if="item?.status == 'unavailable'"
|
v-if="item2?.status == 'unavailable'"
|
||||||
class="card-title bgg-red"
|
class="card-title bgg-red"
|
||||||
style="font-size: 16px"
|
style="font-size: 16px"
|
||||||
>
|
>
|
||||||
{{ "ไม่ว่าง" }}
|
{{ "ไม่ว่าง" }}
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
v-if="item?.status == 'waiting'"
|
v-if="item2?.status == 'waiting'"
|
||||||
class="card-title bgg-warning2"
|
class="card-title bgg-warning2"
|
||||||
style="font-size: 16px"
|
style="font-size: 16px"
|
||||||
>
|
>
|
||||||
{{ "ชำรุด" }}
|
{{ "ชำรุด" }}
|
||||||
</p>
|
</p>
|
||||||
<p
|
<p
|
||||||
v-if="item?.status == 'return'"
|
v-if="item2?.status == 'return'"
|
||||||
class="card-title bgg-return"
|
class="card-title bgg-return"
|
||||||
style="font-size: 16px"
|
style="font-size: 16px"
|
||||||
>
|
>
|
||||||
{{ "ผ่อนผัน" }}
|
{{ "ผ่อนผัน" }}
|
||||||
</p>
|
</p>
|
||||||
<p class="card-title" style="font-size: 14px">
|
<p class="card-title" style="font-size: 14px">
|
||||||
{{ item?.ranks }} {{ item?.firstName }}
|
{{ item2?.ranks }} {{ item2?.firstName }}
|
||||||
{{ item?.laststName }}
|
{{ item2?.laststName }}
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
<span
|
<span
|
||||||
v-if="item?.status !== 'special'"
|
v-if="item2?.status !== 'special'"
|
||||||
style="text-align: right; font-size: small"
|
style="text-align: right; font-size: small"
|
||||||
>{{ item?.Affiliation }}</span
|
>{{ item2?.Affiliation }}</span
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
v-if="item?.status == 'special'"
|
v-if="item2?.status == 'special'"
|
||||||
style="text-align: right; font-size: 16px"
|
style="text-align: right; font-size: 16px"
|
||||||
>{{ "กรณีพิเศษ" }}</span
|
>{{ "กรณีพิเศษ" }}</span
|
||||||
>
|
>
|
||||||
@ -457,6 +528,8 @@ export default {
|
|||||||
id="exampleFormControlTextarea1"
|
id="exampleFormControlTextarea1"
|
||||||
rows="3"
|
rows="3"
|
||||||
placeholder="กรอกชื่อ"
|
placeholder="กรอกชื่อ"
|
||||||
|
:value="committee"
|
||||||
|
@input="(event) => (committee = event.target.value)"
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -464,7 +537,14 @@ export default {
|
|||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||||
ปิดหน้าต่าง
|
ปิดหน้าต่าง
|
||||||
</button>
|
</button>
|
||||||
<MaterialButton variant="gradient" color="success">บันทึก</MaterialButton>
|
<MaterialButton
|
||||||
|
variant="gradient"
|
||||||
|
color="success"
|
||||||
|
@click="EdituserForm"
|
||||||
|
html-type="submit"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
>บันทึก</MaterialButton
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,6 +14,7 @@ import setMaterialInput from "@/assets/js/material-input";
|
|||||||
// onMounted(() => {
|
// onMounted(() => {
|
||||||
// setMaterialInput();
|
// setMaterialInput();
|
||||||
// });
|
// });
|
||||||
|
import axios from "axios";
|
||||||
const listRoom = [
|
const listRoom = [
|
||||||
{ title: "ตึก 1" },
|
{ title: "ตึก 1" },
|
||||||
{ title: "ตึก 2" },
|
{ title: "ตึก 2" },
|
||||||
@ -164,9 +165,9 @@ export default {
|
|||||||
{ label: "มนตรี", value: "มนตรี" },
|
{ label: "มนตรี", value: "มนตรี" },
|
||||||
],
|
],
|
||||||
optionsRoomtype: [
|
optionsRoomtype: [
|
||||||
{ label: "ช๑", value: "ช๑" },
|
{ label: "ช1", value: "ช1" },
|
||||||
{ label: "ช๒", value: "ช๒" },
|
{ label: "ช2", value: "ช2" },
|
||||||
{ label: "ช๓", value: "ช๓" },
|
{ label: "ช3", value: "ช3" },
|
||||||
],
|
],
|
||||||
optionsBuilding: [
|
optionsBuilding: [
|
||||||
{ label: "อาคารแฟลต 1/11", value: "1" },
|
{ label: "อาคารแฟลต 1/11", value: "1" },
|
||||||
@ -209,18 +210,21 @@ export default {
|
|||||||
phone: "1200",
|
phone: "1200",
|
||||||
old: "100",
|
old: "100",
|
||||||
birthday: "200",
|
birthday: "200",
|
||||||
Roomtype: "ช๑",
|
Roomtype: "ช1",
|
||||||
Roomconditions: "ปกติ",
|
Roomconditions: "ปกติ",
|
||||||
selectedRoomtype: "ช๑",
|
selectedRoomtype: "ช1",
|
||||||
statusedit: false,
|
statusedit: false,
|
||||||
mode: "",
|
mode: "",
|
||||||
id: "",
|
id: "",
|
||||||
|
numberRoom: "",
|
||||||
|
roomData:[]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.mode = this.$route.query.mode;
|
this.mode = this.$route.query.mode;
|
||||||
if (this.$route.params.id) {
|
if (this.$route.params.id) {
|
||||||
this.id = this.$route.params.id;
|
this.id = this.$route.params.id;
|
||||||
|
this.getRooms(this.id)
|
||||||
}
|
}
|
||||||
// this.$route.query
|
// this.$route.query
|
||||||
},
|
},
|
||||||
@ -235,6 +239,22 @@ export default {
|
|||||||
console.log(event);
|
console.log(event);
|
||||||
// this.selected = event;
|
// this.selected = event;
|
||||||
},
|
},
|
||||||
|
async getRooms(id) {
|
||||||
|
try {
|
||||||
|
await axios
|
||||||
|
.get(`http://localhost:3001/rooms/${id}`)
|
||||||
|
.then((res) => {
|
||||||
|
this.roomData = res.data;
|
||||||
|
console.log(this.roomData);
|
||||||
|
// this.oldData = this.roomData;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
let body = {
|
let body = {
|
||||||
@ -332,8 +352,8 @@ export default {
|
|||||||
<h5>แก้ไขรายละเอียด ห้อง 2</h5>
|
<h5>แก้ไขรายละเอียด ห้อง 2</h5>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<MaterialInput
|
<MaterialInput
|
||||||
:value="lastName"
|
:value="numberRoom"
|
||||||
@input="(event) => (lastName = event.target.value)"
|
@input="(event) => (numberRoom = event.target.value)"
|
||||||
class="input-group-static"
|
class="input-group-static"
|
||||||
label="เลขห้อง"
|
label="เลขห้อง"
|
||||||
type="text"
|
type="text"
|
||||||
@ -369,7 +389,7 @@ export default {
|
|||||||
value="option2"
|
value="option2"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio2"
|
<label class="form-check-label" for="inlineRadio2"
|
||||||
>ไม่ชำรุด</label
|
>ปกติ</label
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,94 +4,7 @@ import MaterialButton from "@/components/MaterialButton.vue";
|
|||||||
import vueMkHeader from "@/assets/img/bg.jpg";
|
import vueMkHeader from "@/assets/img/bg.jpg";
|
||||||
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
||||||
import masterData from "@/assets/dataJson/masterData.json";
|
import masterData from "@/assets/dataJson/masterData.json";
|
||||||
|
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,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@ -101,9 +14,6 @@ export default {
|
|||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
listRoom,
|
|
||||||
NoRoom,
|
|
||||||
landingColumns,
|
|
||||||
vueMkHeader,
|
vueMkHeader,
|
||||||
masterData,
|
masterData,
|
||||||
};
|
};
|
||||||
@ -111,36 +21,121 @@ export default {
|
|||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: { name: "Vue.js", language: "JavaScript" },
|
|
||||||
options: [
|
|
||||||
{ label: "Vue.js", value: "JavaScript" },
|
|
||||||
{ label: "Rails", value: "Ruby" },
|
|
||||||
{ label: "Sinatra", value: "Ruby" },
|
|
||||||
{ label: "Laravel", value: "PHP" },
|
|
||||||
{ label: "Phoenix", value: "Elixir" },
|
|
||||||
],
|
|
||||||
optionsRoomtype: [
|
|
||||||
{ label: "ช๑", value: "ช๑" },
|
|
||||||
{ label: "ช๒", value: "ช๒" },
|
|
||||||
{ label: "ช๓", value: "ช๓" },
|
|
||||||
],
|
|
||||||
selectedColor: "",
|
selectedColor: "",
|
||||||
Edifice: "",
|
Edifice: "",
|
||||||
Building: "",
|
Building: "",
|
||||||
Floors: "",
|
Floors: "",
|
||||||
selectedRoomtype: "ช๑",
|
selectedRoomtype: "ช๑",
|
||||||
|
buildingList: [],
|
||||||
|
searchName: "",
|
||||||
|
FloorsList: [],
|
||||||
|
Area: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
created() {
|
||||||
|
// console.log(this.masterData);
|
||||||
|
this.getBuildings();
|
||||||
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedColor: function (newValue) {
|
selectedColor: function (newValue) {
|
||||||
// this.updateColor(newValue)
|
// this.updateColor(newValue)
|
||||||
console.log(newValue);
|
console.log(newValue);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
buildingList() {
|
||||||
|
return this.buildingList.filter((item) => item.name.includes(this.searchName));
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changedLabel(event) {
|
changedFloors() {
|
||||||
console.log(event);
|
let array = [];
|
||||||
// this.selected = event;
|
for (let index = 0; index < this.Floors; index++) {
|
||||||
|
array.push({
|
||||||
|
name: this.Building,
|
||||||
|
floor: index + 1,
|
||||||
|
rooms: [
|
||||||
|
{
|
||||||
|
index: 1,
|
||||||
|
numberRoom: 1,
|
||||||
|
ranks: "",
|
||||||
|
firstName: "",
|
||||||
|
laststName: "",
|
||||||
|
Affiliation: "",
|
||||||
|
typeRoom: "",
|
||||||
|
status: "free",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
sumroom: 1,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.FloorsList = array;
|
||||||
|
},
|
||||||
|
addRoom(item) {
|
||||||
|
item.rooms.push({
|
||||||
|
index: item.sumroom + 1,
|
||||||
|
numberRoom: item.sumroom + 1,
|
||||||
|
ranks: "",
|
||||||
|
firstName: "",
|
||||||
|
laststName: "",
|
||||||
|
Affiliation: "",
|
||||||
|
typeRoom: "",
|
||||||
|
status: "free",
|
||||||
|
});
|
||||||
|
item.sumroom = item.sumroom + 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
async submitForm() {
|
||||||
|
let sum = 0;
|
||||||
|
this.FloorsList.forEach((num) => {
|
||||||
|
sum += num.sumroom;
|
||||||
|
});
|
||||||
|
let body = {
|
||||||
|
buil: this.Area,
|
||||||
|
name: this.Building,
|
||||||
|
sumroom: sum,
|
||||||
|
floor: this.Floors,
|
||||||
|
roomnumber: "",
|
||||||
|
type: "",
|
||||||
|
listRoom: this.FloorsList,
|
||||||
|
};
|
||||||
|
await axios
|
||||||
|
.post(`http://localhost:3001/buildings`, body, {
|
||||||
|
headers: {
|
||||||
|
// remove headers
|
||||||
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.getBuildings();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
await axios
|
||||||
|
.post(`http://localhost:3001/rooms`, body, {
|
||||||
|
headers: {
|
||||||
|
// remove headers
|
||||||
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// buildings
|
||||||
|
async getBuildings() {
|
||||||
|
try {
|
||||||
|
await axios
|
||||||
|
.get("http://localhost:3001/buildings")
|
||||||
|
.then((res) => {
|
||||||
|
this.buildingList = res.data;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -172,12 +167,14 @@ export default {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex justify-content-end align-items-baseline">
|
<div class="d-flex justify-content-end align-items-baseline">
|
||||||
<label style="margin-right: 10px">ค้นหาพื้นที่หรือตึก </label>
|
<label style="margin-right: 10px">ค้นหาชื่ออาคาร </label>
|
||||||
<MaterialInput
|
<MaterialInput
|
||||||
class="input-group-dynamic w-30"
|
class="input-group-dynamic w-30"
|
||||||
icon="search"
|
icon="search"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
|
:value="searchName"
|
||||||
|
@input="(event) => (searchName = event.target.value)"
|
||||||
/>
|
/>
|
||||||
<MaterialButton
|
<MaterialButton
|
||||||
style="margin-left: 20px"
|
style="margin-left: 20px"
|
||||||
@ -202,12 +199,12 @@ export default {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in masterData?.building" :key="index">
|
<tr v-for="(item, index) in buildingList" :key="index">
|
||||||
<th scope="row">{{ index + 1 }}</th>
|
<th scope="row">{{ index + 1 }}</th>
|
||||||
<td>{{ item?.buil }}</td>
|
<td>{{ item?.buil }}</td>
|
||||||
<td>{{ item?.name }}</td>
|
<td>{{ item?.name }}</td>
|
||||||
<td>{{ item?.floor }}</td>
|
<td>{{ item?.floor }}</td>
|
||||||
<td>{{ item?.room }}</td>
|
<td>{{ item?.sumroom }}</td>
|
||||||
<!-- <td>{{ item?.roomnumber }}</td> -->
|
<!-- <td>{{ item?.roomnumber }}</td> -->
|
||||||
<!-- <td>{{ item?.type }}</td> -->
|
<!-- <td>{{ item?.type }}</td> -->
|
||||||
</tr>
|
</tr>
|
||||||
@ -228,7 +225,7 @@ export default {
|
|||||||
aria-labelledby="staticBackdropLabel"
|
aria-labelledby="staticBackdropLabel"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
>
|
>
|
||||||
<div class="modal-dialog modal-dialog-centered">
|
<div class="modal-dialog modal-xl">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="staticBackdropLabel">เพิ่มผังห้อง</h5>
|
<h5 class="modal-title" id="staticBackdropLabel">เพิ่มผังห้อง</h5>
|
||||||
@ -261,53 +258,67 @@ export default {
|
|||||||
placeholder="ชื่ออาคาร"
|
placeholder="ชื่ออาคาร"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<md-chips v-model="fruits" md-placeholder="Add fruit..."></md-chips>
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<MaterialInput
|
<MaterialInput
|
||||||
:value="Floors"
|
:value="Floors"
|
||||||
@input="(event) => (Floors = event.target.value)"
|
@input="(event) => (Floors = event.target.value)"
|
||||||
class="input-group-static"
|
class="input-group-static"
|
||||||
label="ชั้น"
|
label="จำนวนชั้น"
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="ชั้น"
|
placeholder="จำนวนชั้น"
|
||||||
|
@change="changedFloors()"
|
||||||
/>
|
/>
|
||||||
|
<div class="card pt-4" v-for="(item, index) in FloorsList" :key="index">
|
||||||
|
<ul
|
||||||
|
class="list-group list-group-flush"
|
||||||
|
style="border: 2px solid #2b572d"
|
||||||
|
>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<span style="font-size: 16px; font-weight: bold"
|
||||||
|
>ชั้นที่ {{ item.floor }}</span
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<label
|
||||||
|
style="font-size: 16px; font-weight: bold; margin-left: 20px"
|
||||||
|
>
|
||||||
|
จำนวนห้อง {{ item.sumroom }}
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="flex-container2">
|
||||||
<MaterialInput
|
<div v-for="(item2, index) in item?.rooms" :key="index">
|
||||||
name="Edifice"
|
ห้อง {{ item2.numberRoom }}
|
||||||
:value="Edifice"
|
</div>
|
||||||
@input="(event) => (Edifice = event.target.value)"
|
<div
|
||||||
class="input-group-static"
|
style="
|
||||||
label="จำนวนห้อง"
|
background: white;
|
||||||
type="text"
|
color: #000;
|
||||||
placeholder="จำนวนห้อง"
|
border: 2px solid #4cbb17;
|
||||||
/>
|
cursor: pointer;
|
||||||
|
text-decoration: underline;
|
||||||
|
font-size: 18px;
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a @click="addRoom(item)">เพิ่มห้อง</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="mb-3">
|
|
||||||
<label>กรอกเลขห้อง</label>
|
|
||||||
<textarea
|
|
||||||
:value="roomnumber"
|
|
||||||
@input="(event) => (roomnumber = event.target.value)"
|
|
||||||
class="form-control"
|
|
||||||
id="exampleFormControlTextarea1"
|
|
||||||
rows="3"
|
|
||||||
placeholder="ตัวอย่าง : 1,2,3"
|
|
||||||
></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
|
||||||
<label>ประเภทห้องพัก</label>
|
|
||||||
<v-select
|
|
||||||
:options="optionsRoomtype"
|
|
||||||
v-model="selectedRoomtype"
|
|
||||||
></v-select>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">
|
||||||
ปิดหน้าต่าง
|
ปิดหน้าต่าง
|
||||||
</button>
|
</button>
|
||||||
<MaterialButton variant="gradient" color="success">บันทึก</MaterialButton>
|
<MaterialButton
|
||||||
|
variant="gradient"
|
||||||
|
color="success"
|
||||||
|
@click="submitForm"
|
||||||
|
html-type="submit"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
>บันทึก</MaterialButton
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -316,7 +327,7 @@ export default {
|
|||||||
</template>
|
</template>
|
||||||
<style>
|
<style>
|
||||||
.bg-green {
|
.bg-green {
|
||||||
border: 2px solid #4CBB17 !important;
|
border: 2px solid #4cbb17 !important;
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
.bg-red {
|
.bg-red {
|
||||||
@ -344,4 +355,19 @@ input::-webkit-inner-spin-button {
|
|||||||
input[type="number"] {
|
input[type="number"] {
|
||||||
-moz-appearance: textfield;
|
-moz-appearance: textfield;
|
||||||
}
|
}
|
||||||
|
.flex-container2 {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-container2 > div {
|
||||||
|
background-color: #4cbb17;
|
||||||
|
color: white;
|
||||||
|
width: 98px;
|
||||||
|
margin: 10px;
|
||||||
|
height: 80px;
|
||||||
|
text-align: center;
|
||||||
|
font-size: 24px;
|
||||||
|
line-height: 80px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -39,45 +39,59 @@ export default {
|
|||||||
typeAffiliation: "",
|
typeAffiliation: "",
|
||||||
typeRanks: "",
|
typeRanks: "",
|
||||||
dataUser: [],
|
dataUser: [],
|
||||||
|
olddata: [],
|
||||||
|
datatypeUser: [],
|
||||||
|
olddatatypeUser: [],
|
||||||
modalShow: false,
|
modalShow: false,
|
||||||
id: "",
|
id: "",
|
||||||
searchName: "",
|
searchName: "",
|
||||||
|
typeUser: "ตร.",
|
||||||
|
typeUserBytype: "",
|
||||||
|
typeUserByrankr: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// console.log(this.masterData);
|
|
||||||
this.getAlluser();
|
this.getAlluser();
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectedColor: function (newValue) {
|
selectedColor: function (newValue) {
|
||||||
// this.updateColor(newValue)
|
|
||||||
console.log(newValue);
|
console.log(newValue);
|
||||||
},
|
},
|
||||||
typeAffiliation: function (newValue) {
|
typeAffiliation: function (newValue) {
|
||||||
// this.updateColor(newValue)
|
|
||||||
console.log(newValue);
|
console.log(newValue);
|
||||||
// if(newValue != undefined){
|
|
||||||
// this.typeAffiliation = newValue.value
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
typeRanks: function (newValue) {
|
|
||||||
// this.updateColor(newValue)
|
|
||||||
console.log(newValue);
|
|
||||||
// if(newValue != undefined){
|
|
||||||
// this.typeRanks = newValue.value
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
dataUser() {
|
||||||
|
return this.dataUser.filter((item) => item.firstName.includes(this.searchName));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
typeUserfilter(e) {
|
||||||
|
if (e.target) this.typeUserBytype = e.target.value;
|
||||||
|
else this.typeUserBytype = e;
|
||||||
|
this.dataUser = this.olddata;
|
||||||
|
if (this.typeUserBytype !== "ทั้งหมด") {
|
||||||
|
let dataFind = this.dataUser.filter((e) => e.typeUser === this.typeUserBytype);
|
||||||
|
this.datatypeUser = dataFind;
|
||||||
|
this.olddatatypeUser = dataFind;
|
||||||
|
this.dataUser = dataFind;
|
||||||
|
if (this.typeUserByrankr !== "") this.rankrfilter(this.typeUserByrankr);
|
||||||
|
} else if (this.typeUserBytype == "ทั้งหมด") {
|
||||||
|
this.dataUser = this.olddata;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
rankrfilter(e) {
|
||||||
filteredData() {
|
if (e.target) this.typeUserByrankr = e.target.value;
|
||||||
this.dataUser.filter((entry) =>
|
else this.typeUserByrankr = e;
|
||||||
this.dataUser.length
|
this.datatypeUser = this.olddatatypeUser;
|
||||||
? Object.keys(this.dataUser[0]).some((key) =>
|
let dataRank = this.datatypeUser.filter((e) => e.typeRanks == this.typeUserByrankr);
|
||||||
("" + entry[key]).toLowerCase().includes(this.searchName.toLowerCase())
|
this.dataUser = dataRank;
|
||||||
)
|
},
|
||||||
: true
|
|
||||||
);
|
typeUserchange(e) {
|
||||||
|
this.typeUser = e.target.value;
|
||||||
},
|
},
|
||||||
|
|
||||||
async editUser(id) {
|
async editUser(id) {
|
||||||
@ -98,7 +112,7 @@ export default {
|
|||||||
this.modalShow = true;
|
this.modalShow = true;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -133,7 +147,7 @@ export default {
|
|||||||
this.getAlluser();
|
this.getAlluser();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async submitForm() {
|
async submitForm() {
|
||||||
@ -153,8 +167,8 @@ export default {
|
|||||||
status: this.selectedDataObtion.value || "โสด",
|
status: this.selectedDataObtion.value || "โสด",
|
||||||
typeAffiliation: this.typeAffiliation.value,
|
typeAffiliation: this.typeAffiliation.value,
|
||||||
typeRanks: this.typeRanks.value,
|
typeRanks: this.typeRanks.value,
|
||||||
|
typeUser: this.typeUser,
|
||||||
};
|
};
|
||||||
|
|
||||||
axios
|
axios
|
||||||
.post(`http://localhost:3001/users`, body, {
|
.post(`http://localhost:3001/users`, body, {
|
||||||
headers: {
|
headers: {
|
||||||
@ -167,19 +181,22 @@ export default {
|
|||||||
this.getAlluser();
|
this.getAlluser();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
getAlluser() {
|
async getAlluser() {
|
||||||
try {
|
try {
|
||||||
axios
|
await axios
|
||||||
.get("http://localhost:3001/users")
|
.get("http://localhost:3001/users")
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.dataUser = res.data;
|
this.dataUser = res.data;
|
||||||
|
this.olddata = res.data;
|
||||||
|
this.typeUserfilter("ทั้งหมด");
|
||||||
|
// this.rankrfilter("ประทวน");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err.response);
|
console.log(err);
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -213,6 +230,20 @@ export default {
|
|||||||
:routes="[{ label: 'หน้าหลัก', route: '/' }, { label: 'ทะเบียน' }]"
|
:routes="[{ label: 'หน้าหลัก', route: '/' }, { label: 'ทะเบียน' }]"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-1">
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="radio"
|
||||||
|
name="inlineRadioOptions"
|
||||||
|
id="inlineRadio33"
|
||||||
|
value="ทั้งหมด"
|
||||||
|
@change="typeUserfilter($event)"
|
||||||
|
checked
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="inlineRadio33">ทั้งหมด</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="d-flex justify-content-between align-items-baseline">
|
<div class="d-flex justify-content-between align-items-baseline">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="form-check form-check-inline">
|
<div class="form-check form-check-inline">
|
||||||
@ -222,8 +253,8 @@ export default {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="inlineRadioOptions"
|
name="inlineRadioOptions"
|
||||||
id="inlineRadio1"
|
id="inlineRadio1"
|
||||||
value="Radio1"
|
value="ตร."
|
||||||
checked
|
@change="typeUserfilter($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio1">ตร.</label>
|
<label class="form-check-label" for="inlineRadio1">ตร.</label>
|
||||||
</div>
|
</div>
|
||||||
@ -233,7 +264,8 @@ export default {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="inlineRadioOptions"
|
name="inlineRadioOptions"
|
||||||
id="inlineRadio2"
|
id="inlineRadio2"
|
||||||
value="Radio2"
|
value="บช.ตชด."
|
||||||
|
@change="typeUserfilter($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio2">บช.ตชด.</label>
|
<label class="form-check-label" for="inlineRadio2">บช.ตชด.</label>
|
||||||
</div>
|
</div>
|
||||||
@ -247,7 +279,6 @@ export default {
|
|||||||
type="text"
|
type="text"
|
||||||
placeholder="Search"
|
placeholder="Search"
|
||||||
:value="searchName"
|
:value="searchName"
|
||||||
@change="filteredData()"
|
|
||||||
@input="(event) => (searchName = event.target.value)"
|
@input="(event) => (searchName = event.target.value)"
|
||||||
/>
|
/>
|
||||||
<MaterialButton
|
<MaterialButton
|
||||||
@ -268,8 +299,8 @@ export default {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="inlineRadioOptions1"
|
name="inlineRadioOptions1"
|
||||||
id="inlineRadio3"
|
id="inlineRadio3"
|
||||||
value="Radio3"
|
value="ประทวน"
|
||||||
checked
|
@change="rankrfilter($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio3">ประทวน</label>
|
<label class="form-check-label" for="inlineRadio3">ประทวน</label>
|
||||||
</div>
|
</div>
|
||||||
@ -279,10 +310,22 @@ export default {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="inlineRadioOptions1"
|
name="inlineRadioOptions1"
|
||||||
id="inlineRadio4"
|
id="inlineRadio4"
|
||||||
value="Radio4"
|
value="สัญญาบัตร"
|
||||||
|
@change="rankrfilter($event)"
|
||||||
/>
|
/>
|
||||||
<label class="form-check-label" for="inlineRadio4">สัญญาบัตร</label>
|
<label class="form-check-label" for="inlineRadio4">สัญญาบัตร</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="radio"
|
||||||
|
name="inlineRadioOptions1"
|
||||||
|
id="inlineRadio5"
|
||||||
|
value="ลูกจ้าง"
|
||||||
|
@change="rankrfilter($event)"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="inlineRadio5">ลูกจ้าง</label>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center pt-4 table-responsive">
|
<div class="text-center pt-4 table-responsive">
|
||||||
<table class="table border border-2 border-success">
|
<table class="table border border-2 border-success">
|
||||||
@ -353,6 +396,32 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div>
|
<div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<label style="margin-right: 20px">ประเภท</label>
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="radio"
|
||||||
|
name="typeUser"
|
||||||
|
id="inlinetypeUser1"
|
||||||
|
value="ตร."
|
||||||
|
@change="typeUserchange($event)"
|
||||||
|
checked
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="inlinetypeUser1">ตร.</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="radio"
|
||||||
|
name="typeUser"
|
||||||
|
id="inlinetypeUser"
|
||||||
|
value="บช.ตชด."
|
||||||
|
@change="typeUserchange($event)"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="inlinetypeUser">บช.ตชด.</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="mb-1">
|
<div class="mb-1">
|
||||||
<label>สังกัด</label>
|
<label>สังกัด</label>
|
||||||
<v-select
|
<v-select
|
||||||
@ -490,14 +559,24 @@ export default {
|
|||||||
v-model="typeAffiliation"
|
v-model="typeAffiliation"
|
||||||
></v-select>
|
></v-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="typeAffiliation.label == 'บก.อก.'">
|
<div
|
||||||
|
class="mb-3"
|
||||||
|
v-if="
|
||||||
|
typeAffiliation.label == 'บก.อก.' || this.typeAffiliation == 'บก.อก.'
|
||||||
|
"
|
||||||
|
>
|
||||||
<label>สังกัด {{ typeAffiliation.label }}</label>
|
<label>สังกัด {{ typeAffiliation.label }}</label>
|
||||||
<v-select
|
<v-select
|
||||||
:options="masterData?.Affiliation"
|
:options="masterData?.Affiliation"
|
||||||
v-model="selectedAffiliation"
|
v-model="selectedAffiliation"
|
||||||
></v-select>
|
></v-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="typeAffiliation.label == 'บก.สนน.'">
|
<div
|
||||||
|
class="mb-3"
|
||||||
|
v-if="
|
||||||
|
typeAffiliation.label == 'บก.สนน.' || this.typeAffiliation == 'บก.สนน.'
|
||||||
|
"
|
||||||
|
>
|
||||||
<label>สังกัด {{ typeAffiliation.label }}</label>
|
<label>สังกัด {{ typeAffiliation.label }}</label>
|
||||||
<v-select
|
<v-select
|
||||||
:options="masterData?.Affiliation2"
|
:options="masterData?.Affiliation2"
|
||||||
@ -508,18 +587,27 @@ export default {
|
|||||||
<label>ลำดับยศ</label>
|
<label>ลำดับยศ</label>
|
||||||
<v-select :options="masterData?.typeranks" v-model="typeRanks"></v-select>
|
<v-select :options="masterData?.typeranks" v-model="typeRanks"></v-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="typeRanks.label == 'ลูกจ้าง'">
|
<div
|
||||||
|
class="mb-3"
|
||||||
|
v-if="typeRanks.label == 'ลูกจ้าง' || this.typeRanks == 'ลูกจ้าง'"
|
||||||
|
>
|
||||||
<label> {{ typeRanks.label }}</label>
|
<label> {{ typeRanks.label }}</label>
|
||||||
<v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select>
|
<v-select :options="masterData?.ranks" v-model="selectedRanks"></v-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="typeRanks.label == 'ประทวน'">
|
<div
|
||||||
|
class="mb-3"
|
||||||
|
v-if="typeRanks.label == 'ประทวน' || this.typeRanks == 'ประทวน'"
|
||||||
|
>
|
||||||
<label> {{ typeRanks.label }}</label>
|
<label> {{ typeRanks.label }}</label>
|
||||||
<v-select
|
<v-select
|
||||||
:options="masterData?.ranks2"
|
:options="masterData?.ranks2"
|
||||||
v-model="selectedRanks"
|
v-model="selectedRanks"
|
||||||
></v-select>
|
></v-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3" v-if="typeRanks.label == 'สัญญาบัตร'">
|
<div
|
||||||
|
class="mb-3"
|
||||||
|
v-if="typeRanks.label == 'สัญญาบัตร' || this.typeRanks == 'สัญญาบัตร'"
|
||||||
|
>
|
||||||
<label> {{ typeRanks.label }}</label>
|
<label> {{ typeRanks.label }}</label>
|
||||||
<v-select
|
<v-select
|
||||||
:options="masterData?.ranks3"
|
:options="masterData?.ranks3"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user