mirror of
https://github.com/creativetimofficial/vue-material-kit.git
synced 2025-05-23 04:04:22 +08:00
update detail
This commit is contained in:
parent
3556889a2d
commit
9ef2366f72
@ -10,7 +10,8 @@
|
||||
"Affiliation": "ฝอ. 2",
|
||||
"typeRoom": "ช1",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "unavailable"
|
||||
"roomStatus": "unavailable",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c389c78-b2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -23,7 +24,8 @@
|
||||
"Affiliation": "ฝอ. 1",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "return"
|
||||
"roomStatus": "return",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c78-b2a3-4ea2-bca5-57521eb7e5db",
|
||||
@ -36,7 +38,8 @@
|
||||
"Affiliation": "ฝอ. 1",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "unavailable"
|
||||
"roomStatus": "unavailable",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c78-b2v3-4ea2-bca5-48521eb7e5db",
|
||||
@ -49,7 +52,8 @@
|
||||
"Affiliation": "ฝอ. 1",
|
||||
"typeRoom": "ช3",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "special"
|
||||
"roomStatus": "special",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c787c78-b2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -62,7 +66,8 @@
|
||||
"Affiliation": "ฝอ. 7",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ชำรุด",
|
||||
"roomStatus": "waiting"
|
||||
"roomStatus": "waiting",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c78-q2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -75,7 +80,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c36-b2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -88,7 +94,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช1",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c41-b2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -101,7 +108,8 @@
|
||||
"Affiliation": "ฝอ. 1",
|
||||
"typeRoom": "ช3",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "special"
|
||||
"roomStatus": "special",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c99-b2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -114,7 +122,8 @@
|
||||
"Affiliation": "ฝอ. 7",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ชำรุด",
|
||||
"roomStatus": "waiting"
|
||||
"roomStatus": "waiting",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c988c78-b2a3-4ea2-bca5-48521eb7e5db",
|
||||
@ -127,7 +136,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c78-b2a3-4ea2-bca5-47821eb7e5db",
|
||||
@ -147,7 +157,8 @@
|
||||
"phone": "0325647845",
|
||||
"status": "โสด",
|
||||
"typeAffiliation": "ลูกจ้าง",
|
||||
"typeRanks": "ลูกจ้าง"
|
||||
"typeRanks": "ลูกจ้าง",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"id": "2c388c78-b2a3-4ea2-bca5-48981eb7e5db",
|
||||
@ -167,7 +178,8 @@
|
||||
"phone": "0325647845",
|
||||
"status": "โสด",
|
||||
"typeAffiliation": "บก.สนน.",
|
||||
"typeRanks": "ประทวน"
|
||||
"typeRanks": "ประทวน",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -182,7 +194,8 @@
|
||||
"Affiliation": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"typeRoom": "ช1",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -197,7 +210,8 @@
|
||||
"Affiliation": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"typeRoom": "ช1",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -212,7 +226,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช2",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -227,7 +242,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช1",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -242,7 +258,8 @@
|
||||
"Affiliation": "",
|
||||
"roomconditions": "ชำรุด",
|
||||
"typeRoom": "ช2",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -264,7 +281,8 @@
|
||||
"phone": "0325647845",
|
||||
"status": "สมรส",
|
||||
"typeAffiliation": "ลูกจ้าง",
|
||||
"typeRanks": "ประทวน"
|
||||
"typeRanks": "ประทวน",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "8bc8b393-8ae2-4e65-9a35-32c0e76545b3",
|
||||
@ -279,7 +297,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "ช1",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c",
|
||||
@ -294,7 +313,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c",
|
||||
@ -309,7 +329,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c",
|
||||
@ -324,7 +345,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c",
|
||||
@ -339,7 +361,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c",
|
||||
@ -354,7 +377,8 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
},
|
||||
{
|
||||
"buildingId": "3ac5e496-89f8-44da-a666-4d910f9ba61c",
|
||||
@ -369,6 +393,7 @@
|
||||
"Affiliation": "",
|
||||
"typeRoom": "",
|
||||
"roomconditions": "ปกติ",
|
||||
"roomStatus": "free"
|
||||
"roomStatus": "free",
|
||||
"pickedBook": "2023-11-02T14:10:26.374Z"
|
||||
}
|
||||
]
|
@ -170,6 +170,7 @@ app.put('/rooms/:id', (req, res) => {
|
||||
if (req.body.typeAffiliation) parsedData.typeAffiliation = req.body.typeAffiliation
|
||||
if (req.body.typeRanks) parsedData.typeRanks = req.body.typeRanks
|
||||
if (req.body.typeRoom) parsedData.typeRoom = req.body.typeRoom
|
||||
if (req.body.pickedBook) parsedData.pickedBook = req.body.pickedBook
|
||||
if (req.body.roomconditions) parsedData.roomconditions = req.body.roomconditions
|
||||
filterdata.push(parsedData)
|
||||
fs.writeFile('./rooms.json', JSON.stringify(filterdata, null, 2), (err) => {
|
||||
|
@ -7,7 +7,6 @@ import MaterialButton from "@/components/MaterialButton.vue";
|
||||
import Breadcrumbs from "@/examples/Breadcrumbs.vue";
|
||||
import axios from "axios";
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
MaterialInput,
|
||||
@ -16,7 +15,7 @@ export default {
|
||||
},
|
||||
setup() {
|
||||
return {
|
||||
vueMkHeader
|
||||
vueMkHeader,
|
||||
};
|
||||
},
|
||||
|
||||
@ -47,6 +46,8 @@ export default {
|
||||
data: "",
|
||||
queueList: [],
|
||||
queuefilter: [],
|
||||
statusRoom: "",
|
||||
dateApproved: ""
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -80,18 +81,31 @@ export default {
|
||||
try {
|
||||
axios.get(`http://localhost:3001/rooms/${id}`).then((res) => {
|
||||
this.data = res.data;
|
||||
// console.log(this.data);
|
||||
// if (this.data.typeRoom == "ช1") this.typeroom = "โสด";
|
||||
// if (this.data.typeRoom == "ช2") this.typeroom = "สมรส";
|
||||
// if (this.data.typeRoom == "ช3") this.typeroom = "ทั่วไป";
|
||||
this.typeroom = this.data.typeRoom
|
||||
this.getAllqueue()
|
||||
console.log(this.data);
|
||||
this.dateApproved = this.convertDateTolocal(this.data.pickedBook)
|
||||
this.typeroom = this.data.typeRoom;
|
||||
if(this.data.affiliation) this.Affiliation = this.data.affiliation
|
||||
if (this.data.roomStatus == "return") this.statusRoom = "ผ่อนผัน";
|
||||
if (this.data.roomStatus == "special") this.statusRoom = "กรณีพิเศษ";
|
||||
if (this.data.roomStatus == "waiting") this.statusRoom = "ชำรุด";
|
||||
if (this.data.roomStatus == "unavailable") this.statusRoom = "ไม่ว่าง";
|
||||
if (this.data.roomStatus == "free") this.statusRoom = "ว่าง";
|
||||
|
||||
|
||||
this.getAllqueue();
|
||||
});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
},
|
||||
|
||||
convertDateTolocal(index){
|
||||
const date = new Date(index);
|
||||
const formatter = new Intl.DateTimeFormat('en-US', { day: '2-digit', month: '2-digit', year: 'numeric' });
|
||||
const formattedDate = formatter.format(date)
|
||||
return formattedDate
|
||||
},
|
||||
|
||||
getAllusersByid(id) {
|
||||
this.userId = id;
|
||||
try {
|
||||
@ -119,7 +133,6 @@ export default {
|
||||
insurance: this.insurance,
|
||||
installments: this.installments,
|
||||
};
|
||||
console.log(body);
|
||||
await axios
|
||||
.post(`http://localhost:3001/history`, body, {
|
||||
headers: {
|
||||
@ -128,9 +141,9 @@ export default {
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
this.submitForm2()
|
||||
this.submitForm3()
|
||||
this.submitFormRoom()
|
||||
this.submitForm2();
|
||||
this.submitForm3();
|
||||
this.submitFormRoom();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
@ -148,13 +161,12 @@ export default {
|
||||
installments: this.installments,
|
||||
};
|
||||
|
||||
await axios
|
||||
.post(`http://localhost:3001/report`, body, {
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
await axios.post(`http://localhost:3001/report`, body, {
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
async submitForm3() {
|
||||
@ -168,19 +180,18 @@ export default {
|
||||
installments: this.installments,
|
||||
};
|
||||
|
||||
await axios
|
||||
.put(`http://localhost:3001/queue/${this.userId}`, body, {
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
})
|
||||
await axios.put(`http://localhost:3001/queue/${this.userId}`, body, {
|
||||
headers: {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
},
|
||||
async submitFormRoom() {
|
||||
let body = {
|
||||
...this.userByid,
|
||||
queue: "inroom",
|
||||
roomStatus: 'unavailable',
|
||||
roomStatus: "unavailable",
|
||||
contract: this.contract,
|
||||
checkintime: this.Checkintime,
|
||||
maintenance: this.Maintenance,
|
||||
@ -262,21 +273,23 @@ export default {
|
||||
<div class="row" v-if="this.mode !== 'add'">
|
||||
<h5 class="card-title">รายละเอียดผู้เช่า</h5>
|
||||
<div class="col-5">
|
||||
<p class="card-text">ชือ : ส.ต.ต. มานะ</p>
|
||||
<p class="card-text">สถานะห้อง : ไม่ว่าง</p>
|
||||
<p class="card-text">สังกัด : ฝอ. 1</p>
|
||||
<p class="card-text">เลขบัตรประชาชน : 123456123456</p>
|
||||
<p class="card-text">วันที่ได้รับอนุมัติ : 12/02/2564</p>
|
||||
<p class="card-text">
|
||||
ชือ : {{ data?.rank }} {{ data?.firstName }}
|
||||
</p>
|
||||
<p class="card-text">สถานะห้อง : {{ statusRoom }}</p>
|
||||
<p class="card-text">สังกัด : {{ Affiliation }} </p>
|
||||
<p class="card-text">เลขบัตรประชาชน : {{ data?.idcard }} </p>
|
||||
<p class="card-text">วันที่ได้รับอนุมัติ : {{ dateApproved }} </p>
|
||||
|
||||
<p class="card-text">ระยะเวลาที่เข้าพัก : 3 เดือน</p>
|
||||
<p class="card-text">ระยะเวลาที่เข้าพัก : {{ data?.Checkintime || 0 }} เดือน</p>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<p class="card-text">นามสกุล : ถือดี</p>
|
||||
<p class="card-text">เบอร์โทร : 0972534887</p>
|
||||
<p class="card-text">เงินค่าประกัน : 12,000</p>
|
||||
<p class="card-text">งวดค่าประกัน : 5/10</p>
|
||||
<p class="card-text">จำนวนงวดค่าประกัน : 2,000</p>
|
||||
<p class="card-text">ยอดคงเหลือค่าประกัน : 6,000</p>
|
||||
<p class="card-text">นามสกุล : {{ data?.lastName }}</p>
|
||||
<p class="card-text">เบอร์โทร : {{ data?.phone }}</p>
|
||||
<p class="card-text">เงินค่าประกัน : {{ data?.Insurancecost }}</p>
|
||||
<p class="card-text">งวดค่าประกัน : {{ data?.installments }}</p>
|
||||
<!-- <p class="card-text">จำนวนงวดค่าประกัน : {{ data?.phone }}</p> -->
|
||||
<!-- <p class="card-text">ยอดคงเหลือค่าประกัน : {{ data?.phone }}</p> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="this.mode !== 'special'">
|
||||
@ -284,7 +297,7 @@ export default {
|
||||
<h5 class="card-title pt-2">รายละเอียดห้องพัก</h5>
|
||||
<p class="card-text">ประเภทห้องพัก : {{ data?.typeRoom }}</p>
|
||||
<!-- <p class="card-text">มิเตอร์น้ำ/ไฟ : 745/546</p> -->
|
||||
<p class="card-text">สภาพห้อง : {{ data?.Roomconditions }}</p>
|
||||
<p class="card-text">สภาพห้อง : {{ data?.roomconditions }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user