update =>คำร้องขอแก้ไขทะเบียนประวัติ
This commit is contained in:
parent
8dadcb450a
commit
4b473d34ba
1 changed files with 102 additions and 60 deletions
|
|
@ -17,8 +17,14 @@ const $q = useQuasar();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const store = useRequestEditStore();
|
const store = useRequestEditStore();
|
||||||
const { date2Thai, showLoader, hideLoader, messageError, success } =
|
const {
|
||||||
useCounterMixin();
|
dialogConfirm,
|
||||||
|
date2Thai,
|
||||||
|
showLoader,
|
||||||
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
success,
|
||||||
|
} = useCounterMixin();
|
||||||
|
|
||||||
const requestId = ref<string>(route.params.id.toString());
|
const requestId = ref<string>(route.params.id.toString());
|
||||||
const dataRequest = ref<any>({
|
const dataRequest = ref<any>({
|
||||||
|
|
@ -55,13 +61,13 @@ async function fetchDataRequest() {
|
||||||
detail: data.detail,
|
detail: data.detail,
|
||||||
};
|
};
|
||||||
|
|
||||||
// formData.status = data.status;
|
formData.status = data.status;
|
||||||
// formData.remark = data.remark;
|
formData.remark = data.remark;
|
||||||
// if (data.status !== "PENDING") {
|
if (data.status !== "PENDING") {
|
||||||
// isReadOnly.value = true;
|
isReadOnly.value = true;
|
||||||
// } else {
|
} else {
|
||||||
// isReadOnly.value = false;
|
isReadOnly.value = false;
|
||||||
// }
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -71,6 +77,28 @@ async function fetchDataRequest() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** function บันทึกรายการคำร้อง*/
|
||||||
|
function onSubmit() {
|
||||||
|
dialogConfirm($q, async () => {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.patch(config.API.requestEdit + `${requestId.value}`, {
|
||||||
|
status: formData.status,
|
||||||
|
remark: formData.remark,
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
await fetchDataRequest();
|
||||||
|
await success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* function ค้นหาคำใน select สถานะคำร้อง
|
* function ค้นหาคำใน select สถานะคำร้อง
|
||||||
* @param val คำค้น
|
* @param val คำค้น
|
||||||
|
|
@ -203,64 +231,78 @@ onMounted(async () => {
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<!-- แก้ไขสถานะคำร้อง -->
|
<!-- แก้ไขสถานะคำร้อง -->
|
||||||
<q-card bordered class="row col-12">
|
<q-form
|
||||||
<div class="bg-grey-1 q-pa-sm col-12 row items-center">
|
class="col-12"
|
||||||
<div class="q-pl-sm text-weight-bold text-dark">
|
greedy
|
||||||
แก้ไขสถานะคำร้อง
|
@submit.prevent
|
||||||
|
@validation-success="onSubmit"
|
||||||
|
>
|
||||||
|
<q-card bordered class="row col-12">
|
||||||
|
<div class="bg-grey-1 q-pa-sm col-12 row items-center">
|
||||||
|
<div class="q-pl-sm text-weight-bold text-dark">
|
||||||
|
แก้ไขสถานะคำร้อง
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-12"><q-separator /></div>
|
||||||
<div class="col-12"><q-separator /></div>
|
<q-card-section class="col-12">
|
||||||
<q-card-section class="col-12">
|
<div class="row q-col-gutter-sm">
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="col-xs-12 col-md-12">
|
||||||
<div class="col-xs-12 col-md-12">
|
<q-select
|
||||||
<q-select
|
:class="classInput(isReadOnly)"
|
||||||
:class="classInput(isReadOnly)"
|
:readonly="isReadOnly"
|
||||||
:readonly="isReadOnly"
|
v-model="formData.status"
|
||||||
v-model="formData.status"
|
label="สถานะ"
|
||||||
label="สถานะ"
|
dense
|
||||||
dense
|
outlined
|
||||||
outlined
|
emit-value
|
||||||
emit-value
|
map-options
|
||||||
map-options
|
:options="statusOption"
|
||||||
:options="statusOption"
|
:rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะ'}`]"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกสถานะ'}`]"
|
lazy-rules
|
||||||
lazy-rules
|
hide-bottom-space
|
||||||
hide-bottom-space
|
use-input
|
||||||
use-input
|
option-label="name"
|
||||||
option-label="name"
|
option-value="id"
|
||||||
option-value="id"
|
@filter="(inputValue:string,
|
||||||
@filter="(inputValue:string,
|
|
||||||
doneFn:Function) => filterOption(inputValue, doneFn
|
doneFn:Function) => filterOption(inputValue, doneFn
|
||||||
) "
|
) "
|
||||||
>
|
>
|
||||||
<template v-slot:no-option>
|
<template v-slot:no-option>
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section class="text-grey">
|
<q-item-section class="text-grey">
|
||||||
ไม่มีข้อมูล
|
ไม่มีข้อมูล
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</template>
|
</template>
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-12 col-md-12">
|
<div class="col-xs-12 col-md-12">
|
||||||
<q-input
|
<q-input
|
||||||
:class="classInput(isReadOnly)"
|
:class="classInput(isReadOnly)"
|
||||||
:readonly="isReadOnly"
|
:readonly="isReadOnly"
|
||||||
v-model="formData.remark"
|
v-model="formData.remark"
|
||||||
label="หมายเหตุ"
|
label="หมายเหตุ"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
type="textarea"
|
type="textarea"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row col-12 justify-end" v-if="!isReadOnly">
|
||||||
|
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||||
|
><q-tooltip>บันทึก</q-tooltip></q-btn
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</q-card-section>
|
||||||
</q-card-section>
|
<q-separator />
|
||||||
</q-card>
|
</q-card>
|
||||||
|
</q-form>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<Workflow :id="requestId" sys-name=" REGISTRY_PROFILE" />
|
<Workflow :id="requestId" sys-name="REGISTRY_PROFILE" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue