fix command
This commit is contained in:
parent
adcb1f034f
commit
d065650e1b
5 changed files with 12 additions and 65 deletions
|
|
@ -46,6 +46,7 @@ async function fetchData() {
|
||||||
isDraft.value = data.isDraft;
|
isDraft.value = data.isDraft;
|
||||||
isSign.value = data.isSign;
|
isSign.value = data.isSign;
|
||||||
isAttachment.value = data.isAttachment;
|
isAttachment.value = data.isAttachment;
|
||||||
|
store.readonly = step.value === 5;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, reactive, ref, watch } from "vue";
|
import { onMounted, reactive, ref } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
|
|
||||||
|
|
@ -102,13 +102,6 @@ onMounted(() => {
|
||||||
: props.formCommandList.isBangkok;
|
: props.formCommandList.isBangkok;
|
||||||
fetchCheckIdofficer();
|
fetchCheckIdofficer();
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* ฟังก์ชันที่ต้องการนำฟังก์ชันออกไปใช้ใน Components แม่
|
|
||||||
*/
|
|
||||||
defineExpose({
|
|
||||||
onSubmit,
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,9 @@ async function onSawpPos(val: any, type: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.commandSwap("tab2", type, val.id))
|
.get(config.API.commandSwap("tab2", type, val.id))
|
||||||
.then((res) => {
|
.then(async () => {
|
||||||
|
await getPersonList();
|
||||||
success($q, "แก้ไขข้อมูลสำเร็จ");
|
success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||||
getPersonList();
|
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -139,9 +139,9 @@ function onDelete(id: string) {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.delete(config.API.commandAction(id, "tab2"))
|
.delete(config.API.commandAction(id, "tab2"))
|
||||||
.then((res) => {
|
.then(async () => {
|
||||||
|
await getPersonList();
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
getPersonList();
|
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
@ -228,8 +228,8 @@ async function getPersonList() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.commandAction(commandId.value, "tab2"))
|
.get(config.API.commandAction(commandId.value, "tab2"))
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = await res.data.result;
|
||||||
templatePos.value = data.commandSalaryId;
|
templatePos.value = data.commandSalaryId;
|
||||||
position.value = data.positionDetail;
|
position.value = data.positionDetail;
|
||||||
rows.value = data.commandRecives;
|
rows.value = data.commandRecives;
|
||||||
|
|
@ -248,13 +248,6 @@ onMounted(async () => {
|
||||||
await getCommandSalaryList(props.commandSysId);
|
await getCommandSalaryList(props.commandSysId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* ฟังก์ชันที่ต้องการนำฟังก์ชันออกไปใช้ใน Components แม่
|
|
||||||
*/
|
|
||||||
defineExpose({
|
|
||||||
onSubmit,
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -196,13 +196,6 @@ function onSubmit() {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* ฟังก์ชันที่ต้องการนำฟังก์ชันออกไปใช้ใน Components แม่
|
|
||||||
*/
|
|
||||||
defineExpose({
|
|
||||||
onSubmit,
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref, watch, reactive, onBeforeMount } from "vue";
|
import { onMounted, ref, reactive } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
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"; //คำสั่งและบัญชีแนบท้าบ
|
import Attached from "@/modules/18_command/components/Step/4_Attached.vue"; //คำสั่งและบัญชีแนบท้าบ
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const commandId = ref<string>(route.params.id.toString()); //ID คำสั่ง
|
const commandId = ref<string>(route.params.id.toString()); //ID คำสั่ง
|
||||||
const store = useCommandDetail();
|
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 tabs = ref<string>("Main"); //Tab
|
||||||
const readonly = ref<boolean>(route.name === "commandViewDetailPage"); //อ่านได้อย่างเดียว
|
|
||||||
const isChangeData = ref<boolean>(false); //การเปลี่ยนแปลงของข้อมูล
|
const isChangeData = ref<boolean>(false); //การเปลี่ยนแปลงของข้อมูล
|
||||||
//รายการ Tab ละเอียดคำสั่ง
|
//รายการ Tab ละเอียดคำสั่ง
|
||||||
const tabsManu = ref<ItemTabs[]>([
|
const tabsManu = ref<ItemTabs[]>([
|
||||||
|
|
@ -62,7 +54,7 @@ let formCommandList = reactive<FormDataDetail>({
|
||||||
commandAffectDate: null, //วันที่ลงนาม
|
commandAffectDate: null, //วันที่ลงนาม
|
||||||
commandExcecuteDate: null, //วันที่คำสั่งมีผล
|
commandExcecuteDate: null, //วันที่คำสั่งมีผล
|
||||||
commandSysId: "", // ประเภท คำสั่ง
|
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 ถูกเรียกใช้งาน
|
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||||
*
|
|
||||||
* กำหนดค่า `store.readonly` เมื่อ route.name เป็น "commandViewDetailPage" จะอ่านข้อมูลได้อย่างเดียว
|
* กำหนดค่า `store.readonly` เมื่อ route.name เป็น "commandViewDetailPage" จะอ่านข้อมูลได้อย่างเดียว
|
||||||
*/
|
*/
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|
@ -169,7 +141,6 @@ onMounted(async () => {
|
||||||
<q-tab-panel style="padding: 0px" name="Main">
|
<q-tab-panel style="padding: 0px" name="Main">
|
||||||
<q-card>
|
<q-card>
|
||||||
<Main
|
<Main
|
||||||
ref="childDetailRef"
|
|
||||||
v-model:is-change-data="isChangeData"
|
v-model:is-change-data="isChangeData"
|
||||||
:on-check-change-data="onCheckChangeData"
|
:on-check-change-data="onCheckChangeData"
|
||||||
/>
|
/>
|
||||||
|
|
@ -179,7 +150,6 @@ onMounted(async () => {
|
||||||
<q-tab-panel style="padding: 0px" name="Detail">
|
<q-tab-panel style="padding: 0px" name="Detail">
|
||||||
<q-card>
|
<q-card>
|
||||||
<Detail
|
<Detail
|
||||||
ref="childDetailRef"
|
|
||||||
v-model:is-change-data="isChangeData"
|
v-model:is-change-data="isChangeData"
|
||||||
:on-check-change-data="onCheckChangeData"
|
:on-check-change-data="onCheckChangeData"
|
||||||
:fetch-data-command-list="fetchDataCommandList"
|
:fetch-data-command-list="fetchDataCommandList"
|
||||||
|
|
@ -190,7 +160,6 @@ onMounted(async () => {
|
||||||
|
|
||||||
<q-tab-panel class="bg-grey-2" style="padding: 0px" name="ListPersons">
|
<q-tab-panel class="bg-grey-2" style="padding: 0px" name="ListPersons">
|
||||||
<ListPersons
|
<ListPersons
|
||||||
ref="childListPersonsRef"
|
|
||||||
v-model:is-change-data="isChangeData"
|
v-model:is-change-data="isChangeData"
|
||||||
:on-check-change-data="onCheckChangeData"
|
:on-check-change-data="onCheckChangeData"
|
||||||
:fetch-data-command-list="fetchDataCommandList"
|
:fetch-data-command-list="fetchDataCommandList"
|
||||||
|
|
@ -201,7 +170,6 @@ onMounted(async () => {
|
||||||
<q-tab-panel style="padding: 0px" name="ReceivedCopy">
|
<q-tab-panel style="padding: 0px" name="ReceivedCopy">
|
||||||
<q-card>
|
<q-card>
|
||||||
<ReceivedCopy
|
<ReceivedCopy
|
||||||
ref="childReceivedCopyRef"
|
|
||||||
v-model:is-change-data="isChangeData"
|
v-model:is-change-data="isChangeData"
|
||||||
:on-check-change-data="onCheckChangeData"
|
:on-check-change-data="onCheckChangeData"
|
||||||
/>
|
/>
|
||||||
|
|
@ -211,10 +179,9 @@ onMounted(async () => {
|
||||||
<q-tab-panel style="padding: 0px" name="Attached">
|
<q-tab-panel style="padding: 0px" name="Attached">
|
||||||
<q-card>
|
<q-card>
|
||||||
<Attached
|
<Attached
|
||||||
ref="childAttachedRef"
|
|
||||||
v-model:is-change-data="isChangeData"
|
v-model:is-change-data="isChangeData"
|
||||||
:on-check-change-data="onCheckChangeData"
|
:on-check-change-data="onCheckChangeData"
|
||||||
v-model:is-attachment="formCommandList.isAttachment "
|
v-model:is-attachment="formCommandList.isAttachment"
|
||||||
/>
|
/>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue