Merge branch 'develop' of github.com:Frappet/bma-ehr-frontend into develop
This commit is contained in:
commit
db62d761bc
22 changed files with 159 additions and 777 deletions
|
|
@ -15,7 +15,7 @@ const {
|
|||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
dialogMessageNotify
|
||||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
|
@ -34,36 +34,38 @@ const options = ref([
|
|||
{ label: "รอบการเสนอขอพระราชทานเครื่องราชรอบที่ 1", value: 1 },
|
||||
{ label: "รอบการเสนอขอพระราชทานเครื่องราชรอบที่ 2", value: 2 },
|
||||
]);
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData();
|
||||
});
|
||||
const fetchData = async () => {
|
||||
if (route.params.id) {
|
||||
edit.value = true;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.getRoundInsignia(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data.period_id;
|
||||
roundInsig.value =
|
||||
options.value.filter((r: any) => r.value == data.period_round)
|
||||
.length > 0
|
||||
? options.value.filter((r: any) => r.value == data.period_round)[0]
|
||||
: null;
|
||||
yearly.value = data.period_year;
|
||||
datelast.value = data.period_amount;
|
||||
dateStart.value = new Date(data.period_start);
|
||||
dateEnd.value = new Date(data.period_end);
|
||||
files.value = data.period_doc;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
await fetchData();
|
||||
}
|
||||
});
|
||||
|
||||
const fetchData = async () => {
|
||||
edit.value = true;
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.getRoundInsignia(id.value))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
id.value = data.period_id;
|
||||
roundInsig.value =
|
||||
options.value.filter((r: any) => r.value == data.period_round).length >
|
||||
0
|
||||
? options.value.filter((r: any) => r.value == data.period_round)[0]
|
||||
: null;
|
||||
yearly.value = data.period_year;
|
||||
datelast.value = data.period_amount;
|
||||
dateStart.value = new Date(data.period_start);
|
||||
dateEnd.value = new Date(data.period_end);
|
||||
files.value = data.period_doc;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
const fileUploadDoc = async (files: any) => {
|
||||
|
|
@ -92,11 +94,12 @@ const editData = async (id: string) => {
|
|||
formData.append("endDate", dateToISO(dateEnd.value));
|
||||
}
|
||||
formData.append("file", files.value);
|
||||
console.log(formData);
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.editRoundInsignia(id), formData)
|
||||
.then(async () => {})
|
||||
.then(() => {
|
||||
success($q, "แก้ไขข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
|
|
@ -104,17 +107,16 @@ const editData = async (id: string) => {
|
|||
hideLoader();
|
||||
clickBack();
|
||||
});
|
||||
console.log(formData);
|
||||
};
|
||||
const checkSave = () => {
|
||||
if (myForm.value !== null) {
|
||||
myForm.value.validate().then(async (success) => {
|
||||
if (success) {
|
||||
dialogConfirm($q, () => SaveData());
|
||||
}else {
|
||||
dialogMessageNotify($q,"กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ")
|
||||
} else {
|
||||
dialogMessageNotify($q, "กรุณาเลือกรอบการเสนอขอพระราชทานเครื่องราชฯ");
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
};
|
||||
const SaveData = async () => {
|
||||
|
|
@ -130,11 +132,9 @@ const updateDateRange = () => {
|
|||
if (roundInsig.value.value == 1) {
|
||||
dateStart.value = new Date(new Date().getFullYear(), 9, 1);
|
||||
dateEnd.value = new Date(new Date().getFullYear() + 1, 3, 29);
|
||||
console.log(1);
|
||||
} else if (roundInsig.value.value == 2) {
|
||||
dateStart.value = new Date(new Date().getFullYear(), 3, 29);
|
||||
dateEnd.value = new Date(new Date().getFullYear(), 4, 29);
|
||||
console.log(2);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -143,7 +143,6 @@ const addData = async () => {
|
|||
const name = `รอบการเสนอขอพระราชทานเครื่องราชรอบที่ ${
|
||||
roundInsig.value.value
|
||||
} ปี ${yearly.value + 543} `;
|
||||
console.log(name);
|
||||
formData.append("name", name);
|
||||
formData.append("year", yearly.value.toString());
|
||||
formData.append("amount", datelast.value.toString());
|
||||
|
|
@ -329,7 +328,9 @@ const clickBack = () => {
|
|||
outlined
|
||||
v-model="datelast"
|
||||
label="จำนวนวันแจ้งเตือนก่อนวันสิ้นสุด"
|
||||
mask="###"
|
||||
/>
|
||||
|
||||
<q-file
|
||||
class="col-xs-12 col-sm-10"
|
||||
outlined
|
||||
|
|
@ -341,9 +342,6 @@ const clickBack = () => {
|
|||
lazy-rules
|
||||
accept=".pdf,.xlsx,.doc"
|
||||
>
|
||||
<!-- :rules="[
|
||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||
]" -->
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ const visibleColumns = ref<string[]>([
|
|||
"period_year",
|
||||
"period_start",
|
||||
"period_end",
|
||||
// "status",
|
||||
"statusRoyal",
|
||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
||||
|
||||
|
|
@ -61,8 +60,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "period_start",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "period_end",
|
||||
|
|
@ -72,8 +71,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
field: "period_end",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
// sort: (a: string, b: string) =>
|
||||
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "statusRoyal",
|
||||
|
|
@ -95,6 +94,7 @@ onMounted(async () => {
|
|||
await fetchData();
|
||||
});
|
||||
|
||||
//เรียกจาก API รายการรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
const fetchData = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -114,7 +114,6 @@ const fetchData = async () => {
|
|||
period_doc: e.period_doc,
|
||||
period_status: e.period_status.result,
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -145,16 +144,11 @@ const clickDelete = (id: string) => {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
// เพิ่มรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
const clickAdd = () => {
|
||||
router.push({ name: "roundAdd" });
|
||||
};
|
||||
|
||||
const clickProposals = (file: string) => {
|
||||
if (file !== null) {
|
||||
window.open(file);
|
||||
}
|
||||
};
|
||||
const clickListInsignia = async (propsId: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -165,6 +159,7 @@ const clickListInsignia = async (propsId: string) => {
|
|||
"ต้องการยืนยันการคำนวณราชชื่อผู้ได้รับเครื่องราชนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
// เรียกจาก API ข้อมูลผู้ได้รับเครื่องราชฯ
|
||||
const getRequest = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -179,16 +174,6 @@ const getRequest = async (id: string) => {
|
|||
await fetchData();
|
||||
});
|
||||
};
|
||||
// const downloadFile = (response: any, name: string) => {
|
||||
// const link = document.createElement("a");
|
||||
// var fileName = name;
|
||||
// link.href = response;
|
||||
// link.setAttribute("target", "_blank");
|
||||
// link.setAttribute("download", fileName);
|
||||
// document.body.appendChild(link);
|
||||
// link.click();
|
||||
// document.body.removeChild(link);
|
||||
// };
|
||||
|
||||
// ค้นหาในตาราง
|
||||
const filterKeyword = ref<string>("");
|
||||
|
|
@ -201,7 +186,7 @@ const resetFilter = () => {
|
|||
const attrs = ref<any>(useAttrs());
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
sortBy: "desc",
|
||||
// sortBy: "desc",
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 10,
|
||||
|
|
@ -375,7 +360,7 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
<q-tooltip>ผู้ได้รับเครื่องราชฯ</q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-td auto-width v-if="props.row.period_doc !== null">
|
||||
<q-btn
|
||||
dense
|
||||
type="a"
|
||||
|
|
@ -387,13 +372,10 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
|||
icon="mdi-file-download"
|
||||
:href="props.row.period_doc"
|
||||
>
|
||||
<!-- @click="
|
||||
downloadFile(props.row.period_doc, props.row.period_name)
|
||||
" -->
|
||||
|
||||
<q-tooltip>ดาวน์โหลดเอกสารประกอบ </q-tooltip>
|
||||
</q-btn>
|
||||
</q-td>
|
||||
<q-td auto-width v-else></q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
dense
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ const $q = useQuasar();
|
|||
const DataStore = useInsigniaDataStore();
|
||||
const roleDataStore = useroleUserDataStore();
|
||||
|
||||
const modalNote = ref<boolean>(false);
|
||||
const modelPopupReject = ref<boolean>(false);
|
||||
const modelPopupDelete = ref<boolean>(false);
|
||||
const modalAdd = ref<boolean>(false);
|
||||
|
|
@ -233,6 +232,7 @@ onMounted(async () => {
|
|||
}
|
||||
}
|
||||
});
|
||||
// เช็คสถานนะแสดงปุ่มเพิ่ม
|
||||
const checkStatus = computed(() => {
|
||||
if (
|
||||
roleDataStore.insignia1Role &&
|
||||
|
|
@ -241,6 +241,7 @@ const checkStatus = computed(() => {
|
|||
return true;
|
||||
} else return false;
|
||||
});
|
||||
// เลืแกหน่วยงาน
|
||||
const changtypeOc = () => {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
props.fecthInsigniaByOc(
|
||||
|
|
@ -252,26 +253,14 @@ const changtypeOc = () => {
|
|||
}
|
||||
DataStore.typeOc = organization.value;
|
||||
};
|
||||
// เพิ่มราชชื่อ
|
||||
const clickmodalAdd = () => {
|
||||
showLoader();
|
||||
fecthlistRetire();
|
||||
fecthInsignia();
|
||||
fecthlistperson(DataStore.typeOc);
|
||||
insigniaType.value = "";
|
||||
};
|
||||
// fecth profile
|
||||
const fecthlistRetire = async () => {
|
||||
await http
|
||||
.get(config.API.profileOrganizRoot)
|
||||
.then((res) => {
|
||||
const id = res.data.result[0].id;
|
||||
if (id !== "") {
|
||||
fecthlistperson(id);
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
});
|
||||
};
|
||||
// เรียกรายชื่อข้าราชการตามหน่วยงานที่จะเพิ่ม
|
||||
const fecthlistperson = async (id: string) => {
|
||||
let data = [{}];
|
||||
data = [
|
||||
|
|
@ -295,10 +284,9 @@ const fecthlistperson = async (id: string) => {
|
|||
position: e.position == null ? "-" : e.position,
|
||||
level: e.positionEmployeeLevel == null ? "-" : e.positionEmployeeLevel,
|
||||
organizationOrganization: e.oc == null ? "-" : e.oc,
|
||||
ocId: DataStore.convertOcid(e.oc),
|
||||
}));
|
||||
modalAdd.value = true;
|
||||
rows2.value = data.filter((e: any) => e.ocId === DataStore.typeOc);
|
||||
rows2.value = data;
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -307,6 +295,7 @@ const fecthlistperson = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
// ยืนยันการเพิ่มราชชื่อ
|
||||
const clickAdd = async (id: string) => {
|
||||
if (insigniaType.value !== "") {
|
||||
dialogConfirm(
|
||||
|
|
@ -319,7 +308,7 @@ const clickAdd = async (id: string) => {
|
|||
);
|
||||
} else dialogMessageNotify($q, "กรุณาเลือกรายชื่อขอพระราชทานเครื่องราชฯ");
|
||||
};
|
||||
|
||||
//เพิ่มราชชื่อข้าราชการ
|
||||
const addlistperson = async (id: string) => {
|
||||
showLoader();
|
||||
let data = {
|
||||
|
|
@ -348,14 +337,14 @@ const addlistperson = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เปิด POP แก้ไขเครื่องราชฯ
|
||||
const clickmodalEdit = (props: any) => {
|
||||
insignia.value = props.insigniaSend;
|
||||
person.value = props;
|
||||
modalEdit.value = true;
|
||||
fecthInsignia();
|
||||
};
|
||||
|
||||
// downloadfile รายชื่อข้าราชการสามัญฯ
|
||||
const downloadFile = (response: any, filename: string) => {
|
||||
const link = document.createElement("a");
|
||||
var fileName = filename;
|
||||
|
|
@ -365,6 +354,7 @@ const downloadFile = (response: any, filename: string) => {
|
|||
link.click();
|
||||
document.body.removeChild(link);
|
||||
};
|
||||
// เรียก file รายชื่อข้าราชการสามัญฯ
|
||||
const downloadFileexcel = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -378,35 +368,13 @@ const downloadFileexcel = async () => {
|
|||
);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
// const downloadReport = async (type: string = "pdf") => {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.reportInsignia("45", type, props.roundId!), {
|
||||
// responseType: "blob",
|
||||
// })
|
||||
// .then(async (res) => {
|
||||
// console.log(res);
|
||||
|
||||
// downloadFile(
|
||||
// res,
|
||||
// `บัญชีแสดงรายชื่อผู้ขอพระราชทานเหรียญจักรพรรดิมาลา ${props.roundName}.${type}`
|
||||
// );
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// };
|
||||
|
||||
// ยืนยันการแก้ไขเครื่องราช
|
||||
const clickSave = () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -417,7 +385,7 @@ const clickSave = () => {
|
|||
"ต้องการยืนยันการแก้ไขเครื่องราชฯ ที่ยื่นขอนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
|
||||
// แก้ไขเครื่องราช API
|
||||
const listEdit = async (profileId: string) => {
|
||||
let data: any = {
|
||||
insigniaId: insignia.value,
|
||||
|
|
@ -442,11 +410,16 @@ const listEdit = async (profileId: string) => {
|
|||
}
|
||||
});
|
||||
};
|
||||
|
||||
//เปิด POPUP ไม่ยืนขอ
|
||||
const clickReject = (id: string) => {
|
||||
modelPopupReject.value = true;
|
||||
rowid.value = id;
|
||||
};
|
||||
// ปิด POPUP ไม่ยืนขอ
|
||||
const closemodelPopupReject = () => {
|
||||
modelPopupReject.value = false;
|
||||
};
|
||||
// ยืนยัน การไม่ยืนขอ
|
||||
const savaReasonReject = (reason: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -460,10 +433,7 @@ const savaReasonReject = (reason: string) => {
|
|||
"ต้องการยืนยันการย้ายข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
const closemodelPopupReject = () => {
|
||||
modelPopupReject.value = false;
|
||||
};
|
||||
|
||||
// ยืนยัน การไม่ยืนขอ API
|
||||
const listreject = async (profileId: string, reason: string) => {
|
||||
await http
|
||||
.put(config.API.insigniaReject(profileId), { reason: reason })
|
||||
|
|
@ -485,14 +455,16 @@ const listreject = async (profileId: string, reason: string) => {
|
|||
await closemodelPopupReject();
|
||||
});
|
||||
};
|
||||
|
||||
//เปิด POPUP คนที่ถูกลบ
|
||||
const clickDelete = (id: string) => {
|
||||
modelPopupDelete.value = true;
|
||||
rowid.value = id;
|
||||
};
|
||||
// ปิด POPUP คนที่ถูกลบ
|
||||
const closemodelPopupDelete = () => {
|
||||
modelPopupDelete.value = false;
|
||||
};
|
||||
// ยืนยัน การลบคนที่ถูกลบ
|
||||
const savaReasonDelete = (reason: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -506,7 +478,7 @@ const savaReasonDelete = (reason: string) => {
|
|||
"ต้องการยืนยันการลบข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
|
||||
// ยืนยัน คนที่ถูกลบ API
|
||||
const listdelete = async (id: string, reason: string) => {
|
||||
await http
|
||||
.put(config.API.insigniaDelete(id), { reason: reason })
|
||||
|
|
@ -532,7 +504,7 @@ const listdelete = async (id: string, reason: string) => {
|
|||
const insignia = ref<string>("");
|
||||
const insigniaOptions = ref<any>([]);
|
||||
const insigniaType = ref<string>("");
|
||||
|
||||
// เรียกประเภทเครื่องราชฯ
|
||||
const fecthInsignia = async () => {
|
||||
await http
|
||||
.get(config.API.insignia)
|
||||
|
|
@ -662,30 +634,7 @@ const closeModalEdit = () => {
|
|||
color="primary"
|
||||
@click="downloadFileexcel"
|
||||
>
|
||||
<!-- @click="downloadReport('pdf')" -->
|
||||
<q-tooltip>ดาวน์โหลด</q-tooltip>
|
||||
<!-- <q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="downloadReport('pdf')">
|
||||
<q-item-section avatar
|
||||
><q-icon color="red" name="mdi-file-pdf"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .PDF</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadReport('docx')">
|
||||
<q-item-section avatar
|
||||
><q-icon color="blue" name="mdi-file-word"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .docx</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="downloadReport('xlsx')">
|
||||
<q-item-section avatar
|
||||
><q-icon color="green" name="mdi-file-excel"
|
||||
/></q-item-section>
|
||||
<q-item-section>ไฟล์ .xlsx</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu> -->
|
||||
</q-btn>
|
||||
<q-btn
|
||||
size="12px"
|
||||
|
|
@ -814,7 +763,7 @@ const closeModalEdit = () => {
|
|||
<q-td key="dateSend" :props="props">
|
||||
{{ props.row.dateSend }}
|
||||
</q-td>
|
||||
|
||||
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="
|
||||
|
|
@ -896,16 +845,16 @@ const closeModalEdit = () => {
|
|||
</q-btn>
|
||||
</q-td>
|
||||
<q-td
|
||||
auto-width
|
||||
v-if="props.row.insigniaSend == 'เหรียญจักรพรรดิมาลา'"
|
||||
>
|
||||
<btnDownloadFile
|
||||
:profileId="props.row.profileId"
|
||||
:round="DataStore.roundId"
|
||||
:optionRound="DataStore.optionRound"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td v-else auto-width></q-td>
|
||||
auto-width
|
||||
v-if="props.row.insigniaSend == 'เหรียญจักรพรรดิมาลา'"
|
||||
>
|
||||
<btnDownloadFile
|
||||
:profileId="props.row.profileId"
|
||||
:round="DataStore.roundId"
|
||||
:optionRound="DataStore.optionRound"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td v-else auto-width></q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:pagination="scope">
|
||||
|
|
@ -1087,6 +1036,7 @@ const closeModalEdit = () => {
|
|||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- popup เหตุผลไม่ยื่นขอ -->
|
||||
<DialogPopupReason
|
||||
:modal="modelPopupReject"
|
||||
title="เหตุผลไม่ยื่นขอ"
|
||||
|
|
@ -1094,6 +1044,7 @@ const closeModalEdit = () => {
|
|||
:click-close="closemodelPopupReject"
|
||||
:savaForm="savaReasonReject"
|
||||
/>
|
||||
<!-- เหตุผลที่ลบออก -->
|
||||
<DialogPopupReason
|
||||
:modal="modelPopupDelete"
|
||||
title="เหตุผลที่ลบออก"
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ onMounted(async () => {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
// เลือกหน่วยงาน
|
||||
const changtypeOc = () => {
|
||||
if (props.fecthInsigniaByOc) {
|
||||
props.fecthInsigniaByOc(
|
||||
|
|
|
|||
|
|
@ -48,24 +48,18 @@ onMounted(async () => {
|
|||
await fecthOrg();
|
||||
DataStore.mainTab = props.tab;
|
||||
});
|
||||
watch(props, async () => {
|
||||
if (props.tab === "organization") {
|
||||
await fecthOrg();
|
||||
}
|
||||
});
|
||||
|
||||
//หน่วยงานที่ยังไม่ได้เสนอชื่อ
|
||||
const fecthOrg = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.insigniaNosend(props.roundId))
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
let data = res.data.result;
|
||||
rows.value = data.map((e: any) => ({
|
||||
orgId: e.orgId,
|
||||
orgName: e.orgName,
|
||||
}));
|
||||
console.log(rows.value);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
|
|
@ -15,9 +14,6 @@ import tab2 from "@/modules/07_insignia/components/2_Manage/Tab2.vue";
|
|||
import tab3 from "@/modules/07_insignia/components/2_Manage/Tab3.vue";
|
||||
import tab4 from "@/modules/07_insignia/components/2_Manage/Tab4.vue";
|
||||
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||
import keycloak from "@/plugins/keycloak";
|
||||
|
||||
const roleUser = ref<string>("admin");
|
||||
|
||||
const roleDataStore = useroleUserDataStore();
|
||||
const DataStore = useInsigniaDataStore();
|
||||
|
|
@ -39,12 +35,14 @@ const stat = ref<any>({
|
|||
orgNoSendCount: 0,
|
||||
orgSendCount: 0,
|
||||
});
|
||||
const modalPopupBackToEdit = ref<boolean>(false); //model แก้ไข
|
||||
|
||||
onMounted(async () => {
|
||||
tab.value = DataStore.mainTab;
|
||||
await fecthlistRound();
|
||||
});
|
||||
|
||||
//เรียกรอบการเสนอขอพระราชทานเครื่อง
|
||||
const fecthlistRound = async () => {
|
||||
await http
|
||||
.get(config.API.listRoundInsignia())
|
||||
|
|
@ -54,13 +52,14 @@ const fecthlistRound = async () => {
|
|||
year: e.period_year,
|
||||
name: e.period_name,
|
||||
}));
|
||||
//มีรอบการเสนอขอพระราชทานเครื่องแสดง UI
|
||||
if (optionRound.value.length !== 0) {
|
||||
DataStore.optionRound = optionRound.value;
|
||||
const lastValue = optionRound.value[0];
|
||||
if (DataStore.roundId) {
|
||||
round.value = DataStore.roundId;
|
||||
round.value = DataStore.roundId; // รอบการเสนอให้ใช้รอบที่เลือก
|
||||
} else {
|
||||
round.value = lastValue.id.toString();
|
||||
round.value = lastValue.id.toString(); // รอบการเสนอให้ใช้รอบล่าสุด
|
||||
}
|
||||
DataStore.roundId = round.value;
|
||||
roundName.value = lastValue.name;
|
||||
|
|
@ -69,11 +68,11 @@ const fecthlistRound = async () => {
|
|||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
|
||||
//เรียกดู Stat ของรอบการเสนอขอพระราชทานเครื่อง
|
||||
const fecthStat = async (id: string) => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -89,6 +88,7 @@ const fecthStat = async (id: string) => {
|
|||
});
|
||||
};
|
||||
|
||||
// เช็คหน่วยงาน
|
||||
const fecthAgency = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -97,11 +97,10 @@ const fecthAgency = async () => {
|
|||
DataStore.agency = res.data.result;
|
||||
loadview.value = true;
|
||||
if (roleDataStore.adminRole) {
|
||||
await fecthType();
|
||||
await fecthType(); // ถ้าไม่มีหนวยงานจะเรียกหน่วยงานทั้งหมด
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
@ -109,7 +108,7 @@ const fecthAgency = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เรียกหน่วยงาน
|
||||
const fecthType = async () => {
|
||||
await http
|
||||
.get(config.API.typeOc())
|
||||
|
|
@ -118,23 +117,21 @@ const fecthType = async () => {
|
|||
id: e.organizationId,
|
||||
name: e.organizationName,
|
||||
}));
|
||||
DataStore.fetchOption(optiontypeOc.value);
|
||||
DataStore.fetchOption(optiontypeOc.value); //ค่าของหน่วยงานทั้งหมดไว้ที่ DataStore
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
// loading.value = true;
|
||||
});
|
||||
};
|
||||
|
||||
//เลือกรอบการแสดง
|
||||
const changround = async () => {
|
||||
DataStore.roundId = round.value;
|
||||
fecthStat(round.value);
|
||||
var organization = await (DataStore.agency != null
|
||||
fecthStat(round.value); //เรียกดู Stat รอบที่เลือก
|
||||
var organization = await (DataStore.agency != null //ถ้ามี agency เรียกข้อมูลตาม agency ถ้าไม่มีเรียนตาม Oc ที่เลือก
|
||||
? DataStore.agency
|
||||
: DataStore.typeOc);
|
||||
fecthInsigniaByOc(round.value, organization, "officer", tab.value);
|
||||
fecthInsigniaByOc(round.value, organization, "officer", tab.value); // เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||
// get round name
|
||||
const roundFilter = await optionRound.value.find(
|
||||
(x: any) => round.value === x.id
|
||||
|
|
@ -145,6 +142,8 @@ const changround = async () => {
|
|||
};
|
||||
const requestNote = ref<string>("");
|
||||
const requestStatus = ref<string>("");
|
||||
|
||||
//เรียกข้อมูลรายชื่อข้าราชการสามัญฯ ที่มีสิทธิ์ยื่นขอพระราชทานเครื่องราชอิสริยาภรณ์ ตามรอบการเสนอขอ
|
||||
const fecthInsigniaByOc = async (
|
||||
roundId: string,
|
||||
ocId: string,
|
||||
|
|
@ -157,20 +156,15 @@ const fecthInsigniaByOc = async (
|
|||
.then(async (res) => {
|
||||
requestNote.value = res.data.result.requestNote;
|
||||
requestStatus.value = res.data.result.requestStatus;
|
||||
await DataStore.fetchData(res.data.result.items);
|
||||
await DataStore.fetchDataInsignia(res.data.result);
|
||||
await DataStore.fetchData(res.data.result.items); // ส่งรายชื่อข้าราชการสามัญฯ
|
||||
await DataStore.fetchDataInsignia(res.data.result); // ส่งข้อมูลรอบบการแสดง
|
||||
loading.value = true;
|
||||
// แสดงปุมล็อกข้อมูล
|
||||
if (res.data.result.items !== null) {
|
||||
if (res.data.result.items.length !== 0) {
|
||||
hideBottom.value = true;
|
||||
} else hideBottom.value = false;
|
||||
}
|
||||
|
||||
// if (res.data.result.items.length !== 0) {
|
||||
// hideBottom.value = true;
|
||||
// }
|
||||
// DataStore.isLock = await res.data.result.isLock;
|
||||
// DataStore.requestId = await res.data.result.requestId;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -180,6 +174,7 @@ const fecthInsigniaByOc = async (
|
|||
});
|
||||
};
|
||||
|
||||
// ส่งรอบการเสนอขอต่อ เฉพาะ รอบที่ requestStatus st1 และ st4
|
||||
const sendToDirector = async () => {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
|
@ -203,15 +198,16 @@ const sendToDirector = async () => {
|
|||
});
|
||||
});
|
||||
};
|
||||
|
||||
const modalPopupBackToEdit = ref<boolean>(false);
|
||||
//แสดง popup แก้ไข
|
||||
const popupBackToEdit = async () => {
|
||||
modalPopupBackToEdit.value = true;
|
||||
};
|
||||
//ปิด popup แก้ไข
|
||||
const closeModalPopupBackToEdit = async () => {
|
||||
modalPopupBackToEdit.value = false;
|
||||
};
|
||||
|
||||
// ตีกลับรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
|
||||
const backToEdit = async (reason: string) => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -246,6 +242,7 @@ const backToEdit = async (reason: string) => {
|
|||
);
|
||||
};
|
||||
|
||||
// อนุมัติรอบการเสนอขอ เฉพาะ รอบที่ requestStatus st3 และ insignia2Role
|
||||
const directorApproved = async () => {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -274,7 +271,7 @@ const directorApproved = async () => {
|
|||
"ต้องการยืนยันการอนุมัติใช่หรือไม่?"
|
||||
);
|
||||
};
|
||||
|
||||
// ล็อกข้อมูลรอบการเสนอขอ
|
||||
const requestSendNote = async () => {
|
||||
var organization = await (DataStore.agency != null
|
||||
? DataStore.agency
|
||||
|
|
|
|||
|
|
@ -62,11 +62,9 @@ const props = defineProps({
|
|||
modal: Boolean,
|
||||
save: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
roundId: {
|
||||
type: String,
|
||||
|
|
@ -200,7 +198,6 @@ const fectDataByid = async (id: string) => {
|
|||
status.value = data.status;
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ const closeModal = () => {
|
|||
props.close();
|
||||
};
|
||||
const clickSave = () => {
|
||||
console.log(props.insigniadata);
|
||||
|
||||
dialogConfirm($q, () => {
|
||||
if (props.actionType === "insignia") {
|
||||
props.save(
|
||||
|
|
@ -76,7 +74,7 @@ const clickSave = () => {
|
|||
dense
|
||||
lazy-rules
|
||||
type="text"
|
||||
label="จำนวน"
|
||||
label="เครื่องราชฯ"
|
||||
disable
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ const clickSave = () => {
|
|||
label="จำนวน"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกจำนวน'}`]"
|
||||
/>
|
||||
<!-- :rules="[(val:any) =>val.length != 13 ||`${'กรุณากรอกเลขประจำตัวประชาชนให้ครบ'}`,]" -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,19 +1,18 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted, watch, useAttrs } from "vue";
|
||||
// import { useRouter } from "vue-router";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useAllocateDataStore } from "@/modules/07_insignia/storeAllocate";
|
||||
import type { FormProprsalsRound } from "@/modules/07_insignia/interface/request/Main";
|
||||
import router from "@/router";
|
||||
import DialogForm from "@/modules/07_insignia/components/4_Allocate/DialogForm.vue";
|
||||
import DialogEdit from "@/modules/07_insignia/components/4_Allocate/DialogEdit.vue";
|
||||
|
||||
import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main";
|
||||
import type { QTableProps, QInput } from "quasar";
|
||||
import { Loading, useQuasar } from "quasar";
|
||||
import type { load } from "@/router/loader";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
|
||||
const DataStore = useAllocateDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
|
|
@ -41,16 +40,12 @@ const selectRound = ref<string>();
|
|||
const selectRoundOption = ref<OptionDataYear[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const action = ref<string>("");
|
||||
const personId = ref<string>();
|
||||
const profileType = ref<string>("");
|
||||
const filterKeyword = ref<string>("");
|
||||
const roundYear = ref<number>();
|
||||
const insigniaOp = ref<any>([]);
|
||||
const loadView = ref<boolean>(false);
|
||||
|
||||
onMounted(async () => {
|
||||
await fecthRound();
|
||||
// await fecthInsigniaType();
|
||||
});
|
||||
|
||||
const fecthRound = async () => {
|
||||
|
|
@ -74,8 +69,6 @@ const fecthRound = async () => {
|
|||
if (selectRound.value) {
|
||||
DataStore.roundId = selectRound.value;
|
||||
}
|
||||
|
||||
// roundYear.value = data[0].year;
|
||||
if (roundYear.value) {
|
||||
await fecthInsigniaType();
|
||||
}
|
||||
|
|
@ -111,7 +104,6 @@ const fecthInsigniaType = async () => {
|
|||
if (DataStore.mainTab) {
|
||||
tab.value = DataStore.mainTab;
|
||||
} else tab.value = DataStore.insigniaType[0].name;
|
||||
|
||||
loadView.value = true;
|
||||
fecthInsignia();
|
||||
})
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ const fecthListData = async () => {
|
|||
await http
|
||||
.get(config.API.insigniaManageOrg(id.value))
|
||||
.then((res) => {
|
||||
// console.log("res===>", res)
|
||||
rows.value = res.data.result.map((e: any) => ({
|
||||
id: e.id,
|
||||
organization: e.organizationOrganization,
|
||||
|
|
@ -129,7 +128,9 @@ const save = async (organizationId: string, total: string) => {
|
|||
const saveEdit = async (organizationId: string, amount: number) => {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.insigniaManageOrg(organizationId), { total: Number(amount) })
|
||||
.put(config.API.insigniaManageOrg(organizationId), {
|
||||
total: Number(amount),
|
||||
})
|
||||
.then(async () => {
|
||||
success($q, "แก้ไขมูลสำเร็จ");
|
||||
await fecthDashboard();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ const roundNo = ref<string | undefined>("");
|
|||
const cardid = ref<string>("");
|
||||
const OrganazationId = ref<string>("");
|
||||
const fullName = ref<string>("");
|
||||
// const position = ref<string>("");
|
||||
const receivedate = ref<Date | null>();
|
||||
const returndate = ref<Date | null>();
|
||||
const reason = ref<string>("");
|
||||
|
|
@ -147,7 +146,7 @@ const fetchData = async () => {
|
|||
await http
|
||||
.get(config.API.insigniaManageBorrowById(props.profileId))
|
||||
.then(async (response: any) => {
|
||||
console.log(response.data.result);
|
||||
console.log(response);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -208,7 +207,6 @@ const searchcardid = async () => {
|
|||
);
|
||||
|
||||
if (node) {
|
||||
console.log("node", node);
|
||||
fullName.value = `${node.prefix} ${node.fullName}`;
|
||||
brand.value = node.requestInsignia;
|
||||
insigniaNoteProfileId.value = node.id;
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ const loadView = ref<boolean>(false);
|
|||
|
||||
onMounted(async () => {
|
||||
await fecthRound();
|
||||
// await fecthInsigniaType();
|
||||
});
|
||||
// รอบการเสนอขอพระราชทานเครื่องราชฯ
|
||||
const fecthRound = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -74,7 +74,7 @@ const fecthRound = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
||||
// เรียกประเภทเครื่องราชฯ
|
||||
const fecthInsignia = async () => {
|
||||
await http
|
||||
.get(config.API.insignia)
|
||||
|
|
@ -91,7 +91,7 @@ const fecthInsignia = async () => {
|
|||
);
|
||||
});
|
||||
};
|
||||
|
||||
//ระดีบเครื่องราชฯ Tab
|
||||
const fecthInsigniaType = async () => {
|
||||
await http(config.API.insigniaType)
|
||||
.then(async (res) => {
|
||||
|
|
@ -153,7 +153,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - สกุล",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -334,6 +334,7 @@ const selectorRound = async (round: number) => {
|
|||
roundYear.value = round;
|
||||
await fecthlistInsignia();
|
||||
};
|
||||
// ราชชื่อการเสนอขอเครื่องราชฯ
|
||||
const fecthlistInsignia = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -559,7 +560,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<div v-if="props.col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
||||
|
||||
<div
|
||||
v-else-if="
|
||||
props.col.name == 'action' && props.row.returnDate == '-'
|
||||
|
|
@ -574,8 +575,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</q-td>
|
||||
</div>
|
||||
<div v-else-if="props.col.name == 'returnOrganization'">
|
||||
{{ props.row.returnOrganization == null? '-': props.row.returnOrganization}}
|
||||
</div>
|
||||
{{
|
||||
props.row.returnOrganization == null
|
||||
? "-"
|
||||
: props.row.returnOrganization
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ props.value }}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,5 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<!-- <q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/> -->
|
||||
ประวัติการยื่นขอพระราชทานเหรียญจักรพรรดิมาลา
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
|
||||
|
|
|
|||
|
|
@ -1,409 +0,0 @@
|
|||
<template>
|
||||
<div class="toptitle text-dark col-12 row items-center">
|
||||
<!-- <q-btn
|
||||
icon="mdi-arrow-left"
|
||||
unelevated
|
||||
round
|
||||
dense
|
||||
flat
|
||||
color="primary"
|
||||
class="q-mr-sm"
|
||||
@click="router.go(-1)"
|
||||
/> -->
|
||||
บันทึกผลการจ่ายใบกำกับ
|
||||
</div>
|
||||
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
|
||||
<div class="q-py-md q-px-lg">
|
||||
<div class="q-mt-md">
|
||||
<div class="col-12 row q-pb-sm items-center">
|
||||
<selector
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="selectType"
|
||||
hide-bottom-space
|
||||
:label="`${'ประเภทเครื่องราชฯ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="selectTypeOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'selectTypeOption'
|
||||
) "
|
||||
/>
|
||||
<selector
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="selectStatus"
|
||||
hide-bottom-space
|
||||
:label="`${'สถานะการจ่ายใบกำกับ'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="selectStatusOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn,'selectStatusOption'
|
||||
) "
|
||||
/>
|
||||
<q-space />
|
||||
<div class="items-center" style="display: flex">
|
||||
<!-- ค้นหาข้อความใน table -->
|
||||
<q-input
|
||||
standout
|
||||
dense
|
||||
v-model="filter"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="q-ml-sm"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filter == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filter !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<!-- แสดงคอลัมน์ใน table -->
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
:display-value="$q.lang.table.columns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
:options="columns"
|
||||
options-dense
|
||||
option-value="name"
|
||||
map-options
|
||||
emit-value
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<d-table
|
||||
:rows="rows"
|
||||
:columns="columns"
|
||||
:visible-columns="visibleColumns"
|
||||
:filter="filter"
|
||||
row-key="name"
|
||||
>
|
||||
<template v-slot:body-cell="props">
|
||||
<q-td :props="props">
|
||||
<div v-if="props.col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="props.col.name == 'datepay'">
|
||||
{{ date2Thai(props.value) ?? "-" }}
|
||||
</div>
|
||||
<div
|
||||
class="table_ellipsis"
|
||||
v-else-if="props.col.name == 'address'"
|
||||
>
|
||||
{{ props.value ?? "-" }}
|
||||
</div>
|
||||
<div v-else-if="props.col.name == 'status'">
|
||||
{{ props.value ?? "-" }}
|
||||
<q-btn
|
||||
class="q-ml-sm"
|
||||
color="blue"
|
||||
outline
|
||||
dense
|
||||
v-if="props.value == 'ยังไม่ได้จ่าย'"
|
||||
@click="open"
|
||||
>
|
||||
จ่ายแล้ว
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ props.value ?? "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card>
|
||||
<q-dialog v-model="modal" persistent>
|
||||
<q-card>
|
||||
<DialogHeader tittle="รูปแบบการจ่าย" :close="close" />
|
||||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-md">
|
||||
<selector
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
v-model="selectPayType"
|
||||
hide-bottom-space
|
||||
:label="`${'เลือกรูปแบบการจ่าย'}`"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
:options="selectPayTypeOption"
|
||||
option-value="id"
|
||||
use-input
|
||||
input-debounce="0"
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn label="บันทึก" color="public" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
// import { useRouter } from "vue-router";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
import type { OptionData } from "@/modules/07_insignia/interface/index/Main";
|
||||
import type { QTableProps, QInput } from "quasar";
|
||||
|
||||
// const router = useRouter();
|
||||
const mixin = useCounterMixin();
|
||||
const { date2Thai } = mixin;
|
||||
|
||||
const selectStatus = ref<string>("1");
|
||||
const selectStatusOption = ref<OptionData[]>([]);
|
||||
const selectStatusOptionFilter = ref<OptionData[]>([]);
|
||||
|
||||
const selectType = ref<string>("1");
|
||||
const selectTypeOption = ref<OptionData[]>([]);
|
||||
const selectTypeOptionFilter = ref<OptionData[]>([]);
|
||||
|
||||
const selectPayType = ref<string>("1");
|
||||
const selectPayTypeOption = ref<OptionData[]>([
|
||||
{ id: "1", name: "จัดส่งทางไปรษณี" },
|
||||
{ id: "2", name: "มารับด้วยตัวเอง" },
|
||||
]);
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
|
||||
const open = () => (modal.value = true);
|
||||
const close = () => (modal.value = false);
|
||||
|
||||
const visibleColumns = ref<String[]>([
|
||||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
"type",
|
||||
"vatnumber",
|
||||
"datepay",
|
||||
"typepay",
|
||||
"address",
|
||||
"status",
|
||||
]);
|
||||
const filterRef = ref<QInput>();
|
||||
const filter = ref<string>("");
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
{
|
||||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
field: "no",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "idcard",
|
||||
align: "left",
|
||||
label: "เลขประจำตัวประชาชน",
|
||||
field: "idcard",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - สกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "type",
|
||||
align: "left",
|
||||
label: "ประเภทเครื่องราชฯ ที่ได้รับ",
|
||||
field: "type",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "vatnumber",
|
||||
align: "left",
|
||||
label: "หมายเลขใบกำกับ",
|
||||
field: "vatnumber",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "datepay",
|
||||
align: "left",
|
||||
label: "วันที่จ่ายใบกำกับฯ",
|
||||
field: "datepay",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "typepay",
|
||||
align: "left",
|
||||
label: "รูปแบบการจ่าย",
|
||||
field: "typepay",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "address",
|
||||
align: "left",
|
||||
label: "ที่อยู่ที่จ่าย",
|
||||
field: "address",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "status",
|
||||
align: "left",
|
||||
label: "สถานะการจ่าย",
|
||||
field: "status",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
]);
|
||||
const rows = ref<any>([
|
||||
{
|
||||
no: "1",
|
||||
idcard: "1XXXXXXXXXXXX",
|
||||
name: "นางสาวรัชภรณ์ ภักดี",
|
||||
type: "ตริตาภรณ์ช้างเผือก",
|
||||
vatnumber: "5647833",
|
||||
datepay: null,
|
||||
typepay: null,
|
||||
address: "เลขที่ 2/3 หมู่ที่ 14 ถนนบ...",
|
||||
status: "ยังไม่ได้จ่าย",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
idcard: "1XXXXXXXXXXXX",
|
||||
name: "นางสาวภาพรรณ ลออ",
|
||||
type: "จัตุรถาภรณ์ช้างเผือก",
|
||||
vatnumber: "1122345",
|
||||
datepay: null,
|
||||
typepay: null,
|
||||
address: "เลขที่ 2/3 หมู่ที่ 14 ถนนบ...",
|
||||
status: "ยังไม่ได้จ่าย",
|
||||
},
|
||||
{
|
||||
no: "3",
|
||||
idcard: "1XXXXXXXXXXXX",
|
||||
name: "นายนภัทร นาทองดี",
|
||||
type: "จัตุรถาภรณ์ช้างเผือก",
|
||||
vatnumber: "1223354",
|
||||
datepay: new Date(),
|
||||
typepay: "มารับด้วยตัวเอง",
|
||||
address: "330 ถ.เชียงใหม่-ลำปาง...",
|
||||
status: "จ่ายแล้ว",
|
||||
},
|
||||
]);
|
||||
|
||||
onMounted(() => {
|
||||
const op1: OptionData[] = [{ id: "1", name: "ทั้งหมด" }];
|
||||
const op2: OptionData[] = [
|
||||
{ id: "1", name: "ทั้งหมด" },
|
||||
{ id: "2", name: "รอบันทึกข้อมูล" },
|
||||
{ id: "3", name: "บันทึกลง ก.พ. 7 แล้ว" },
|
||||
];
|
||||
selectTypeOption.value = op1;
|
||||
selectTypeOptionFilter.value = op1;
|
||||
selectStatusOption.value = op2;
|
||||
selectStatusOptionFilter.value = op2;
|
||||
});
|
||||
|
||||
const resetFilter = () => {
|
||||
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
||||
filter.value = "";
|
||||
filterRef.value!.focus();
|
||||
};
|
||||
|
||||
const filterSelector = (val: any, update: Function, filtername: string) => {
|
||||
switch (filtername) {
|
||||
case "selectTypeOption":
|
||||
update(() => {
|
||||
selectTypeOption.value = selectTypeOptionFilter.value.filter(
|
||||
(v: OptionData) => v.name!.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
case "selectStatusOption":
|
||||
update(() => {
|
||||
selectStatusOption.value = selectStatusOptionFilter.value.filter(
|
||||
(v: OptionData) => v.name!.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.arrow {
|
||||
transition: transform 0.5s;
|
||||
}
|
||||
|
||||
.arrow-active {
|
||||
transition: transform 0.5s;
|
||||
transform: rotate(-90deg);
|
||||
}
|
||||
|
||||
.bg-base {
|
||||
background-color: #efefef;
|
||||
}
|
||||
|
||||
.v-enter-active,
|
||||
.v-leave-active {
|
||||
transition: opacity 0.5s ease;
|
||||
}
|
||||
|
||||
.v-enter-from,
|
||||
.v-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.flexsave {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -46,15 +46,6 @@ const nextPage = (type: string, title: string) => {
|
|||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- <q-item to="/insignia/report/report-01" dense class="hover-green">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="primary" name="mdi-file" size="xs" />
|
||||
</q-item-section>
|
||||
<q-item-section class="text-dark"
|
||||
>รายชื่อข้าราชการสามัญฯ ที่ได้รับ/ไม่ได้รับใบกำกับ
|
||||
</q-item-section>
|
||||
</q-item> -->
|
||||
|
||||
<q-item
|
||||
clickable
|
||||
@click="
|
||||
|
|
@ -84,22 +75,6 @@ const nextPage = (type: string, title: string) => {
|
|||
บัญชีแสดงจำนวนชั้นตราเครื่องราชฯ
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<!-- <q-item
|
||||
clickable
|
||||
@click="
|
||||
nextPage('46', 'ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา')
|
||||
"
|
||||
dense
|
||||
class="hover-green"
|
||||
>
|
||||
<q-item-section avatar>
|
||||
<q-icon color="primary" name="mdi-file" size="xs" />
|
||||
</q-item-section>
|
||||
<q-item-section class="text-dark">
|
||||
ประวัติสำหรับการเสนอขอพระราชทานเหรียญจักรพรรดิมาลา
|
||||
</q-item-section>
|
||||
</q-item> -->
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,14 +10,7 @@ import config from "@/app.config";
|
|||
import type { QForm } from "quasar";
|
||||
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
} = mixin;
|
||||
const { messageError, showLoader, hideLoader } = mixin;
|
||||
const $q = useQuasar();
|
||||
|
||||
const myForm = ref<QForm>();
|
||||
|
|
@ -27,15 +20,6 @@ const page = ref<number>(1);
|
|||
const dialog = ref<boolean>(false);
|
||||
onMounted(async () => {
|
||||
await fecthlistRound();
|
||||
// const pdfData = usePDF(
|
||||
// "https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"
|
||||
// );
|
||||
|
||||
// setTimeout(() => {
|
||||
// pdfSrc.value = pdfData.pdf.value;
|
||||
// numOfPages.value = pdfData.pages.value;
|
||||
// }, 1000);
|
||||
// console.log(pdfData);
|
||||
});
|
||||
|
||||
const splitterModel = ref(14);
|
||||
|
|
@ -76,7 +60,6 @@ const fecthlistRound = async () => {
|
|||
}));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
|
|
@ -91,7 +74,6 @@ const conditionDocument = (type: string) => {
|
|||
if (type == "show") {
|
||||
await downloadReport("pdf", false);
|
||||
} else {
|
||||
// await downloadReport("pdf", false);
|
||||
await downloadReport(type, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -141,8 +123,6 @@ const downloadReport = async (
|
|||
);
|
||||
} else {
|
||||
const url = URL.createObjectURL(new Blob([res.data]));
|
||||
// pdfSrc.value = "";
|
||||
// numOfPages.value = 0;
|
||||
showDocument(url);
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -12,14 +12,7 @@ import type { QForm } from "quasar";
|
|||
|
||||
const store = useInsigniaDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
date2Thai,
|
||||
messageError,
|
||||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
success,
|
||||
} = mixin;
|
||||
const { messageError, showLoader, hideLoader } = mixin;
|
||||
const { typeReport, titleReport } = store;
|
||||
const $q = useQuasar();
|
||||
|
||||
|
|
@ -31,26 +24,9 @@ const dialog = ref<boolean>(false);
|
|||
|
||||
onMounted(async () => {
|
||||
await fecthlistRound();
|
||||
// const pdfData = usePDF(
|
||||
// "https://raw.githubusercontent.com/mozilla/pdf.js/ba2edeae/web/compressed.tracemonkey-pldi-09.pdf"
|
||||
// );
|
||||
|
||||
// setTimeout(() => {
|
||||
// pdfSrc.value = pdfData.pdf.value;
|
||||
// numOfPages.value = pdfData.pages.value;
|
||||
// }, 1000);
|
||||
// console.log(pdfData);
|
||||
});
|
||||
|
||||
const splitterModel = ref(14);
|
||||
const fileId = ref<string>("");
|
||||
const selectReport = ref<any>({ id: 39, name: "รายงานขร.1" });
|
||||
const optionsReport = ref<any>([
|
||||
{ id: 39, name: "รายงานขร.1" },
|
||||
{ id: 40, name: "รายงานขร.2" },
|
||||
{ id: 41, name: "รายงานขร.3" },
|
||||
{ id: 42, name: "รายงานขร.4" },
|
||||
]);
|
||||
const selectList = ref<any>();
|
||||
const optionsList = ref<any>([{ id: 0, name: "เลือกกรอบการยื่นขอ" }]);
|
||||
|
||||
|
|
@ -80,7 +56,6 @@ const fecthlistRound = async () => {
|
|||
}));
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
});
|
||||
};
|
||||
|
|
@ -95,7 +70,6 @@ const conditionDocument = (type: string) => {
|
|||
if (type == "show") {
|
||||
await downloadReport("pdf", false);
|
||||
} else {
|
||||
// await downloadReport("pdf", false);
|
||||
await downloadReport(type, true);
|
||||
}
|
||||
}
|
||||
|
|
@ -125,7 +99,6 @@ const downloadReport = async (
|
|||
type: string = "pdf",
|
||||
download: boolean = true
|
||||
) => {
|
||||
console.log(typeReport);
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.reportInsignia(typeReport, type, selectList.value.id), {
|
||||
|
|
@ -136,8 +109,6 @@ const downloadReport = async (
|
|||
downloadFile(res, `${titleReport} ${selectList.value.name}.${type}`);
|
||||
} else {
|
||||
const url = URL.createObjectURL(new Blob([res.data]));
|
||||
// pdfSrc.value = "";
|
||||
// numOfPages.value = 0;
|
||||
showDocument(url);
|
||||
}
|
||||
})
|
||||
|
|
@ -169,21 +140,6 @@ const downloadReport = async (
|
|||
<div class="q-pa-md q-gutter-y-sm">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-form ref="myForm" class="row items-center">
|
||||
<!-- <q-select
|
||||
use-input
|
||||
fill-input
|
||||
hide-selected
|
||||
class="q-mr-sm"
|
||||
dense
|
||||
outlined
|
||||
v-model="selectReport"
|
||||
:options="optionsReport"
|
||||
:label="optionsReport.name"
|
||||
option-value="id"
|
||||
option-label="name"
|
||||
style="width: 150px"
|
||||
@update:model-value="updateSelect"
|
||||
/> -->
|
||||
<q-select
|
||||
class="q-pa-none"
|
||||
use-input
|
||||
|
|
@ -200,7 +156,6 @@ const downloadReport = async (
|
|||
@update:model-value="updateSelect"
|
||||
/>
|
||||
</q-form>
|
||||
<!-- style="width: 200px" -->
|
||||
<q-space />
|
||||
<div class="q-pa-ms q-gutter-sm" style="padding: 0">
|
||||
<q-btn outline color="primary" icon="download" label="ดาวน์โหลด">
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ const report_02 = () =>
|
|||
import("../07_insignia/components/report/Report_02.vue");
|
||||
const RecordInsignia = () =>
|
||||
import("@/modules/07_insignia/views/ResultPage.vue");
|
||||
const Coin = () => import("@/modules/07_insignia/components/Coin.vue");
|
||||
const insigniaProposals = () =>
|
||||
import("@/modules/07_insignia/components/1_Proposals/listProposals.vue");
|
||||
const roundAdd = () =>
|
||||
|
|
@ -22,8 +21,7 @@ const listAllocate = () =>
|
|||
import("@/modules/07_insignia/components/4_Allocate/Main.vue");
|
||||
const allocateOrdList = () =>
|
||||
import("@/modules/07_insignia/components/4_Allocate/OrgList.vue");
|
||||
const VatInsignia = () =>
|
||||
import("@/modules/07_insignia/components/VatInsignia.vue");
|
||||
|
||||
|
||||
// ยืม - คืนเครื่องราช
|
||||
const insigniaBorrow = () =>
|
||||
|
|
@ -80,16 +78,6 @@ export default [
|
|||
Role: "insignia",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/coin",
|
||||
name: "coin",
|
||||
component: Coin,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8],
|
||||
Role: "insignia",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/report",
|
||||
name: "insigniaReport",
|
||||
|
|
@ -150,16 +138,6 @@ export default [
|
|||
Role: "insignia",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/vat",
|
||||
name: "VatInsignia",
|
||||
component: VatInsignia,
|
||||
meta: {
|
||||
Auth: true,
|
||||
Key: [8.9],
|
||||
Role: "insignia",
|
||||
},
|
||||
},
|
||||
{
|
||||
path: "/insignia/borrow",
|
||||
name: "insigniaBorrow",
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
typeReport.value = type;
|
||||
titleReport.value = title;
|
||||
};
|
||||
|
||||
// เรียกราชชื่อการเสนอขอ
|
||||
const fetchData = async (data: any) => {
|
||||
if (data !== null) {
|
||||
let datalist = await data.map((e: any) => ({
|
||||
|
|
@ -55,11 +55,13 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
filtertypeInsignia();
|
||||
} else rows.value = [];
|
||||
};
|
||||
// เรียกข้อมูลรอบการเสนอขอ
|
||||
const fetchDataInsignia = async (data: any) => {
|
||||
isLock.value = data.isLock;
|
||||
isLock.value = data.isLock; // สถานะล็อกข้อมูล
|
||||
requestId.value = data.requestId;
|
||||
requestStatus.value = data.requestStatus;
|
||||
requestStatus.value = data.requestStatus; // สถานะของรอบการเสนอขอ
|
||||
}
|
||||
// เรียก Option หน่วยงานทั้งหมด
|
||||
const fetchOption = (op: any) => {
|
||||
if (agency.value !== null) {
|
||||
typeOc.value = agency.value;
|
||||
|
|
@ -68,9 +70,11 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
(optionsTypeOc.value = op), (typeOc.value = op[2].id);
|
||||
}
|
||||
};
|
||||
// หาประเภทเครื่องราชทั้งหมดที่อยู่ในรายชื่อข้าราชการสามัญฯ
|
||||
const filtertypeInsignia = async () => {
|
||||
typeinsignia.value = "all";
|
||||
if (listinsignia.value.length !== 0) {
|
||||
// หาประเภทเครื่องราชที่ขอที่ชื่อซ้ำกัน
|
||||
const double_name = [
|
||||
...new Set(listinsignia.value.map((item: any) => item.insigniaSend)),
|
||||
];
|
||||
|
|
@ -85,6 +89,7 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
}
|
||||
} else typeinsigniaOptions.value = [{ id: "all", name: "ทั้งหมด" }];
|
||||
};
|
||||
// ค้นหาข้อมมูลราชชื่อ ตาม ประเท๓และสถานภาพ
|
||||
const searchDataTable = async (type: string, employeeClasstype: string) => {
|
||||
typeinsignia.value = type
|
||||
employeeClass.value = employeeClasstype
|
||||
|
|
@ -97,15 +102,9 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
} else if (type === 'all' && employeeClasstype === 'all') {
|
||||
rows.value = listinsignia.value
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
const convertOcid = (oc: string) => {
|
||||
let ocdata = optionsTypeOc.value.find((e: any) => e.name === oc)
|
||||
if (ocdata) {
|
||||
return ocdata.id
|
||||
} else return ""
|
||||
}
|
||||
|
||||
// ประเภทลูกจ้าง
|
||||
const profileType = (val: string) => {
|
||||
switch (val) {
|
||||
case "officer":
|
||||
|
|
@ -129,7 +128,6 @@ export const useInsigniaDataStore = defineStore("insignia", () => {
|
|||
fetchOption,
|
||||
searchDataTable,
|
||||
setTypeandTitle,
|
||||
convertOcid,
|
||||
typeReport,
|
||||
titleReport,
|
||||
employeeClass,
|
||||
|
|
|
|||
|
|
@ -58,8 +58,6 @@ export const useBrrowDataStore = defineStore("insigniaBrrow", () => {
|
|||
}));
|
||||
rows.value = list
|
||||
listInsignia.value = list
|
||||
console.log(listInsignia.value);
|
||||
|
||||
searchDatatable(insignia.value, employeeClass.value)
|
||||
}
|
||||
const searchDatatable = (type: string, employeeClass: string) => {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const {
|
|||
const $q = useQuasar();
|
||||
const tab = ref<string>("");
|
||||
|
||||
const selectRound = ref<string>();
|
||||
const selectRound = ref<string>("");
|
||||
const selectRoundOption = ref<OptionData[]>([]);
|
||||
const modal = ref<boolean>(false);
|
||||
const action = ref<string>("");
|
||||
|
|
@ -36,9 +36,8 @@ const fileinvoice = ref<any>(null);
|
|||
const loadView = ref<boolean>(false);
|
||||
onMounted(async () => {
|
||||
await fecthRound();
|
||||
// await fecthInsignia();
|
||||
// await fecthInsigniaType();
|
||||
});
|
||||
// รอบการเสนอขอพระราชทานเครื่องราช
|
||||
const fecthRound = async () => {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -62,6 +61,7 @@ const fecthRound = async () => {
|
|||
hideLoader();
|
||||
});
|
||||
};
|
||||
// ประเภทเครื่องราช
|
||||
const fecthInsignia = async () => {
|
||||
await http
|
||||
.get(config.API.insignia)
|
||||
|
|
@ -71,9 +71,10 @@ const fecthInsignia = async () => {
|
|||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
console.log("fecthInsignia");
|
||||
});
|
||||
};
|
||||
|
||||
// ระดับเครื่องราช
|
||||
const fecthInsigniaType = async () => {
|
||||
await http(config.API.insigniaType)
|
||||
.then((res) => {
|
||||
|
|
@ -137,7 +138,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
{
|
||||
name: "name",
|
||||
align: "left",
|
||||
label: "ชื่อ - สกุล",
|
||||
label: "ชื่อ - นามสกุล",
|
||||
field: "name",
|
||||
sortable: true,
|
||||
sort: (a: string, b: string) =>
|
||||
|
|
@ -269,13 +270,18 @@ watch(modal, () => {
|
|||
fecthlistInsignia();
|
||||
}
|
||||
});
|
||||
// เลือกประเภทเครื่องราช
|
||||
const selectorInsignia = () => {
|
||||
fecthlistInsignia();
|
||||
};
|
||||
// เลือกประเภทเครื่องราช
|
||||
const selectorRound = (round: string) => {
|
||||
selectRound.value = round;
|
||||
if (round) {
|
||||
selectRound.value = round;
|
||||
}
|
||||
fecthlistInsignia();
|
||||
};
|
||||
// ราชชื่อบันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ
|
||||
const fecthlistInsignia = async () => {
|
||||
showLoader();
|
||||
let data = {
|
||||
|
|
@ -287,11 +293,9 @@ const fecthlistInsignia = async () => {
|
|||
.post(config.API.noteSearch(), data)
|
||||
.then((res) => {
|
||||
let data = res.data.result;
|
||||
console.log(data);
|
||||
DataStore.fetchlistinsignia(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
@ -354,6 +358,7 @@ const modelPerview = ref<boolean>(false);
|
|||
const rowspreview = ref<any>([]);
|
||||
const typepreview = ref<string>("");
|
||||
const fileInsignia = ref<any>(null);
|
||||
// แสดง fileupload
|
||||
const perviewfile = async (event: any, actionType: string) => {
|
||||
showLoader();
|
||||
typepreview.value = actionType;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue