รายการออกคำสั่งย้ายสับเปลี่ยนตำแหน่ง (รอ API)

This commit is contained in:
STW_TTTY\stwtt 2024-06-12 14:37:02 +07:00
parent 49bb827226
commit aad0d88867
5 changed files with 69 additions and 94 deletions

View file

@ -26,20 +26,19 @@ function close() {
}
function onSubmit() {
// dialogConfirm($q, () => {
// const url = editCheck.value
// ? config.API.
// : config.API.;
dialogConfirm($q, () => {
const url = editCheck.value
? config.API.changePosition+`/${idRound.value}`
: config.API.changePosition;
// http[editCheck.value ? "put" : "post"](url, {
// id: editCheck.value ? idRound : undefined,
// round: round.value,
// }).then((res) => {
// close();
// success($q, "");
// props.getData?.();
// });
// });
http[editCheck.value ? "put" : "post"](url, {
name: round.value,
}).then((res) => {
close();
success($q, "บันทึกข้อมูลสำเร็จ");
props.getData?.();
});
});
}
</script>
@ -54,13 +53,14 @@ function onSubmit() {
:close="close"
/>
<q-separator />
<q-card-section>
<q-card-section class="q-pa-sm">
<div class="row">
<div class="col-12">
<q-input
:model-value="round"
v-model="round"
outlined
dense
hide-bottom-space
class="inputgreen"
label="ชื่อรอบการย้ายสับเปลี่ยนตำแหน่ง"
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อรอบการย้ายสับเปลี่ยนตำแหน่ง'}`,]"

View file

@ -111,37 +111,19 @@ const sendToCommand = () => {
// API
const fecthLists = async () => {
// showLoader();
// rows.value = [];
// await http
// .get(config.API.appointmentMain())
// .then((res) => {
// let response = res.data.result;
// listRecevice.value = response;
// rows.value = response;
// rows2.value = rows.value.filter(
// (e: any) => e.status !== "REPORT" && e.status !== "DONE"
// );
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
rows.value = [
{
id: "08dc86c2-98a5-45f0-8e37-3502a4eb78c0",
name: "ย้ายสับเปลี่ยนตำแหน่งทุกเขต",
status: "WAITTING",
createdAt: "2024-06-07T14:22:31.985829",
},
];
rows2.value = rows.value.filter(
(e: any) => e.status !== "REPORT" && e.status !== "DONE"
);
showLoader();
rows.value = [];
await http
.get(config.API.changePosition)
.then((res) => {
rows.value = res.data.result;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
// dialog
@ -160,19 +142,19 @@ function addRound() {
//
const clickDelete = (id: string) => {
dialogRemove($q, () => {
// showLoader();
// http
// .delete(config.API.appointmentDelete(id))
// .then(() => {
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// fecthLists();
// hideLoader();
// });
showLoader();
http
.delete(config.API.changePosition+`/${id}`)
.then(() => {
success($q, "ลบข้อมูลสำเร็จ");
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
fecthLists();
hideLoader();
});
});
};
@ -183,23 +165,6 @@ const personalListPage = (id: string) => {
});
};
function onSave(data: any) {
// showLoader();
// http
// .put(config.API.appointmentPosition(personalId.value), dataAppoint)
// .then((res) => {
// modalTree.value = false;
// success($q, "");
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(async () => {
// fecthLists();
// hideLoader();
// });
}
onMounted(() => {
fecthLists();
});

View file

@ -2,7 +2,7 @@
import { ref, onMounted } from "vue";
import type { QTableProps } from "quasar";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useRoute, useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
@ -13,6 +13,12 @@ import config from "@/app.config";
import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue";
import DialogEvalute from '@/modules/05_placement/components/ChangePosition/DialogChange.vue'
const router = useRouter();
const route = useRoute();
const id = ref<string>(
route.params.id ? route.params.id.toString() : ""
);
const modalDialog = ref<boolean>(false)
const posType = ref<string>("");
const posLevel = ref<string>("");
@ -34,7 +40,7 @@ const {
dialogRemove,
} = mixin;
const router = useRouter();
const rows = ref<any>([]);
const modalTree = ref<boolean>(false);
const personalId = ref<string>("");
@ -144,20 +150,20 @@ const addPerson = () => {
// API
const fecthLists = async () => {
// showLoader();
// rows.value = [];
// await http
// .get(config.API.appointmentMain())
// .then((res) => {
// let response = res.data.result;
// rows.value = response;
// })
// .catch((e) => {
// messageError($q, e);
// })
// .finally(() => {
// hideLoader();
// });
showLoader();
rows.value = [];
await http
.get(config.API.changePosition+`/${id.value}`)
.then((res) => {
let response = res.data.result;
rows.value = response;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
rows.value = [
{
@ -598,8 +604,7 @@ onMounted(() => {
:onSubmit="onSave"
/>
<DialogEvalute
v-model:modal="modalDialog"/>
<DialogEvalute v-model:modal="modalDialog" />
</template>
<style scoped lang="scss"></style>