diff --git a/src/modules/13_salary/components/04_salaryLists/ProcessStep.vue b/src/modules/13_salary/components/04_salaryLists/ProcessStep.vue index 2613ed0db..56c17129c 100644 --- a/src/modules/13_salary/components/04_salaryLists/ProcessStep.vue +++ b/src/modules/13_salary/components/04_salaryLists/ProcessStep.vue @@ -379,11 +379,11 @@ onMounted(() => { - - - + + + - + /> --> - + /> --> - + /> --> - + /> --> - + /> --> - + /> --> - - - + /> --> + + { - - - - - --> + + + + - - + - - + - - + - - + - + + + + + + (""); //หน่วยงาน const snapFilter = ref(""); //รอบ const periodLatest = ref(); const salaryPeriodId = ref(""); +const dataOrg = ref([]); +const isDeputy = ref(false); // สำนักงานปลัด //ตัวเลือก const roundOptions = ref([]); //ตัวเลือกรอบการขึ้นเงินเดือน @@ -181,6 +183,7 @@ async function getAgency(id: string) { .get(config.API.activeOrganizationRootById(id)) .then(async (res) => { const data = res.data.result; + dataOrg.value = data; agencyOptions.value = []; agencyOptionsMain.value = []; agencyOptionsMain.value = await [ @@ -222,6 +225,10 @@ async function getAgencyPosition(id: string) { ); agencyFilter.value = position ? position.id : "ALL"; + isDeputy.value = position + ? dataOrg.value.find((e) => e.id === position.id)?.isDeputy + : false; + if (agencyFilter.value && roundFilter.value.id && snapFilter.value) { await fetchSalalyPeriod( agencyFilter.value, @@ -319,6 +326,9 @@ async function onChangeSnap() { /** function เปลี่ยนหน่วยงาน*/ async function onChangeAgency() { store.rootId = agencyFilter.value; + isDeputy.value = dataOrg.value.find( + (e) => e.id === agencyFilter.value + )?.isDeputy; if ( agencyFilter.value !== "ALL" && roundFilter.value.id && @@ -577,6 +587,7 @@ onMounted(async () => { :command-type-code-array="['C-PM-33', 'C-PM-34', 'C-PM-35']" :salary-period-id="salaryPeriodId" :title-command="titleCommand" + :is-deputy="isDeputy" /> diff --git a/src/modules/18_command/components/DialogCreateCommandORG.vue b/src/modules/18_command/components/DialogCreateCommandORG.vue index 9d655ca9d..c9f467d21 100644 --- a/src/modules/18_command/components/DialogCreateCommandORG.vue +++ b/src/modules/18_command/components/DialogCreateCommandORG.vue @@ -35,6 +35,7 @@ const modal = defineModel("modal", { required: true }); const isOfficer = defineModel("isOfficer"); const isStaff = defineModel("isStaff"); const rootId = defineModel("rootId"); +const isDeputy = defineModel("isDeputy", { default: false }); const props = defineProps({ commandTypeCode: { type: String, defult: "" }, // ไอดีประเภทคำสั่ง @@ -56,7 +57,7 @@ const commandCode = ref(""); const group = ref("GROUP1.1"); //กลุ่ม const isCheckOrgPublishDate = ref(false); //เช็คค่าของวันที่คำสั่งมีผล -const groupDataOp = ref([ +const groupDataMain = ref([ { id: "GROUP1.1", name: "กลุ่มที่ 1.1 : ปฏิบัติงาน ชำนาญงาน ปฏิบัติการ ชำนาญการ", @@ -70,7 +71,8 @@ const groupDataOp = ref([ name: "กลุ่มที่ 2 : ทักษะพิเศษ เชี่ยวชาญ ทรงคุณวุฒิ อำนวยการสูง บริหารต้น บริหารสูง", }, ]); -const groupOp = ref(groupDataOp.value); +const groupDataOp = ref([]); +const groupOp = ref([]); const dataMapToSend = computed(() => { return selected.value.map((i: any) => ({ refId: i.id, @@ -268,13 +270,16 @@ function getPerson() { watch(modal, async () => { if (modal.value) { + groupOp.value = groupDataMain.value; + groupDataOp.value = groupDataMain.value; fetchCommandType(); if (props.orgPublishDate) { commandExcecuteDate.value = props.orgPublishDate; isCheckOrgPublishDate.value = true; } await nextTick(); - if (isOfficer.value) { + + if (isOfficer.value && !isDeputy.value) { group.value = "GROUP1.2"; groupDataOp.value = groupDataOp.value.filter( (item) => item.id !== "GROUP1.1"