ปรับ input edit date
This commit is contained in:
parent
b7ff33b40f
commit
8eca4d1650
5 changed files with 61 additions and 62 deletions
|
|
@ -487,6 +487,19 @@ function calendarOpen() {
|
|||
calendarModal.value = true;
|
||||
}
|
||||
|
||||
function inputEdit(val: boolean) {
|
||||
if (formData.investigationExtendHistory.length > 0) {
|
||||
return {
|
||||
"full-width cursor-pointer ": val,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
"full-width cursor-pointer ": val,
|
||||
"full-width cursor-pointer inputgreen": !val,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
mainStore.rowsAdd = [];
|
||||
getOc();
|
||||
|
|
@ -854,15 +867,8 @@ onMounted(async () => {
|
|||
<template #trigger>
|
||||
<q-input
|
||||
for="#date"
|
||||
class="full-width cursor-pointer"
|
||||
:class="inputEdit(isReadonly)"
|
||||
ref="dateRef"
|
||||
:input-style="
|
||||
isReadonly ||
|
||||
formData.investigationExtendHistory.length >
|
||||
0
|
||||
? { color: 'black' }
|
||||
: { color: 'teal' }
|
||||
"
|
||||
:readonly="
|
||||
isReadonly ||
|
||||
formData.investigationExtendHistory.length >
|
||||
|
|
@ -876,7 +882,7 @@ onMounted(async () => {
|
|||
:model-value="
|
||||
formData.investigationDateStart
|
||||
? date2Thai(
|
||||
formData.investigationDateStart
|
||||
formData.investigationDateStart as Date
|
||||
)
|
||||
: null
|
||||
"
|
||||
|
|
@ -922,15 +928,8 @@ onMounted(async () => {
|
|||
<template #trigger>
|
||||
<q-input
|
||||
for="#dateEnd"
|
||||
:input-style="
|
||||
isReadonly ||
|
||||
formData.investigationExtendHistory.length >
|
||||
0
|
||||
? { color: 'black' }
|
||||
: { color: 'teal' }
|
||||
"
|
||||
ref="dateEndRef"
|
||||
class="full-width cursor-pointer"
|
||||
:class="inputEdit(isReadonly)"
|
||||
:readonly="
|
||||
isReadonly ||
|
||||
formData.investigationExtendHistory.length >
|
||||
|
|
@ -943,7 +942,7 @@ onMounted(async () => {
|
|||
borderless
|
||||
:model-value="
|
||||
formData.investigationDateEnd
|
||||
? date2Thai(formData.investigationDateEnd)
|
||||
? date2Thai(formData.investigationDateEnd as Date)
|
||||
: null
|
||||
"
|
||||
:rules="[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue