fix date pickers
This commit is contained in:
parent
c22c7e2b06
commit
dccfcd43d2
@ -8,9 +8,8 @@
|
|||||||
<h3>Calibration Date</h3>
|
<h3>Calibration Date</h3>
|
||||||
<VueDatePicker
|
<VueDatePicker
|
||||||
v-model="date"
|
v-model="date"
|
||||||
inline
|
|
||||||
:enableTimePicker="false"
|
|
||||||
auto-apply
|
auto-apply
|
||||||
|
:enableTimePicker="false"
|
||||||
:flow="flow"
|
:flow="flow"
|
||||||
></VueDatePicker>
|
></VueDatePicker>
|
||||||
</td>
|
</td>
|
||||||
@ -20,9 +19,8 @@
|
|||||||
<h3>Calibration Due Date</h3>
|
<h3>Calibration Due Date</h3>
|
||||||
<VueDatePicker
|
<VueDatePicker
|
||||||
v-model="due_date"
|
v-model="due_date"
|
||||||
inline
|
|
||||||
:enableTimePicker="false"
|
|
||||||
auto-apply
|
auto-apply
|
||||||
|
:enableTimePicker="false"
|
||||||
:flow="flow"
|
:flow="flow"
|
||||||
></VueDatePicker>
|
></VueDatePicker>
|
||||||
</td>
|
</td>
|
||||||
|
@ -9,9 +9,8 @@
|
|||||||
<div class="date-picker">
|
<div class="date-picker">
|
||||||
<VueDatePicker
|
<VueDatePicker
|
||||||
v-model="date"
|
v-model="date"
|
||||||
inline
|
|
||||||
:enableTimePicker="false"
|
|
||||||
auto-apply
|
auto-apply
|
||||||
|
:enableTimePicker="false"
|
||||||
:flow="flow"
|
:flow="flow"
|
||||||
></VueDatePicker>
|
></VueDatePicker>
|
||||||
</div>
|
</div>
|
||||||
@ -24,7 +23,6 @@
|
|||||||
<VueDatePicker
|
<VueDatePicker
|
||||||
v-model="due_date"
|
v-model="due_date"
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
inline
|
|
||||||
auto-apply
|
auto-apply
|
||||||
:flow="flow"
|
:flow="flow"
|
||||||
></VueDatePicker>
|
></VueDatePicker>
|
||||||
|
@ -106,36 +106,36 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
@ -204,36 +204,36 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0.050%</td>
|
<td>TBD</td>
|
||||||
<td>-12.510</td>
|
<td>TBD</td>
|
||||||
<td>-12.490</td>
|
<td>TBD</td>
|
||||||
<td>-12.500</td>
|
<td>TBD</td>
|
||||||
<td>0</td>
|
<td>TBD</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
@ -333,11 +333,10 @@ const i_date = () => {
|
|||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
||||||
const day = d.getDate().toString().padStart(2, "0");
|
const day = d.getDate().toString().padStart(2, "0");
|
||||||
return `${year}/${month}/${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const i_due_date = () => {
|
const i_due_date = () => {
|
||||||
if (props.instrument?.due_date === undefined) {
|
if (props.instrument?.due_date === undefined) {
|
||||||
return;
|
return;
|
||||||
@ -346,7 +345,7 @@ const i_due_date = () => {
|
|||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
||||||
const day = d.getDate().toString().padStart(2, "0");
|
const day = d.getDate().toString().padStart(2, "0");
|
||||||
return `${year}/${month}/${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const c_date = () => {
|
const c_date = () => {
|
||||||
@ -357,7 +356,7 @@ const c_date = () => {
|
|||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
||||||
const day = d.getDate().toString().padStart(2, "0");
|
const day = d.getDate().toString().padStart(2, "0");
|
||||||
return `${year}/${month}/${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
};
|
};
|
||||||
const c_due_date = () => {
|
const c_due_date = () => {
|
||||||
if (props.calibration?.due_date === undefined) {
|
if (props.calibration?.due_date === undefined) {
|
||||||
@ -367,14 +366,14 @@ const c_due_date = () => {
|
|||||||
const year = d.getFullYear();
|
const year = d.getFullYear();
|
||||||
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
const month = (d.getMonth() + 1).toString().padStart(2, "0"); // Month is zero-based, so we add 1
|
||||||
const day = d.getDate().toString().padStart(2, "0");
|
const day = d.getDate().toString().padStart(2, "0");
|
||||||
return `${year}/${month}/${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const exportToPDF = () => {
|
const exportToPDF = () => {
|
||||||
const element = document.getElementById("pdf");
|
const element = document.getElementById("pdf");
|
||||||
var opt = {
|
var opt = {
|
||||||
margin: 0.4,
|
margin: 0.4,
|
||||||
filename: "myfile.pdf",
|
filename: `${props.instrument.model}_${i_date()}.pdf`,
|
||||||
image: { type: "jpeg", quality: 0.98 },
|
image: { type: "jpeg", quality: 0.98 },
|
||||||
html2canvas: { scale: 2 },
|
html2canvas: { scale: 2 },
|
||||||
jsPDF: { unit: "in", format: "letter", orientation: "portrait" },
|
jsPDF: { unit: "in", format: "letter", orientation: "portrait" },
|
||||||
|
@ -11,13 +11,13 @@
|
|||||||
required
|
required
|
||||||
id="id_report_type"
|
id="id_report_type"
|
||||||
>
|
>
|
||||||
<option value="" selected>---------</option>
|
<option value="-" selected>----Select-----</option>
|
||||||
<option value="TV">Transducer Verify</option>
|
<option value="TV">Transducer Verify</option>
|
||||||
<option value="HC">Hardware Calibration</option>
|
<option value="HC">Hardware Calibration</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr v-if="showUpload">
|
<tr v-if="report_type != '-' || showUpload">
|
||||||
<td>
|
<td>
|
||||||
<button class="custom-button" @click="openFileInput" v-if="showUpload">
|
<button class="custom-button" @click="openFileInput" v-if="showUpload">
|
||||||
Select First File
|
Select First File
|
||||||
@ -76,19 +76,32 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
/*
|
||||||
|
|
||||||
|
RADIO BUTTONS ARE FUCKED
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
import { ref, computed, watchEffect } from "vue";
|
import { ref, computed, watchEffect } from "vue";
|
||||||
|
|
||||||
const report_type = ref(""),
|
const report_type = ref("-"),
|
||||||
files = ref([]),
|
files = ref([]),
|
||||||
current_file = ref(null),
|
current_file = ref(null),
|
||||||
doc = ref();
|
doc = ref();
|
||||||
|
|
||||||
const showUpload = computed({
|
const showUpload = computed({
|
||||||
get() {
|
get() {
|
||||||
console.log(files.value.length)
|
/// default select
|
||||||
|
if (report_type.value === "-") {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// no more more than 2 files
|
||||||
if (files.value.length >= 2) {
|
if (files.value.length >= 2) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if the first item is both, disable upload
|
||||||
if (files.value.length > 0 && files.value[0].kind == "both") {
|
if (files.value.length > 0 && files.value[0].kind == "both") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user