fix(command): validate if isIdofficer isBangkok fields to show warnings

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2026-04-17 14:59:22 +07:00
parent 9d9cd92d6b
commit 8a0a6ea873
4 changed files with 29 additions and 23 deletions

View file

@ -92,12 +92,25 @@ async function fetchDataCommandList() {
});
}
/** ฟังก์ชันเช็ค สกจ.*/
async function fetchCheckIdofficer() {
await http
.get(config.API.checkIdofficer)
.then((res) => {
store.isIdofficer = res.data.result;
})
.catch((err) => {
messageError($q, err);
});
}
/**
* ทำงานเม Components กเรยกใชงาน
* กำหนดค `store.readonly` เม route.name เป "commandViewDetailPage" จะอานขอมลไดอยางเดยว
*/
onMounted(async () => {
await fetchDataCommandList();
await fetchCheckIdofficer();
store.readonly =
route.name === "commandViewDetailPage" ||
formCommandList.status === "REPORTED" ||