Merge branch 'develop' into devTee
# Conflicts: # src/modules/04_registry/components/Discipline.vue
This commit is contained in:
commit
a0c1ec7e6e
9 changed files with 347 additions and 74 deletions
|
|
@ -281,6 +281,7 @@ const tittleName = computed(() => {
|
|||
</div>
|
||||
<div class="col-2">
|
||||
<q-input
|
||||
mask="##"
|
||||
v-model="formData.orgCode"
|
||||
ref="orgCodeRef"
|
||||
dense
|
||||
|
|
@ -288,8 +289,6 @@ const tittleName = computed(() => {
|
|||
for="#ocNo"
|
||||
:label="level == 0 ? 'รหัสหน่วยงาน' : 'รหัสส่วนราชการ'"
|
||||
hide-bottom-space
|
||||
maxlength="2"
|
||||
type="number"
|
||||
class="inputNumber"
|
||||
:rules="[
|
||||
(val) =>
|
||||
|
|
|
|||
|
|
@ -604,7 +604,7 @@ watch(
|
|||
<style scoped>
|
||||
.tree-container {
|
||||
overflow: auto;
|
||||
height: 60vh;
|
||||
height: 73vh;
|
||||
border: 1px solid #e6e6e7;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,49 +153,47 @@ const breadcrumbsGen = () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">แผนภูมิโครงสร้าง</div>
|
||||
<div class="text-dark">
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<div class="q-pa-sm row wrap items-center">
|
||||
<q-btn flat round color="primary" @click="savePNG()" icon="mdi-image">
|
||||
<q-tooltip> ดาวน์โหลด PNG </q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="red-7"
|
||||
@click="savePDF()"
|
||||
icon="mdi-file-pdf-box"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลด PDF </q-tooltip>
|
||||
</q-btn>
|
||||
<div class="bg-grey-2 q-py-xs q-px-sm rounded-borders">
|
||||
<q-breadcrumbs>
|
||||
<template v-slot:separator>
|
||||
<q-icon size="1.5em" name="chevron_right" color="primary" />
|
||||
</template>
|
||||
<template v-for="link in theBreadcrumb" :key="link.id">
|
||||
<q-breadcrumbs-el
|
||||
:label="link.label"
|
||||
@click="refreshChart(link.id)"
|
||||
class="breadcrumbs-link"
|
||||
/>
|
||||
</template>
|
||||
</q-breadcrumbs>
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-mt-sm">
|
||||
<div class="q-pa-sm row wrap items-center">
|
||||
<q-btn flat round color="primary" @click="savePNG()" icon="mdi-image">
|
||||
<q-tooltip> ดาวน์โหลด PNG </q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="red-7"
|
||||
@click="savePDF()"
|
||||
icon="mdi-file-pdf-box"
|
||||
>
|
||||
<q-tooltip> ดาวน์โหลด PDF </q-tooltip>
|
||||
</q-btn>
|
||||
<div class="bg-grey-2 q-py-xs q-px-sm rounded-borders">
|
||||
<q-breadcrumbs>
|
||||
<template v-slot:separator>
|
||||
<q-icon size="1.5em" name="chevron_right" color="primary" />
|
||||
</template>
|
||||
<template v-for="link in theBreadcrumb" :key="link.id">
|
||||
<q-breadcrumbs-el
|
||||
:label="link.label"
|
||||
@click="refreshChart(link.id)"
|
||||
class="breadcrumbs-link"
|
||||
/>
|
||||
</template>
|
||||
</q-breadcrumbs>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div style="overflow-x: auto; overflow-y: auto" class="q-pt-md">
|
||||
<StructChart
|
||||
style="height: 70vh"
|
||||
ref="chartRef"
|
||||
class="struct"
|
||||
:dataSource="dataSource"
|
||||
@onElementClick="refreshChart"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator />
|
||||
<div style="overflow-x: auto; overflow-y: auto" class="q-pt-md">
|
||||
<StructChart
|
||||
style="height: 70vh"
|
||||
ref="chartRef"
|
||||
class="struct"
|
||||
:dataSource="dataSource"
|
||||
@onElementClick="refreshChart"
|
||||
/>
|
||||
</div>
|
||||
</q-card>
|
||||
|
||||
<full-loader :visibility="loader"></full-loader>
|
||||
</template>
|
||||
|
||||
|
|
@ -224,7 +222,7 @@ const breadcrumbsGen = () => {
|
|||
.section-secondary,
|
||||
.struct .section-list {
|
||||
padding: 6px 15px 6px 15px;
|
||||
}
|
||||
}
|
||||
.struct .section-primary .header {
|
||||
font-weight: 600 !important;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,8 +228,8 @@ onMounted(async () => {
|
|||
(store.typeOrganizational = 'current'),
|
||||
(labelHistory = 'ประวัติโครงสร้าง')
|
||||
"
|
||||
:disable="ishasActive"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
dense
|
||||
class="q-px-md"
|
||||
|
|
@ -243,6 +243,7 @@ onMounted(async () => {
|
|||
:disable="ishasDraft"
|
||||
/>
|
||||
<q-btn-dropdown
|
||||
v-if="itemHistory.length !== 0"
|
||||
dense
|
||||
class="q-px-md"
|
||||
color="blue"
|
||||
|
|
@ -310,12 +311,25 @@ onMounted(async () => {
|
|||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-section style="padding: 0px">
|
||||
<ListView
|
||||
<!-- <ListView
|
||||
v-if="store.statusView === 'list'"
|
||||
v-model:historyId="historyId"
|
||||
v-model:count="count"
|
||||
/>
|
||||
<StructureView v-if="store.statusView === 'tree'" />
|
||||
<StructureView v-if="store.statusView === 'tree'" /> -->
|
||||
<q-tab-panels v-model="store.statusView" animated>
|
||||
<q-tab-panel name="list" style="padding: 0px">
|
||||
<ListView
|
||||
v-if="store.statusView === 'list'"
|
||||
v-model:historyId="historyId"
|
||||
v-model:count="count"
|
||||
/>
|
||||
</q-tab-panel>
|
||||
|
||||
<q-tab-panel name="tree" style="padding: 0px">
|
||||
<StructureView v-if="store.statusView === 'tree'" />
|
||||
</q-tab-panel>
|
||||
</q-tab-panels>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
|
|
@ -670,6 +765,7 @@ const clickSave = async () => {
|
|||
if (modalEdit.value) {
|
||||
await editData();
|
||||
} else {
|
||||
if (inputDate.value === "") dayChecked.value = true;
|
||||
await saveData();
|
||||
}
|
||||
}
|
||||
|
|
@ -694,13 +790,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);
|
||||
|
|
@ -728,9 +825,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, "บันทึกข้อมูลสำเร็จ");
|
||||
|
|
@ -817,6 +912,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();
|
||||
};
|
||||
|
||||
|
|
@ -825,6 +925,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 as Date)
|
||||
(refCommandDate && date2Thai(refCommandDate as Date)) || 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>();
|
||||
|
|
@ -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 () => {
|
||||
|
|
@ -728,6 +803,8 @@ const saveData = async () => {
|
|||
})
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
inputDate.value = "";
|
||||
inputRefCommandDate.value = "";
|
||||
modal.value = false;
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
@ -838,13 +915,19 @@ const selectData = async (props: DataProps) => {
|
|||
refCommandDate.value = props.row.refCommandDate == '-' ? '':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 as Date)
|
||||
: "";
|
||||
checkRowPage();
|
||||
};
|
||||
|
||||
/**
|
||||
* กดปุ่มเพิ่มบน table
|
||||
*/
|
||||
const addData = () => {
|
||||
inputDate.value = "";
|
||||
inputRefCommandDate.value = "";
|
||||
modalEdit.value = false;
|
||||
modal.value = true;
|
||||
edit.value = true;
|
||||
|
|
|
|||
|
|
@ -679,8 +679,12 @@ const fetchData = async () => {
|
|||
govermentData.value.ageAll = data.govAge;
|
||||
govermentData.value.reasonSameDate = data.reasonSameDate;
|
||||
|
||||
inputContainDate.value = convertDateDisplay(data.dateAppoint);
|
||||
inputWorkDate.value = convertDateDisplay(data.dateStart);
|
||||
inputContainDate.value = data.dateAppoint
|
||||
? convertDateDisplay(data.dateAppoint)
|
||||
: "";
|
||||
inputWorkDate.value = data.dateStart
|
||||
? convertDateDisplay(data.dateStart)
|
||||
: "";
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
|
|||
|
|
@ -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