This commit is contained in:
setthawutttty 2024-11-06 16:47:02 +07:00
parent 8390a8ab01
commit 8c989e84b2
23 changed files with 201 additions and 149 deletions

View file

@ -1,7 +1,8 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar, type QTableColumn, type QTableProps } from "quasar";
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, computed } from "vue";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import http from "@/plugins/http";
@ -11,6 +12,8 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const $q = useQuasar();
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const officerLink = computed(() => dataStore.officerLink);
const mixin = useCounterMixin();
const {
showLoader,
@ -43,7 +46,7 @@ const formDataInformation = reactive<any>({
email: "",
});
const emailVerify = ref<string|null>(null);
const emailVerify = ref<string | null>(null);
const visibleColumnsHistory = ref<string[]>([
"citizenId",
"prefix",
@ -240,7 +243,7 @@ function onHistory() {
async function getData() {
showLoader();
await http
.get(config.API.dataUserInformation)
.get(config.API.dataUserInformationByType(dataStore.officerLink))
.then(async (res) => {
const data = await res.data.result;
formDataInformation.citizenId = data.citizenId;
@ -256,7 +259,7 @@ async function getData() {
formDataInformation.religion = data.religion;
formDataInformation.bloodGroup = data.bloodGroup;
formDataInformation.phone = data.phone;
formDataInformation.email = data.email.split("@")[0];
formDataInformation.email = data.email ? data.email.split("@")[0] : "";
emailVerify.value = data.statusEmail;
hideLoader();
@ -272,7 +275,7 @@ async function getData() {
/** get history */
function getHistory() {
const url =
store.typeProfile == "OFFICER"
dataStore.officerType == "OFFICER"
? config.API.dataUserInformatioHistory("")
: config.API.dataUserInformatioHistory("-employee");
showLoader();

View file

@ -1,5 +1,6 @@
<script setup lang="ts">
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
@ -11,6 +12,7 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const rows = ref<ChangNameRows[]>([]);
@ -162,7 +164,7 @@ function onHistory(id: string) {
function getData() {
showLoader();
http
.get(config.API.dataUserChangeName)
.get(config.API.dataUserChangeNameByType(dataStore.officerLink))
.then((res) => {
const data = res.data.result;
rows.value = data;
@ -181,7 +183,7 @@ function getData() {
function getHistory() {
showLoader();
http
.get(config.API.dataUserChangeNameHistory + `/${idByrow.value}`)
.get(config.API.dataUserChangeNameHistoryByType(dataStore.officerLink) + `/${idByrow.value}`)
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;

View file

@ -5,6 +5,7 @@ import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import type {
@ -18,6 +19,7 @@ import type {
import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]);
const $q = useQuasar();
const mixin = useCounterMixin();
@ -227,7 +229,7 @@ function onHistory() {
function getData() {
showLoader();
http
.get(config.API.dataUserAddress)
.get(config.API.dataUserAddressByType(dataStore.officerLink))
.then((res) => {
const data: Address = res.data.result;
fetchDistrict(data.registrationProvinceId, "1");
@ -260,7 +262,7 @@ function getData() {
/** get history */
function getHistory() {
const url =
store.typeProfile == "OFFICER"
dataStore.officerType == "OFFICER"
? config.API.dataUserHistory("")
: config.API.dataUserHistory("-employee");
showLoader();

View file

@ -5,6 +5,7 @@ import { ref, reactive, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRegistryInFormationStore } from "@/modules/10_registry/store/registry";
import { useDataStore } from "@/stores/data";
import { useCounterMixin } from "@/stores/mixin";
import type { FormChildren } from "@/modules/10_registry/interface/index/Family";
@ -17,6 +18,7 @@ const { showLoader, hideLoader, messageError } = mixin;
const idFamily = ref<string>("");
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]);
const typeForm = ref<string>("");
@ -147,7 +149,7 @@ function onHistory(type: string, id: string) {
function getData(type: string) {
showLoader();
http
.get(config.API.dataUserFamily(type))
.get(config.API.dataUserFamilyByType(dataStore.officerLink,type))
.then((res) => {
const data = res.data.result;
if (data) {
@ -199,7 +201,7 @@ function getData(type: string) {
/** get history */
function getHistory() {
const url =
store.typeProfile == "OFFICER"
dataStore.officerType == "OFFICER"
? config.API.dataUserFamilyHistory(typeForm.value, "", idFamily.value)
: config.API.dataUserFamilyHistory(
typeForm.value,

View file

@ -2,7 +2,7 @@
import { useCounterMixin } from "@/stores/mixin";
import { useQuasar, type QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useDataStore } from "@/stores/data";
//history dialog
import http from "@/plugins/http";
@ -14,6 +14,7 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const rows = ref<EducationProfile[]>([]);
@ -442,7 +443,7 @@ function onHistory(id: string) {
function getData() {
showLoader();
http
.get(config.API.dataUserEducations)
.get(config.API.dataUserEducationsByType(dataStore.officerLink))
.then((res) => {
const data = res.data.result;
rows.value = data;
@ -461,7 +462,7 @@ function getData() {
function getHistory() {
showLoader();
http
.get(config.API.dataUserEducationsHistory(idByRow.value))
.get(config.API.dataUserEducationsHistoryByType(dataStore.officerLink,idByRow.value))
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;

View file

@ -5,6 +5,7 @@ import { ref, onMounted } from "vue";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import { useDataStore } from "@/stores/data";
import type { AbilityRows } from "@/modules/10_registry/interface/index/Main";
//history dialog
@ -17,6 +18,7 @@ const filter = ref<string>("");
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const modalHistory = ref<boolean>(false);
@ -163,7 +165,7 @@ function onHistory(id: string) {
function getData() {
showLoader();
http
.get(config.API.dataUserAbility)
.get(config.API.dataUserAbilityByType(dataStore.officerLink))
.then((res) => {
const data = res.data.result;
rows.value = data;
@ -182,7 +184,7 @@ function getData() {
function getHistory() {
showLoader();
http
.get(config.API.dataUserAbilityHistory(idByRow.value))
.get(config.API.dataUserAbilityHistoryByType(dataStore.officerLink,idByRow.value))
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;