เพิ่มแสดงเงินค่าตอบแทนพิเศษ

This commit is contained in:
setthawutttty 2024-12-06 17:15:02 +07:00
parent 4ab2c5e139
commit 1fc8c41554
8 changed files with 63 additions and 9 deletions

View file

@ -48,7 +48,7 @@ async function getReportRecruit() {
await http
.get(
config.API.reportRecruit(reportSelect.value) +
`?rootId=&year=${year.value+543}`
`?year=${year.value+543}`
)
.then(async (res) => {
const data = res.data.result;
@ -188,7 +188,7 @@ onMounted(() => {
dense
v-model="reportSelect"
:options="reportSelectOption"
label="ประเภท"
label="รายงาน"
emit-value
map-options
hide-selected

View file

@ -192,6 +192,7 @@ const formDataSalary = reactive<FormSalaryNew>({
refCommandNo: "", //
templateDoc: "", // (template)
doc: "", //
amountSpecial: null, //
});
const modalDialogSalary = ref<boolean>(false); // popup
@ -748,6 +749,17 @@ onMounted(() => {
{{ col.value ? col.value : "-" }}
<q-tooltip v-if="col.value">ดูคำสั่ง</q-tooltip>
</div>
<div v-else-if="col.name == 'amount'">
{{
props.row.amount
? `${props.row.amount}${
props.row.amountSpecial !== 0 && props.row.amountSpecial
? `(${props.row.amountSpecial.toLocaleString()})`
: ""
}`
: "-"
}}
</div>
<div v-else-if="col.name == 'refCommandNo' && !props.row.commandId">
-
</div>
@ -1097,7 +1109,21 @@ onMounted(() => {
hide-bottom-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-4">
<q-input
:class="classInput(true)"
ref="amountSpecialRef"
dense
outlined
v-model="formDataSalary.amountSpecial"
label="เงินค่าตอบแทนพิเศษ"
mask="###,###,###,###"
reverse-fill-mask
:rules="[(val:string) => !!val || `${'กรุณากรอกเงินค่าตอบแทนพิเศษ'}`]"
lazy-rules
hide-bottom-space
/>
</div>
<div class="col-xs-6 col-sm-6 col-md-12">
<q-input
:class="classInput(true)"

View file

@ -9,6 +9,7 @@ interface FormSalaryNew {
positionLevel: string;
positionExecutive: string;
salary: number | string | null;
amountSpecial: number | string | null;
salaryPos: number | string | null;
salaryCompensation: number | string | null;
refCommandNo: string;

View file

@ -1,5 +1,6 @@
interface ResListSalary {
amount: number;
amountSpecial: number;
createdAt: string;
createdFullName: string;
createdUserId: string;

View file

@ -78,8 +78,13 @@ const dataMapToSend = computed(() => {
firstName: i.firstName,
lastName: i.lastName,
citizenId: i.citizenId,
...(props.systemName?.includes("SALARY") && {
amount: i.positionSalaryAmount,
amountSpecial: i.amountSpecial,
}),
}));
});
//Table
const rows = ref<any[]>([]);
const selected = ref<any[]>([]);
@ -143,6 +148,7 @@ function onSubmit() {
commandNo: commandNo.value,
persons: selected.value ? dataMapToSend.value : [],
};
await http
.post(config.API.command + `/person`, body)
.then(async (res) => {

View file

@ -47,6 +47,7 @@ async function fetchData() {
isDraft.value = data.isDraft;
isSign.value = data.isSign;
isAttachment.value = data.isAttachment;
store.isSalary = data.isSalary
})
.catch((err) => {
messageError($q, err);

View file

@ -6,13 +6,14 @@ import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useCommandMainStore } from "@/modules/18_command/store/Main";
import { useCommandDetail } from "@/modules/18_command/store/DetailStore";
import DialogHeader from "@/components/DialogHeader.vue";
const $q = useQuasar();
const { showLoader, hideLoader, dialogConfirm, messageError, success } =
useCounterMixin();
const store = useCommandMainStore();
const storeDetail = useCommandDetail();
const props = defineProps({
getData: Function,
@ -36,6 +37,7 @@ const formData = reactive<any>({
mouthSalaryAmount: null,
remarkVertical: null,
remarkHorizontal: null,
amountSpecial: null,
});
const readonly = ref<boolean>(false);
@ -167,12 +169,28 @@ watch(
:class="getClass(!readonly)"
mask="###,###,###,###,###,###"
reverse-fill-mask
:readonly="readonly"
:readonly="!storeDetail.isSalary"
:label="`${'เงินเดือน'}`"
:rules="[(val: any) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
/>
</div>
<div
v-if="store.isShowSalary(type)"
class="col-xs-6 col-sm-6 col-md-6"
>
<q-input
dense
outlined
lazy-rules
hide-bottom-space
v-model="formData.amountSpecial"
:class="getClass(!readonly)"
:readonly="!storeDetail.isSalary"
mask="###,###,###,###,###,###"
reverse-fill-mask
:label="`${'เงินค่าตอบแทนพิเศษ'}`"
/>
</div>
<div
v-if="store.isShowSalary(type)"
class="col-xs-6 col-sm-6 col-md-6"
@ -184,7 +202,7 @@ watch(
hide-bottom-space
v-model="formData.positionSalaryAmount"
:class="getClass(!readonly)"
:readonly="readonly"
:readonly="!storeDetail.isSalary"
mask="###,###,###,###,###,###"
reverse-fill-mask
:label="`${'เงินประจำตำแหน่ง'}`"
@ -202,7 +220,7 @@ watch(
hide-bottom-space
v-model="formData.monthSalaryAmount"
:class="getClass(!readonly)"
:readonly="readonly"
:readonly="!storeDetail.isSalary"
mask="###,###,###,###,###,###"
reverse-fill-mask
:label="`${'เงินค่าตอบแทนรายเดือน'}`"

View file

@ -7,7 +7,7 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
const readonly = ref<boolean>(false);
const dataCommand = ref<FormDataDetail>();
const status = ref<string>("");
const isSalary = ref<boolean>(false)
function checkStep(val: string) {
status.value = val;
switch (val) {
@ -39,5 +39,6 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
readonly,
status,
dataCommand,
isSalary
};
});