This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-10 14:35:56 +07:00
parent ace4e47c94
commit a18581abbe
3 changed files with 9 additions and 8 deletions

View file

@ -877,7 +877,6 @@ const getClass = (val: boolean) => {
v-model="command" v-model="command"
hide-bottom-space hide-bottom-space
:label="`${'คำสั่งเลขที่'}`" :label="`${'คำสั่งเลขที่'}`"
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเลขที่'}`]"
/> />
</div> </div>
<label class="col-1 flex justify-center items-center text-bold" <label class="col-1 flex justify-center items-center text-bold"

View file

@ -455,7 +455,7 @@ function fetchSalaryRound() {
v-model="command" v-model="command"
hide-bottom-space hide-bottom-space
:label="`${'คำสั่งเลขที่'}`" :label="`${'คำสั่งเลขที่'}`"
:rules="[(val) => !!val || `${'กรุณากรอกคำสั่งเลขที่'}`]"
/> />
</div> </div>
<label class="col-1 flex justify-center items-center text-bold" <label class="col-1 flex justify-center items-center text-bold"

View file

@ -86,8 +86,8 @@ function fetchPosType() {
id: e.id, id: e.id,
name: e.posTypeName, name: e.posTypeName,
})); }));
salaryPosTypeOptionMain.value = listOption;
salaryPosTypeOption.value = listOption; salaryPosTypeOption.value = listOption;
salaryPosTypeOptionMain.value = listOption;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -105,8 +105,8 @@ function fetchPosLevel(id: string) {
name: e.posLevelName, name: e.posLevelName,
})) || []; })) || [];
salaryPosLevelOptionMain.value = listOption;
salaryPosLevelOption.value = listOption; salaryPosLevelOption.value = listOption;
salaryPosLevelOptionMain.value = listOption;
if (!listOption.some((e: DataOption) => e.id === formData.posLevelId)) { if (!listOption.some((e: DataOption) => e.id === formData.posLevelId)) {
formData.posLevelId = ""; formData.posLevelId = "";
} }
@ -146,18 +146,20 @@ function fetchSalaryDetail(id: string) {
*/ */
watch( watch(
() => modal.value, () => modal.value,
() => { async () => {
if (modal.value) { if (modal.value) {
fetchPosType(); await fetchPosType();
if (props.typeAction === "edit") { if (props.typeAction === "edit") {
showLoader();
setTimeout(() => { setTimeout(() => {
if (props.data) { if (props.data) {
salaryId.value = props.data.id; salaryId.value = props.data.id;
fetchPosLevel(props?.data?.posTypeId);
fetchSalaryDetail(props.data.id); fetchSalaryDetail(props.data.id);
fetchPosLevel(props.data.posTypeId); hideLoader();
} }
}, 100); }, 2000);
} }
} }
} }