Merge branch 'oat_dev' into develop
This commit is contained in:
commit
c0a4ab94d8
4 changed files with 282 additions and 24 deletions
|
|
@ -64,7 +64,19 @@
|
|||
<q-card-section class="q-p-sm">
|
||||
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<q-input
|
||||
v-if="edit"
|
||||
outlined
|
||||
v-model="inputDate"
|
||||
label="วันที่ได้รับ"
|
||||
mask="##/##/####"
|
||||
dense
|
||||
:error="dayChecked"
|
||||
error-message="กรุณากรอกวันที่ได้รับ"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวันที่ได้รับ'}`]"
|
||||
/>
|
||||
<datepicker
|
||||
v-else
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="date"
|
||||
|
|
@ -340,8 +352,16 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
success,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
convertDate,
|
||||
convertDateDisplay,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const name = ref<string>();
|
||||
|
|
@ -588,6 +608,23 @@ const visibleColumnsHistory = ref<String[]>([
|
|||
"createdAt",
|
||||
]);
|
||||
|
||||
const inputDate = ref<string>("");
|
||||
const dayChecked = ref<boolean>(false);
|
||||
watch(
|
||||
() => inputDate.value,
|
||||
(value: string) => {
|
||||
if (value.length === 10) {
|
||||
const dateVal = convertDate(value);
|
||||
if (dateVal.isValid) {
|
||||
dayChecked.value = false;
|
||||
date.value = new Date(dateVal.value);
|
||||
} else {
|
||||
dayChecked.value = true;
|
||||
inputDate.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
||||
await changeProfileColumns("assessment", count);
|
||||
});
|
||||
|
|
@ -733,6 +770,7 @@ const saveData = async () => {
|
|||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
inputDate.value = "";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -845,6 +883,7 @@ const selectData = async (props: DataProps) => {
|
|||
pointSum.value = props.row.pointSum;
|
||||
date.value = props.row.date;
|
||||
id.value = props.row.id;
|
||||
inputDate.value = convertDateDisplay(props.row.date);
|
||||
await checkRowPage();
|
||||
};
|
||||
|
||||
|
|
@ -852,6 +891,7 @@ const selectData = async (props: DataProps) => {
|
|||
* กดปุ่มเพิ่มบน table
|
||||
*/
|
||||
const addData = () => {
|
||||
inputDate.value = "";
|
||||
modalEdit.value = false;
|
||||
modal.value = true;
|
||||
edit.value = true;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,12 @@
|
|||
: col.value + 543
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
v-else-if="col.name == 'refCommandDate'"
|
||||
class="table_ellipsis"
|
||||
>
|
||||
{{ date2Thai(props.row.refCommandDate) }}
|
||||
</div>
|
||||
<div v-else class="table_ellipsis">
|
||||
{{ col.value }}
|
||||
</div>
|
||||
|
|
@ -90,8 +96,30 @@
|
|||
/>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
v-if="edit && isDate === 'false'"
|
||||
outlined
|
||||
v-model="inputYear"
|
||||
label="ปี"
|
||||
mask="####"
|
||||
dense
|
||||
:error="yearChecked"
|
||||
error-message="กรุณากรอกปี"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกปี'}`]"
|
||||
/>
|
||||
<q-input
|
||||
v-if="edit && isDate === 'true'"
|
||||
outlined
|
||||
v-model="inputDate"
|
||||
label="วัน/เดือน/ปี"
|
||||
mask="##/##/####"
|
||||
dense
|
||||
:error="dayChecked"
|
||||
error-message="กรุณากรอกวัน/เดือน/ปี"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวัน/เดือน/ปี'}`]"
|
||||
/>
|
||||
<datepicker
|
||||
v-if="isDate === 'false'"
|
||||
v-if="isDate === 'false' && !edit"
|
||||
menu-class-name="modalfix"
|
||||
v-model="issueDate"
|
||||
:locale="'th'"
|
||||
|
|
@ -114,7 +142,6 @@
|
|||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="issueDate + 543"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกวันที่ได้รับ'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วันที่ได้รับ'}`"
|
||||
>
|
||||
|
|
@ -134,7 +161,7 @@
|
|||
</template>
|
||||
</datepicker>
|
||||
<datepicker
|
||||
v-else
|
||||
v-else-if="isDate === 'true' && !edit"
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="issueDate2"
|
||||
|
|
@ -229,7 +256,18 @@
|
|||
</q-input>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
v-if="edit"
|
||||
outlined
|
||||
v-model="inputDateRef"
|
||||
label="เอกสารอ้างอิง (ลงวันที่)"
|
||||
mask="##/##/####"
|
||||
dense
|
||||
:error="dayCheckedRef"
|
||||
error-message="กรุณากรอกเอกสารอ้างอิง (ลงวันที่)"
|
||||
/>
|
||||
<datepicker
|
||||
v-else
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="refCommandDate"
|
||||
|
|
@ -251,7 +289,7 @@
|
|||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="
|
||||
refCommandDate == null ? null : date2Thai(refCommandDate as Date)
|
||||
refCommandDate == null ? null : date2Thai(refCommandDate)
|
||||
"
|
||||
hide-bottom-space
|
||||
:label="`${'เอกสารอ้างอิง (ลงวันที่)'}`"
|
||||
|
|
@ -367,8 +405,16 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
success,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
convertDate,
|
||||
convertDateDisplay,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const issuer = ref<string>();
|
||||
|
|
@ -376,7 +422,7 @@ const detail = ref<string>();
|
|||
const issueDate = ref<number>(new Date().getFullYear());
|
||||
const issueDate2 = ref<Date>(new Date());
|
||||
const refCommandNo = ref<string>();
|
||||
const refCommandDate = ref<Date | null | string>(new Date());
|
||||
const refCommandDate = ref<Date>(new Date());
|
||||
const myForm = ref<any>(); //form data input
|
||||
const edit = ref<boolean>(false); //เช็คการกดปุ่มแก้ไขใน dialog
|
||||
const modal = ref<boolean>(false); //modal add detail
|
||||
|
|
@ -556,6 +602,55 @@ watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
|||
await changeProfileColumns("coined", count);
|
||||
});
|
||||
|
||||
const inputDateRef = ref<string>("");
|
||||
const inputYear = ref<string>("");
|
||||
const inputDate = ref<string>("");
|
||||
const dayCheckedRef = ref<boolean>(false);
|
||||
const dayChecked = ref<boolean>(false);
|
||||
const yearChecked = ref<boolean>(false);
|
||||
|
||||
watch(
|
||||
() => inputDate.value,
|
||||
(value: string) => {
|
||||
if (value.length === 10) {
|
||||
const dateVal = convertDate(value);
|
||||
if (dateVal.isValid) {
|
||||
dayChecked.value = false;
|
||||
issueDate2.value = new Date(dateVal.value);
|
||||
} else {
|
||||
dayChecked.value = true;
|
||||
inputDate.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => inputYear.value,
|
||||
(value: string) => {
|
||||
if (value.length === 4) {
|
||||
yearChecked.value = false;
|
||||
issueDate.value = parseInt(value) - 543;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => inputDateRef.value,
|
||||
(value: string) => {
|
||||
if (value.length === 10) {
|
||||
const dateVal = convertDate(value);
|
||||
if (dateVal.isValid) {
|
||||
dayCheckedRef.value = false;
|
||||
refCommandDate.value = new Date(dateVal.value);
|
||||
} else {
|
||||
dayCheckedRef.value = true;
|
||||
inputDateRef.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
|
|
@ -669,6 +764,7 @@ const clickSave = async () => {
|
|||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
if (inputDate.value === "") dayChecked.value = true;
|
||||
await saveData();
|
||||
}
|
||||
}
|
||||
|
|
@ -693,13 +789,14 @@ const saveData = async () => {
|
|||
: new Date(`${issueDate.value}-01-01`),
|
||||
refCommandNo: refCommandNo.value,
|
||||
refCommandDate:
|
||||
refCommandDate.value == null
|
||||
? null
|
||||
: dateToISO(refCommandDate.value as Date),
|
||||
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
modal.value = false;
|
||||
inputYear.value = "";
|
||||
inputDateRef.value = "";
|
||||
inputDate.value = "";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -727,9 +824,7 @@ const editData = async () => {
|
|||
: new Date(`${issueDate.value}-01-01`),
|
||||
refCommandNo: refCommandNo.value,
|
||||
refCommandDate:
|
||||
refCommandDate.value == null
|
||||
? null
|
||||
: dateToISO(refCommandDate.value as Date),
|
||||
refCommandDate.value == null ? null : dateToISO(refCommandDate.value),
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
@ -816,6 +911,11 @@ const selectData = async (props: DataProps) => {
|
|||
refCommandDate.value =
|
||||
props.row.refCommandDate == "-" ? null : props.row.refCommandDate;
|
||||
id.value = props.row.id;
|
||||
inputYear.value = props.row.issueDate + 543;
|
||||
inputDate.value = convertDateDisplay(props.row.issueDate2);
|
||||
inputDateRef.value = convertDateDisplay(props.row.refCommandDate);
|
||||
console.log(refCommandDate.value);
|
||||
|
||||
await checkRowPage();
|
||||
};
|
||||
|
||||
|
|
@ -824,6 +924,9 @@ const selectData = async (props: DataProps) => {
|
|||
*/
|
||||
const addData = () => {
|
||||
modalEdit.value = false;
|
||||
inputDate.value = "";
|
||||
inputYear.value = "";
|
||||
inputDateRef.value = "";
|
||||
modal.value = true;
|
||||
edit.value = true;
|
||||
issuer.value = "";
|
||||
|
|
|
|||
|
|
@ -60,7 +60,19 @@
|
|||
<q-card-section class="q-p-sm">
|
||||
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
v-if="edit"
|
||||
outlined
|
||||
v-model="inputDate"
|
||||
label="วัน/เดือน/ปี"
|
||||
mask="##/##/####"
|
||||
dense
|
||||
:error="dayChecked"
|
||||
error-message="กรุณากรอกวัน/เดือน/ปี"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวัน/เดือน/ปี'}`]"
|
||||
/>
|
||||
<datepicker
|
||||
v-else
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="date"
|
||||
|
|
@ -180,7 +192,16 @@
|
|||
</q-input>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
v-if="edit"
|
||||
outlined
|
||||
v-model="inputRefCommandDate"
|
||||
label="เอกสารอ้างอิง (ลงวันที่)"
|
||||
mask="##/##/####"
|
||||
dense
|
||||
/>
|
||||
<datepicker
|
||||
v-else
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="refCommandDate"
|
||||
|
|
@ -202,7 +223,7 @@
|
|||
lazy-rules
|
||||
:borderless="!edit"
|
||||
:model-value="
|
||||
refCommandDate == null ? null : date2Thai(refCommandDate)
|
||||
(refCommandDate && date2Thai(refCommandDate)) || null
|
||||
"
|
||||
hide-bottom-space
|
||||
:label="`${'เอกสารอ้างอิง (ลงวันที่)'}`"
|
||||
|
|
@ -316,8 +337,16 @@ const store = useProfileDataStore();
|
|||
const { profileData, changeProfileColumns } = store;
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai, success, dateToISO, messageError, showLoader, hideLoader } =
|
||||
mixin;
|
||||
const {
|
||||
date2Thai,
|
||||
success,
|
||||
dateToISO,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
convertDate,
|
||||
convertDateDisplay,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
const level = ref<string>();
|
||||
|
|
@ -372,7 +401,7 @@ const OpsFilter = ref<DisciplineOps>({
|
|||
const detail = ref<string>();
|
||||
const unStigma = ref<string>();
|
||||
const refCommandNo = ref<string>();
|
||||
const refCommandDate = ref<Date | null>(new Date());
|
||||
const refCommandDate = ref<Date | null>(null);
|
||||
const date = ref<Date>(new Date());
|
||||
const myForm = ref<any>(); //form data input
|
||||
const edit = ref<boolean>(false); //เช็คการกดปุ่มแก้ไขใน dialog
|
||||
|
|
@ -573,8 +602,54 @@ const visibleColumnsHistory = ref<String[]>([
|
|||
"createdAt",
|
||||
]);
|
||||
|
||||
const inputDate = ref<string>("");
|
||||
const dayChecked = ref<boolean>(false);
|
||||
|
||||
const inputRefCommandDate = ref<string>("");
|
||||
const dayCheckedRef = ref<boolean>(false);
|
||||
|
||||
watch(
|
||||
() => inputRefCommandDate.value,
|
||||
(value: string) => {
|
||||
console.log(value);
|
||||
if (value.length === 10) {
|
||||
const dateVal = convertDate(value);
|
||||
|
||||
if (dateVal.isValid) {
|
||||
dayCheckedRef.value = false;
|
||||
if (!!dateVal.value) {
|
||||
refCommandDate.value = new Date(dateVal.value);
|
||||
} else {
|
||||
refCommandDate.value = null;
|
||||
}
|
||||
} else {
|
||||
dayCheckedRef.value = true;
|
||||
inputRefCommandDate.value = "";
|
||||
}
|
||||
} else {
|
||||
refCommandDate.value = null;
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => inputDate.value,
|
||||
(value: string) => {
|
||||
if (value.length === 10) {
|
||||
const dateVal = convertDate(value);
|
||||
if (dateVal.isValid) {
|
||||
dayChecked.value = false;
|
||||
date.value = new Date(dateVal.value);
|
||||
} else {
|
||||
dayChecked.value = true;
|
||||
inputDate.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(visibleColumns, async (count: String[], prevCount: String[]) => {
|
||||
await changeProfileColumns("discipline", count);
|
||||
changeProfileColumns("discipline", count);
|
||||
});
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -727,6 +802,8 @@ const saveData = async () => {
|
|||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
inputDate.value = "";
|
||||
inputRefCommandDate.value = "";
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -837,13 +914,19 @@ const selectData = async (props: DataProps) => {
|
|||
refCommandDate.value = props.row.refCommandDate;
|
||||
date.value = props.row.date;
|
||||
id.value = props.row.id;
|
||||
await checkRowPage();
|
||||
inputDate.value = convertDateDisplay(props.row.date);
|
||||
inputRefCommandDate.value = props.row.refCommandDate
|
||||
? convertDateDisplay(props.row.refCommandDate)
|
||||
: "";
|
||||
checkRowPage();
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มเพิ่มบน table
|
||||
*/
|
||||
const addData = () => {
|
||||
inputDate.value = "";
|
||||
inputRefCommandDate.value = "";
|
||||
modalEdit.value = false;
|
||||
modal.value = true;
|
||||
edit.value = true;
|
||||
|
|
|
|||
|
|
@ -116,7 +116,21 @@
|
|||
<q-scroll-area visible style="height: 70vh">
|
||||
<div class="row col-12 q-col-gutter-xs">
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<q-input
|
||||
v-if="edit"
|
||||
outlined
|
||||
v-model="inputDate"
|
||||
label="วัน/เดือน/ปี"
|
||||
mask="##/##/####"
|
||||
dense
|
||||
:error="dayChecked"
|
||||
error-message="กรุณากรอกวัน/เดือน/ปี"
|
||||
:rules="[
|
||||
(val) => !!val || `${'กรุณากรอกวัน/เดือน/ปี'}`,
|
||||
]"
|
||||
/>
|
||||
<datepicker
|
||||
v-else
|
||||
menu-class-name="modalfix"
|
||||
:readonly="!edit"
|
||||
v-model="formDataSalary.date"
|
||||
|
|
@ -460,6 +474,8 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
convertDate,
|
||||
convertDateDisplay,
|
||||
} = mixin;
|
||||
const route = useRoute();
|
||||
const id = ref<string>("");
|
||||
|
|
@ -1220,7 +1236,23 @@ const visibleColumnsHistory = ref<String[]>([
|
|||
"createdFullName",
|
||||
"createdAt",
|
||||
]);
|
||||
|
||||
const inputDate = ref<string>("");
|
||||
const dayChecked = ref<boolean>(false);
|
||||
watch(
|
||||
() => inputDate.value,
|
||||
(value: string) => {
|
||||
if (value.length === 10) {
|
||||
const dateVal = convertDate(value);
|
||||
if (dateVal.isValid) {
|
||||
dayChecked.value = false;
|
||||
formDataSalary.date = new Date(dateVal.value);
|
||||
} else {
|
||||
dayChecked.value = true;
|
||||
inputDate.value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
/****************************************** FormDataNew **********************************************/
|
||||
const formDataSalary = reactive<FormSalaryNew>({
|
||||
date: new Date(),
|
||||
|
|
@ -1674,7 +1706,7 @@ const selectData = async (props: DataProps) => {
|
|||
rawItem.value = props.row;
|
||||
rowIndex.value = props.rowIndex;
|
||||
id.value = props.row.id;
|
||||
|
||||
inputDate.value = formDataSalary.date;
|
||||
// console.log(props.row);
|
||||
|
||||
// date.value = props.row.date;
|
||||
|
|
@ -1698,7 +1730,7 @@ const selectData = async (props: DataProps) => {
|
|||
// orgName.value = props.row.orgName;
|
||||
// agencyName.value = props.row.agencyName;
|
||||
// cLevel.value = props.row.cLevel;
|
||||
|
||||
inputDate.value = convertDateDisplay(props.row.date);
|
||||
formDataSalary.date = props.row.date;
|
||||
formDataSalary.posNo = props.row.posNo ?? "-";
|
||||
formDataSalary.templatePos = "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue