fix
This commit is contained in:
parent
bf175c7750
commit
8a5a9f3e20
4 changed files with 168 additions and 183 deletions
|
|
@ -134,7 +134,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "posTypeName",
|
name: "posTypeName",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "ประเภทตำเเหน่ง",
|
label: "ตำแหน่งประเภท",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "posTypeName",
|
field: "posTypeName",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
|
||||||
|
|
@ -7,28 +7,20 @@ import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
import { useOrganizational } from "@/modules/02_organization/store/organizational";
|
||||||
|
|
||||||
/**
|
/** importType*/
|
||||||
* importType
|
|
||||||
*/
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
import type { DataSortPos } from "@/modules/02_organization/interface/index/organizational";
|
import type { DataSortPos } from "@/modules/02_organization/interface/index/organizational";
|
||||||
|
|
||||||
/**
|
/** importComponents*/
|
||||||
* importComponents
|
|
||||||
*/
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
/**
|
/** use*/
|
||||||
* use
|
|
||||||
*/
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const store = useOrganizational();
|
const store = useOrganizational();
|
||||||
const { dialogConfirm, showLoader, success, hideLoader, messageError } =
|
const { dialogConfirm, showLoader, success, hideLoader, messageError } =
|
||||||
useCounterMixin();
|
useCounterMixin();
|
||||||
|
|
||||||
/**
|
/** props*/
|
||||||
* props
|
|
||||||
*/
|
|
||||||
const modal = defineModel<boolean>("sortPosition", { required: true });
|
const modal = defineModel<boolean>("sortPosition", { required: true });
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
fetchDataTable: Function,
|
fetchDataTable: Function,
|
||||||
|
|
@ -56,9 +48,7 @@ function onDrop(from: number, to: number) {
|
||||||
rows.value.splice(to, 0, rows.value.splice(from, 1)[0]);
|
rows.value.splice(to, 0, rows.value.splice(from, 1)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function บันทึกการจัดลำดับ*/
|
||||||
* function บันทึกการจัดลำดับ
|
|
||||||
*/
|
|
||||||
function save() {
|
function save() {
|
||||||
dialogConfirm($q, () => {
|
dialogConfirm($q, () => {
|
||||||
const data = rows.value;
|
const data = rows.value;
|
||||||
|
|
@ -84,9 +74,7 @@ function save() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** function เรียกรายการข้อมูลตำแหน่ง*/
|
||||||
* function เรียกรายการข้อมูลตำแหน่ง
|
|
||||||
*/
|
|
||||||
function getData() {
|
function getData() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
http
|
||||||
|
|
@ -103,7 +91,7 @@ function getData() {
|
||||||
const dataList = res.data.result.data;
|
const dataList = res.data.result.data;
|
||||||
const dataMap = dataList.map((item: any) => ({
|
const dataMap = dataList.map((item: any) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: `${item.orgShortname}${
|
name: `${item.orgShortname} ${
|
||||||
item.posMasterNoPrefix ? item.posMasterNoPrefix : ""
|
item.posMasterNoPrefix ? item.posMasterNoPrefix : ""
|
||||||
}${item.posMasterNo ? item.posMasterNo : ""}${
|
}${item.posMasterNo ? item.posMasterNo : ""}${
|
||||||
item.posMasterNoSuffix ? item.posMasterNoSuffix : ""
|
item.posMasterNoSuffix ? item.posMasterNoSuffix : ""
|
||||||
|
|
@ -123,9 +111,7 @@ function getData() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** callback function ทำงานเมื่อ modal = true ทำการเรียกข้อมูลตำแหน่ง*/
|
||||||
* callback function ทำงานเมื่อ modal = true ทำการเรียกข้อมูลตำแหน่ง
|
|
||||||
*/
|
|
||||||
watch(
|
watch(
|
||||||
() => modal.value,
|
() => modal.value,
|
||||||
() => {
|
() => {
|
||||||
|
|
@ -135,6 +121,7 @@ watch(
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ export const useOrganizational = defineStore("organizationalStore", () => {
|
||||||
posMasterNo:
|
posMasterNo:
|
||||||
e.orgShortname +
|
e.orgShortname +
|
||||||
(e.posMasterNoPrefix ? e.posMasterNoPrefix : "") +
|
(e.posMasterNoPrefix ? e.posMasterNoPrefix : "") +
|
||||||
(e.posMasterNo ? e.posMasterNo : "") +
|
(e.posMasterNo ? ` ${e.posMasterNo }`: "") +
|
||||||
(e.posMasterNoSuffix ? e.posMasterNoSuffix : ""),
|
(e.posMasterNoSuffix ? e.posMasterNoSuffix : ""),
|
||||||
positionName: e.isSit ? e.profilePosition : e.positionName,
|
positionName: e.isSit ? e.profilePosition : e.positionName,
|
||||||
posTypeName: e.isSit ? e.profilePostype : e.posTypeName,
|
posTypeName: e.isSit ? e.profilePostype : e.posTypeName,
|
||||||
|
|
|
||||||
|
|
@ -185,167 +185,165 @@ watch(
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card class="col-12" style="width: 85%">
|
<q-card class="col-12" style="width: 85%">
|
||||||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
<Header :tittle="`เลื่อนขั้น`" :close="close" />
|
||||||
<Header :tittle="`เลื่อนขั้น`" :close="close" />
|
<q-separator />
|
||||||
<q-separator />
|
|
||||||
|
|
||||||
<q-card-section class="scroll" style="max-height: 80vh">
|
<q-card-section class="scroll" style="max-height: 80vh">
|
||||||
<div class="q-gutter-y-sm">
|
<div class="q-gutter-y-sm">
|
||||||
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
<div class="row items-center q-gutter-x-sm q-pb-sm">
|
||||||
<q-select
|
<q-select
|
||||||
class="inputgreen"
|
class="inputgreen"
|
||||||
v-model="type"
|
v-model="type"
|
||||||
label="เลื่อนขั้น"
|
label="เลื่อนขั้น"
|
||||||
dense
|
dense
|
||||||
outlined
|
outlined
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="id"
|
option-value="id"
|
||||||
:options="typeRangeOps"
|
:options="typeRangeOps"
|
||||||
:rules="[(val:string) => !!val || `${'กรุณาเลือก ขั้น'}`]"
|
:rules="[(val:string) => !!val || `${'กรุณาเลือก ขั้น'}`]"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
@update:model-value="chengType()"
|
@update:model-value="chengType()"
|
||||||
style="min-width: 140px"
|
style="min-width: 140px"
|
||||||
/>
|
/>
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input
|
<q-input
|
||||||
standout
|
standout
|
||||||
dense
|
dense
|
||||||
v-model="keyword"
|
v-model="keyword"
|
||||||
ref="filterRef"
|
ref="filterRef"
|
||||||
outlined
|
outlined
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
@keydown.enter.pervent="serchDataTable"
|
@keydown.enter.pervent="serchDataTable"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
</template>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
<q-select
|
<q-select
|
||||||
v-model="visibleColumns"
|
v-model="visibleColumns"
|
||||||
multiple
|
multiple
|
||||||
outlined
|
outlined
|
||||||
dense
|
dense
|
||||||
options-dense
|
options-dense
|
||||||
:display-value="$q.lang.table.columns"
|
:display-value="$q.lang.table.columns"
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
:options="columns"
|
:options="columns"
|
||||||
option-value="name"
|
option-value="name"
|
||||||
style="min-width: 140px"
|
style="min-width: 140px"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12">
|
|
||||||
<d-table
|
|
||||||
ref="table"
|
|
||||||
:columns="columns"
|
|
||||||
:rows="rows"
|
|
||||||
row-key="id"
|
|
||||||
flat
|
|
||||||
bordered
|
|
||||||
:paging="true"
|
|
||||||
dense
|
|
||||||
:rows-per-page-options="[10, 25, 50, 100]"
|
|
||||||
:visible-columns="visibleColumns"
|
|
||||||
selection="multiple"
|
|
||||||
v-model:selected="selectedData"
|
|
||||||
>
|
|
||||||
<template v-slot:header-selection="scope">
|
|
||||||
<q-checkbox
|
|
||||||
keep-color
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
v-model="scope.selected"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template v-slot:body="props">
|
|
||||||
<q-tr :props="props">
|
|
||||||
<q-td auto-width>
|
|
||||||
<q-checkbox
|
|
||||||
v-model="props.selected"
|
|
||||||
keep-color
|
|
||||||
color="primary"
|
|
||||||
dense
|
|
||||||
/>
|
|
||||||
</q-td>
|
|
||||||
<q-td
|
|
||||||
v-for="col in props.cols"
|
|
||||||
:key="col.name"
|
|
||||||
:props="props"
|
|
||||||
>
|
|
||||||
<div v-if="col.name === 'no'">
|
|
||||||
{{ props.rowIndex + 1 }}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="col.name === 'fullName'">
|
|
||||||
{{
|
|
||||||
`${props.row.prefix}${props.row.firstName} ${props.row.lastName}`
|
|
||||||
}}
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
v-else-if="col.name == 'organization'"
|
|
||||||
class="text-html"
|
|
||||||
>
|
|
||||||
{{ findOrgNameHtml(props.row) }}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="col.name == 'amount'">
|
|
||||||
{{ Number(props.row.amount).toLocaleString() }}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="col.name == 'isSuspension'">
|
|
||||||
<q-icon
|
|
||||||
v-if="props.row.isSuspension !== null"
|
|
||||||
:name="props.row.isSuspension ? 'done' : 'close'"
|
|
||||||
:color="props.row.isSuspension ? 'primary' : 'red'"
|
|
||||||
size="24px"
|
|
||||||
/>
|
|
||||||
<div v-else-if="props.row.isSuspension == null">
|
|
||||||
{{ props.row.isSuspension == null ? "-" : "" }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-else>
|
|
||||||
{{ col.value ? col.value : "-" }}
|
|
||||||
</div>
|
|
||||||
</q-td>
|
|
||||||
</q-tr>
|
|
||||||
</template>
|
|
||||||
</d-table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12">
|
|
||||||
<q-checkbox
|
|
||||||
v-if="type === 'FULL'"
|
|
||||||
keep-color
|
|
||||||
label="สำรอง"
|
|
||||||
dense
|
|
||||||
v-model="isReserve"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<q-input
|
|
||||||
v-if="type === 'NONE'"
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
v-model="note"
|
|
||||||
label="หมายเหตุ"
|
|
||||||
type="textarea"
|
|
||||||
:class="inputEdit(isReadonly)"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
|
||||||
<q-separator />
|
<div class="col-12">
|
||||||
<q-card-actions align="right">
|
<d-table
|
||||||
<q-btn
|
ref="table"
|
||||||
:disable="selectedData.length === 0 || type === ''"
|
:columns="columns"
|
||||||
type="submit"
|
:rows="rows"
|
||||||
color="secondary"
|
row-key="id"
|
||||||
label="บันทึก"
|
flat
|
||||||
/>
|
bordered
|
||||||
</q-card-actions>
|
:paging="true"
|
||||||
</q-form>
|
dense
|
||||||
|
:rows-per-page-options="[10, 25, 50, 100]"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
selection="multiple"
|
||||||
|
v-model:selected="selectedData"
|
||||||
|
>
|
||||||
|
<template v-slot:header-selection="scope">
|
||||||
|
<q-checkbox
|
||||||
|
keep-color
|
||||||
|
color="primary"
|
||||||
|
dense
|
||||||
|
v-model="scope.selected"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:body="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-td auto-width>
|
||||||
|
<q-checkbox
|
||||||
|
v-model="props.selected"
|
||||||
|
keep-color
|
||||||
|
color="primary"
|
||||||
|
dense
|
||||||
|
/>
|
||||||
|
</q-td>
|
||||||
|
<q-td
|
||||||
|
v-for="col in props.cols"
|
||||||
|
:key="col.name"
|
||||||
|
:props="props"
|
||||||
|
>
|
||||||
|
<div v-if="col.name === 'no'">
|
||||||
|
{{ props.rowIndex + 1 }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.name === 'fullName'">
|
||||||
|
{{
|
||||||
|
`${props.row.prefix}${props.row.firstName} ${props.row.lastName}`
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="col.name == 'organization'"
|
||||||
|
class="text-html"
|
||||||
|
>
|
||||||
|
{{ findOrgNameHtml(props.row) }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.name == 'amount'">
|
||||||
|
{{ Number(props.row.amount).toLocaleString() }}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="col.name == 'isSuspension'">
|
||||||
|
<q-icon
|
||||||
|
v-if="props.row.isSuspension !== null"
|
||||||
|
:name="props.row.isSuspension ? 'done' : 'close'"
|
||||||
|
:color="props.row.isSuspension ? 'primary' : 'red'"
|
||||||
|
size="24px"
|
||||||
|
/>
|
||||||
|
<div v-else-if="props.row.isSuspension == null">
|
||||||
|
{{ props.row.isSuspension == null ? "-" : "" }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else>
|
||||||
|
{{ col.value ? col.value : "-" }}
|
||||||
|
</div>
|
||||||
|
</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
</d-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<q-checkbox
|
||||||
|
v-if="type === 'FULL'"
|
||||||
|
keep-color
|
||||||
|
label="สำรอง"
|
||||||
|
dense
|
||||||
|
v-model="isReserve"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
v-if="type === 'NONE'"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="note"
|
||||||
|
label="หมายเหตุ"
|
||||||
|
type="textarea"
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
<q-separator />
|
||||||
|
<q-card-actions align="right">
|
||||||
|
<q-btn
|
||||||
|
:disable="selectedData.length === 0 || type === ''"
|
||||||
|
@click="onSubmit"
|
||||||
|
color="secondary"
|
||||||
|
label="บันทึก"
|
||||||
|
/>
|
||||||
|
</q-card-actions>
|
||||||
</q-card>
|
</q-card>
|
||||||
</q-dialog>
|
</q-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue