(false); // แสดงเพิ่มร
async function onSubmit() {
//ถ้าเป็น สกจ. ต้องเลือกประเภทคำสั่งด้วย
if (
- store.isIdofficer &&
+ isIdofficer.value &&
formData.isBangkok !== "BANGKOK" &&
formData.isBangkok !== "OFFICE"
) {
@@ -214,6 +225,7 @@ function onDeleteData(id: string) {
onMounted(async () => {
try {
showLoader();
+ await fetchCheckIdofficer();
await fetchDataOperatorList();
formData.commandNo = props.formCommandList.commandNo;
formData.commandYear = props.formCommandList.commandYear;
@@ -223,7 +235,7 @@ onMounted(async () => {
formData.issue = props.formCommandList.issue;
formData.commandAffectDate = props.formCommandList.commandAffectDate;
formData.commandExcecuteDate = props.formCommandList.commandExcecuteDate;
- formData.isBangkok = !store.isIdofficer
+ formData.isBangkok = !isIdofficer.value
? null
: props.formCommandList.isBangkok;
commandCode.value = props.formCommandList.commandCode;
@@ -488,7 +500,7 @@ onMounted(async () => {
{
const readonly = ref(false);
const dataCommand = ref();
const status = ref("");
- const isSalary = ref(false);
- const isIdofficer = ref(false);
+ const isSalary = ref(false)
function checkStep(val: string) {
status.value = val;
switch (val) {
@@ -40,7 +39,6 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
readonly,
status,
dataCommand,
- isSalary,
- isIdofficer,
+ isSalary
};
});
diff --git a/src/modules/18_command/views/detail.vue b/src/modules/18_command/views/detail.vue
index 5e41124dc..37ab3326f 100644
--- a/src/modules/18_command/views/detail.vue
+++ b/src/modules/18_command/views/detail.vue
@@ -92,25 +92,12 @@ 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" ||