diff --git a/src/modules/07_insignia/components/3_result/DialogForm.vue b/src/modules/07_insignia/components/3_result/DialogForm.vue
index 269c3d687..c58e12f63 100644
--- a/src/modules/07_insignia/components/3_result/DialogForm.vue
+++ b/src/modules/07_insignia/components/3_result/DialogForm.vue
@@ -340,6 +340,7 @@ const searchcardid = () => {
v-model="employeeClass"
:label="`ขรก.สามัญ/ลูกจ้างประจำ`"
@update:model-value="selectType"
+ :disable="status !== ''"
/>
@@ -347,7 +348,7 @@ const searchcardid = () => {
{
{
{
{
map-options
v-model="payment"
:label="`เลือกรูปแบบการจ่าย`"
- :rules="[(val) => !!val || 'เลือกรูปแบบการจ่าย']"
/>
{
const insignia = ref('')
const insigniaOp = ref([{ name: "ทั้งหมด", id: "" }])
const insigniaOp2 = ref([])
const insigniaType = ref()
+ const invoiceType = ref('all')
+ const invoiceTypeop = ref([{ name: "ทั้งหมด", id: "all" }, { name: "ใบกำกับที่ค้างจ่าย", id: "noDate" }, { name: "ใบกำกับที่จ่ายแล้ว", id: "haveDate" }])
+ const rows = ref([])
+ const listInsignia = ref([])
const fetchDatainsignia = async (data: any) => {
+ insignia.value = ''
+ invoiceType.value = 'all'
data.forEach((e: any) => {
insigniaOp.value.push({ name: e.name, id: e.id })
});
data.forEach((e: any) => {
insigniaOp2.value.push({ name: e.name, id: e.id })
});
-
}
const fetchDatainsigniaType = async (data: any) => {
insigniaType.value = data.map((e: any) => ({ name: e.id, label: e.name }))
}
+ const fetchlistinsignia = async (data: any) => {
+ rows.value = [];
+ let alllist = await data.map((e: any) => ({
+ id: e.id,
+ citizenId: e.citizenId,
+ prefix: e.prefix,
+ position: e.position,
+ status: status(e.status),
+ dateReceive: date2Thai(e.dateReceive),
+ name: e.fullName,
+ type: e.requestInsignia,
+ employeeType: profileType(e.profileType),
+ profileType: e.profileType,
+ page: e.page,
+ number: e.no,
+ vatnumber: e.number,
+ datepay: date2Thai(e.datePayment),
+ typepay: e.typePayment,
+ address: e.address,
+ }));
+ rows.value = alllist
+ listInsignia.value = alllist
+ selectInvoice(invoiceType.value)
+
+ }
+ const selectInvoice = (invoice: string) => {
+ console.log(invoice);
+ if (invoice === "noDate") {
+ let list = listInsignia.value.filter((e: any) => e.datepay === null)
+ rows.value = list
+ } else if (invoice === "haveDate") {
+ let list = listInsignia.value.filter((e: any) => e.datepay !== null)
+ rows.value = list
+ } else rows.value = listInsignia.value
+ }
const status = (val: string) => {
switch (val) {
case "PENDING":
@@ -43,13 +92,18 @@ export const useResultDataStore = defineStore("insigniaResult", () => {
}
}
return {
+ rows,
insignia,
insigniaOp,
insigniaOp2,
insigniaType,
+ invoiceType,
+ invoiceTypeop,
fetchDatainsignia,
fetchDatainsigniaType,
status,
profileType,
+ fetchlistinsignia,
+ selectInvoice,
};
});
diff --git a/src/modules/07_insignia/views/ResultPage.vue b/src/modules/07_insignia/views/ResultPage.vue
index 572138b01..09e6b6f11 100644
--- a/src/modules/07_insignia/views/ResultPage.vue
+++ b/src/modules/07_insignia/views/ResultPage.vue
@@ -45,6 +45,8 @@ const fecthRound = async () => {
.get(config.API.noteround())
.then((res) => {
let data = res.data.result;
+ // console.log(data);
+
selectRoundOption.value = data;
selectRound.value = data[0].id;
// console.log(selectRound.value);
@@ -57,7 +59,7 @@ const fecthInsignia = async () => {
await http
.get(config.API.insignia)
.then((res) => {
- // console.log(res);
+ console.log(res);
let data = res.data.result;
DataStore.fetchDatainsignia(data);
})
@@ -80,8 +82,10 @@ const fecthInsigniaType = async () => {
const visibleColumns = ref([
"no",
"status",
+ "citizenId",
"name",
"type",
+ "dateReceive",
"employeeType",
"page",
"number",
@@ -101,6 +105,7 @@ const columns = ref([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
+
{
name: "status",
align: "left",
@@ -110,6 +115,15 @@ const columns = ref([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
+ {
+ name: "citizenId",
+ align: "left",
+ label: "เลขบัตรประชาชน",
+ field: "citizenId",
+ sortable: true,
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ },
{
name: "name",
align: "left",
@@ -122,12 +136,21 @@ const columns = ref([
{
name: "type",
align: "left",
- label: "ประเภทเครื่องราชฯ",
+ label: "เครื่องราชฯ",
field: "type",
sortable: true,
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
+ {
+ name: "dateReceive",
+ align: "left",
+ label: "วันที่ได้รับพระราชทาน",
+ field: "dateReceive",
+ sortable: true,
+ sort: (a: string, b: string) =>
+ a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
+ },
{
name: "employeeType",
align: "left",
@@ -198,24 +221,7 @@ const columns = ref([
field: "",
},
]);
-const rows = ref([
- // {
- // no: "1",
- // status: "รอบันทึกข้อมูล",
- // name: "นางสาวรัชภรณ์ ภักดี",
- // type: "ทั้งหมด",
- // page: "8",
- // number: "11",
- // vatnumber: "5647833",
- // datepay: null,
- // typepay: null,
- // address: "เลขที่ 2/3 หมู่ที่ 14 ถนนบ...",
- // },
-]);
watch(tab, () => {
- console.log(tab.value);
- console.log(DataStore.insigniaType);
-
if (tab.value !== "doc") {
fecthlistInsignia();
}
@@ -242,24 +248,28 @@ const fecthlistInsignia = async () => {
.post(config.API.noteSearch(), data)
.then((res) => {
let data = res.data.result;
- rows.value = [];
- rows.value = data.map((e: any) => ({
- id: e.id,
- citizenId: e.citizenId,
- prefix: e.prefix,
- position: e.position,
- status: DataStore.status(e.status),
- name: e.fullName,
- type: e.requestInsignia,
- employeeType: DataStore.profileType(e.profileType),
- profileType: e.profileType,
- page: e.page,
- number: e.no,
- vatnumber: e.number,
- datepay: date2Thai(e.datePayment),
- typepay: e.typePayment,
- address: e.address,
- }));
+ console.log(data);
+ DataStore.fetchlistinsignia(data);
+
+ // rows.value = [];
+ // rows.value = data.map((e: any) => ({
+ // id: e.id,
+ // citizenId: e.citizenId,
+ // prefix: e.prefix,
+ // position: e.position,
+ // status: DataStore.status(e.status),
+ // dateReceive: date2Thai(e.dateReceive),
+ // name: e.fullName,
+ // type: e.requestInsignia,
+ // employeeType: DataStore.profileType(e.profileType),
+ // profileType: e.profileType,
+ // page: e.page,
+ // number: e.no,
+ // vatnumber: e.number,
+ // datepay: date2Thai(e.datePayment),
+ // typepay: e.typePayment,
+ // address: e.address,
+ // }));
})
.catch((err) => {
console.log(err);
@@ -392,38 +402,6 @@ const resetFilter = () => {
>
-
-
-
-
-
-
- เพิ่ม
-
-
{
>อัพโหลดไฟล์บันทึกผลการได้รับพระราชทานเครื่องราชย์อิสริยสภรณ์
-
-
{
อัพโหลดไฟล์บันทึกผลการจ่ายใบกำกับ
+
+
+
+
+
+
+
+
+
+
+
+ เพิ่ม
+
+
@@ -549,7 +561,7 @@ const resetFilter = () => {
-
-