เลื่อนเงินเดือน => เพิ่ม remark
This commit is contained in:
parent
5775054ef1
commit
80a69afd86
7 changed files with 125 additions and 19 deletions
|
|
@ -23,12 +23,14 @@ const profileId = defineModel<string>("profileId", { required: true });
|
|||
const props = defineProps({
|
||||
typeLevel: { type: String, required: true },
|
||||
isReserve: { type: Boolean, required: true },
|
||||
remark: { type: String, required: true },
|
||||
fetchData: {
|
||||
type: Function,
|
||||
},
|
||||
});
|
||||
|
||||
const type = ref<string>("");
|
||||
const note = ref<string>("");
|
||||
const typeRef = ref<any>(null);
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
const isChange = ref<boolean>(false); // มีการแก้ไขข้อมูลหรือไม่
|
||||
|
|
@ -75,6 +77,7 @@ function onSubmit() {
|
|||
profileId: profileId.value,
|
||||
type: type.value,
|
||||
isReserve: isReserve.value,
|
||||
remark: type.value === "NONE" ? note.value : undefined,
|
||||
};
|
||||
http
|
||||
.post(config.API.salaryPeriodEmp() + `/change/type`, body)
|
||||
|
|
@ -92,10 +95,15 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
function chengType() {
|
||||
note.value = props.typeLevel === "NONE" ? props.remark : "";
|
||||
}
|
||||
|
||||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel;
|
||||
note.value = props.typeLevel === "NONE" ? props.remark : "";
|
||||
isReserve.value = props.isReserve;
|
||||
isChange.value = false;
|
||||
}
|
||||
|
|
@ -132,7 +140,7 @@ function inputEdit(val: boolean) {
|
|||
:rules="[(val) => !!val || `${'กรุณาเลือก ขั้น'}`]"
|
||||
lazy-rules
|
||||
hide-bottom-space
|
||||
@update:model-value="isChange = true"
|
||||
@update:model-value="(isChange = true), chengType()"
|
||||
/>
|
||||
<!-- :options="typeRangeOps.filter((e) => e.id !== store.tabType)" -->
|
||||
|
||||
|
|
@ -144,6 +152,17 @@ function inputEdit(val: boolean) {
|
|||
v-model="isReserve"
|
||||
@update:model-value="isChange = true"
|
||||
/>
|
||||
|
||||
<q-input
|
||||
v-if="type === 'NONE'"
|
||||
:class="inputEdit(isReadonly)"
|
||||
outlined
|
||||
dense
|
||||
v-model="note"
|
||||
label="หมายเหตุ"
|
||||
type="textarea"
|
||||
@update:model-value="isChange = true"
|
||||
/>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue