Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2024-11-21 16:46:23 +07:00
commit dc3e62dc68
17 changed files with 312 additions and 84 deletions

View file

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

View file

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

View file

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

View file

@ -19,6 +19,7 @@ import type {
import type { FilterMaster } from "@/modules/02_organization/interface/request/organizational"; import type { FilterMaster } from "@/modules/02_organization/interface/request/organizational";
import type { PosMaster2 } from "@/modules/02_organization/interface/response/organizational"; import type { PosMaster2 } from "@/modules/02_organization/interface/response/organizational";
import type { DataPosition } from "@/modules/02_organization/interface/index/organizational"; import type { DataPosition } from "@/modules/02_organization/interface/index/organizational";
import type { DataPositionCondition } from "@/modules/19_condition/interface/response/Main";
/** importComponents*/ /** importComponents*/
import DialogFormPosotion from "@/modules/02_organization/components/DialogFormPosition.vue"; // 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 DialogHistoryPos from "@/modules/02_organization/components/DialogHistoryPos.vue"; //
import DialogSelectPerson from "@/modules/02_organization/components/DialogSelectPerson.vue"; // import DialogSelectPerson from "@/modules/02_organization/components/DialogSelectPerson.vue"; //
import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue"; // import DialogSuccession from "@/modules/02_organization/components/DialogSuccession.vue"; //
import DialogCondition from "@/modules/19_condition/components/DialogCondition.vue";
const $q = useQuasar(); const $q = useQuasar();
const store = useOrganizational(); const store = useOrganizational();
@ -96,6 +98,12 @@ const listMenu = ref<ListMenu[]>([
type: "INHERIT", type: "INHERIT",
color: "deep-orange", color: "deep-orange",
}, },
{
label: "จัดการตำแหน่งติดเงื่อนไข",
icon: "mdi-account-alert",
type: "CONDITION",
color: "deep-orange",
},
{ {
label: "ประวัติตำแหน่ง", label: "ประวัติตำแหน่ง",
icon: "history", 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({ const pagination = ref({
page: reqMaster.value.page, page: reqMaster.value.page,
rowsPerPage: reqMaster.value.pageSize, rowsPerPage: reqMaster.value.pageSize,
@ -684,6 +720,8 @@ watch(
? onClickInherit(props.row.id) ? onClickInherit(props.row.id)
: item.type === 'COPY' : item.type === 'COPY'
? onClickCopyPosition('COPY', props.row.id) ? onClickCopyPosition('COPY', props.row.id)
: item.type === 'CONDITION'
? onClickCodition(props.row)
: null : null
" "
> >
@ -739,7 +777,12 @@ watch(
/> />
</q-td> </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'"> <div v-if="col.name == 'no'">
{{ {{
(reqMaster.page - 1) * Number(reqMaster.pageSize) + (reqMaster.page - 1) * Number(reqMaster.pageSize) +
@ -908,6 +951,13 @@ watch(
<!-- บทอดตำแหน --> <!-- บทอดตำแหน -->
<DialogSuccession v-model:modal="modalDialogSuccession" :rowId="rowId" /> <DialogSuccession v-model:modal="modalDialogSuccession" :rowId="rowId" />
<!-- ดการตำแหนงตดเงอนไข -->
<DialogCondition
v-model:modal="modalCondition"
:fetch-data="fetchDataCondition"
:data-condition="dataCondition"
/>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

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

View file

@ -55,6 +55,7 @@ interface FormDataNewStructure {
orgRevisionId: string; orgRevisionId: string;
orgRevisionName: string; orgRevisionName: string;
typeDraft: string; typeDraft: string;
remark: string;
} }
interface FormAgencyRef { interface FormAgencyRef {

View file

@ -116,6 +116,8 @@ interface PosMaster {
profilePosition: string; profilePosition: string;
profilePostype: string; profilePostype: string;
profilePoslevel: string; profilePoslevel: string;
conditionReason: string;
isCondition: boolean;
} }
interface Position2 { interface Position2 {
id: string; // id ตำแหน่ง id: string; // id ตำแหน่ง
@ -150,6 +152,11 @@ interface PosMaster2 {
positionArea: string; // ด้าน/สาขา positionArea: string; // ด้าน/สาขา
positionIsSelected: string; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้น ๆ หรือไม่? positionIsSelected: string; // เป็นตำแหน่งที่ถูกเลือกในรอบนั้น ๆ หรือไม่?
positions: Position[]; // ตำแหน่ง positions: Position[]; // ตำแหน่ง
conditionReason: string;
isCondition: boolean;
profilePosition: string;
profilePoslevel: string;
profilePostype: string;
} }
interface HistoryPos { interface HistoryPos {

View file

@ -15,6 +15,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
const rootId = ref<string>(""); const rootId = ref<string>("");
const isOfficer = ref<boolean | null>(null); const isOfficer = ref<boolean | null>(null);
const isStaff = ref<boolean | null>(null); const isStaff = ref<boolean | null>(null);
const remark = ref<string>("");
const dataActive = ref<DataActive>(); //ข้อมูลโครงสร้าง const dataActive = ref<DataActive>(); //ข้อมูลโครงสร้าง
const activeId = ref<string>(); // id โครงสร้างปัจจุบัน const activeId = ref<string>(); // id โครงสร้างปัจจุบัน
@ -169,5 +170,6 @@ export const useOrganizational = defineStore("organizationalStore", () => {
isStaff, isStaff,
rootId, rootId,
isLosck, isLosck,
remark,
}; };
}); });

View file

@ -23,7 +23,7 @@ import StructureOrgMain from "@/modules/02_organization/components/StructureOrgM
import DialogFormNewStructure from "@/modules/02_organization/components/DialogNewStructure.vue"; import DialogFormNewStructure from "@/modules/02_organization/components/DialogNewStructure.vue";
import DialogDateTime from "@/modules/02_organization/components/DialogFormDateTime.vue"; import DialogDateTime from "@/modules/02_organization/components/DialogFormDateTime.vue";
import DialogCreateCommandORG from "@/modules/18_command/components/DialogCreateCommandORG.vue"; // import DialogCreateCommandORG from "@/modules/18_command/components/DialogCreateCommandORG.vue"; //
import DialogHeader from "@/components/DialogHeader.vue";
/** /**
* use * use
*/ */
@ -43,6 +43,7 @@ const labelHistory = ref<string>("ประวัติโครงสร้า
const count = ref<number>(0); const count = ref<number>(0);
const modalCommand = ref<boolean>(false); // const modalCommand = ref<boolean>(false); //
const modalRemark = ref<boolean>(false); //
/** /**
* function เรยกขอมลโครงสราง แบบปนและ แบบราง * function เรยกขอมลโครงสราง แบบปนและ แบบราง
@ -323,6 +324,17 @@ onMounted(async () => {
</q-btn-dropdown> </q-btn-dropdown>
</q-btn-group> </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 <q-btn
v-if=" v-if="
checkPermission($route)?.attrOwnership == 'OWNER' && checkPermission($route)?.attrOwnership == 'OWNER' &&
@ -450,6 +462,21 @@ onMounted(async () => {
v-model:root-id="store.rootId" v-model:root-id="store.rootId"
:system-name="'ORGANIZATION'" :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> </template>
<style scoped></style> <style scoped></style>

View file

@ -16,7 +16,6 @@ import type { DataStructureTree } from "@/interface/main";
*/ */
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
/** use*/ /** use*/
const route = useRoute(); const route = useRoute();
const $q = useQuasar(); const $q = useQuasar();
@ -48,8 +47,10 @@ const files = ref<any>(); //ไฟล์รับ
const filesReturn = ref<any>(); // const filesReturn = ref<any>(); //
const OrganazationId = ref<string>(""); //id const OrganazationId = ref<string>(""); //id
const OrganazationId2 = ref<string>(""); //id const OrganazationId2 = ref<string>(""); //id
const OrgListMain = ref<DataOption[]>([]); ////
const OrgList = ref<DataOption[]>([]); // const OrgList = ref<DataOption[]>([]); //
const OrgList2 = ref<DataOption[]>([]); //// const OrgList2 = ref<DataOption[]>([]); //
const Datereceive = ref<Date | null>(); // const Datereceive = ref<Date | null>(); //
const Datereturn = ref<Date | null>(); // const Datereturn = ref<Date | null>(); //
const nullii = ref<any>(null); const nullii = ref<any>(null);
@ -87,9 +88,11 @@ function onSubmit(type: string, id: string) {
if (props.dateCheckReceive === null) { if (props.dateCheckReceive === null) {
formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii)); formData.append("Date", dateToISO((Datereceive.value as Date) ?? nullii));
formData.append("File", files.value); formData.append("File", files.value);
formData.append("OrgId", OrganazationId.value);
} else { } else {
formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii)); formData.append("Date", dateToISO((Datereturn.value as Date) ?? nullii));
formData.append("File", filesReturn.value); formData.append("File", filesReturn.value);
formData.append("OrgId", OrganazationId2.value);
} }
showLoader(); showLoader();
http http
@ -107,6 +110,8 @@ function onSubmit(type: string, id: string) {
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
}); });
@ -116,6 +121,16 @@ function onSubmit(type: string, id: string) {
* function เรยกหนวยงาน * function เรยกหนวยงาน
*/ */
async function fetchOrgList() { async function fetchOrgList() {
const newData = [
{
id: "00000000-0000-0000-0000-000000000000",
name: "สำนักนายกรัฐมนตรี",
},
];
// OrgListMain.value = newData;
// OrgList.value = newData;
// OrgList2.value = newData;
showLoader(); showLoader();
await http await http
.get(config.API.activeOrganization) .get(config.API.activeOrganization)
@ -130,8 +145,11 @@ async function fetchOrgList() {
name: item.orgName, name: item.orgName,
}) })
); );
OrgList.value = dataSystem;
OrgList2.value = dataSystem; newData.push(...dataSystem);
OrgListMain.value = newData;
OrgList.value = newData;
OrgList2.value = newData;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -145,14 +163,49 @@ async function fetchOrgList() {
}); });
} }
/**
* function นหาขอมลใน select
* @param val คำคนหา
* @param update Function
*/
function filterOption(val: string, update: Function, type: string) {
switch (type) {
case "receive":
update(() => {
OrgList.value = OrgListMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
case "return":
update(() => {
OrgList2.value = OrgListMain.value.filter(
(v: DataOption) => v.name.indexOf(val) > -1
);
});
break;
}
}
/**
* class inpui
* @param val าสถานะ
*/
function classInput(val: boolean) {
return {
"full-width cursor-pointer ": val,
"full-width cursor-pointer inputgreen": !val,
};
}
/** /**
* callback function จะทำงานเม modal การเปลยนแปลง * callback function จะทำงานเม modal การเปลยนแปลง
*/ */
watch( watch(
() => props.modal, () => props.modal,
() => { async () => {
if (props.modal == true) { if (props.modal == true) {
fetchOrgList(); await fetchOrgList();
} }
} }
); );
@ -164,15 +217,16 @@ watch(props, () => {
if (props.dataModal) { if (props.dataModal) {
Datereceive.value = props.dataModal.dateReceiveInsignia; Datereceive.value = props.dataModal.dateReceiveInsignia;
Datereturn.value = props.dataModal.dateReturnInsignia; Datereturn.value = props.dataModal.dateReturnInsignia;
OrganazationId.value = props.dataModal.orgReceiveInsignia; OrganazationId.value = props.dataModal.orgReceiveInsigniaId;
filesCheck.value = props.dataModal.docReceiveInsignia; filesCheck.value = props.dataModal.docReceiveInsignia;
filesReturnCheck.value = props.dataModal.docReturnInsignia; filesReturnCheck.value = props.dataModal.docReturnInsignia;
OrganazationId2.value = OrganazationId2.value =
Datereturn.value != null Datereturn.value != null
? props.dataModal.orgReturnInsignia == null || ? props.dataModal.orgReturnInsigniaId === null ||
props.dataModal.orgReturnInsignia == "-" props.dataModal.orgReturnInsigniaId === "-" ||
props.dataModal.orgReturnInsigniaId === ""
? "00000000-0000-0000-0000-000000000000" ? "00000000-0000-0000-0000-000000000000"
: props.dataModal.orgReturnInsignia : props.dataModal.orgReturnInsigniaId
: ""; : "";
} }
}); });
@ -180,7 +234,7 @@ watch(props, () => {
<template> <template>
<q-dialog v-model="props.modal" persistent> <q-dialog v-model="props.modal" persistent>
<q-card style="min-width: 900px"> <q-card style="width: 1200px; max-width: 200vw">
<q-form <q-form
greedy greedy
@submit.prevent @submit.prevent
@ -223,12 +277,12 @@ watch(props, () => {
outlined outlined
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่ได้รับ']" :rules="[(val:string) => !!val || 'กรุณาเลือกวันที่ได้รับ']"
hide-bottom-space hide-bottom-space
class="inputgreen"
:model-value=" :model-value="
Datereceive != null ? date2Thai(Datereceive) : null Datereceive != null ? date2Thai(Datereceive) : null
" "
:label="`${'วันที่ได้รับ'}`" :label="`${'วันที่ได้รับ'}`"
:disable="dateCheckReceive !== null" :class="classInput(dateCheckReceive !== null)"
:readonly="dateCheckReceive !== null"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -268,6 +322,7 @@ watch(props, () => {
:rules="[(val:string) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']" :rules="[(val:string) => val || 'กรุณาเลือกไฟล์หลักฐานการรับ']"
hide-bottom-space hide-bottom-space
:disable="dateCheckReceive !== null" :disable="dateCheckReceive !== null"
class="inputgreen"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
@ -285,12 +340,16 @@ watch(props, () => {
emit-value emit-value
map-options map-options
outlined outlined
use-input
v-model="OrganazationId" v-model="OrganazationId"
lazy-rules lazy-rules
:label="`หน่วยงานที่รับ`" :label="`หน่วยงานที่รับ`"
:rules="[(val:string) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']" :rules="[(val:string) => !!val || 'กรุณาเลือกหน่วยงานที่รับ']"
:disable="dateCheckReceive !== null" :class="classInput(dateCheckReceive !== null)"
class="inputgreen" :readonly="dateCheckReceive !== null"
@filter="(inputValue:string,
doneFn:Function) => filterOption(inputValue, doneFn,'receive'
) "
/> />
</div> </div>
</div> </div>
@ -325,7 +384,6 @@ watch(props, () => {
dense dense
borderless borderless
outlined outlined
class="inputgreen"
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่คืน']" :rules="[(val:string) => !!val || 'กรุณาเลือกวันที่คืน']"
hide-bottom-space hide-bottom-space
:model-value=" :model-value="
@ -334,7 +392,8 @@ watch(props, () => {
:label="`${'วันที่คืน'}`" :label="`${'วันที่คืน'}`"
clearable clearable
@clear="clearReturnDate" @clear="clearReturnDate"
:disable="dateCheckReturn !== null" :class="classInput(dateCheckReturn !== null)"
:readonly="dateCheckReturn !== null"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
@ -374,6 +433,7 @@ watch(props, () => {
:rules="[(val:string) => val || 'กรุณาเลือกไฟล์หลักฐานการคืน']" :rules="[(val:string) => val || 'กรุณาเลือกไฟล์หลักฐานการคืน']"
hide-bottom-space hide-bottom-space
:disable="dateCheckReturn !== null" :disable="dateCheckReturn !== null"
class="inputgreen"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" color="primary" /> <q-icon name="attach_file" color="primary" />
@ -393,10 +453,15 @@ watch(props, () => {
outlined outlined
v-model="OrganazationId2" v-model="OrganazationId2"
lazy-rules lazy-rules
use-input
:label="`หน่วยงานที่คืน`" :label="`หน่วยงานที่คืน`"
:rules="[(val:string) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']" :rules="[(val:string) => !!val || 'กรุณาเลือกหน่วยงานที่คืน']"
:disable="dateCheckReturn !== null" :class="classInput(dateCheckReturn !== null)"
class="inputgreen" :readonly="dateCheckReturn !== null"
@filter="(inputValue:string,
doneFn:Function) => filterOption(inputValue, doneFn,'return'
) "
/> />
</div> </div>
</div> </div>

View file

@ -157,8 +157,6 @@ function findlist(id: string = "", idCard: string) {
} else { } else {
notifyError($q, "ไม่พบข้อมูลเลขประจำตัวประชาชนนี้"); notifyError($q, "ไม่พบข้อมูลเลขประจำตัวประชาชนนี้");
} }
console.log(res);
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
@ -241,6 +239,8 @@ function onSubmit() {
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
})
.finally(() => {
hideLoader(); hideLoader();
}); });
} }
@ -274,6 +274,17 @@ function filterSelector(val: string, update: Function, name: string) {
}); });
} }
/**
* class inpui
* @param val าสถานะ
*/
function classInput(val: boolean) {
return {
"full-width cursor-pointer ": val,
"full-width cursor-pointer inputgreen": !val,
};
}
/** /**
* callback function จำทำงานเม props.modal = true เป popup เพมรายชอบนทกผล * callback function จำทำงานเม props.modal = true เป popup เพมรายชอบนทกผล
*/ */
@ -339,9 +350,9 @@ watch(props, () => {
v-model="employeeClass" v-model="employeeClass"
:label="`ขรก.สามัญ/ลูกจ้างประจำ`" :label="`ขรก.สามัญ/ลูกจ้างประจำ`"
@update:model-value="selectType" @update:model-value="selectType"
:disable="status !== ''" :class="classInput(status !== '')"
:readonly="status !== ''"
lazy-rules lazy-rules
class="inputgreen"
/> />
</div> </div>
<div class="col-12 text-weight-bold text-grey"> <div class="col-12 text-weight-bold text-grey">
@ -349,12 +360,17 @@ watch(props, () => {
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:disable=" :readonly="
disbleStatus || status == 'DONE' || status == 'PENDING' disbleStatus || status == 'DONE' || status == 'PENDING'
" "
:class="
classInput(
disbleStatus || status == 'DONE' || status == 'PENDING'
)
"
:disable="employeeClass == ''"
hide-bottom-space hide-bottom-space
outlined outlined
class="inputgreen"
v-model="cardid" v-model="cardid"
dense dense
lazy-rules lazy-rules
@ -373,12 +389,12 @@ watch(props, () => {
<div class="col-xs-6 col-sm-4"> <div class="col-xs-6 col-sm-4">
<q-input <q-input
disable :disable="employeeClass == ''"
readonly
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="fullName" v-model="fullName"
:label="`${'ชื่อ-นามสกุล'}`" :label="`${'ชื่อ-นามสกุล'}`"
@ -387,12 +403,12 @@ watch(props, () => {
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
disable :disable="employeeClass == ''"
readonly
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="position" v-model="position"
:label="`ตำเเหน่ง`" :label="`ตำเเหน่ง`"
@ -407,8 +423,10 @@ watch(props, () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:rules="[ :class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
:rules="disbleStatus || status == 'DONE' ? [] : [
(val:string) => (val:string) =>
!!val || !!val ||
'กรุณากรอกหมายเลขประกาศนีย์บัตรกำกับเครื่องราชอิสริยาภรณ์', 'กรุณากรอกหมายเลขประกาศนีย์บัตรกำกับเครื่องราชอิสริยาภรณ์',
@ -420,12 +438,13 @@ watch(props, () => {
v-model="Advertise" v-model="Advertise"
lazy-rules lazy-rules
label="หมายเลขประกาศนีย์บัตรกำกับเครื่องราชอิสริยาภรณ์" label="หมายเลขประกาศนีย์บัตรกำกับเครื่องราชอิสริยาภรณ์"
class="inputgreen"
/> />
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select <q-select
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
v-model="brand" v-model="brand"
dense dense
outlined outlined
@ -437,12 +456,10 @@ watch(props, () => {
option-label="name" option-label="name"
:options="filterinsigniaOp2" :options="filterinsigniaOp2"
option-value="id" option-value="id"
:readonly="false"
use-input use-input
:borderless="false" :borderless="false"
class="inputgreen"
style="min-width: 150px" style="min-width: 150px"
:rules="[ :rules="disbleStatus || status == 'DONE' ? [] :[
(val:string) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์', (val:string) => !!val || 'กรุณากรอกชื่อชั้นตราเครื่องราชอิสริยาภรณ์',
]" ]"
@filter="(inputValue:string,doneFn:Function) => @filter="(inputValue:string,doneFn:Function) =>
@ -468,12 +485,13 @@ watch(props, () => {
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
dense dense
borderless borderless
outlined outlined
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่']" :rules="disbleStatus || status == 'DONE' ? [] :[(val:string) => !!val || 'กรุณาเลือกวันที่']"
class="inputgreen"
hide-bottom-space hide-bottom-space
:model-value=" :model-value="
receivedate != null ? date2Thai(receivedate) : undefined receivedate != null ? date2Thai(receivedate) : undefined
@ -482,6 +500,7 @@ watch(props, () => {
> >
<template v-if="receivedate" v-slot:append> <template v-if="receivedate" v-slot:append>
<q-icon <q-icon
v-if="!disbleStatus && status !== 'DONE'"
name="cancel" name="cancel"
@click.stop.prevent="receivedate = null" @click.stop.prevent="receivedate = null"
class="cursor-pointer" class="cursor-pointer"
@ -501,9 +520,10 @@ watch(props, () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:rules="[(val:string) => !!val || 'กรุณากรอกทะเบียนฐานันดร']" :class="classInput(disbleStatus || status == 'DONE')"
class="inputgreen" :disable="employeeClass == ''"
:rules="disbleStatus || status == 'DONE' ? [] : [(val:string) => !!val || 'กรุณากรอกทะเบียนฐานันดร']"
hide-bottom-space hide-bottom-space
dense dense
borderless borderless
@ -515,10 +535,16 @@ watch(props, () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable=" :readonly="
disbleStatus || status == 'DONE' || status == 'PENDING' disbleStatus || status == 'DONE' || status == 'PENDING'
" "
:rules="[(val:string) => !!val || 'กรุณากรอกสังกัด']" :class="
classInput(
disbleStatus || status == 'DONE' || status == 'PENDING'
)
"
:disable="employeeClass == ''"
:rules="disbleStatus || status == 'DONE' || status == 'PENDING' ? [] :[(val:string) => !!val || 'กรุณากรอกสังกัด']"
class="inputgreen" class="inputgreen"
hide-bottom-space hide-bottom-space
dense dense
@ -531,11 +557,16 @@ watch(props, () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable=" :readonly="
disbleStatus || status == 'DONE' || status == 'PENDING' disbleStatus || status == 'DONE' || status == 'PENDING'
" "
:rules="[(val:string) => !!val || 'กรุณากรอกสังกัด']" :class="
class="inputgreen" classInput(
disbleStatus || status == 'DONE' || status == 'PENDING'
)
"
:disable="employeeClass == ''"
:rules="disbleStatus || status == 'DONE' || status == 'PENDING' ? [] :[(val:string) => !!val || 'กรุณากรอกสังกัด']"
hide-bottom-space hide-bottom-space
dense dense
borderless borderless
@ -559,6 +590,8 @@ watch(props, () => {
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:readonly="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
> >
<template #year="{ year }"> <template #year="{ year }">
{{ year + 543 }} {{ year + 543 }}
@ -568,12 +601,13 @@ watch(props, () => {
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
dense dense
borderless borderless
outlined outlined
:rules="[(val:string) => !!val || 'กรุณาเลือกวันที่']" :rules="disbleStatus || status == 'DONE' ? []:[(val:string) => !!val || 'กรุณาเลือกวันที่']"
class="inputgreen"
hide-bottom-space hide-bottom-space
:model-value=" :model-value="
announceDate != null ? date2Thai(announceDate) : undefined announceDate != null ? date2Thai(announceDate) : undefined
@ -582,6 +616,7 @@ watch(props, () => {
> >
<template v-if="announceDate" v-slot:append> <template v-if="announceDate" v-slot:append>
<q-icon <q-icon
v-if="!disbleStatus && status !== 'DONE'"
name="cancel" name="cancel"
@click.stop.prevent="announceDate = null" @click.stop.prevent="announceDate = null"
class="cursor-pointer" class="cursor-pointer"
@ -601,58 +636,62 @@ watch(props, () => {
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="volume" v-model="volume"
:label="`เล่มที่`" :label="`เล่มที่`"
:rules="[(val:string) => !!val || 'กรุณากรอกเล่มที่']" :rules="disbleStatus || status == 'DONE' ? []:[(val:string) => !!val || 'กรุณากรอกเล่มที่']"
/> />
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="episode" v-model="episode"
:label="`ตอนที่`" :label="`ตอนที่`"
:rules="[(val:string) => !!val || 'กรุณากรอกตอนที่']" :rules="disbleStatus || status == 'DONE' ? []:[(val:string) => !!val || 'กรุณากรอกตอนที่']"
/> />
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="duty" v-model="duty"
:label="`หน้าที่`" :label="`หน้าที่`"
:rules="[(val:string) => !!val || 'กรุณากรอกหน้าที่']" :rules="disbleStatus || status == 'DONE' ? []:[(val:string) => !!val || 'กรุณากรอกหน้าที่']"
/> />
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus || status == 'DONE'" :readonly="disbleStatus || status == 'DONE'"
:class="classInput(disbleStatus || status == 'DONE')"
:disable="employeeClass == ''"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="announced" v-model="announced"
:label="`ลำดับที่`" :label="`ลำดับที่`"
:rules="[(val:string) => !!val || 'กรุณากรอกลำดับที่']" :rules="disbleStatus || status == 'DONE' ? []:[(val:string) => !!val || 'กรุณากรอกลำดับที่']"
/> />
</div> </div>
<div class="col-12 q-my-xs"><q-separator size="2px" /></div> <div class="col-12 q-my-xs"><q-separator size="2px" /></div>
@ -679,11 +718,12 @@ watch(props, () => {
<template #trigger> <template #trigger>
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus"
:readonly="disbleStatus"
:class="classInput(disbleStatus)"
dense dense
borderless borderless
outlined outlined
hide-bottom-space hide-bottom-space
class="inputgreen"
:model-value=" :model-value="
invoiceDate != null ? date2Thai(invoiceDate) : undefined invoiceDate != null ? date2Thai(invoiceDate) : undefined
" "
@ -706,9 +746,10 @@ watch(props, () => {
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select <q-select
:disable="disbleStatus" :disable="disbleStatus"
:readonly="disbleStatus"
:class="classInput(disbleStatus)"
hide-bottom-space hide-bottom-space
:options="paymentOp" :options="paymentOp"
class="inputgreen"
dense dense
borderless borderless
option-label="label" option-label="label"
@ -724,6 +765,8 @@ watch(props, () => {
<div v-if="payment === 'จัดส่งทางไปรษณีย์'" class="col-12"> <div v-if="payment === 'จัดส่งทางไปรษณีย์'" class="col-12">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus"
:readonly="disbleStatus"
:class="classInput(disbleStatus)"
label="ที่อยู่ที่จ่าย" label="ที่อยู่ที่จ่าย"
dense dense
lazy-rules lazy-rules
@ -731,7 +774,6 @@ watch(props, () => {
outlined outlined
v-model="addressPayment" v-model="addressPayment"
type="textarea" type="textarea"
class="inputgreen"
/> />
</div> </div>
</div> </div>

View file

@ -62,6 +62,17 @@ function onSubmit() {
}); });
} }
/**
* class inpui
* @param val าสถานะ
*/
function classInput(val: boolean) {
return {
"full-width cursor-pointer ": val,
"full-width cursor-pointer inputgreen": !val,
};
}
watch(props, () => { watch(props, () => {
if (props.modal === true) { if (props.modal === true) {
amount.value = props.insigniadata.total; amount.value = props.insigniadata.total;
@ -91,13 +102,13 @@ watch(props, () => {
<q-input <q-input
hide-bottom-space hide-bottom-space
outlined outlined
class="inputgreen"
v-model="title" v-model="title"
dense dense
lazy-rules lazy-rules
type="text" type="text"
label="เครื่องราชฯ" label="เครื่องราชฯ"
disable :class="classInput(true)"
readonly
/> />
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">

View file

@ -343,7 +343,6 @@ onMounted(() => {
outlined outlined
dense dense
lazy-rules lazy-rules
class="inputgreen"
borderless borderless
v-model="fullName" v-model="fullName"
:label="`${'ชื่อ-นามสกุล'}`" :label="`${'ชื่อ-นามสกุล'}`"
@ -362,7 +361,7 @@ onMounted(() => {
<q-input <q-input
:rules="[(val:string) => !!val || 'กรุณาเลือกเครื่องราชฯ']" :rules="[(val:string) => !!val || 'กรุณาเลือกเครื่องราชฯ']"
v-model="brand" v-model="brand"
disable readonly
dense dense
outlined outlined
lazy-rules lazy-rules

View file

@ -89,6 +89,8 @@ interface ResponseRecordLists {
status: string; status: string;
typePayment: string; typePayment: string;
volumeNo: string; volumeNo: string;
orgReceiveInsigniaId: string;
orgReturnInsigniaId: string;
} }
interface ResponseProfile { interface ResponseProfile {

View file

@ -112,11 +112,13 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
typepay: e.typePayment, typepay: e.typePayment,
address: e.address, address: e.address,
dateReceiveInsignia: e.dateReceiveInsignia, dateReceiveInsignia: e.dateReceiveInsignia,
dateReturnInsignia: e.dateReturnInsignia,
docReceiveInsignia: e.docReceiveInsignia, docReceiveInsignia: e.docReceiveInsignia,
docReturnInsignia: e.docReturnInsignia,
orgReceiveInsignia: e.orgReceiveInsignia, orgReceiveInsignia: e.orgReceiveInsignia,
orgReceiveInsigniaId: e.orgReceiveInsigniaId,
dateReturnInsignia: e.dateReturnInsignia,
docReturnInsignia: e.docReturnInsignia,
orgReturnInsignia: e.orgReturnInsignia, orgReturnInsignia: e.orgReturnInsignia,
orgReturnInsigniaId: e.orgReturnInsigniaId,
})); }));
rows.value = alllist; rows.value = alllist;

View file

@ -557,7 +557,6 @@ onMounted(async () => {
map-options map-options
:options="columns" :options="columns"
option-value="name" option-value="name"
style="min-width: 140px" style="min-width: 140px"
class="col-xs-12 col-sm-3 col-md-2" class="col-xs-12 col-sm-3 col-md-2"
/> />
@ -686,6 +685,7 @@ onMounted(async () => {
label="คืนเครื่องราชฯ" label="คืนเครื่องราชฯ"
@click="editData(props.row.id)" @click="editData(props.row.id)"
color="blue" color="blue"
size="sm"
/> />
</q-td> </q-td>
</div> </div>

View file

@ -225,7 +225,7 @@ async function fetchDataTree(id: string) {
.get(config.API.orgByid(id)) .get(config.API.orgByid(id))
.then((res) => { .then((res) => {
const data = res.data.result; const data = res.data.result;
nodeTree.value = data; nodeTree.value = data.data;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);