เงินเดือน => permission ผังบัญชีค่าจ้างลูกจ้างประจำ
This commit is contained in:
parent
864b67fbe5
commit
38d5697a7c
9 changed files with 323 additions and 252 deletions
|
|
@ -26,6 +26,8 @@ const {
|
|||
|
||||
/** props*/
|
||||
const modal = defineModel<boolean>("modal", { required: true });
|
||||
const activeType = defineModel<string>("activeType", { required: true });
|
||||
|
||||
const props = defineProps({
|
||||
isStatusEdit: { type: Boolean, required: true },
|
||||
data: { type: Object, required: true },
|
||||
|
|
@ -65,7 +67,7 @@ function fetchSalaryDetail(id: string) {
|
|||
formData.startDate = data.startDate;
|
||||
formData.endDate = data.endDate;
|
||||
formData.details = data.details;
|
||||
isReadonly.value = data.isActive ? true : false;
|
||||
isReadonly.value = activeType.value === "view" ? true : data.isActive;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -84,9 +86,9 @@ function onSubmit() {
|
|||
? config.API.salaryEmployeeChart
|
||||
: config.API.salaryEmployeeChartByid(props.data.id);
|
||||
await http[!props.isStatusEdit ? "post" : "put"](url, formData);
|
||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
props.fetchData?.();
|
||||
await props.fetchData?.();
|
||||
closeDialog();
|
||||
success($q, "บันทีกข้อมูลสำเร็จ");
|
||||
} catch (err) {
|
||||
messageError($q, err);
|
||||
} finally {
|
||||
|
|
@ -150,7 +152,9 @@ const getClass = (val: boolean) => {
|
|||
<q-form greedy @submit.prevent @validation-success="onSubmit">
|
||||
<Header
|
||||
:tittle="
|
||||
props.isStatusEdit
|
||||
props.isStatusEdit && activeType === 'view'
|
||||
? 'รายละเอียด'
|
||||
: props.isStatusEdit
|
||||
? 'แก้ไขผังบัญชีค่าจ้างลูกจ้างประจำ'
|
||||
: 'เพิ่มผังบัญชีค่าจ้างลูกจ้างประจำ'
|
||||
"
|
||||
|
|
@ -359,12 +363,8 @@ const getClass = (val: boolean) => {
|
|||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="บันทึก"
|
||||
color="secondary"
|
||||
type="submit"
|
||||
:disable="isReadonly"
|
||||
<q-card-actions align="right" v-if="!isReadonly">
|
||||
<q-btn label="บันทึก" color="secondary" type="submit"
|
||||
><q-tooltip>บันทึกข้อมูล</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue