{
map-options
:options="columns"
option-value="name"
-
style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2"
/>
@@ -462,7 +469,10 @@ onMounted(async () => {
รายละเอียด
(true); // true คือแสดงปุ่มบันทึกและเลือกรายชื่อต่อ / false คือซ่อนปุ่มบันทึกและเลือกรายชื่อต่อ
+// tab สร้างคำสั่งใหม่ และเลือกคำสั่งที่เป็นแบบร่าง
+const tabOptions = ref([
+ { label: "สร้างคำสั่งใหม่", value: "NEW" },
+ { label: "เลือกคำสั่งที่เป็นแบบร่าง", value: "DRAF" },
+]);
+/** ฟังก์ชั่นเช็คการแสดงผล ตรวจสอบว่าเป็นประเภทคำสั่งที่เป็นแบบเลือกได้รายการเดียวไหม ถ้าเป็นแบบรายการเดียวจะซ่อนเลือกคำสั่งที่เป็นแบบร่าง*/
+async function displayTab() {
+ isHold.value =
+ (await (props.commandTypeCode !== "C-PM-10" &&
+ props.commandTypeCode !== "C-PM-11" &&
+ props.commandTypeCode !== "C-PM-12")) ?? false;
+ tabOptions.value = isHold.value
+ ? [
+ { label: "สร้างคำสั่งใหม่", value: "NEW" },
+ { label: "เลือกคำสั่งที่เป็นแบบร่าง", value: "DRAF" },
+ ]
+ : [{ label: "สร้างคำสั่งใหม่", value: "NEW" }];
+}
+
/** ดูการเปลี่ยนแปลงของจำนวนแถวต่อหน้า*/
watch(
() => pagination.value.rowsPerPage,
@@ -294,6 +315,7 @@ watch(
/** ดูการเปลี่ยนแปลงของ modal*/
watch(modal, () => {
if (modal.value && props.persons?.length !== 0) {
+ displayTab();
fetchCommandType();
}
});
@@ -313,7 +335,6 @@ watch(
-
@@ -324,10 +345,7 @@ watch(
color="white"
text-color="black"
no-caps
- :options="[
- { label: 'สร้างคำสั่งใหม่', value: 'NEW' },
- { label: 'เลือกคำสั่งที่เป็นแบบร่าง', value: 'DRAF' },
- ]"
+ :options="tabOptions"
/>
@@ -478,7 +496,6 @@ watch(
map-options
:options="columns"
option-value="name"
-
style="min-width: 140px"
class="gt-xs q-ml-sm"
/>
@@ -539,6 +556,7 @@ watch(
onSubmit(false)"
:disable="
diff --git a/src/modules/18_command/interface/index/Main.ts b/src/modules/18_command/interface/index/Main.ts
index 7c9647b5e..163f6e5af 100644
--- a/src/modules/18_command/interface/index/Main.ts
+++ b/src/modules/18_command/interface/index/Main.ts
@@ -12,6 +12,11 @@ interface ItemTabs {
name: string;
}
+interface TabOptions {
+ label: string;
+ value: string;
+}
+
interface DataPerson {
fullName?: string;
citizenId: string;
@@ -112,5 +117,6 @@ export type {
ListCommand,
DataOrder,
DataFileOrder,
- FormDataDetail
+ FormDataDetail,
+ TabOptions,
};