no message

This commit is contained in:
setthawutttty 2024-02-23 11:25:02 +07:00
parent b85a61920d
commit d54a6c1fa9
3 changed files with 32 additions and 22 deletions

View file

@ -14,7 +14,7 @@ import { useQuasar } from "quasar";
const idRound = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const { dialogRemove, showLoader, hideLoader, messageError } = mixin;
const { dialogRemove, showLoader, hideLoader, messageError,date2Thai } = mixin;
const dataStore = useSalaryDataStore();
const year = ref<number>(0);
const filterKeyword = ref<string>("");
@ -84,6 +84,7 @@ const columns = ref<QTableProps["columns"]>([
function clickAdd() {
dialog.value = true;
editCheck.value = false
}
/** ดึงข้อมูลเริ่มต้น */
function getData() {
@ -94,10 +95,8 @@ function getData() {
`?page=${page.value}&pageSise=${rowsPerPage.value}&keyword=${filterKeyword.value}&year=${year.value}`
)
.then((res) => {
// maxPage.value = Math.ceil(dataList[0].total / rowsPerPage.value);
// dataStore.fetchDataMap(dataList[0].data);
dataStore.fetchDataMap(res.data.result.data);
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
// fetchAppealComplain(res.data.result.data);
})
.catch((e) => {
messageError($q, e);
@ -140,6 +139,17 @@ function deleteData(id: string) {
hideLoader();
});
}
function editPopup(data:RowList) {
console.log(data)
editCheck.value = true;
dialog.value = true;
console.log(dialog.value)
idRound.value = data.id;
period.value = data.period ? data.period:'';
effectiveDate.value = data.effectiveDate as Date;
isActive.value = data.isActive ? data.isActive:false;
}
onMounted(async () => {
year.value = new Date().getFullYear();
getData();
@ -301,6 +311,9 @@ onMounted(async () => {
1
}}
</div>
<div v-if="col.name == 'effectiveDate'">
{{ date2Thai(props.row.effectiveDate)}}
</div>
<div v-else-if="col.name === 'isActive'">
<q-icon
v-if="col.value == false"
@ -329,16 +342,7 @@ onMounted(async () => {
size="12px"
icon="edit"
clickable
@click.stop="
() => {
editCheck = true;
dialog = true;
idRound = props.row.id;
period = props.row.period;
effectiveDate = props.row.effectiveDate;
isActive = props.row.isActive;
}
"
@click="editPopup(props.row)"
>
<q-tooltip>แกไขขอม</q-tooltip>
</q-btn>
@ -370,7 +374,7 @@ onMounted(async () => {
:get-data="getData"
:idRound="idRound"
:period="period"
:effectiveDate?="effectiveDate"
v-model:effective="effectiveDate"
:isActive="isActive"
/>
</template>