แก้วินัย อัพไฟล์ เเล้ว ข้อมูลเเก้ไขหาย/เเก้ฟิลเตอร์

This commit is contained in:
setthawutttty 2024-01-08 09:45:03 +07:00
parent b670ae3733
commit 9bf53d2689
8 changed files with 275 additions and 190 deletions

View file

@ -69,27 +69,27 @@ const saveOrder = () => {
}
};
//
async function Ordersave(){
async function Ordersave() {
const persons = selected.value.map((r) => r.id);
// if (props.title == "") {
const body = {
persons,
};
showLoader();
await http
.put(config.API.reportresult(idPath.value, type.value as string), body)
.then((res: any) => {
success($q, `${props.title}สำเร็จ`);
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.getData?.();
hideLoader();
});
const body = {
persons,
};
showLoader();
await http
.put(config.API.reportresult(idPath.value, type.value as string), body)
.then((res: any) => {
success($q, `${props.title}สำเร็จ`);
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.getData?.();
hideLoader();
});
// } else if (props.title == "/") {
// const body = {
// persons,
@ -109,7 +109,7 @@ async function Ordersave(){
// hideLoader();
// });
// }
};
}
const emit = defineEmits([
"update:filterKeyword2",
@ -122,28 +122,28 @@ const updateInput = (value: any) => {
};
//
function Reset(){
function Reset() {
emit("update:filterKeyword2", "");
};
}
//----()------//
async function fecthTypeOption(){
async function fecthTypeOption() {
showLoader();
await http
.get(config.API.typeOrder())
.then((res) => {
// if (props.title == "") {
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-19" ||
e.commandCode === "C-PM-20" ||
e.commandCode === "C-PM-27" ||
e.commandCode === "C-PM-28" ||
e.commandCode === "C-PM-29" ||
e.commandCode === "C-PM-30" ||
e.commandCode === "C-PM-31"
);
// }
optionsType.value = res.data.result.filter(
(e: OpType) =>
e.commandCode === "C-PM-19" ||
e.commandCode === "C-PM-20" ||
e.commandCode === "C-PM-27" ||
e.commandCode === "C-PM-28" ||
e.commandCode === "C-PM-29" ||
e.commandCode === "C-PM-30" ||
e.commandCode === "C-PM-31"
);
// }
// else {
// optionsType.value = res.data.result.filter(
// (e: OpType) =>
@ -157,13 +157,15 @@ async function fecthTypeOption(){
.finally(() => {
hideLoader();
});
};
}
watchEffect(() => {
if (props.Modal === true) {
selected.value = [];
type.value = "";
rows.value = props.data.persons
rows.value = props.data.persons.filter(
(item: any) => item.status === "NEW"
);
// if (props.title == "") {
// rows.value = props.data.persons.filter(
// (item: any) => item.status !== "REPORT"
@ -193,7 +195,6 @@ watch(
<div class="row justify-between">
<div class="col-5">
<q-toolbar style="padding: 0">
<q-select
outlined
dense
@ -285,7 +286,7 @@ watch(
v-model="props.selected"
/>
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props" >
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
@ -295,6 +296,9 @@ watch(
>
{{ props.row.organization }}
</div>
<div v-else-if="col.name === 'salary'">
{{ props.row.salary.toLocaleString() }}
</div>
<div v-else>
{{ col.value }}
</div>