โครงสร้าง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-21 12:48:12 +07:00
parent 112f650623
commit 0f706b8e75
11 changed files with 123 additions and 13 deletions

View file

@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, reactive, watch, } from "vue";
import { ref, reactive, watch } from "vue";
import { useQuasar } from "quasar";
import http from "@/plugins/http";
@ -232,6 +232,8 @@ async function clearFormPositionSelect() {
formPositionSelect.positionExecutive = "";
formPositionSelect.positionExecutiveField = "";
formPositionSelect.positionArea = "";
shape.value = "false";
posExecutive.value = "";
isSpecial.value = false;
setTimeout(async () => {
isDisValidate.value = false;
@ -376,7 +378,7 @@ watch(
hide-bottom-space
:rules="
!isDisValidate
? [(val) => !!val || `${'กรุณากรอกตำแหน่งในสายงาน'}`]
? [(val:string) => !!val || `${'กรุณากรอกตำแหน่งในสายงาน'}`]
: []
"
/>
@ -407,7 +409,7 @@ watch(
hide-bottom-space
:rules="
!isDisValidate
? [(val) => !!val || `${'กรุณากรอกสายงาน'}`]
? [(val:string) => !!val || `${'กรุณากรอกสายงาน'}`]
: []
"
/>
@ -430,7 +432,7 @@ watch(
hide-bottom-space
:rules="
!isDisValidate
? [(val) => !!val || `${'กรุณาเลือกประเภทตำแหน่ง'}`]
? [(val:string) => !!val || `${'กรุณาเลือกประเภทตำแหน่ง'}`]
: []
"
/>
@ -453,7 +455,7 @@ watch(
hide-bottom-space
:rules="
!isDisValidate
? [(val) => !!val || `${'กรุณาเลือกระดับตำแหน่ง'}`]
? [(val:string) => !!val || `${'กรุณาเลือกระดับตำแหน่ง'}`]
: []
"
/>

View file

@ -69,6 +69,7 @@ const formData = reactive<FormDataNewStructure>({
orgRevisionId: "",
orgRevisionName: "",
typeDraft: "",
remark: "",
});
/** ฟังก์ชันยืนยันการบันทึกการกสร้างโครงสร้าง*/
@ -130,6 +131,7 @@ function close() {
formData.orgRevisionId = "";
formData.orgRevisionName = "";
formData.typeDraft = "";
formData.remark = "";
selectType.value = [];
}
@ -202,6 +204,18 @@ watch(
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อโครงสร้าง'}`]"
/>
</div>
<div class="col-12">
<q-input
v-model="formData.remark"
dense
outlined
for="#orgRevisionRemark"
label="หมายเหตุ"
hide-bottom-space
type="textarea"
/>
</div>
<div class="col-12" v-if="type === 'ADD'">
เลอกทำสำเนา
<div class="column">

View file

@ -56,7 +56,7 @@ async function fetchTree() {
await http
.get(config.API.orgByid(id))
.then((res) => {
nodeTree.value = res.data.result;
nodeTree.value = res.data.result.data;
})
.catch((err) => {
messageError($q, err);

View file

@ -19,6 +19,7 @@ import type {
import type { FilterMaster } from "@/modules/02_organization/interface/request/organizational";
import type { PosMaster2 } from "@/modules/02_organization/interface/response/organizational";
import type { DataPosition } from "@/modules/02_organization/interface/index/organizational";
import type { DataPositionCondition } from "@/modules/19_condition/interface/response/Main";
/** importComponents*/
import DialogFormPosotion from "@/modules/02_organization/components/DialogFormPosition.vue"; //
@ -28,6 +29,7 @@ import DialogMovePos from "@/modules/02_organization/components/DialogMovePos.vu
import DialogHistoryPos from "@/modules/02_organization/components/DialogHistoryPos.vue"; //
import DialogSelectPerson from "@/modules/02_organization/components/DialogSelectPerson.vue"; //
import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue"; //
import DialogCondition from "@/modules/19_condition/components/DialogCondition.vue";
const $q = useQuasar();
const store = useOrganizational();
@ -96,6 +98,12 @@ const listMenu = ref<ListMenu[]>([
type: "INHERIT",
color: "deep-orange",
},
{
label: "จัดการตำแหน่งติดเงื่อนไข",
icon: "mdi-account-alert",
type: "CONDITION",
color: "deep-orange",
},
{
label: "ประวัติตำแหน่ง",
icon: "history",
@ -481,6 +489,34 @@ async function onClickDownloadReport(val: string, name: string) {
});
}
const modalCondition = ref<boolean>(false);
const dataCondition = ref<DataPositionCondition>();
function onClickCodition(data: PosMaster2) {
dataCondition.value = {
conditionReason: data.conditionReason,
id: data.id,
isCondition: data.isCondition,
orgShortname: data.orgShortname,
posMasterNo: Number(data.posMasterNo),
posMasterNoPrefix: data.posMasterNoPrefix,
posMasterNoSuffix: data.posMasterNoSuffix,
profilePosition: data.profilePosition,
profilePoslevel: data.profilePoslevel,
profilePostype: data.profilePostype,
positions: [],
};
modalCondition.value = true;
}
async function fetchDataCondition() {
await props.fetchDataTable?.(
reqMaster.value.id,
reqMaster.value.type,
reqMaster.value.isAll
);
}
const pagination = ref({
page: reqMaster.value.page,
rowsPerPage: reqMaster.value.pageSize,
@ -684,6 +720,8 @@ watch(
? onClickInherit(props.row.id)
: item.type === 'COPY'
? onClickCopyPosition('COPY', props.row.id)
: item.type === 'CONDITION'
? onClickCodition(props.row)
: null
"
>
@ -739,7 +777,12 @@ watch(
/>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
:class="props.row.isCondition ? 'text-red' : ''"
>
<div v-if="col.name == 'no'">
{{
(reqMaster.page - 1) * Number(reqMaster.pageSize) +
@ -908,6 +951,13 @@ watch(
<!-- บทอดตำแหน -->
<DialogSuccession v-model:modal="modalDialogSuccession" :rowId="rowId" />
<!-- ดการตำแหนงตดเงอนไข -->
<DialogCondition
v-model:modal="modalCondition"
:fetch-data="fetchDataCondition"
:data-condition="dataCondition"
/>
</template>
<style lang="scss" scoped>

View file

@ -65,7 +65,8 @@ async function fetchDataTree(id: string) {
.get(config.API.orgByid(id))
.then((res) => {
const data = res.data.result;
nodeTree.value = data;
nodeTree.value = data.data;
store.remark = data.remark;
selected.value = "";
nodeId.value = "";
store.treeId = "";
@ -117,11 +118,14 @@ async function fetchDataTable(id: string, level: number, action: boolean) {
if (p.length !== 0) {
const a = p.find((el: Position) => el.positionIsSelected === true);
const { id, ...rest } = a ? a : p[0];
const test = { ...e, ...rest };
const test = {
...e,
...rest,
};
dataMain.push(test);
}
});
posMaster.value = await store.fetchPosMaster(dataMain);
posMaster.value = store.fetchPosMaster(dataMain);
})
.catch((err) => {
messageError($q, err);