Refactoring code module 11_discipline
This commit is contained in:
parent
202fbf27b6
commit
9653ae78cb
58 changed files with 1021 additions and 1305 deletions
|
|
@ -1,22 +1,20 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, watchEffect, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import type { ResponseData } from "@/modules/05_placement/interface/response/Transfer";
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
import type { DataListRow } from "@/modules/11_discipline/interface/request/result";
|
||||
import { useRoute } from "vue-router";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
const route = useRoute();
|
||||
|
||||
const optionsType = ref<[]>([]);
|
||||
const idPath = ref<string>(route.params.id as string);
|
||||
const type = ref<string>("");
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
const route = useRoute();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
|
|
@ -27,6 +25,12 @@ const {
|
|||
dialogMessageNotify,
|
||||
} = mixin;
|
||||
|
||||
const optionsType = ref<[]>([]);
|
||||
const idPath = ref<string>(route.params.id as string);
|
||||
const type = ref<string>("");
|
||||
const rows = ref<DataListRow[]>([]);
|
||||
const selected = ref<ResponseData[]>([]);
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object,
|
||||
|
|
@ -90,25 +94,6 @@ async function Ordersave() {
|
|||
props.getData?.();
|
||||
hideLoader();
|
||||
});
|
||||
// } else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
||||
// const body = {
|
||||
// persons,
|
||||
// };
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.discardResult(idPath.value, type.value as string), body)
|
||||
// .then((res: any) => {
|
||||
// success($q, `${props.title}สำเร็จ`);
|
||||
// props.closeModal?.();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// props.getData?.();
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
}
|
||||
|
||||
const emit = defineEmits([
|
||||
|
|
@ -132,7 +117,6 @@ async function fecthTypeOption() {
|
|||
await http
|
||||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
// if (props.title == "ส่งไปออกคำสั่ง") {
|
||||
optionsType.value = res.data.result.filter(
|
||||
(e: OpType) =>
|
||||
e.commandCode === "C-PM-19" ||
|
||||
|
|
@ -143,13 +127,6 @@ async function fecthTypeOption() {
|
|||
e.commandCode === "C-PM-30" ||
|
||||
e.commandCode === "C-PM-31"
|
||||
);
|
||||
// }
|
||||
// else {
|
||||
// optionsType.value = res.data.result.filter(
|
||||
// (e: OpType) =>
|
||||
// e.commandCode === "C-PM-30" || e.commandCode === "C-PM-31"
|
||||
// );
|
||||
// }
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
|
|
@ -166,15 +143,6 @@ watchEffect(() => {
|
|||
rows.value = props.data.persons.filter(
|
||||
(item: any) => item.status === "NEW"
|
||||
);
|
||||
// if (props.title == "ส่งไปออกคำสั่งลงโทษทางวินัย") {
|
||||
// rows.value = props.data.persons.filter(
|
||||
// (item: any) => item.status !== "REPORT"
|
||||
// );
|
||||
// } else if (props.title == "ส่งไปออกคำสั่งงดโทษ/เพิ่มโทษ") {
|
||||
// rows.value = props.data.persons.filter(
|
||||
// (item: any) => item.status == "REPORT" && item.statusDiscard == "NEW"
|
||||
// );
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue