Merge branch 'nice' into develop
This commit is contained in:
commit
cdfd03c713
11 changed files with 123 additions and 13 deletions
|
|
@ -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 || `${'กรุณาเลือกระดับตำแหน่ง'}`]
|
||||
: []
|
||||
"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ interface FormDataNewStructure {
|
|||
orgRevisionId: string;
|
||||
orgRevisionName: string;
|
||||
typeDraft: string;
|
||||
remark: string;
|
||||
}
|
||||
|
||||
interface FormAgencyRef {
|
||||
|
|
|
|||
|
|
@ -116,6 +116,8 @@ interface PosMaster {
|
|||
profilePosition: string;
|
||||
profilePostype: string;
|
||||
profilePoslevel: string;
|
||||
conditionReason: string;
|
||||
isCondition: boolean;
|
||||
}
|
||||
interface Position2 {
|
||||
id: string; // id ตำแหน่ง
|
||||
|
|
@ -150,6 +152,11 @@ interface PosMaster2 {
|
|||
positionArea: string; // ด้าน/สาขา
|
||||
positionIsSelected: string; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้น ๆ หรือไม่?
|
||||
positions: Position[]; // ตำแหน่ง
|
||||
conditionReason: string;
|
||||
isCondition: boolean;
|
||||
profilePosition: string;
|
||||
profilePoslevel: string;
|
||||
profilePostype: string;
|
||||
}
|
||||
|
||||
interface HistoryPos {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
const rootId = ref<string>("");
|
||||
const isOfficer = ref<boolean | null>(null);
|
||||
const isStaff = ref<boolean | null>(null);
|
||||
const remark = ref<string>("");
|
||||
|
||||
const dataActive = ref<DataActive>(); //ข้อมูลโครงสร้าง
|
||||
const activeId = ref<string>(); // id โครงสร้างปัจจุบัน
|
||||
|
|
@ -169,5 +170,6 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
|||
isStaff,
|
||||
rootId,
|
||||
isLosck,
|
||||
remark,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import StructureOrgMain from "@/modules/02_organization/components/StructureOrgM
|
|||
import DialogFormNewStructure from "@/modules/02_organization/components/DialogNewStructure.vue";
|
||||
import DialogDateTime from "@/modules/02_organization/components/DialogFormDateTime.vue";
|
||||
import DialogCreateCommandORG from "@/modules/18_command/components/DialogCreateCommandORG.vue"; //ส่่งไปออกคำสั่ง
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
|
|
@ -43,6 +43,7 @@ const labelHistory = ref<string>("ประวัติโครงสร้า
|
|||
const count = ref<number>(0);
|
||||
|
||||
const modalCommand = ref<boolean>(false); //ส่งไปออกคำสั่ง
|
||||
const modalRemark = ref<boolean>(false); // หมายเหตุ
|
||||
|
||||
/**
|
||||
* function เรียกข้อมูลโครงสร้าง แบบปัจุบันและ แบบร่าง
|
||||
|
|
@ -323,6 +324,17 @@ onMounted(async () => {
|
|||
</q-btn-dropdown>
|
||||
</q-btn-group>
|
||||
|
||||
<q-btn
|
||||
v-if="store.remark"
|
||||
flat
|
||||
round
|
||||
color="info"
|
||||
icon="info"
|
||||
@click="modalRemark = true"
|
||||
>
|
||||
<q-tooltip>หมายเหตุ</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
checkPermission($route)?.attrOwnership == 'OWNER' &&
|
||||
|
|
@ -450,6 +462,21 @@ onMounted(async () => {
|
|||
v-model:root-id="store.rootId"
|
||||
:system-name="'ORGANIZATION'"
|
||||
/>
|
||||
|
||||
<q-dialog v-model="modalRemark">
|
||||
<q-card style="width: 300px">
|
||||
<DialogHeader tittle="หมายเหตุ" :close="() => (modalRemark = false)" />
|
||||
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{{ store.remark }}
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ import type { DataStructureTree } from "@/interface/main";
|
|||
*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
|
||||
/** use*/
|
||||
const route = useRoute();
|
||||
const $q = useQuasar();
|
||||
|
|
@ -87,9 +86,11 @@ function onSubmit(type: string, id: string) {
|
|||
if (props.dateCheckReceive === null) {
|
||||
formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii));
|
||||
formData.append("File", files.value);
|
||||
formData.append("OrgId", OrganazationId.value);
|
||||
} else {
|
||||
formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii));
|
||||
formData.append("File", filesReturn.value);
|
||||
formData.append("OrgId", OrganazationId2.value);
|
||||
}
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -107,6 +108,8 @@ function onSubmit(type: string, id: string) {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ async function fetchDataTree(id: string) {
|
|||
.get(config.API.orgByid(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
nodeTree.value = data;
|
||||
nodeTree.value = data.data;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue