refactor ออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-09-22 10:47:31 +07:00
parent 8dfa5ca02e
commit 3802d5d5a2
8 changed files with 526 additions and 916 deletions

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import { ref } from "vue";
import type { DataOption } from "@/modules/04_registry/components/profileType";
import http from "@/plugins/http";
import config from "@/app.config";
import type { QForm } from "quasar";
@ -10,7 +9,7 @@ import { useRouter } from "vue-router";
const myForm = ref<QForm>();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
const { showLoader, hideLoader, messageError } = mixin;
const $q = useQuasar();
const router = useRouter();
@ -69,7 +68,7 @@ const columns = ref<any["columns"]>([
},
]);
const rows = ref<any>([]);
// popup
const clickOpenpopup = () => {
modal.value = true;
employeeClass.value = "";
@ -85,6 +84,7 @@ const clickOpenpopup = () => {
reportNo.value = "";
}
};
//
const clickSearch = async () => {
await myForm.value!.validate().then((result: boolean) => {
if (result) {
@ -98,7 +98,6 @@ const clickSearch = async () => {
.post(config.API.searchOrderprofile(), body)
.then((res) => {
let data = res.data.result;
if (data.length !== 0) {
rows.value = data.map((e: any) => ({
id: e.id,
@ -108,7 +107,6 @@ const clickSearch = async () => {
position: e.position,
}));
} else {
// notifyError($q, "");
rows.value = [];
}
})
@ -122,12 +120,12 @@ const clickSearch = async () => {
}
});
};
// Redirect to
const clickRedirect = (id: string) => {
router.push(`/registry/${id}`);
};
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "citizenId",
descending: false,
page: 1,
rowsPerPage: 10,
@ -319,10 +317,6 @@ const paginationLabel = (start: number, end: number, total: number) => {
</template>
</q-table>
</q-card-section>
<!-- <q-card-actions align="right">
<q-btn flat label="OK" color="primary" v-close-popup />
</q-card-actions> -->
</q-card>
</q-dialog>
</template>