no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-24 17:01:21 +07:00
parent 8e8ab5b8cf
commit fd2a76ecab
2 changed files with 37 additions and 33 deletions

View file

@ -47,7 +47,7 @@ const invoiceDate = ref<Date | null>(null);
const employeeClass = ref<string>(""); const employeeClass = ref<string>("");
const employeeClassOps = ref<DataOption[]>([ const employeeClassOps = ref<DataOption[]>([
{ id: "officer", name: "ข้าราชการ กทม.สามัญ" }, { id: "officer", name: "ข้าราชการ กทม.สามัญ" },
{ id: "perm", name: "ลูกจ้างประจำ" }, { id: "employee", name: "ลูกจ้างประจำ" },
]); ]);
const listPerson = ref<any>([]); const listPerson = ref<any>([]);
@ -120,6 +120,9 @@ const props = defineProps({
personId: { personId: {
type: String, type: String,
}, },
profileType: {
type: String,
},
}); });
watch(props, () => { watch(props, () => {
if (props.modal === true) { if (props.modal === true) {
@ -191,7 +194,7 @@ const findlist = async (id: string) => {
let data = [{}]; let data = [{}];
if (employeeClass.value === "officer") { if (employeeClass.value === "officer") {
data = [{ criteriaType: "is_retire", criteriaValue: "false" }]; data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
} else if (employeeClass.value === "perm") { } else if (employeeClass.value === "employee") {
data = [ data = [
{ criteriaType: "is_retire", criteriaValue: "false" }, { criteriaType: "is_retire", criteriaValue: "false" },
{ criteriaType: "employee_class", criteriaValue: "perm" }, { criteriaType: "employee_class", criteriaValue: "perm" },
@ -202,7 +205,7 @@ const findlist = async (id: string) => {
criterias: data, criterias: data,
}) })
.then((res) => { .then((res) => {
console.log(res.data.result); // console.log(res.data.result);
listPerson.value = res.data.result; listPerson.value = res.data.result;
}) })
.catch((e) => { .catch((e) => {
@ -217,7 +220,6 @@ const fectDataByid = async (id: string) => {
await http await http
.get(config.API.noteByid(id)) .get(config.API.noteByid(id))
.then((res) => { .then((res) => {
console.log(res);
let data = res.data.result; let data = res.data.result;
employeeClass.value = ""; employeeClass.value = "";
cardid.value = data.citizenId; cardid.value = data.citizenId;
@ -238,9 +240,11 @@ const fectDataByid = async (id: string) => {
payment.value = data.typePayment; payment.value = data.typePayment;
addressPayment.value = data.address; addressPayment.value = data.address;
status.value = data.status; status.value = data.status;
employeeClass.value = props.profileType;
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
messageError($q, err);
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
@ -267,7 +271,6 @@ const clickSave = async () => {
}; };
await myForm.value!.validate().then((result: boolean) => { await myForm.value!.validate().then((result: boolean) => {
if (result) { if (result) {
console.log(123);
dialogConfirm($q, async () => { dialogConfirm($q, async () => {
await addNote(body); await addNote(body);
}); });
@ -295,7 +298,6 @@ const searchcardid = () => {
fullName.value = data.fullname; fullName.value = data.fullname;
position.value = data.positionEmployeePosition; position.value = data.positionEmployeePosition;
} else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้"); } else notifyError($q, "ไม่พบข้อมูลเลขบัตรประชาชนนี้");
console.log(data);
} }
}; };
</script> </script>
@ -345,7 +347,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
hide-bottom-space hide-bottom-space
outlined outlined
class="inputgreen" class="inputgreen"
@ -442,7 +444,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
:rules="[ :rules="[
(val) => (val) =>
!!val || !!val ||
@ -470,7 +472,7 @@ const searchcardid = () => {
label="ชั้นตราเครื่องราชอิสริยาภรณ์" label="ชั้นตราเครื่องราชอิสริยาภรณ์"
/> --> /> -->
<q-select <q-select
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
v-model="brand" v-model="brand"
dense dense
outlined outlined
@ -508,7 +510,7 @@ const searchcardid = () => {
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
dense dense
borderless borderless
outlined outlined
@ -535,7 +537,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
:rules="[(val) => !!val || 'กรุณากรอกทะเบียนฐานนันดร']" :rules="[(val) => !!val || 'กรุณากรอกทะเบียนฐานนันดร']"
hide-bottom-space hide-bottom-space
dense dense
@ -547,7 +549,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
:rules="[(val) => !!val || 'กรุณากรอกสังกัด']" :rules="[(val) => !!val || 'กรุณากรอกสังกัด']"
hide-bottom-space hide-bottom-space
dense dense
@ -573,7 +575,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
:rules="[(val) => !!val || 'กรุณากรอกสังกัด']" :rules="[(val) => !!val || 'กรุณากรอกสังกัด']"
hide-bottom-space hide-bottom-space
dense dense
@ -618,7 +620,7 @@ const searchcardid = () => {
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
dense dense
borderless borderless
outlined outlined
@ -645,7 +647,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
@ -674,7 +676,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-4"> <div class="col-xs-12 col-sm-4">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
@ -703,7 +705,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
@ -732,7 +734,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-input <q-input
:disable="disbleStatus" :disable="disbleStatus || status == 'DONE'"
hide-bottom-space hide-bottom-space
outlined outlined
dense dense
@ -791,7 +793,7 @@ const searchcardid = () => {
</template> </template>
<template #trigger> <template #trigger>
<q-input <q-input
:disable="disbleStatus && status !== 'DONE'" :disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณาเลือกวันที่']" :rules="[(val) => !!val || 'กรุณาเลือกวันที่']"
dense dense
borderless borderless
@ -818,7 +820,7 @@ const searchcardid = () => {
</div> </div>
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
<q-select <q-select
:disable="disbleStatus && status !== 'DONE'" :disable="disbleStatus"
hide-bottom-space hide-bottom-space
:options="paymentOp" :options="paymentOp"
class="col-xs-12 col-sm-6" class="col-xs-12 col-sm-6"
@ -836,7 +838,7 @@ const searchcardid = () => {
</div> </div>
<div v-if="payment === 'จัดส่งทางไปรษณี'" class="col-12"> <div v-if="payment === 'จัดส่งทางไปรษณี'" class="col-12">
<q-input <q-input
:disable="disbleStatus && status !== 'DONE'" :disable="disbleStatus"
:rules="[(val) => !!val || 'กรุณากรอกที่อยู่ที่จ่าย']" :rules="[(val) => !!val || 'กรุณากรอกที่อยู่ที่จ่าย']"
label="ที่อยู่ที่จ่าย" label="ที่อยู่ที่จ่าย"
class="bg-white" class="bg-white"

View file

@ -26,6 +26,7 @@ const selectRoundOption = ref<OptionData[]>([]);
const modal = ref<boolean>(false); const modal = ref<boolean>(false);
const action = ref<string>(""); const action = ref<string>("");
const personId = ref<string>(); const personId = ref<string>();
const profileType = ref<string>("");
onMounted(async () => { onMounted(async () => {
await fecthRound(); await fecthRound();
await fecthInsignia(); await fecthInsignia();
@ -38,7 +39,7 @@ const fecthRound = async () => {
let data = res.data.result; let data = res.data.result;
selectRoundOption.value = data; selectRoundOption.value = data;
selectRound.value = data[0].id; selectRound.value = data[0].id;
console.log(selectRound.value); // console.log(selectRound.value);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
@ -48,7 +49,7 @@ const fecthInsignia = async () => {
await http await http
.get(config.API.insignia) .get(config.API.insignia)
.then((res) => { .then((res) => {
console.log(res); // console.log(res);
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsignia(data); DataStore.fetchDatainsignia(data);
}) })
@ -59,7 +60,7 @@ const fecthInsignia = async () => {
const fecthInsigniaType = async () => { const fecthInsigniaType = async () => {
await http(config.API.insigniaType) await http(config.API.insigniaType)
.then((res) => { .then((res) => {
console.log(res); // console.log(res);
let data = res.data.result; let data = res.data.result;
DataStore.fetchDatainsigniaType(data); DataStore.fetchDatainsigniaType(data);
tab.value = DataStore.insigniaType[0].name; tab.value = DataStore.insigniaType[0].name;
@ -226,7 +227,6 @@ watch(modal, () => {
} }
}); });
const selectorInsignia = () => { const selectorInsignia = () => {
console.log(DataStore.insignia, selectRound.value, tab.value);
fecthlistInsignia(); fecthlistInsignia();
}; };
const selectorRound = (round: string) => { const selectorRound = (round: string) => {
@ -242,7 +242,6 @@ const fecthlistInsignia = async () => {
await http await http
.post(config.API.noteSearch(), data) .post(config.API.noteSearch(), data)
.then((res) => { .then((res) => {
console.log(res);
let data = res.data.result; let data = res.data.result;
rows.value = []; rows.value = [];
rows.value = data.map((e: any) => ({ rows.value = data.map((e: any) => ({
@ -254,6 +253,7 @@ const fecthlistInsignia = async () => {
name: e.fullName, name: e.fullName,
type: e.requestInsignia, type: e.requestInsignia,
employeeType: DataStore.profileType(e.profileType), employeeType: DataStore.profileType(e.profileType),
profileType: e.profileType,
page: e.page, page: e.page,
number: e.no, number: e.no,
vatnumber: e.number, vatnumber: e.number,
@ -261,7 +261,6 @@ const fecthlistInsignia = async () => {
typepay: e.typePayment, typepay: e.typePayment,
address: e.address, address: e.address,
})); }));
console.log(rows.value);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
@ -284,14 +283,16 @@ const addData = () => {
action.value = "addData"; action.value = "addData";
}; };
const editData = (id: string) => { const editData = (data) => {
personId.value = id; console.log(data);
personId.value = data.id;
profileType.value = data.profileType;
action.value = "editData"; action.value = "editData";
modal.value = true; modal.value = true;
}; };
const save = () => { const save = () => {
console.log(122);
console.log("save function"); console.log("save function");
}; };
@ -469,7 +470,7 @@ const resetFilter = () => {
flat flat
round round
color="primary" color="primary"
@click.stop="editData(props.row.id)" @click.stop="editData(props.row)"
icon="mdi-pencil-outline" icon="mdi-pencil-outline"
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
@ -601,7 +602,7 @@ const resetFilter = () => {
flat flat
round round
color="primary" color="primary"
@click="editData(props.row.id)" @click="editData(props.row)"
icon="mdi-pencil-outline" icon="mdi-pencil-outline"
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
@ -732,7 +733,7 @@ const resetFilter = () => {
flat flat
round round
color="primary" color="primary"
@click="editData(props.row.id)" @click="editData(props.row)"
icon="mdi-pencil-outline" icon="mdi-pencil-outline"
> >
<q-tooltip>แกไขขอม</q-tooltip> <q-tooltip>แกไขขอม</q-tooltip>
@ -759,6 +760,7 @@ const resetFilter = () => {
:roundId="selectRound" :roundId="selectRound"
:action="action" :action="action"
:personId="personId" :personId="personId"
:profileType="profileType"
/> />
</q-card> </q-card>
</template> </template>