no message
This commit is contained in:
parent
b85a61920d
commit
d54a6c1fa9
3 changed files with 32 additions and 22 deletions
|
|
@ -15,6 +15,7 @@ const $q = useQuasar();
|
|||
const isActive = ref<boolean>(false);
|
||||
const period = ref<string>("");
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const effective = defineModel<Date|null|string>("effective", { required: true });
|
||||
const mixin = useCounterMixin();
|
||||
const { dialogConfirm, date2Thai, messageError } = mixin;
|
||||
const isReadonly = ref<boolean>(false); // อ่านได้อย่างเดียว
|
||||
|
|
@ -66,7 +67,7 @@ function saveData() {}
|
|||
function clearForm() {
|
||||
isActive.value = false;
|
||||
period.value = "";
|
||||
effectiveDate.value = null;
|
||||
effective.value = null;
|
||||
}
|
||||
|
||||
function close() {
|
||||
|
|
@ -79,7 +80,7 @@ function editSummit(){
|
|||
const body = {
|
||||
period: period.value,
|
||||
isActive: isActive.value,
|
||||
effectiveDate: effectiveDate.value,
|
||||
effectiveDate: effective.value,
|
||||
};
|
||||
http
|
||||
.put(config.API.salaryPeriod()+`/${props.idRound}`, body)
|
||||
|
|
@ -100,7 +101,7 @@ function onSubmit() {
|
|||
const body = {
|
||||
period: period.value,
|
||||
isActive: isActive.value,
|
||||
effectiveDate: effectiveDate.value,
|
||||
effectiveDate: effective.value,
|
||||
};
|
||||
http
|
||||
.post(config.API.salaryPeriod(), body)
|
||||
|
|
@ -124,12 +125,17 @@ function inputEdit(val: boolean) {
|
|||
}
|
||||
|
||||
watch(
|
||||
() => props.edit,
|
||||
() => modal.value,
|
||||
() => {
|
||||
console.log(props.edit)
|
||||
if (props.edit == true) {
|
||||
period.value = props.period ? props.period :'';
|
||||
effectiveDate.value = props.effectiveDate ? props.effectiveDate:null;
|
||||
isActive.value = props.isActive;
|
||||
}else{
|
||||
effective.value = null
|
||||
period.value = ''
|
||||
isActive.value = false
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -166,7 +172,7 @@ watch(
|
|||
/>
|
||||
<datepicker
|
||||
menu-class-name="modalfix"
|
||||
v-model="effectiveDate"
|
||||
v-model="effective"
|
||||
:locale="'th'"
|
||||
autoApply
|
||||
borderless
|
||||
|
|
@ -190,7 +196,7 @@ watch(
|
|||
:readonly="isReadonly"
|
||||
hide-bottom-space
|
||||
:model-value="
|
||||
effectiveDate != null ? date2Thai(effectiveDate) : null
|
||||
effective != null ? date2Thai(effective as Date) : null
|
||||
"
|
||||
label="วันที่มีผลบังคับใช้งาน"
|
||||
:rules="[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue