Merge branch 'nice_dev' into develop
This commit is contained in:
commit
ea655acefb
2 changed files with 66 additions and 20 deletions
|
|
@ -1,31 +1,60 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, watch } from "vue";
|
import { ref, reactive, watch } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { HistoryType } from "@/modules/02_organizationalNew/interface/index/Main";
|
import type { HistoryType } from "@/modules/02_organizationalNew/interface/index/Main";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import config from "@/app.config";
|
import { useOrganizational } from "@/modules/02_organizationalNew/store/organizational";
|
||||||
|
|
||||||
const modal = defineModel<boolean>("structureDetail", { required: true });
|
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
const store = useOrganizational();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||||
|
|
||||||
|
const modal = defineModel<boolean>("structureDetail", { required: true });
|
||||||
|
const treeId = defineModel<string>("treeId", { required: true });
|
||||||
|
const orgLevel = defineModel<number>("orgLevel", { required: true });
|
||||||
|
|
||||||
const formData = reactive<any>({
|
const formData = reactive<any>({
|
||||||
orgName: "สำนักงาน ก.ก.",
|
orgName: "",
|
||||||
agencyName: "กลุ่มงานสารสนเทศฯศูนย์สารสนเทศ", //*ส่วนราชการ
|
agencyName: "", //*ส่วนราชการ
|
||||||
orgType: "ส่วนราชการ", //*ประเภท
|
orgType: "", //*ประเภท
|
||||||
orgLevel: "กลุ่มงาน", //*ระดับ
|
orgLevel: "", //*ระดับ
|
||||||
status: "ปกติ", //*สถานะ
|
status: "", //*สถานะ
|
||||||
orgPhoneEx: "0111111111", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
orgPhoneEx: "", //หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก
|
||||||
orgPhoneIn: "0333333333", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
orgPhoneIn: "", //หมายเลขโทรศัพท์ที่ติดต่อจากภายใน
|
||||||
orgFax: "023123456", //หมายเลขโทรสาร
|
orgFax: "", //หมายเลขโทรสาร
|
||||||
|
orgShortName: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
async function fetchDetailTree(id: string, type: string) {
|
||||||
|
await http
|
||||||
|
.get(config.API.orgLevelByid(type.toLocaleLowerCase(), id))
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
formData.orgName = data[`org${type}Name`];
|
||||||
|
formData.agencyName = data[`org${type}Name`];
|
||||||
|
formData.orgType = data[`org${type}Name`];
|
||||||
|
formData.orgLevel = data[`org${type}Rank`];
|
||||||
|
formData.status = data[`org${type}Name`];
|
||||||
|
formData.orgPhoneEx = data[`org${type}PhoneEx`];
|
||||||
|
formData.orgPhoneIn = data[`org${type}PhoneIn`];
|
||||||
|
formData.orgFax = data[`org${type}Fax`];
|
||||||
|
formData.orgShortName = data[`org${type}ShortName`];
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
}
|
}
|
||||||
|
|
@ -34,6 +63,8 @@ watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
() => {
|
() => {
|
||||||
if (modal.value == true) {
|
if (modal.value == true) {
|
||||||
|
const type = store.checkLevel(orgLevel.value);
|
||||||
|
fetchDetailTree(treeId.value, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -53,7 +84,7 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 text-grey-8">
|
<div class="col-8 text-grey-8">
|
||||||
<p>{{ formData.orgName }}</p>
|
<p>{{ formData.orgName }} ({{ formData.orgShortName }})</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row q-col-gutter-sm q-mb-xs">
|
<div class="row q-col-gutter-sm q-mb-xs">
|
||||||
|
|
@ -103,13 +134,21 @@ watch(
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-8 text-grey-8">
|
<div class="col-8 text-grey-8">
|
||||||
<p class="q-ma-none">{{ formData.orgPhoneEx ? `ภายนอก ${formData.orgPhoneEx}`:'' }}</p>
|
<p class="q-ma-none">
|
||||||
|
{{
|
||||||
|
formData.orgPhoneEx ? `ภายนอก ${formData.orgPhoneEx}` : ""
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm">
|
||||||
<div class="offset-4 col-8 text-grey-8">
|
<div class="offset-4 col-8 text-grey-8">
|
||||||
<p>{{ formData.orgPhoneIn ? `ภายใน ${formData.orgPhoneIn}`:'' }}</p>
|
<p>
|
||||||
|
{{
|
||||||
|
formData.orgPhoneIn ? `ภายใน ${formData.orgPhoneIn}` : ""
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,6 +242,8 @@ function searchAndReplace(
|
||||||
const dialogAgency = ref<boolean>(false);
|
const dialogAgency = ref<boolean>(false);
|
||||||
const actionType = ref<string>("");
|
const actionType = ref<string>("");
|
||||||
const dataNode = ref<any>();
|
const dataNode = ref<any>();
|
||||||
|
const treeId = ref<string>("");
|
||||||
|
|
||||||
function onClickAgency(level: number, node: any) {
|
function onClickAgency(level: number, node: any) {
|
||||||
dialogAgency.value = !dialogAgency.value;
|
dialogAgency.value = !dialogAgency.value;
|
||||||
orgLevel.value = level;
|
orgLevel.value = level;
|
||||||
|
|
@ -250,9 +252,10 @@ function onClickAgency(level: number, node: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const dialogDetail = ref<boolean>(false);
|
const dialogDetail = ref<boolean>(false);
|
||||||
function onClickDetail() {
|
function onClickDetail(id: string, level: number) {
|
||||||
console.log(dialogDetail.value);
|
treeId.value = id;
|
||||||
dialogDetail.value = !dialogDetail.value;
|
dialogDetail.value = !dialogDetail.value;
|
||||||
|
orgLevel.value = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onClickEdit(node: any) {
|
async function onClickEdit(node: any) {
|
||||||
|
|
@ -403,7 +406,7 @@ onMounted(async () => {
|
||||||
: item.type === 'ADD'
|
: item.type === 'ADD'
|
||||||
? onClickAgency(prop.node.orgLevel + 1, prop.node)
|
? onClickAgency(prop.node.orgLevel + 1, prop.node)
|
||||||
: item.type === 'DETAIL'
|
: item.type === 'DETAIL'
|
||||||
? onClickDetail()
|
? onClickDetail(prop.node.orgTreeId, prop.node.orgLevel)
|
||||||
: item.type === 'DEL'
|
: item.type === 'DEL'
|
||||||
? onClickDel(prop.node.orgLevel, prop.node.orgTreeId)
|
? onClickDel(prop.node.orgLevel, prop.node.orgTreeId)
|
||||||
: null
|
: null
|
||||||
|
|
@ -478,7 +481,11 @@ onMounted(async () => {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- รายละเอียดโครงสร้าง -->
|
<!-- รายละเอียดโครงสร้าง -->
|
||||||
<DialogStructureDetail v-model:structure-detail="dialogDetail" />
|
<DialogStructureDetail
|
||||||
|
v-model:structure-detail="dialogDetail"
|
||||||
|
v-model:treeId="treeId"
|
||||||
|
v-model:orgLevel="orgLevel"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue