แก้ประเภทคำสั่งของวินัย และสีปุ่ม

This commit is contained in:
Warunee Tamkoo 2023-12-18 17:09:55 +07:00
parent c32340737d
commit b13f8c0697
2 changed files with 23 additions and 13 deletions

View file

@ -82,7 +82,6 @@ const Ordersave = async () => {
const body = {
id,
};
console.log(body);
showLoader();
await http
.put(config.API.reportresult(type.value as string), body)
@ -123,14 +122,21 @@ const fecthTypeOption = async () => {
await http
.get(config.API.typeOrder())
.then((res) => {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-19" ||
e.commandCode === "C-PM-20" ||
e.commandCode === "C-PM-27" ||
e.commandCode === "C-PM-28" ||
e.commandCode === "C-PM-29"
);
if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-19" ||
e.commandCode === "C-PM-20" ||
e.commandCode === "C-PM-27" ||
e.commandCode === "C-PM-28" ||
e.commandCode === "C-PM-29"
);
} else {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-30" || e.commandCode === "C-PM-31"
);
}
})
.catch((e) => {
messageError($q, e);
@ -151,10 +157,14 @@ watchEffect(() => {
}
});
onMounted(async () => {
await fecthTypeOption();
});
watch(
() => props.title,
() => {
fecthTypeOption();
}
);
</script>
<template>
<q-dialog v-model="props.Modal">
<q-card style="width: 1200px; max-width: 80vw">