fix
This commit is contained in:
parent
0c419e04b4
commit
e03d2a84a5
8 changed files with 117 additions and 43 deletions
11
src/modules/04_registryPerson/interface/index/Edit.ts
Normal file
11
src/modules/04_registryPerson/interface/index/Edit.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
interface DataProfile {
|
||||||
|
fullName: string;
|
||||||
|
position: string;
|
||||||
|
citizenId: string;
|
||||||
|
posNo: string;
|
||||||
|
posType: string;
|
||||||
|
posLevel: string;
|
||||||
|
org: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataProfile };
|
||||||
9
src/modules/04_registryPerson/interface/request/Edit.ts
Normal file
9
src/modules/04_registryPerson/interface/request/Edit.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
interface DataFilter {
|
||||||
|
status: string;
|
||||||
|
empType: string;
|
||||||
|
keyword: string;
|
||||||
|
page: number;
|
||||||
|
pageSize: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataFilter };
|
||||||
26
src/modules/04_registryPerson/interface/response/Edit.ts
Normal file
26
src/modules/04_registryPerson/interface/response/Edit.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
interface DataSalaryPos {
|
||||||
|
avatar: string;
|
||||||
|
avatarName: string;
|
||||||
|
citizenId: string;
|
||||||
|
firstName: string;
|
||||||
|
id: string;
|
||||||
|
lastName: string;
|
||||||
|
org: string;
|
||||||
|
orgRevisionId: string;
|
||||||
|
orgRootShortName: string;
|
||||||
|
posExecutive: string;
|
||||||
|
posLevel: string;
|
||||||
|
posLevelId: string;
|
||||||
|
posNo: string;
|
||||||
|
posType: string;
|
||||||
|
posTypeId: string;
|
||||||
|
position: string;
|
||||||
|
prefix: string;
|
||||||
|
rank: string;
|
||||||
|
root: string;
|
||||||
|
rootId: string;
|
||||||
|
statusCheckEdit: string;
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataSalaryPos };
|
||||||
|
|
@ -1,15 +1,8 @@
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { useQuasar } from "quasar";
|
|
||||||
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
|
||||||
|
|
||||||
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
||||||
|
|
||||||
const $q = useQuasar();
|
|
||||||
const mixin = useCounterMixin();
|
|
||||||
const {} = mixin;
|
|
||||||
|
|
||||||
export const useEditPosDataStore = defineStore("EditPos", () => {
|
export const useEditPosDataStore = defineStore("EditPos", () => {
|
||||||
const commandCodeData = ref<DataOption[]>([]);
|
const commandCodeData = ref<DataOption[]>([]);
|
||||||
const posTypeData = ref<DataOption[]>([]); //รายการประเภทตำแหน่ง | กลุ่มงาน
|
const posTypeData = ref<DataOption[]>([]); //รายการประเภทตำแหน่ง | กลุ่มงาน
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ function classInput(val: boolean) {
|
||||||
borderless
|
borderless
|
||||||
v-model="formData.posNo"
|
v-model="formData.posNo"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:label="empType === '' ? 'เลขที่ตำแหน่ง' : 'ตำแหน่งเลขที่'"
|
:label="empType === 'officer' ? 'เลขที่ตำแหน่ง' : 'ตำแหน่งเลขที่'"
|
||||||
>
|
>
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -323,7 +323,7 @@ function classInput(val: boolean) {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
borderless
|
borderless
|
||||||
v-model="formData.positionName"
|
v-model="formData.positionName"
|
||||||
:label="empType == '' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'"
|
:label="empType === 'officer' ? 'ตำแหน่งในสายงาน' : 'ตำแหน่ง'"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -338,7 +338,7 @@ function classInput(val: boolean) {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
borderless
|
borderless
|
||||||
v-model="formData.positionType"
|
v-model="formData.positionType"
|
||||||
:label="empType == '' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'"
|
:label="empType === 'officer' ? 'ประเภทตำแหน่ง' : 'กลุ่มงาน'"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -374,7 +374,7 @@ function classInput(val: boolean) {
|
||||||
lazy-rules
|
lazy-rules
|
||||||
borderless
|
borderless
|
||||||
v-model="formData.positionLevel"
|
v-model="formData.positionLevel"
|
||||||
:label="empType == '' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'"
|
:label="empType === 'officer' ? 'ระดับตำแหน่ง' : 'ระดับชั้นงาน'"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
|
|
@ -396,7 +396,7 @@ function classInput(val: boolean) {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||||
<q-input
|
<q-input
|
||||||
:class="classInput(isReadonly)"
|
:class="classInput(isReadonly)"
|
||||||
:readonly="isReadonly"
|
:readonly="isReadonly"
|
||||||
|
|
@ -411,7 +411,7 @@ function classInput(val: boolean) {
|
||||||
</q-input>
|
</q-input>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||||
<q-select
|
<q-select
|
||||||
outlined
|
outlined
|
||||||
:class="classInput(isReadonly)"
|
:class="classInput(isReadonly)"
|
||||||
|
|
@ -444,7 +444,7 @@ function classInput(val: boolean) {
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||||
<q-select
|
<q-select
|
||||||
:class="classInput(isReadonly)"
|
:class="classInput(isReadonly)"
|
||||||
:readonly="isReadonly"
|
:readonly="isReadonly"
|
||||||
|
|
@ -477,7 +477,7 @@ function classInput(val: boolean) {
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType == ''">
|
<div class="col-xs-6 col-sm-6 col-md-4" v-if="empType === 'officer'">
|
||||||
<q-select
|
<q-select
|
||||||
:class="classInput(isReadonly)"
|
:class="classInput(isReadonly)"
|
||||||
:readonly="isReadonly"
|
:readonly="isReadonly"
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ function classColorRow(isDelete: boolean, isEdit: boolean, isEntry: boolean) {
|
||||||
return isDelete
|
return isDelete
|
||||||
? "text-red"
|
? "text-red"
|
||||||
: isEdit
|
: isEdit
|
||||||
? "text-yellow-8"
|
? "text-orange"
|
||||||
: isEntry
|
: isEntry
|
||||||
? "text-grey"
|
? "text-grey"
|
||||||
: "";
|
: "";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, watch, defineAsyncComponent } from "vue";
|
import { ref, reactive, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
|
|
@ -9,20 +9,27 @@ import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
import type { QTableColumn } from "quasar";
|
import type { QTableColumn } from "quasar";
|
||||||
|
import type { DataStructureTree } from "@/interface/main";
|
||||||
|
import type {
|
||||||
|
DataOption,
|
||||||
|
Pagination,
|
||||||
|
} from "@/modules/04_registryPerson/interface/index/Main";
|
||||||
|
import type { DataSalaryPos } from "@/modules/04_registryPerson/interface/response/Edit";
|
||||||
|
import type { DataFilter } from "@/modules/04_registryPerson/interface/request/Edit";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
const { showLoader, hideLoader, messageError } = useCounterMixin();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const organizationOps = ref<any[]>([]);
|
const organizationOps = ref<DataOption[]>([]);
|
||||||
const organizationOpsMain = ref<any[]>([]);
|
const organizationOpsMain = ref<DataOption[]>([]);
|
||||||
const employeeClassOpsMain = ref<any[]>([
|
const employeeClassOpsMain = ref<DataOption[]>([
|
||||||
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
|
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" },
|
||||||
{ id: "employee", name: "ลูกจ้างประจำ" },
|
{ id: "employee", name: "ลูกจ้างประจำ" },
|
||||||
]);
|
]);
|
||||||
const employeeClassOps = ref<any[]>(employeeClassOpsMain.value);
|
const employeeClassOps = ref<DataOption[]>(employeeClassOpsMain.value);
|
||||||
const statusOpsMain = ref<any[]>([
|
const statusOpsMain = ref<DataOption[]>([
|
||||||
{
|
{
|
||||||
id: "ALL",
|
id: "ALL",
|
||||||
name: "ทั้งหมด",
|
name: "ทั้งหมด",
|
||||||
|
|
@ -40,11 +47,11 @@ const statusOpsMain = ref<any[]>([
|
||||||
name: "ตรวจสอบแล้ว",
|
name: "ตรวจสอบแล้ว",
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const statusOps = ref<any[]>(statusOpsMain.value);
|
const statusOps = ref<DataOption[]>(statusOpsMain.value);
|
||||||
|
|
||||||
//Table
|
//Table
|
||||||
const organization = ref<string>("");
|
const organization = ref<string>("");
|
||||||
const filter = reactive({
|
const filter = reactive<DataFilter>({
|
||||||
status: "ALL",
|
status: "ALL",
|
||||||
empType: "officer",
|
empType: "officer",
|
||||||
keyword: "",
|
keyword: "",
|
||||||
|
|
@ -53,7 +60,7 @@ const filter = reactive({
|
||||||
});
|
});
|
||||||
const total = ref<number>(0);
|
const total = ref<number>(0);
|
||||||
const maxPage = ref<number>(0);
|
const maxPage = ref<number>(0);
|
||||||
const rows = ref<any[]>([]);
|
const rows = ref<DataSalaryPos[]>([]);
|
||||||
const columns = ref<QTableColumn[]>([
|
const columns = ref<QTableColumn[]>([
|
||||||
{
|
{
|
||||||
name: "posNo",
|
name: "posNo",
|
||||||
|
|
@ -174,7 +181,7 @@ function fetchListOrg(id: string) {
|
||||||
http
|
http
|
||||||
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
.get(config.API.orgByIdSystem(id, route.meta.Key as string))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = await res.data.result.map((item: any) => ({
|
const data = await res.data.result.map((item: DataStructureTree) => ({
|
||||||
id: item.orgTreeId,
|
id: item.orgTreeId,
|
||||||
name: item.orgName,
|
name: item.orgName,
|
||||||
}));
|
}));
|
||||||
|
|
@ -200,14 +207,14 @@ function filterSelector(val: string, update: Function, type: string) {
|
||||||
case "organization":
|
case "organization":
|
||||||
update(() => {
|
update(() => {
|
||||||
organizationOps.value = organizationOpsMain.value.filter(
|
organizationOps.value = organizationOpsMain.value.filter(
|
||||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
(v: DataOption) => v.name.toLowerCase().indexOf(val) > -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "employeeClass":
|
case "employeeClass":
|
||||||
update(() => {
|
update(() => {
|
||||||
employeeClassOps.value = employeeClassOpsMain.value.filter(
|
employeeClassOps.value = employeeClassOpsMain.value.filter(
|
||||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
(v: DataOption) => v.name.toLowerCase().indexOf(val) > -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
@ -215,7 +222,7 @@ function filterSelector(val: string, update: Function, type: string) {
|
||||||
case "status":
|
case "status":
|
||||||
update(() => {
|
update(() => {
|
||||||
statusOps.value = statusOpsMain.value.filter(
|
statusOps.value = statusOpsMain.value.filter(
|
||||||
(v: any) => v.name.toLowerCase().indexOf(val) > -1
|
(v: DataOption) => v.name.toLowerCase().indexOf(val) > -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
@ -271,11 +278,16 @@ function onSearchData(val: boolean = true) {
|
||||||
* function เปลี่ยนแถวต่อหน้า
|
* function เปลี่ยนแถวต่อหน้า
|
||||||
* @param newPagination ข้อมูล Pagination
|
* @param newPagination ข้อมูล Pagination
|
||||||
*/
|
*/
|
||||||
function updatePageSize(newPagination: any) {
|
function updatePageSize(newPagination: Pagination) {
|
||||||
filter.pageSize = newPagination.rowsPerPage;
|
filter.pageSize = newPagination.rowsPerPage;
|
||||||
onSearchData();
|
onSearchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* function ไปหน้ารายการประวัติตำแหน่ง/เงินเดือน
|
||||||
|
* @param id ProfileID
|
||||||
|
* @param type ประเภทของข้าราชการ
|
||||||
|
*/
|
||||||
function onRedirectToPosition(id: string, type: string) {
|
function onRedirectToPosition(id: string, type: string) {
|
||||||
const tyepeLower = type?.toLocaleLowerCase();
|
const tyepeLower = type?.toLocaleLowerCase();
|
||||||
router.push(`/registry/edit/salary/${tyepeLower}/${id}`);
|
router.push(`/registry/edit/salary/${tyepeLower}/${id}`);
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,35 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, onMounted, watch, defineAsyncComponent } from "vue";
|
import { ref, onMounted } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useRegistryNewDataStore } from "@/modules/04_registryPerson/store";
|
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
|
||||||
/** importType*/
|
/** importType*/
|
||||||
|
import type { DataProfile } from "@/modules/04_registryPerson/interface/index/Edit";
|
||||||
|
|
||||||
import Table from "@/modules/04_registryPerson/views/edit/components/Table.vue";
|
import Table from "@/modules/04_registryPerson/views/edit/components/Table.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useRegistryNewDataStore();
|
const {
|
||||||
const { showLoader, hideLoader, messageError, dialogConfirm, findOrgName } =
|
showLoader,
|
||||||
useCounterMixin();
|
hideLoader,
|
||||||
|
messageError,
|
||||||
|
dialogConfirm,
|
||||||
|
findOrgName,
|
||||||
|
success,
|
||||||
|
} = useCounterMixin();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const dataProfile = ref<any>();
|
const dataProfile = ref<DataProfile>();
|
||||||
const tabs = ref<string>("PENDING");
|
const tabs = ref<string>("PENDING");
|
||||||
const empType = ref<string>(route.params.type.toString());
|
const empType = ref<string>(route.params.type.toString());
|
||||||
const profileId = ref<string>(route.params.id.toString());
|
const profileId = ref<string>(route.params.id.toString());
|
||||||
|
|
||||||
|
/** funtion*/
|
||||||
async function fetchDataProfile() {
|
async function fetchDataProfile() {
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
await http
|
||||||
|
|
@ -52,6 +58,7 @@ async function fetchDataProfile() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** function ยืนยันเสร็จสิ้นการแก้ไข*/
|
||||||
function onConfirmEdit() {
|
function onConfirmEdit() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -60,9 +67,11 @@ function onConfirmEdit() {
|
||||||
http
|
http
|
||||||
.post(config.API.salaryTemp + `/confirm-edit`, {
|
.post(config.API.salaryTemp + `/confirm-edit`, {
|
||||||
profileId: profileId.value,
|
profileId: profileId.value,
|
||||||
type: empType.value,
|
type: empType.value?.toLocaleUpperCase(),
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
success($q, "ยืนยันเสร็จสิ้นการแก้ไขสำเร็จ");
|
||||||
})
|
})
|
||||||
.then((res) => {})
|
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
|
|
@ -75,6 +84,7 @@ function onConfirmEdit() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** function ยืนยันข้อมูลถูกต้อง*/
|
||||||
function onConfirmDone() {
|
function onConfirmDone() {
|
||||||
dialogConfirm(
|
dialogConfirm(
|
||||||
$q,
|
$q,
|
||||||
|
|
@ -83,9 +93,11 @@ function onConfirmDone() {
|
||||||
http
|
http
|
||||||
.post(config.API.salaryTemp + `/confirm-done`, {
|
.post(config.API.salaryTemp + `/confirm-done`, {
|
||||||
profileId: profileId.value,
|
profileId: profileId.value,
|
||||||
type: empType.value,
|
type: empType.value?.toLocaleUpperCase(),
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
success($q, "ยืนยันข้อมูลถูกต้องสำเร็จ");
|
||||||
})
|
})
|
||||||
.then((res) => {})
|
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
|
|
@ -150,7 +162,11 @@ onMounted(async () => {
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label
|
<q-item-label
|
||||||
><strong>เลขที่ตำแหน่ง:</strong>
|
><strong
|
||||||
|
>{{
|
||||||
|
empType === "officer" ? "เลขที่ตำแหน่ง:" : "ตำแหน่งเลขที่:"
|
||||||
|
}}
|
||||||
|
</strong>
|
||||||
{{ dataProfile?.posNo }}</q-item-label
|
{{ dataProfile?.posNo }}</q-item-label
|
||||||
>
|
>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
@ -159,7 +175,11 @@ onMounted(async () => {
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label
|
<q-item-label
|
||||||
><strong>ตำแหน่งประเภท:</strong>
|
><strong>
|
||||||
|
{{
|
||||||
|
empType === "officer" ? "ตำแหน่งประเภท:" : "กลุ่มงาน:"
|
||||||
|
}}</strong
|
||||||
|
>
|
||||||
{{ dataProfile?.posType }}</q-item-label
|
{{ dataProfile?.posType }}</q-item-label
|
||||||
>
|
>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
@ -168,7 +188,10 @@ onMounted(async () => {
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label
|
<q-item-label
|
||||||
><strong>ระดับ:</strong> {{ dataProfile?.posLevel }}</q-item-label
|
><strong>{{
|
||||||
|
empType === "officer" ? "ระดับ:" : "ระดับชั้นงาน:"
|
||||||
|
}}</strong>
|
||||||
|
{{ dataProfile?.posLevel }}</q-item-label
|
||||||
>
|
>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue