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

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

@ -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
};
});