fix load ===> ยุทธศาสตร์
This commit is contained in:
parent
c94fbd22e0
commit
5d97f44ee3
1 changed files with 86 additions and 83 deletions
|
|
@ -36,9 +36,9 @@ const levelnode = ref<number>(0);
|
||||||
const titleDialog = ref<string>("");
|
const titleDialog = ref<string>("");
|
||||||
|
|
||||||
/** ดึงข้อมูล ในรูปแบบ tree */
|
/** ดึงข้อมูล ในรูปแบบ tree */
|
||||||
function fetchDataTree() {
|
async function fetchDataTree() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.get(config.API.devStrategy + `/edit/strategic`)
|
.get(config.API.devStrategy + `/edit/strategic`)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data: DataStrategic[] = res.data.result;
|
const data: DataStrategic[] = res.data.result;
|
||||||
|
|
@ -129,6 +129,7 @@ function closeDialog() {
|
||||||
/** บันทึกข้อมูล */
|
/** บันทึกข้อมูล */
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
|
showLoader();
|
||||||
const formData = {
|
const formData = {
|
||||||
idnode: levelnode.value === 0 ? "0" : nodeId.value,
|
idnode: levelnode.value === 0 ? "0" : nodeId.value,
|
||||||
levelnode: levelnode.value,
|
levelnode: levelnode.value,
|
||||||
|
|
@ -137,18 +138,21 @@ function onSubmit() {
|
||||||
try {
|
try {
|
||||||
const method = isStatusEdit.value ? "patch" : "post";
|
const method = isStatusEdit.value ? "patch" : "post";
|
||||||
await http[method](config.API.devStrategy, formData);
|
await http[method](config.API.devStrategy, formData);
|
||||||
fetchDataTree();
|
await fetchDataTree();
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
closeDialog();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
} finally {
|
} finally {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
closeDialog();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ลบข้อมูลตาม id */
|
/**
|
||||||
|
* ฟังก์ชันลบข้อมูลยุทธศาสตร์
|
||||||
|
* @param data ข้อมูลยุทธศาสตร์ที่ต้องการลบ
|
||||||
|
*/
|
||||||
function onDelete(data: DataStrategic) {
|
function onDelete(data: DataStrategic) {
|
||||||
dialogRemove($q, () => {
|
dialogRemove($q, () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -158,8 +162,8 @@ function onDelete(data: DataStrategic) {
|
||||||
};
|
};
|
||||||
http
|
http
|
||||||
.delete(config.API.devStrategy, { data: formData })
|
.delete(config.API.devStrategy, { data: formData })
|
||||||
.then(() => {
|
.then(async () => {
|
||||||
fetchDataTree();
|
await fetchDataTree();
|
||||||
success($q, "ลบข้อมูลสำเร็จ");
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -252,84 +256,83 @@ onMounted(() => {
|
||||||
icon="mdi-dots-vertical"
|
icon="mdi-dots-vertical"
|
||||||
round
|
round
|
||||||
>
|
>
|
||||||
<q-menu
|
<q-menu>
|
||||||
>
|
|
||||||
<q-list dense style="min-width: 100px">
|
<q-list dense style="min-width: 100px">
|
||||||
<q-item
|
<q-item
|
||||||
v-if="
|
v-if="
|
||||||
prop.node.level !== 4 &&
|
prop.node.level !== 4 &&
|
||||||
checkPermission($route)?.attrIsCreate
|
checkPermission($route)?.attrIsCreate
|
||||||
"
|
"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click.stop="onClickAction('ADD', prop.node)"
|
@click.stop="onClickAction('ADD', prop.node)"
|
||||||
>
|
>
|
||||||
<q-item-section avatar style="min-width: 20px">
|
<q-item-section avatar style="min-width: 20px">
|
||||||
<q-icon size="17px" :color="'primary'" :name="'add'" />
|
<q-icon size="17px" :color="'primary'" :name="'add'" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
|
||||||
<q-item-section v-if="prop.node.level === 1">
|
<q-item-section v-if="prop.node.level === 1">
|
||||||
{{ `เพิ่มยุทธศาสตร์ 1` }}
|
{{ `เพิ่มยุทธศาสตร์ 1` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section v-if="prop.node.level === 2">
|
<q-item-section v-if="prop.node.level === 2">
|
||||||
{{ `เพิ่มยุทธศาสตร์ย่อย` }}
|
{{ `เพิ่มยุทธศาสตร์ย่อย` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section v-if="prop.node.level === 3">
|
<q-item-section v-if="prop.node.level === 3">
|
||||||
{{ `เพิ่มกลยุทธ์ที่/เป้าประสงค์` }}
|
{{ `เพิ่มกลยุทธ์ที่/เป้าประสงค์` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-if="
|
v-if="
|
||||||
checkPermission($route)?.attrIsUpdate &&
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
checkPermission($route)?.attrIsGet
|
checkPermission($route)?.attrIsGet
|
||||||
"
|
"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click.stop="onClickAction('EDIT', prop.node)"
|
@click.stop="onClickAction('EDIT', prop.node)"
|
||||||
>
|
>
|
||||||
<q-item-section avatar style="min-width: 20px">
|
<q-item-section avatar style="min-width: 20px">
|
||||||
<q-icon size="17px" :color="'edit'" :name="'edit'" />
|
<q-icon size="17px" :color="'edit'" :name="'edit'" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section v-if="prop.node.level === 1">
|
<q-item-section v-if="prop.node.level === 1">
|
||||||
{{ `แก้ไขยุทธศาสตร์/แผน` }}
|
{{ `แก้ไขยุทธศาสตร์/แผน` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section v-if="prop.node.level === 2">
|
<q-item-section v-if="prop.node.level === 2">
|
||||||
{{ `แก้ไขยุทธศาสตร์ 1` }}
|
{{ `แก้ไขยุทธศาสตร์ 1` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section v-if="prop.node.level === 3">
|
<q-item-section v-if="prop.node.level === 3">
|
||||||
{{ `แก้ไขยุทธศาสตร์ย่อย` }}
|
{{ `แก้ไขยุทธศาสตร์ย่อย` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section v-if="prop.node.level === 4">
|
<q-item-section v-if="prop.node.level === 4">
|
||||||
{{ `แก้ไขกลยุทธ์ที่/เป้าประสงค์` }}
|
{{ `แก้ไขกลยุทธ์ที่/เป้าประสงค์` }}
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-if="prop.node.children.length !== 0"
|
v-if="prop.node.children.length !== 0"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click="
|
@click="
|
||||||
(modalSort = true),
|
(modalSort = true),
|
||||||
(idSort = prop.node.id),
|
(idSort = prop.node.id),
|
||||||
(dataSort = prop.node.children)
|
(dataSort = prop.node.children)
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<q-item-section avatar style="min-width: 20px">
|
<q-item-section avatar style="min-width: 20px">
|
||||||
<q-icon size="17px" :color="'blue'" :name="'mdi-sort'" />
|
<q-icon size="17px" :color="'blue'" :name="'mdi-sort'" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section> จัดลำดับข้อมูล </q-item-section>
|
<q-item-section> จัดลำดับข้อมูล </q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
<q-item
|
<q-item
|
||||||
v-if="checkPermission($route)?.attrIsDelete"
|
v-if="checkPermission($route)?.attrIsDelete"
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
@click.stop="onClickAction('DEL', prop.node)"
|
@click.stop="onClickAction('DEL', prop.node)"
|
||||||
>
|
>
|
||||||
<q-item-section avatar style="min-width: 20px">
|
<q-item-section avatar style="min-width: 20px">
|
||||||
<q-icon size="17px" :color="'red'" :name="'delete'" />
|
<q-icon size="17px" :color="'red'" :name="'delete'" />
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
<q-item-section> ลบข้อมูล </q-item-section>
|
<q-item-section> ลบข้อมูล </q-item-section>
|
||||||
</q-item>
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue