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