fix command

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-10-10 11:52:53 +07:00
parent adcb1f034f
commit d065650e1b
5 changed files with 12 additions and 65 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { onMounted, ref, watch, reactive, onBeforeMount } from "vue";
import { onMounted, ref, reactive } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
@ -18,21 +18,13 @@ import ReceivedCopy from "@/modules/18_command/components/Step/3_ReceivedCopy.vu
import Attached from "@/modules/18_command/components/Step/4_Attached.vue"; //
const $q = useQuasar();
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const router = useRouter();
const route = useRoute();
const commandId = ref<string>(route.params.id.toString()); //ID
const store = useCommandDetail();
const childDetailRef = ref<InstanceType<typeof Detail> | null>(null); //ref components
const childListPersonsRef = ref<InstanceType<typeof ListPersons> | null>(null); //ref components
const childReceivedCopyRef = ref<InstanceType<typeof ReceivedCopy> | null>(
null
); //ref components
const childAttachedRef = ref<InstanceType<typeof Attached> | null>(null); //ref components
const tabs = ref<string>("Main"); //Tab
const readonly = ref<boolean>(route.name === "commandViewDetailPage"); //
const isChangeData = ref<boolean>(false); //
// Tab
const tabsManu = ref<ItemTabs[]>([
@ -62,7 +54,7 @@ let formCommandList = reactive<FormDataDetail>({
commandAffectDate: null, //
commandExcecuteDate: null, //
commandSysId: "", //
isAttachment:true
isAttachment: true,
});
/**
@ -97,28 +89,8 @@ async function fetchDataCommandList() {
});
}
/**
* การเปลยนแปลงของ tabs เมอมการเปลยนแปลง
*
* เชคการเปลยนแปลงของขอม าการเปลยนแปลงของขอมลจะบนทกขอม
*/
// watch(tabs, (newValue, oldValue) => {
// //
// if (isChangeData.value) {
// const refMap: { [key: string]: any } = {
// Detail: childDetailRef,
// ListPersons: childListPersonsRef,
// ReceivedCopy: childReceivedCopyRef,
// Attached: childAttachedRef,
// };
// refMap[oldValue]?.value?.onSubmit();
// }
// });
/**
* ทำงานเม Components กเรยกใชงาน
*
* กำหนดค `store.readonly` เม route.name เป "commandViewDetailPage" จะอานขอมลไดอยางเดยว
*/
onMounted(async () => {
@ -169,7 +141,6 @@ onMounted(async () => {
<q-tab-panel style="padding: 0px" name="Main">
<q-card>
<Main
ref="childDetailRef"
v-model:is-change-data="isChangeData"
:on-check-change-data="onCheckChangeData"
/>
@ -179,7 +150,6 @@ onMounted(async () => {
<q-tab-panel style="padding: 0px" name="Detail">
<q-card>
<Detail
ref="childDetailRef"
v-model:is-change-data="isChangeData"
:on-check-change-data="onCheckChangeData"
:fetch-data-command-list="fetchDataCommandList"
@ -190,7 +160,6 @@ onMounted(async () => {
<q-tab-panel class="bg-grey-2" style="padding: 0px" name="ListPersons">
<ListPersons
ref="childListPersonsRef"
v-model:is-change-data="isChangeData"
:on-check-change-data="onCheckChangeData"
:fetch-data-command-list="fetchDataCommandList"
@ -201,7 +170,6 @@ onMounted(async () => {
<q-tab-panel style="padding: 0px" name="ReceivedCopy">
<q-card>
<ReceivedCopy
ref="childReceivedCopyRef"
v-model:is-change-data="isChangeData"
:on-check-change-data="onCheckChangeData"
/>
@ -211,10 +179,9 @@ onMounted(async () => {
<q-tab-panel style="padding: 0px" name="Attached">
<q-card>
<Attached
ref="childAttachedRef"
v-model:is-change-data="isChangeData"
:on-check-change-data="onCheckChangeData"
v-model:is-attachment="formCommandList.isAttachment "
v-model:is-attachment="formCommandList.isAttachment"
/>
</q-card>
</q-tab-panel>