ui command tab 2/3/5

This commit is contained in:
STW_TTTY\stwtt 2024-09-24 10:50:42 +07:00
parent fc9f22ba2b
commit df4cb61671
6 changed files with 396 additions and 62 deletions

View file

@ -23,6 +23,7 @@ const router = useRouter();
const route = useRoute();
const commandId = ref<string>(route.params.id.toString()); //ID
const store = useCommandDetail();
const isMomFirst = ref<boolean>(false);
const childDetailRef = ref<InstanceType<typeof Detail> | null>(null); //ref components
const childListPersonsRef = ref<InstanceType<typeof ListPersons> | null>(null); //ref components
@ -31,7 +32,7 @@ const childReceivedCopyRef = ref<InstanceType<typeof ReceivedCopy> | null>(
); //ref components
const childAttachedRef = ref<InstanceType<typeof Attached> | null>(null); //ref components
const tabs = ref<string>("Detail"); //Tab
const tabs = ref<string>("Main"); //Tab
const readonly = ref<boolean>(route.name === "commandViewDetailPage"); //
const isChangeData = ref<boolean>(false); //
// Tab
@ -49,7 +50,7 @@ const tabsManu = ref<ItemTabs[]>([
{ label: "พรีวิวคำสั่ง", name: "Attached" },
]);
const formCommandList = reactive<FormDataDetail>({
let formCommandList = reactive<FormDataDetail>({
id: "",
status: "",
commandTypeName: "",
@ -84,19 +85,7 @@ async function fetchDataCommandList() {
.get(config.API.commandAction(commandId.value, "tab1"))
.then(async (res) => {
const data = await res.data.result;
formCommandList.id = data.id;
formCommandList.status = data.status;
formCommandList.commandTypeName = data.commandTypeName;
formCommandList.commandNo = data.commandNo;
formCommandList.commandYear = data.commandYear;
formCommandList.detailHeader = data.detailHeader;
formCommandList.detailBody = data.detailBody;
formCommandList.detailFooter = data.detailFooter;
formCommandList.issue = data.issue;
formCommandList.commandAffectDate = data.commandAffectDate;
formCommandList.commandExcecuteDate = data.commandExcecuteDate;
formCommandList.commandSysId = data.commandSysId;
formCommandList = data;
isChangeData.value = false;
})
.catch((err) => {
@ -204,7 +193,7 @@ onMounted(async () => {
ref="childListPersonsRef"
v-model:is-change-data="isChangeData"
:on-check-change-data="onCheckChangeData"
:form-command-list="formCommandList"
:command-sys-id="formCommandList.commandSysId as string"
:fetch-data-command-list="fetchDataCommandList"
/>
</q-card>