Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit e9590364 authored by Kritkhanin Anantakul's avatar Kritkhanin Anantakul
Browse files

add header table / fix add queue dialog

parent 9de2957d
No related branches found
No related tags found
No related merge requests found
...@@ -5,41 +5,52 @@ ...@@ -5,41 +5,52 @@
<form @submit.prevent="handleSubmit"> <form @submit.prevent="handleSubmit">
<div class="form-group"> <div class="form-group">
<label class="white-text">Machine ID:</label> <label class="white-text">Machine ID:</label>
<select v-model="form.machineID" required class="selete-mec-color-text"> <select v-model="form.status" class="border-input" required>
<option disabled value="">Select Machine</option>
<option v-for="machine in machines" :key="machine.machineID" :value="machine.machineID"> <option v-for="machine in machines" :key="machine.machineID" :value="machine.machineID">
{{ machine.name }} {{ machine.name }}
</option> </option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="white-text">Order ID:</label> <label class="white-text">Order ID:</label>
<input class="border-input" v-model.number="form.orderID" type="number" required /> <input class="border-input" v-model.number="form.orderID" type="number" required />
</div> </div>
<div class="form-group">
<label class="white-text">Page Number:</label> <!-- 🆕 Start Time & Finish Time: ใช้ DateTime Picker -->
<input class="border-input" v-model.number="form.pageNumber" type="number" required />
</div>
<div class="form-group"> <div class="form-group">
<label class="white-text">Start Time:</label> <label class="white-text">Start Time:</label>
<input class="border-input" v-model="form.startTime" type="text" required /> <input class="border-input" type="datetime-local" v-model="form.startTime" required />
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="white-text">Finish Time:</label> <label class="white-text">Finish Time:</label>
<input class="border-input" v-model="form.finishTime" type="text" required /> <input class="border-input" type="datetime-local" v-model="form.finishTime" required />
</div> </div>
<!-- 🆕 Status: ใช้ Dropdown -->
<div class="form-group"> <div class="form-group">
<label class="white-text">Status:</label> <label class="white-text">Status:</label>
<input class="border-input" v-model="form.status" type="text" required /> <select v-model="form.status" class="border-input" required>
<option value="ยังไม่ได้จัดส่ง">ยังไม่ได้จัดส่ง</option>
<option value="จัดส่งแล้ว">จัดส่งแล้ว</option>
</select>
</div> </div>
<!-- 🆕 Bottle Size: ใช้ Dropdown -->
<div class="form-group"> <div class="form-group">
<label class="white-text">Bottle Size:</label> <label class="white-text">Bottle Size:</label>
<input class="border-input" v-model="form.bottleSize" type="text" required /> <select v-model="form.bottleSize" class="border-input" required>
<option value="600 ml">600 ml</option>
<option value="1500 ml">1500 ml</option>
<option value="350 ml">350 ml</option>
</select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="white-text">Produced Quantity:</label> <label class="white-text">Produced Quantity:</label>
<input class="border-input" v-model.number="form.producedQuantity" type="number" required /> <input class="border-input" v-model.number="form.producedQuantity" type="number" required />
</div> </div>
<!-- ปุ่ม Add หรือ Save Changes --> <!-- ปุ่ม Add หรือ Save Changes -->
<div class="dialog-buttons"> <div class="dialog-buttons">
<button type="submit" class="primary-btn"> <button type="submit" class="primary-btn">
...@@ -58,7 +69,6 @@ import { reactive, ref, watch } from 'vue' ...@@ -58,7 +69,6 @@ import { reactive, ref, watch } from 'vue'
interface QueueItem { interface QueueItem {
machineID: string machineID: string
orderID: number | null orderID: number | null
pageNumber: number | null
startTime: string startTime: string
finishTime: string finishTime: string
status: string status: string
...@@ -89,11 +99,10 @@ const emit = defineEmits<{ ...@@ -89,11 +99,10 @@ const emit = defineEmits<{
const form = reactive<QueueItem>({ const form = reactive<QueueItem>({
machineID: '', machineID: '',
orderID: null, orderID: null,
pageNumber: null,
startTime: '', startTime: '',
finishTime: '', finishTime: '',
status: '', status: 'ยังไม่ได้จัดส่ง',
bottleSize: '', bottleSize: '600 ml',
producedQuantity: null, producedQuantity: null,
}) })
...@@ -113,11 +122,10 @@ const isEditing = ref(false) ...@@ -113,11 +122,10 @@ const isEditing = ref(false)
function resetForm() { function resetForm() {
form.machineID = '' form.machineID = ''
form.orderID = null form.orderID = null
form.pageNumber = null
form.startTime = '' form.startTime = ''
form.finishTime = '' form.finishTime = ''
form.status = '' form.status = 'ยังไม่ได้จัดส่ง'
form.bottleSize = '' form.bottleSize = '600 ml'
form.producedQuantity = null form.producedQuantity = null
} }
...@@ -184,7 +192,8 @@ watch( ...@@ -184,7 +192,8 @@ watch(
margin-bottom: 5px; margin-bottom: 5px;
} }
.form-group input { .form-group input,
.form-group select {
width: 100%; width: 100%;
padding: 5px; padding: 5px;
box-sizing: border-box; box-sizing: border-box;
...@@ -215,28 +224,10 @@ watch( ...@@ -215,28 +224,10 @@ watch(
cursor: pointer; cursor: pointer;
} }
.icon-button {
position: absolute;
top: 10px;
right: 10px;
background: transparent;
border: none;
cursor: pointer;
}
.icon-button .mdi {
font-size: 24px;
color: #2B2E3F;
}
.white-text { .white-text {
color: white; color: white;
} }
.selete-mec-color-text {
color: rgb(0, 204, 255)
}
.border-input { .border-input {
background-color: white; background-color: white;
border: 1px solid #ccc; border: 1px solid #ccc;
......
<template> <template>
<div class="gantt-container"> <div class="gantt-container">
<h2 class="gantt-title">ตารางคิวการผลิต</h2>
<div class="gantt-header"> <div class="gantt-header">
<!-- Calendar: เชื่อมกับ selectedDate --> <!-- Calendar: เชื่อมกับ selectedDate -->
<GanttCalendar v-model:modelValue="selectedDate" /> <GanttCalendar v-model:modelValue="selectedDate" />
...@@ -330,10 +331,10 @@ function getQueueStyle(item: QueueItem) { ...@@ -330,10 +331,10 @@ function getQueueStyle(item: QueueItem) {
function getLineStyle(hour: number) { function getLineStyle(hour: number) {
const timelineStart = timeToDecimal(startTime.value); const totalHours = hours.value.length; // นับจำนวนชั่วโมงที่แสดง (เช่น 10 ช่อง)
const timelineEnd = timeToDecimal(endTime.value); const leftPercent = (hour - timeToDecimal(startTime.value)) / totalHours * 100;
const ratio = (hour - timelineStart) / (timelineEnd - timelineStart);
return { left: ratio * 100 + '%' }; return { left: `${leftPercent}%` };
} }
function timeToDecimal(timeStr: string): number { function timeToDecimal(timeStr: string): number {
......
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
display: flex; display: flex;
background: #fff; background: #fff;
} }
.gantt-header { .gantt-header {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; /* จัดให้ Calendar อยู่ซ้าย, ปุ่มอยู่ขวา */ justify-content: space-between;
/* จัดให้ Calendar อยู่ซ้าย, ปุ่มอยู่ขวา */
margin-bottom: 16px; margin-bottom: 16px;
} }
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
} }
.time-cell { .time-cell {
flex: 1; width: calc(100% / 10);
text-align: center; text-align: center;
border-bottom: 1px solid #ddd; border-bottom: 1px solid #ddd;
font-size: 15px; font-size: 15px;
...@@ -84,6 +86,15 @@ ...@@ -84,6 +86,15 @@
padding: 0 10px; padding: 0 10px;
} }
.gantt-title {
text-align: left;
font-size: 30px;
font-weight: bold;
margin: 10px 0 10px 30px;
color: #333;
}
.resize-handle { .resize-handle {
width: 5px; width: 5px;
height: 100%; height: 100%;
...@@ -126,7 +137,8 @@ ...@@ -126,7 +137,8 @@
} }
.pagination-right { .pagination-right {
margin-left: auto; /* ดันไปขวาสุด */ margin-left: auto;
/* ดันไปขวาสุด */
} }
...@@ -186,10 +198,14 @@ ...@@ -186,10 +198,14 @@
.dialog-buttons button { .dialog-buttons button {
margin: 5px; margin: 5px;
} }
.add-page-btn { .add-page-btn {
background-color: #2B2E3F !important; /* สีปุ่ม */ background-color: #2B2E3F !important;
color: white !important; /* สีไอคอน */ /* สีปุ่ม */
border-radius: 50%; /* ทำให้เป็นวงกลม */ color: white !important;
/* สีไอคอน */
border-radius: 50%;
/* ทำให้เป็นวงกลม */
width: 40px; width: 40px;
height: 40px; height: 40px;
display: flex; display: flex;
...@@ -200,11 +216,12 @@ ...@@ -200,11 +216,12 @@
} }
.add-page-btn:hover { .add-page-btn:hover {
background-color: #1E1E2F !important; /* สีเข้มขึ้นเมื่อ hover */ background-color: #1E1E2F !important;
/* สีเข้มขึ้นเมื่อ hover */
} }
.add-page:disabled { .add-page:disabled {
background-color: #ccc !important; /* เปลี่ยนสีเป็นสีจาง */ background-color: #ccc !important;
/* เปลี่ยนสีเป็นสีจาง */
cursor: not-allowed; cursor: not-allowed;
} }
\ No newline at end of file
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment