fix: ระบบพัฒนา เพิ่มปุ่มลบ/ระบบวินัย เพิ่ม ค้นหาขั้นสูง

This commit is contained in:
setthawutttty 2025-07-17 14:46:20 +07:00
parent 9c5e958715
commit 852be66d2e
12 changed files with 1182 additions and 75 deletions

View file

@ -10,6 +10,7 @@ import { useStructureTree } from "@/stores/structureTree";
import genReportXLSX from "@/plugins/genreportxlsx";
import { useDevelopmentDataStore } from "@/modules/15_development/store/developmentStore";
import { useCounterMixin } from "@/stores/mixin";
import { updateCurrentPage } from "@/utils/function";
/**importType*/
import type {
@ -40,6 +41,8 @@ const {
messageError,
dialogMessageNotify,
dialogConfirm,
dialogRemove,
success,
} = useCounterMixin();
const node = ref<OrgTree[]>([]); // /
@ -272,6 +275,29 @@ function onRedirectToRecordPage(id: string) {
router.push(`/development/record/${id}`);
}
function onDelete(id: string) {
dialogRemove($q, async () => {
showLoader();
await http
.delete(config.API.developmentMain + `/${id}`)
.then(async () => {
formQuery.page = await updateCurrentPage(
formQuery.page,
totalList.value,
rows.value.length
);
await fetchListProject();
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((err) => {
messageError($q, err);
})
.finally(() => {
hideLoader();
});
});
}
/**
* function redirect หนาบนทกผล
* @param id โครงการ
@ -525,6 +551,21 @@ onMounted(() => {
>
<q-tooltip>แกไขขอม</q-tooltip></q-btn
>
<q-btn
v-if="
formQuery.status === 'ONGOING' &&
checkPermission($route)?.attrIsUpdate &&
checkPermission($route)?.attrIsGet
"
flat
round
dense
color="red"
icon="delete"
@click.prevent="onDelete(props.row.id)"
>
<q-tooltip>ลบขอม</q-tooltip></q-btn
>
<q-btn
v-if="
formQuery.status === 'FINISH' &&