isClose
This commit is contained in:
parent
24e0fc57fa
commit
1d4a73fc17
4 changed files with 28 additions and 27 deletions
|
|
@ -266,7 +266,6 @@ function checkEndDate() {
|
|||
outlined
|
||||
v-model="formData.name"
|
||||
label="ชื่อผังบัญชีอัตราเงินเดือน"
|
||||
la
|
||||
:rules="[
|
||||
(val) => !!val || 'กรุณากรอกชื่อผังบัญชีอัตราเงินเดือน',
|
||||
]"
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ interface RowList {
|
|||
id: string;
|
||||
period: string|null;
|
||||
isActive: boolean|null;
|
||||
isClose: boolean|null;
|
||||
effectiveDate: Date|null|string;
|
||||
year: number|null;
|
||||
status: string|null;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ export const useSalaryDataStore = defineStore("salaryDataStore", () => {
|
|||
period: i.period !== null ? i.period : null,
|
||||
year: i.year !== null ? i.year : null,
|
||||
isActive: i.isActive !== null ? i.isActive : null,
|
||||
isClose: i.isClose !== null ? i.isClose : null,
|
||||
effectiveDate: i.effectiveDate !== null ? i.effectiveDate : null,
|
||||
status: i.status !== null ? i.status : null,
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -179,14 +179,15 @@ function dialogClose(id: string) {
|
|||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
// http
|
||||
// .put(config.API)
|
||||
// .then((res) => {})
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// });
|
||||
http
|
||||
.get(config.API.salaryPeriod() + `/close/${id}`)
|
||||
.then((res) => {
|
||||
getData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
},
|
||||
"ยืนยันการปิดรอบ",
|
||||
"หากปิดรอบแล้วจะไม่สามารถแก้ไขรายการเงินเดือนของรอบนี้ได้ ต้องการยืนยันการปิดรอบนี้ใช่หรือไม่?"
|
||||
|
|
@ -408,32 +409,31 @@ onMounted(async () => {
|
|||
}}</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="props.row.isClose == false ? dateToISO(new Date()) >= dateToISO(props.row.effectiveDate) ? true : false:false"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
:icon="
|
||||
dateToISO(new Date()) >= dateToISO(props.row.effectiveDate)
|
||||
? 'mdi-close-box'
|
||||
: 'mdi-delete'
|
||||
"
|
||||
icon="mdi-close-box"
|
||||
clickable
|
||||
@click.stop="
|
||||
dateToISO(new Date()) >= dateToISO(props.row.effectiveDate)
|
||||
? dialogClose(props.row.id)
|
||||
: dialogRemove(
|
||||
$q,
|
||||
async () => await deleteData(props.row.id)
|
||||
)
|
||||
"
|
||||
@click.stop="dialogClose(props.row.id)"
|
||||
>
|
||||
<q-tooltip>ปิดรอบ</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="dateToISO(new Date()) >= dateToISO(props.row.effectiveDate) ? false : true"
|
||||
color="red"
|
||||
flat
|
||||
dense
|
||||
round
|
||||
size="12px"
|
||||
icon="mdi-delete"
|
||||
clickable
|
||||
@click.stop="dialogRemove( $q, async () => await deleteData(props.row.id))"
|
||||
v-close-popup
|
||||
>
|
||||
<q-tooltip>{{
|
||||
dateToISO(new Date()) >= dateToISO(props.row.effectiveDate)
|
||||
? "ปิดรอบ"
|
||||
: "ลบข้อมูล"
|
||||
}}</q-tooltip>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue