ทะเบียนประวัติ: วินัย clean code
This commit is contained in:
parent
25303bc6ca
commit
f51cd9ae86
1 changed files with 2 additions and 64 deletions
|
|
@ -6,7 +6,6 @@ import type {
|
|||
FormFilter,
|
||||
DataOption,
|
||||
DisciplineOps,
|
||||
MyObjectRef,
|
||||
} from "@/modules/04_registryNew/interface/index/discipline";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useQuasar } from "quasar";
|
||||
|
|
@ -29,7 +28,7 @@ const {
|
|||
hideLoader,
|
||||
messageError,
|
||||
success,
|
||||
dateToISO,
|
||||
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const disciplineData = reactive<any>({
|
||||
|
|
@ -143,24 +142,12 @@ const dateRef = ref<object | null>(null);
|
|||
const detailRef = ref<object | null>(null);
|
||||
const refCommandNoRef = ref<object | null>(null);
|
||||
|
||||
const objectRef: MyObjectRef = {
|
||||
date: dateRef,
|
||||
detail: detailRef,
|
||||
refCommandNo: refCommandNoRef,
|
||||
};
|
||||
|
||||
/** dialog */
|
||||
const edit = ref<boolean>(false);
|
||||
const modal = ref<boolean>(false);
|
||||
const modalHistory = ref<boolean>(false);
|
||||
|
||||
const id = ref<string>("");
|
||||
const date = ref<Date | null>(null);
|
||||
const detail = ref<string>();
|
||||
const level = ref<string>();
|
||||
const unStigma = ref<string>();
|
||||
const refCommandNo = ref<string>();
|
||||
const refCommandDate = ref<Date | null>(null);
|
||||
|
||||
const Ops = ref<DisciplineOps>({
|
||||
levelOptions: [
|
||||
|
|
@ -246,7 +233,6 @@ async function fetchData(id: string) {
|
|||
await http
|
||||
.get(config.API.profileNewDisciplineByProfileId(id))
|
||||
.then(async (res) => {
|
||||
console.log(res.data.result);
|
||||
rows.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
|
@ -296,6 +282,7 @@ function deleteData(idData: string) {
|
|||
.delete(config.API.profileNewDisciplineByDisciplineId(idData))
|
||||
.then(() => {
|
||||
fetchData(profileId.value);
|
||||
success($q, "ลบข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
@ -312,8 +299,6 @@ function deleteData(idData: string) {
|
|||
function openDialogEdit(props: RequestItemsObject) {
|
||||
modal.value = true;
|
||||
edit.value = true;
|
||||
|
||||
console.log(props);
|
||||
id.value = props.id;
|
||||
disciplineData.date = props.date;
|
||||
disciplineData.detail = props.detail;
|
||||
|
|
@ -339,53 +324,6 @@ async function onSubmit() {
|
|||
"ต้องการยืนยันการบันทึกข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
// const data: RequestItemsObject[] = [
|
||||
// {
|
||||
// level: "ภาคทัณฑ์",
|
||||
// detail: "1",
|
||||
// refCommandNo: "1",
|
||||
// refCommandDate: null,
|
||||
// date: new Date("2024-03-19T00:00:00"),
|
||||
// unStigma: "1",
|
||||
// id: "08dc2e0f-5631-4a7c-8ac4-0f7c99156c2e",
|
||||
// createdAt: new Date("2024-02-15T17:17:38.524861"),
|
||||
// createdFullName: "สาวิตรี ศรีสมัย",
|
||||
// },
|
||||
// {
|
||||
// level: "ภาคทัณฑ์",
|
||||
// detail: "11",
|
||||
// refCommandNo: "11",
|
||||
// refCommandDate: new Date("2024-03-11T00:00:00"),
|
||||
// date: new Date("2024-02-20T00:00:00"),
|
||||
// unStigma: "",
|
||||
// id: "08dc2e11-3588-44ea-8c1a-99109a4c4fe0",
|
||||
// createdAt: new Date("2024-02-20T12:59:47.193103"),
|
||||
// createdFullName: "สาวิตรี ศรีสมัย",
|
||||
// },
|
||||
// {
|
||||
// level: "ตัดเงินเดือน",
|
||||
// detail: "115",
|
||||
// refCommandNo: "1",
|
||||
// refCommandDate: new Date("2024-03-11T00:00:00"),
|
||||
// date: new Date("2024-02-20T00:00:00"),
|
||||
// unStigma: "11",
|
||||
// id: "08dc2e11-8054-416c-8299-81005d739a25",
|
||||
// createdAt: new Date("2024-02-20T12:59:47.193103"),
|
||||
// createdFullName: "สาวิตรี ศรีสมัย",
|
||||
// },
|
||||
// {
|
||||
// level: "",
|
||||
// detail: "test",
|
||||
// refCommandNo: "12",
|
||||
// refCommandDate: new Date("2024-03-11T00:00:00"),
|
||||
// date: new Date("2024-02-20T00:00:00"),
|
||||
// unStigma: "",
|
||||
// id: "08dc31d9-24a0-4870-896c-4c4ea8f7b104",
|
||||
// createdAt: new Date("2024-02-20T12:59:47.193103"),
|
||||
// createdFullName: "สาวิตรี ศรีสมัย",
|
||||
// },
|
||||
// ];
|
||||
// rows.value = data;
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchData(profileId.value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue