แก้ไข รายงานเครื่องราช

This commit is contained in:
Thanit Konmek 2023-08-28 16:18:26 +07:00
parent aadb3927e2
commit 62f728f975
2 changed files with 14 additions and 2 deletions

View file

@ -81,13 +81,17 @@ const fecthlistRound = async () => {
}); });
}; };
const updateSelect = () => {
conditionDocument("show");
};
const conditionDocument = (type: string) => { const conditionDocument = (type: string) => {
myForm.value?.validate().then(async (success: boolean) => { myForm.value?.validate().then(async (success: boolean) => {
if (success) { if (success) {
if (type == "show") { if (type == "show") {
await downloadReport("pdf", false); await downloadReport("pdf", false);
} else { } else {
await downloadReport("pdf", false); // await downloadReport("pdf", false);
await downloadReport(type, true); await downloadReport(type, true);
} }
} }
@ -183,6 +187,7 @@ const downloadReport = async (
option-value="id" option-value="id"
option-label="name" option-label="name"
style="width: 150px" style="width: 150px"
@update:model-value="updateSelect"
/> />
<q-select <q-select
class="q-pa-none" class="q-pa-none"
@ -197,6 +202,7 @@ const downloadReport = async (
option-value="id" option-value="id"
option-label="name" option-label="name"
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']" :rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
@update:model-value="updateSelect"
/> />
</q-form> </q-form>
<!-- style="width: 200px" --> <!-- style="width: 200px" -->

View file

@ -85,13 +85,17 @@ const fecthlistRound = async () => {
}); });
}; };
const updateSelect = () => {
conditionDocument("show");
};
const conditionDocument = (type: string) => { const conditionDocument = (type: string) => {
myForm.value?.validate().then(async (success: boolean) => { myForm.value?.validate().then(async (success: boolean) => {
if (success) { if (success) {
if (type == "show") { if (type == "show") {
await downloadReport("pdf", false); await downloadReport("pdf", false);
} else { } else {
await downloadReport("pdf", false); // await downloadReport("pdf", false);
await downloadReport(type, true); await downloadReport(type, true);
} }
} }
@ -177,6 +181,7 @@ const downloadReport = async (
option-value="id" option-value="id"
option-label="name" option-label="name"
style="width: 150px" style="width: 150px"
@update:model-value="updateSelect"
/> --> /> -->
<q-select <q-select
class="q-pa-none" class="q-pa-none"
@ -191,6 +196,7 @@ const downloadReport = async (
option-value="id" option-value="id"
option-label="name" option-label="name"
:rules="[(val) => !!val || 'กรุณาเลือกรอบ']" :rules="[(val) => !!val || 'กรุณาเลือกรอบ']"
@update:model-value="updateSelect"
/> />
</q-form> </q-form>
<!-- style="width: 200px" --> <!-- style="width: 200px" -->