test & update

This commit is contained in:
Warunee Tamkoo 2023-07-26 00:57:05 +07:00
parent 97b5e63813
commit d035692f44
2 changed files with 20 additions and 16 deletions

View file

@ -117,7 +117,7 @@ const rows = ref<any>([
]);
const filter = ref<string>("");
watch(modal, () => {
console.log(props);
// console.log(props);
if (modal.value === true) {
retireld.value = props.retireld;
@ -137,7 +137,7 @@ const fecthlistRetire = async () => {
.get(config.API.profileOrganizRoot)
.then((res) => {
const id = res.data.result[0].id;
console.log(id);
// console.log(id);
if (id !== "") {
findlist(id);
}
@ -152,20 +152,20 @@ const findlist = async (id: string) => {
if (type.value === "officer") {
data = [{ criteriaType: "is_retire", criteriaValue: "false" }];
} else if (type.value === "all") {
console.log("all");
// console.log("all");
data = [
{ criteriaType: "is_retire", criteriaValue: "false" },
{ criteriaType: "employee_class", criteriaValue: "perm" },
];
}
console.log(data);
// console.log(data);
await http
.post(config.API.profileSearchNewOcIdType(id, type.value), {
criterias: data,
})
.then((res) => {
console.log(res.data.result);
// console.log(res.data.result);
rows.value = res.data.result.map((e: any) => ({
id: e.id,
fullname: e.fullname,
@ -182,13 +182,15 @@ const findlist = async (id: string) => {
});
};
const clickAdd = (props: any) => {
console.log(retireld.value, id);
// console.log("props===>",props.row.id)
if (retireld.value == undefined) {
retireld.value = id;
}
let data: any = props.row.id;
console.log("retireld & profileId",retireld.value, data);
$q.dialog({
title: "ยืนยันการเพิ่มข้อมูล",
message: "ต้องการเพิ่มข้อมูลนี้ใช่หรือไม่?",

View file

@ -332,9 +332,11 @@ const visibleNote = computed(() => {
}
});
const UpdateListId = async (retireld: string, pId: string) => {
const UpdateListId = (retireld: string, pId: string) => {
profileId.value = pId
await fecthlist(retireld)
fecthlist(retireld)
console.log("profileId",profileId.value);
};
// const saveList = () => {
// $q.dialog({
@ -363,15 +365,15 @@ const UpdateListId = async (retireld: string, pId: string) => {
// .onCancel(() => {})
// .onDismiss(() => {});
// };
const classrow = (prop: any) => {
if (prop.profileId === profileId.value) {
return "color: #26a69a; border: 1px solid #26a69a;";
} else return "";
};
// const classrow = (prop: any) => {
// if (profileId.value!=='' && prop.profileId === profileId.value) {
// return "color: #26a69a;";
// } else return "";
// };
const paging = ref<boolean>(true);
const pagination = ref({
sortBy: "order",
descending: true,
descending: false,
page: 1,
rowsPerPage: 10,
});
@ -401,7 +403,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
<AddList
:retireld="retireld"
:profile-id="profileId"
:update-list-id="UpdateListId"
:UpdateListId="UpdateListId"
/>
<!-- <q-btn flat round color="blue-12" icon="save" @click="saveList">
<q-tooltip>นทกขอม</q-tooltip>
@ -493,7 +495,7 @@ const paginationLabel = (start: number, end: number, total: number) => {
<q-tr
:props="props"
class="cursor-pointer"
:style="classrow(props.row)"
:style="props.row.profileId === profileId && 'color: #26a69a;'"
>
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
<q-td key="fixname" :props="props">{{ props.row.fixname }}</q-td>