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">
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);

View file

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

View file

@ -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 {

View file

@ -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,
};
});

View file

@ -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>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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);