แก้ แสดง สังกัด

This commit is contained in:
setthawutttty 2025-03-20 16:58:30 +07:00
parent 708170a2e5
commit fcaf891197
17 changed files with 93 additions and 83 deletions

View file

@ -16,7 +16,7 @@ import PopupPersonal from "@/components/Dialogs/PopupPersonalNew.vue";
import { useCounterMixin } from "@/stores/mixin";
/** use*/
const { findOrgNameOld, findOrgName, textTranForm } = useCounterMixin();
const { findOrgNameOld, findOrgName } = useCounterMixin();
/** propsDataProfile*/
const props = defineProps({
@ -166,7 +166,7 @@ watch(
<div class="col-12">
<div class="col-12 text-top">งก</div>
<div class="col-12 text-detail text-html">
{{ textTranForm(profile.organization) }}
{{ profile.organization }}
</div>
</div>
</div>

View file

@ -22,7 +22,7 @@ const mixin = useCounterMixin();
const router = useRouter();
const $q = useQuasar();
const retireDate = ref<Date>();
const { showLoader, hideLoader, messageError, date2Thai,textTranForm } = mixin;
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const isEmployee = defineModel("isEmployee", { type: String });
const empType = ref<string>("officer");
@ -374,7 +374,7 @@ async function fetchProfile(id: string, avatarName: string) {
<q-input
borderless
readonly
:model-value="goverment.oc === '' ? '-' : textTranForm(goverment.oc)"
:model-value="goverment.oc === '' ? '-' : goverment.oc"
label="สังกัด"
autogrow
></q-input>

View file

@ -18,7 +18,7 @@ const {
showLoader,
hideLoader,
dialogConfirm,
findOrgChildName,
findOrgChildNameHtml,
} = mixin;
const route = useRoute();
const retireld_params = route.params.id;
@ -107,7 +107,7 @@ async function fecthProfile() {
e.posTypeName && e.posLevelName
? e.posTypeName + " (" + e.posLevelName + ")"
: "-",
organizationOrganization: findOrgChildName(e),
organizationOrganization: findOrgChildNameHtml(e),
}));
})
.catch((err) => {
@ -139,7 +139,7 @@ async function fecthProfile() {
e.posTypeName && e.posLevelName
? e.posTypeName + " (" + e.posLevelName + ")"
: "-",
organizationOrganization: findOrgChildName(e),
organizationOrganization: findOrgChildNameHtml(e),
}));
})
.catch((err) => {

View file

@ -33,7 +33,7 @@ const dataMapToSend = computed(() => {
}));
});
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, onSearchDataTable, textTranForm } = mixin;
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
/** props*/
const props = defineProps({
@ -118,9 +118,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "datetext",
@ -164,7 +166,6 @@ const modalCommand = ref<boolean>(false);
/** popup ยืนยันส่งัว */
function saveOrder() {
dialogConfirm(
$q,
() => {
@ -275,7 +276,7 @@ watch(
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -30,7 +30,6 @@ const {
hideLoader,
onSearchDataTable,
findOrgName,
textTranForm,
} = mixin;
/** Table */
@ -106,9 +105,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "datetext",
@ -393,7 +394,7 @@ onMounted(async () => {
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -33,7 +33,7 @@ const dataMapToSend = computed(() => {
}));
});
const mixin = useCounterMixin();
const { dialogConfirm, date2Thai, onSearchDataTable, textTranForm } = mixin;
const { dialogConfirm, date2Thai, onSearchDataTable } = mixin;
/** props*/
const props = defineProps({
@ -119,9 +119,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "datetext",
@ -275,7 +277,7 @@ watch(
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -28,8 +28,7 @@ const {
date2Thai,
showLoader,
hideLoader,
onSearchDataTable,
textTranForm,
onSearchDataTable
} = mixin;
/** Table */
@ -105,9 +104,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "datetext",
@ -388,7 +389,7 @@ onMounted(async () => {
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -52,7 +52,6 @@ const {
hideLoader,
date2Thai,
onSearchDataTable,
textTranForm,
} = mixin;
/** คอลัมน์ */
@ -106,9 +105,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "createdAt",
@ -263,7 +264,7 @@ watchEffect(() => {
<div v-else-if="col.name == 'org'" class="text-html">
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -52,7 +52,6 @@ const {
hideLoader,
date2Thai,
onSearchDataTable,
textTranForm,
} = mixin;
/** คอลัมน์ */
@ -106,9 +105,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "createdAt",
@ -266,7 +267,7 @@ watchEffect(() => {
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -29,7 +29,6 @@ const {
success,
onSearchDataTable,
dialogRemove,
textTranForm,
} = mixin;
const modal = ref<boolean>(false);
@ -105,9 +104,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "createdAt",
@ -380,7 +381,7 @@ onMounted(async () => {
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -29,7 +29,6 @@ const {
success,
onSearchDataTable,
dialogRemove,
textTranForm,
} = mixin;
const modal = ref<boolean>(false);
@ -105,9 +104,11 @@ const columns = ref<QTableProps["columns"]>([
field: "organizationPositionOld",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
},
// copy
// format(val, row) {
// return `${row.organizationPositionOld.replace(/\n/g, " ")}`;
// },
},
{
name: "createdAt",
@ -386,7 +387,7 @@ onMounted(async () => {
>
{{
props.row.organizationPositionOld
? textTranForm(props.row.organizationPositionOld)
? props.row.organizationPositionOld
: "-"
}}
</div>

View file

@ -94,6 +94,9 @@ const columns = ref<QTableProps["columns"]>([
field: "profileType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${mainStore.convertType(row.profileType)}`;
},
},
{
name: "idcard",
@ -116,7 +119,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",

View file

@ -352,9 +352,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="data.positionType"
:rules="[(val:string) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
hide-bottom-space
:label="`${'ประเภทตำแหน่ง'}`"
:label="`${'ตำแหน่งประเภท'}`"
/>
</div>
</div>
@ -384,9 +384,9 @@ onMounted(async () => {
:readonly="!edit"
:borderless="!edit"
v-model="data.posNo"
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งเลขที่'}`]"
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่ตำแหน่ง'}`]"
hide-bottom-space
:label="`${'ตำแหน่งเลขที่'}`"
:label="`${'เลขที่ตำแหน่ง'}`"
/>
</div>
</div>

View file

@ -102,7 +102,7 @@ const columns = ref<QTableProps["columns"]>([
{
name: "positionLevel",
align: "left",
label: "ประเภทตำแหน่ง",
label: "ตำแหน่งประเภท",
sortable: true,
field: "positionLevel",
headerStyle: "font-size: 14px",
@ -236,7 +236,8 @@ watch(
);
function convertType(val: string) {
switch (val) {
const data = val?.toLocaleUpperCase();
switch (data) {
case "OFFICER":
return "ข้าราชการ กทม. สามัญ";
case "EMPLOYEE":
@ -410,7 +411,8 @@ onMounted(async () => {
</div>
<div
v-else-if="col.name === 'organization'"
class="table_ellipsis"
class="text-html"
style="width: 250px"
>
{{ props.row.organization ? props.row.organization : "-" }}
</div>

View file

@ -218,13 +218,6 @@ watch(
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name === 'profileType'">
{{
props.row.profileType
? mainStore.convertType(props.row.profileType)
: "-"
}}
</div>
<div v-else>
{{ col.value ? col.value:'-' }}
</div>

View file

@ -53,6 +53,9 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
field: "profileType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${convertType(row.profileType)}`;
},
},
{
name: "idcard",
@ -75,7 +78,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -108,7 +111,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return val ? val.toLocaleString() : '-';
return val ? val.toLocaleString() : "-";
},
},
{
@ -146,7 +149,6 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
// style: "font-size: 14px",
// },
const columnsDirector = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
@ -164,6 +166,9 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
field: "profileType",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format(val, row) {
return `${convertType(row.profileType)}`;
},
},
{
name: "idcard",
@ -186,7 +191,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
{
name: "posNo",
align: "left",
label: "ตำแหน่งเลขที่",
label: "เลขที่ตำแหน่ง",
sortable: true,
field: "posNo",
headerStyle: "font-size: 14px",
@ -430,7 +435,7 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
* @param data
*/
async function fetchData(data: ArrayPersonAdd[], type?: string) {
console.log("🚀 ~ fetchData ~ data:", data)
console.log("🚀 ~ fetchData ~ data:", data);
const dataList: any = data.map((item: any) => ({
profileType: item.profileType
? item.profileType
@ -470,17 +475,20 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
posLevelId: item.posLevelId,
posLevelName: item.posLevelName,
rootDnaId:item.rootDnaId,
child1DnaId:item.child1DnaId,
child2DnaId:item.child2DnaId,
child3DnaId:item.child3DnaId,
child4DnaId:item.child4DnaId,
rootDnaId: item.rootDnaId,
child1DnaId: item.child1DnaId,
child2DnaId: item.child2DnaId,
child3DnaId: item.child3DnaId,
child4DnaId: item.child4DnaId,
}));
const newItems = dataList.filter(
(newItem: any) => !rowsAdd.value.some((existingItem: any) => existingItem.personId === newItem.personId)
(newItem: any) =>
!rowsAdd.value.some(
(existingItem: any) => existingItem.personId === newItem.personId
)
);
// เพิ่มข้อมูลใหม่เข้า rowsAdd
rowsAdd.value = [...rowsAdd.value, ...newItems];
}
@ -530,7 +538,8 @@ export const useDisciplineMainStore = defineStore("disciplineMainStore", () => {
}
function convertType(val: string) {
switch (val) {
const data = val?.toLocaleUpperCase();
switch (data) {
case "OFFICER":
return "ข้าราชการ กทม. สามัญ";
case "EMPLOYEE":

View file

@ -1248,11 +1248,6 @@ export const useCounterMixin = defineStore("mixin", () => {
}
}
function textTranForm(val: string) {
return (val.match(/[^()\s]+(?:\s*\([^()]+\))?|\([^()]+\)/g) || []).join(
"\n"
);
}
function pathRegistryEmp(routeName: string) {
return routeName
? routeName === "registryNewByid"
@ -1396,6 +1391,5 @@ export const useCounterMixin = defineStore("mixin", () => {
findOrgNameHtml,
findOrgNameOldHtml,
findOrgChildNameHtml,
textTranForm
};
});