Merge branch 'nice_dev' into develop
# Conflicts: # src/modules/13_salary/views/salaryLists.vue
This commit is contained in:
commit
bbbb157866
11 changed files with 283 additions and 213 deletions
|
|
@ -146,7 +146,7 @@ function onClickAddPerson(data: DataPerson) {
|
|||
$q,
|
||||
() => {
|
||||
http
|
||||
.post(config.API.salaryPeriodProfile, body)
|
||||
.post(config.API.salaryPeriodProfileEmp, body)
|
||||
.then(() => {
|
||||
props.fetchData?.();
|
||||
success($q, "เพื่มรายชื่อสำเร็จ");
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ const maxPage = ref<number>(1);
|
|||
function fetchDataQuota(id: string) {
|
||||
// showLoader();
|
||||
http
|
||||
.get(config.API.salaryListPeriodQuota(id))
|
||||
.get(config.API.salaryListPeriodQuotaEmp(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
store.remaining = data.remaining;
|
||||
|
|
@ -242,7 +242,7 @@ function fetchDataPeriod(id: string) {
|
|||
};
|
||||
|
||||
http
|
||||
.put(config.API.salaryListPeriodORG(id), formData)
|
||||
.put(config.API.salaryListPeriodORGEmp(id), formData)
|
||||
.then((res) => {
|
||||
rows.value = res.data.result.data;
|
||||
total.value = res.data.result.total;
|
||||
|
|
@ -298,9 +298,9 @@ function onClickDownload(data: DataOption) {
|
|||
}
|
||||
|
||||
const modalDialogInfoCriteria = ref<boolean>(false);
|
||||
onMounted(async () => {
|
||||
await fetchDataQuota(store.groupId);
|
||||
await fetchDataPeriod(store.groupId);
|
||||
onMounted(() => {
|
||||
fetchDataQuota(store.groupId);
|
||||
fetchDataPeriod(store.groupId);
|
||||
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -289,7 +289,13 @@ watch(
|
|||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="store.roundMainCode === 'OCT' ? columns : columns.slice(0, 10)"
|
||||
:options="
|
||||
store.roundMainCode === 'OCT'
|
||||
? columns
|
||||
: columns
|
||||
? columns.slice(0, 10)
|
||||
: []
|
||||
"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
|
|
@ -299,7 +305,13 @@ watch(
|
|||
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="store.roundMainCode === 'OCT' ? columns : columns.slice(0, 10)"
|
||||
:columns="
|
||||
store.roundMainCode === 'OCT'
|
||||
? columns
|
||||
: columns
|
||||
? columns.slice(0, 10)
|
||||
: []
|
||||
"
|
||||
:rows="props.rows"
|
||||
row-key="id"
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -48,10 +48,15 @@ const typeRangeOps = computed(() => {
|
|||
{ id: "FULL", name: "1 ขั้น" },
|
||||
{ id: "FULLHAFT", name: "1.5 ขั้น" },
|
||||
]
|
||||
: [
|
||||
: store.roundMainCode == "ARP"
|
||||
? [
|
||||
{ id: "NONE", name: "ไม่ได้เลื่อน" },
|
||||
{ id: "HAFT", name: "0.5 ขั้น" },
|
||||
{ id: "FULL", name: "1 ขั้น" },
|
||||
]
|
||||
: [
|
||||
{ id: "HAFT", name: "0.5 ขั้น" },
|
||||
{ id: "FULL", name: "1 ขั้น" },
|
||||
];
|
||||
});
|
||||
|
||||
|
|
@ -104,7 +109,7 @@ function onSubmit() {
|
|||
watch(
|
||||
() => modal.value,
|
||||
() => {
|
||||
type.value = props.typeLevel == 'PENDING' ? "" : props.typeLevel;
|
||||
type.value = props.typeLevel == "PENDING" ? "" : props.typeLevel;
|
||||
isReserve.value = props.isReserve;
|
||||
isChange.value = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ const { messageError, showLoader, hideLoader } = useCounterMixin();
|
|||
/** props*/
|
||||
const props = defineProps({
|
||||
periodLatest: { type: Object as () => DataPeriodLatest, require: true },
|
||||
rootId: { type: String, require: true },
|
||||
periodId: { type: String, require: true },
|
||||
});
|
||||
|
||||
const total = ref<number>();
|
||||
|
|
@ -84,7 +86,8 @@ const itemsTabType = computed(() => {
|
|||
type: "NONE",
|
||||
},
|
||||
]
|
||||
: [
|
||||
: store.roundMainCode === "APR"
|
||||
? [
|
||||
{
|
||||
lable: "รายชื่อคนครอง",
|
||||
name: "tab1",
|
||||
|
|
@ -105,6 +108,23 @@ const itemsTabType = computed(() => {
|
|||
name: "tab4",
|
||||
type: "NONE",
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
lable: "รายชื่อคนครอง",
|
||||
name: "tab1",
|
||||
type: "PENDING",
|
||||
},
|
||||
{
|
||||
lable: "1 ขั้น",
|
||||
name: "tab2",
|
||||
type: "FULL",
|
||||
},
|
||||
{
|
||||
lable: "0.5 ขั้น",
|
||||
name: "tab3",
|
||||
type: "HAFT",
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
|
|
@ -282,26 +302,29 @@ function fetchDataPeriodNew() {
|
|||
}
|
||||
|
||||
function onClickDownload(data: DataOption) {
|
||||
console.log(data);
|
||||
// showLoader();
|
||||
// http
|
||||
// .get(config.API.salaryReportByid(salaryId.value))
|
||||
// .then((res) => {
|
||||
// const dataList = res.data.result;
|
||||
// genReportXLSX(dataList, "อัตราเงินเดือน");
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
if (props.rootId && props.periodId) {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
config.API.salaryReportListsByid(data.id, props.rootId, props.periodId)
|
||||
)
|
||||
.then((res) => {
|
||||
const dataList = res.data.result;
|
||||
genReportXLSX(dataList, data.name);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const modalDialogInfoCriteria = ref<boolean>(false);
|
||||
onMounted(async () => {
|
||||
await fetchDataQuota(store.groupId);
|
||||
await fetchDataPeriod(store.groupId);
|
||||
onMounted(() => {
|
||||
fetchDataQuota(store.groupId);
|
||||
fetchDataPeriod(store.groupId);
|
||||
splitterModel.value = store.roundMainCode === "APR" ? 13 : 16;
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -289,7 +289,13 @@ watch(
|
|||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="store.roundMainCode === 'OCT' ? columns : columns.slice(0, 10)"
|
||||
:options="
|
||||
store.roundMainCode === 'OCT'
|
||||
? columns
|
||||
: columns
|
||||
? columns.slice(0, 10)
|
||||
: []
|
||||
"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
|
|
@ -299,7 +305,13 @@ watch(
|
|||
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="store.roundMainCode === 'OCT' ? columns : columns.slice(0, 10)"
|
||||
:columns="
|
||||
store.roundMainCode === 'OCT'
|
||||
? columns
|
||||
: columns
|
||||
? columns.slice(0, 10)
|
||||
: []
|
||||
"
|
||||
:rows="props.rows"
|
||||
row-key="id"
|
||||
flat
|
||||
|
|
|
|||
|
|
@ -198,10 +198,10 @@ const modalDialogProperties = ref<boolean>(false);
|
|||
/** ตัวแปร*/
|
||||
const profileId = ref<string>("");
|
||||
const amount = ref<number>(0);
|
||||
const isPunish = ref<boolean>(false)
|
||||
const isSuspension = ref<boolean>(false)
|
||||
const isAbsent = ref<boolean>(false)
|
||||
const isLeave = ref<boolean>(false)
|
||||
const isPunish = ref<boolean>(false);
|
||||
const isSuspension = ref<boolean>(false);
|
||||
const isAbsent = ref<boolean>(false);
|
||||
const isLeave = ref<boolean>(false);
|
||||
/**
|
||||
* function ยืนยันการลบรายชื่อ
|
||||
* @param id profileId
|
||||
|
|
@ -282,14 +282,13 @@ function searchData() {
|
|||
props.fetchDataTable?.();
|
||||
}
|
||||
|
||||
function onProperties(data:any){
|
||||
console.log(data)
|
||||
modalDialogProperties.value = true
|
||||
profileId.value = data.id
|
||||
isPunish.value = data.isPunish
|
||||
isSuspension.value = data.isSuspension
|
||||
isAbsent.value = data.isAbsent
|
||||
isLeave.value = data.isLeave
|
||||
function onProperties(data: any) {
|
||||
modalDialogProperties.value = true;
|
||||
profileId.value = data.id;
|
||||
isPunish.value = data.isPunish;
|
||||
isSuspension.value = data.isSuspension;
|
||||
isAbsent.value = data.isAbsent;
|
||||
isLeave.value = data.isLeave;
|
||||
}
|
||||
/** callblack function เรียกข้อมูลรายชื่อใหม่ เมื่อมีการเปลี่ยน PageSize*/
|
||||
watch(
|
||||
|
|
@ -302,7 +301,14 @@ watch(
|
|||
|
||||
<template>
|
||||
<q-toolbar class="text-primary" style="padding: 0px">
|
||||
<q-btn v-if="!store.isClosedRound" flat round dense icon="add" @click="onClickAddPerson">
|
||||
<q-btn
|
||||
v-if="!store.isClosedRound"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
icon="add"
|
||||
@click="onClickAddPerson"
|
||||
>
|
||||
<q-tooltip>เพิ่ม </q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
|
|
@ -439,7 +445,7 @@ watch(
|
|||
size="24px"
|
||||
/>
|
||||
<div v-else-if="props.row.isPunish == null">
|
||||
{{ props.row.isPunish == null ? '-':''}}
|
||||
{{ props.row.isPunish == null ? "-" : "" }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'isSuspension'">
|
||||
|
|
@ -450,7 +456,7 @@ watch(
|
|||
size="24px"
|
||||
/>
|
||||
<div v-else-if="props.row.isSuspension == null">
|
||||
{{ props.row.isSuspension == null ? '-':''}}
|
||||
{{ props.row.isSuspension == null ? "-" : "" }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'isAbsent'">
|
||||
|
|
@ -461,12 +467,12 @@ watch(
|
|||
size="24px"
|
||||
/>
|
||||
<div v-else-if="props.row.isAbsent == null">
|
||||
{{ props.row.isAbsent == null ? '-':''}}
|
||||
{{ props.row.isAbsent == null ? "-" : "" }}
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'amount'">
|
||||
{{Number(props.row.amount).toLocaleString()}}
|
||||
</div>
|
||||
{{ Number(props.row.amount).toLocaleString() }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'isLeave'">
|
||||
<q-icon
|
||||
v-if="props.row.isLeave !== null"
|
||||
|
|
@ -475,9 +481,8 @@ watch(
|
|||
size="24px"
|
||||
/>
|
||||
<div v-else-if="props.row.isLeave == null">
|
||||
{{ props.row.isLeave == null ? '-':''}}
|
||||
{{ props.row.isLeave == null ? "-" : "" }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
|
|
@ -485,7 +490,7 @@ watch(
|
|||
</q-td>
|
||||
<q-td>
|
||||
<q-btn
|
||||
v-if="!store.isClosedRound"
|
||||
v-if="!store.isClosedRound"
|
||||
flat
|
||||
dense
|
||||
icon="mdi-dots-vertical"
|
||||
|
|
@ -576,13 +581,13 @@ watch(
|
|||
:fetchData="props.fetchDataTable"
|
||||
/>
|
||||
<DialogProperties
|
||||
v-model:modal="modalDialogProperties"
|
||||
v-model:id="profileId"
|
||||
:is-punish="isPunish"
|
||||
:is-suspension="isSuspension"
|
||||
:is-absent="isAbsent"
|
||||
:is-leave="isLeave"
|
||||
:fetch-data="props.fetchDataTable"
|
||||
v-model:modal="modalDialogProperties"
|
||||
v-model:id="profileId"
|
||||
:is-punish="isPunish"
|
||||
:is-suspension="isSuspension"
|
||||
:is-absent="isAbsent"
|
||||
:is-leave="isLeave"
|
||||
:fetch-data="props.fetchDataTable"
|
||||
/>
|
||||
</template>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue