fix: ระบบพัฒนา เพิ่มปุ่มลบ/ระบบวินัย เพิ่ม ค้นหาขั้นสูง
This commit is contained in:
parent
9c5e958715
commit
852be66d2e
12 changed files with 1182 additions and 75 deletions
|
|
@ -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' &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue