Merge branch 'develop' into nice_dev

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-12-15 17:23:51 +07:00
commit 4ec797c4ec
6 changed files with 110 additions and 44 deletions

View file

@ -22,7 +22,7 @@ import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const type = ref<string>(""); const type = ref<string>("");
const rows = ref<DataListRow[]>([]) const rows = ref<DataListRow[]>([]);
const $q = useQuasar(); const $q = useQuasar();
const selected = ref<ResponseData[]>([]); const selected = ref<ResponseData[]>([]);
const mixin = useCounterMixin(); const mixin = useCounterMixin();
@ -124,9 +124,11 @@ const fecthTypeOption = async () => {
.then((res) => { .then((res) => {
optionsType.value = res.data.result.filter( optionsType.value = res.data.result.filter(
(e: OpType) => (e: OpType) =>
e.commandCode === "C-PM-26" || e.commandCode === "C-PM-19" ||
e.commandCode === "C-PM-20" ||
e.commandCode === "C-PM-27" || e.commandCode === "C-PM-27" ||
e.commandCode === "C-PM-28" e.commandCode === "C-PM-28" ||
e.commandCode === "C-PM-29"
); );
}) })
.catch((e) => { .catch((e) => {
@ -140,9 +142,11 @@ const fecthTypeOption = async () => {
watchEffect(() => { watchEffect(() => {
if (props.Modal === true) { if (props.Modal === true) {
selected.value = []; selected.value = [];
type.value = '' type.value = "";
// console.log(props.data.status) // console.log(props.data.status)
rows.value = props.data.persons.filter((item: any) => item.status !== 'REPORT'); rows.value = props.data.persons.filter(
(item: any) => item.status !== "REPORT"
);
} }
}); });

View file

@ -521,7 +521,6 @@ onMounted(async () => {
</div> </div>
<div class="col-4"> <div class="col-4">
<q-input <q-input
:class="getClass(edit)"
:outlined="edit" :outlined="edit"
dense dense
readonly readonly
@ -533,7 +532,6 @@ onMounted(async () => {
</div> </div>
<div class="col-12"> <div class="col-12">
<q-input <q-input
:class="getClass(edit)"
:outlined="edit" :outlined="edit"
dense dense
lazy-rules lazy-rules

View file

@ -1,11 +1,12 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, watch } from "vue"; import { ref, computed, watch, onMounted } from "vue";
import { useQuasar } from "quasar"; import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin"; import { useCounterMixin } from "@/stores/mixin";
import DialogHeader from "@/components/DialogHeader.vue"; import DialogHeader from "@/components/DialogHeader.vue";
import type { QTableProps } from "quasar"; import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main"; import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import type { OpType } from "@/modules/05_placement/interface/response/Main";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -14,7 +15,7 @@ import config from "@/app.config";
const $q = useQuasar(); const $q = useQuasar();
const selected = ref<any>([]); const selected = ref<any>([]);
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { success, dialogConfirm } = mixin; const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const emit = defineEmits([ const emit = defineEmits([
"update:filterKeyword2", "update:filterKeyword2",
"update:selected", "update:selected",
@ -130,20 +131,71 @@ function updateInput(value: any) {
function Reset() { function Reset() {
emit("update:filterKeyword2", ""); emit("update:filterKeyword2", "");
} }
const type = ref<string>("");
//----()------//
const optionsType = ref<[]>([]);
const fecthTypeOption = async () => {
showLoader();
await http
.get(config.API.typeOrder())
.then((res) => {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-25" || e.commandCode === "C-PM-26"
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
// watch([()=>props.modal],() => { // watch([()=>props.modal],() => {
// selected.value = props.modal ? [] : []; // selected.value = props.modal ? [] : [];
// if (props.modal === true) { // if (props.modal === true) {
// selected.value = props.rows2; // selected.value = props.rows2;
// } // }
// }); // });
onMounted(() => {
fecthTypeOption();
});
</script> </script>
<template> <template>
<q-dialog v-model="props.modal"> <q-dialog v-model="props.modal">
<q-card style="width: 1200px; max-width: 80vw"> <q-card style="width: 1200px; max-width: 80vw">
<DialogHeader tittle="ส่งไปออกคำสั่ง" :close="closeModal" /> <DialogHeader tittle="ส่งไปออกคำสั่ง" :close="closeModal" />
<q-separator /> <q-separator />
<q-card-section class="q-pt-none"> <q-card-section class="q-pt-none">
<div class="row justify-end"> <div class="row justify-between">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-select
outlined
dense
v-model="type"
:options="optionsType"
label="ประเภทคำสั่ง"
style="width: 400px; max-width: auto"
emit-value
map-options
option-label="name"
option-value="id"
use-input
><template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template>
</q-select>
</q-toolbar>
</div>
<div class="col-5"> <div class="col-5">
<q-toolbar style="padding: 0"> <q-toolbar style="padding: 0">
<q-input <q-input
@ -166,7 +218,7 @@ function Reset() {
/> />
</template> </template>
</q-input> </q-input>
<q-select <q-select
v-model="visibleColumns2" v-model="visibleColumns2"
multiple multiple

View file

@ -162,7 +162,7 @@ watch(
() => currentPage.value, () => currentPage.value,
() => { () => {
rowsPerPage.value = pagination.value.rowsPerPage; rowsPerPage.value = pagination.value.rowsPerPage;
getData() getData();
} }
); );
@ -171,7 +171,7 @@ watch(
() => { () => {
rowsPerPage.value = pagination.value.rowsPerPage; rowsPerPage.value = pagination.value.rowsPerPage;
currentPage.value = 1; currentPage.value = 1;
getData() getData();
} }
); );
@ -201,7 +201,7 @@ watch(
/** ไปยังหน้าเพิ่มข้อมูล */ /** ไปยังหน้าเพิ่มข้อมูล */
function redirectToPageadd() { function redirectToPageadd() {
dataStore.rowsAdd = [] dataStore.rowsAdd = [];
router.push(`/discipline-appealcomplain/add`); router.push(`/discipline-appealcomplain/add`);
} }
@ -209,7 +209,7 @@ function editPage(id: string) {
router.push(`/discipline-appealcomplain/${id}`); router.push(`/discipline-appealcomplain/${id}`);
} }
function filterFn() { function filterFn() {
getData() getData();
console.log("enter", filterKeyword.value); console.log("enter", filterKeyword.value);
} }
@ -245,7 +245,7 @@ function getData() {
) )
.then((res) => { .then((res) => {
maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value); maxPage.value = Math.ceil(res.data.result.total / rowsPerPage.value);
fetchAppealComplain(res.data.result.data) fetchAppealComplain(res.data.result.data);
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -255,17 +255,20 @@ function getData() {
}); });
} }
function dataUpdate(){ function dataUpdate() {
getData() getData();
} }
function yearAll() {
formData.year = 0;
getData();
}
/** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */ /** เรียกใช้งาน ฟังชั่น ตอนเริ่มโหลดหน้า */
onMounted(async () => { onMounted(async () => {
getData() getData();
// await getList(); // await getList();
dataStore.visibleColumns = visibleColumns.value; dataStore.visibleColumns = visibleColumns.value;
dataStore.columns = columns.value; dataStore.columns = columns.value;
}); });
</script> </script>
@ -310,10 +313,18 @@ onMounted(async () => {
dense dense
lazy-rules lazy-rules
outlined outlined
:model-value="Number(formData.year) + 543" :model-value="
formData.year === 0 ? null : Number(formData.year) + 543
"
:label="`${'ปีงบประมาณ'}`" :label="`${'ปีงบประมาณ'}`"
> >
<template v-if="formData.year" v-slot:append>
<q-icon
name="cancel"
@click.stop.prevent="yearAll"
class="cursor-pointer"
/>
</template>
<template v-slot:prepend> <template v-slot:prepend>
<q-icon <q-icon
name="event" name="event"

View file

@ -42,6 +42,7 @@ export const useEvalutuonStore = defineStore("EvalutuonStore", () => {
// เสร็จสิ้น -> DONE // เสร็จสิ้น -> DONE
const visibleColumns = ref<String[]>([ const visibleColumns = ref<String[]>([
"no",
"citizanId", "citizanId",
"fullName", "fullName",
"position", "position",
@ -66,6 +67,26 @@ export const useEvalutuonStore = defineStore("EvalutuonStore", () => {
} }
const columns = ref<QTableProps["columns"]>([ const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "center",
label: "ลำดับ",
sortable: false,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "level",
align: "left",
label: "ระดับที่ยื่นขอ",
sortable: true,
field: "level",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "citizanId", name: "citizanId",
align: "center", align: "center",
@ -95,17 +116,6 @@ export const useEvalutuonStore = defineStore("EvalutuonStore", () => {
sort: (a: string, b: string) => sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
}, },
{
name: "level",
align: "left",
label: "ระดับ",
sortable: true,
field: "level",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{ {
name: "positionNumber", name: "positionNumber",
align: "left", align: "left",

View file

@ -43,15 +43,6 @@ onMounted(async () => {
agency: "กลุ่มงานกฎหมาย", agency: "กลุ่มงานกฎหมาย",
status: "WAIT_CHECK_DOC_V1", status: "WAIT_CHECK_DOC_V1",
}, },
{
citizanId: "172223000401",
fullName: "นางธัญพร ปัทมเดชา",
position: "หัวหน้าสำนักงาน",
level: "ปฏิบัติการ",
positionNumber: "สก.ก412",
agency: "กลุ่มงานกฎหมาย",
status: "WAIT_CHECK_DOC_V1",
},
{ {
citizanId: "122222000401", citizanId: "122222000401",
fullName: "นายสิริศักดิ์ พรมบุตร", fullName: "นายสิริศักดิ์ พรมบุตร",
@ -176,10 +167,10 @@ onMounted(async () => {
<q-icon <q-icon
color="primary" color="primary"
size="xs" size="xs"
name="mdi-bookmark-outline" name="mdi-eye"
/> />
</q-item-section> </q-item-section>
<q-item-section>ตรวจสอบคณสมบ</q-item-section> <q-item-section>รายละเอยดคำขอ</q-item-section>
</q-item> </q-item>
<q-separator /> <q-separator />