UI => ส่งคนไประบบออกคำสั่ง

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-09-27 15:59:13 +07:00
parent 3ca0390b87
commit fc75e315f5
19 changed files with 816 additions and 842 deletions

View file

@ -1,21 +1,20 @@
<script setup lang="ts">
import { ref, computed, watchEffect } from "vue";
import { useQuasar } from "quasar";
import type { QTableProps } from "quasar";
import http from "@/plugins/http";
import config from "@/app.config";
import { useCounterMixin } from "@/stores/mixin";
import type { QTableProps } from "quasar";
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
import DialogHeader from "@/components/DialogHeader.vue";
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
/** use */
const $q = useQuasar();
const selected = ref<ResponseItems[]>([]);
const mixin = useCounterMixin();
const { showLoader, success, messageError, dialogConfirm, hideLoader } = mixin;
const { dialogConfirm } = mixin;
/** props*/
const props = defineProps({
@ -26,16 +25,14 @@ const props = defineProps({
filterKeyword2: String,
});
/**
* งกนการ Selected Data
*/
/** ฟังก์ชั่นการ Selected Data*/
const checkSelected = computed(() => {
if (selected.value.length === 0) {
return true;
}
});
/** คอลัมน์ */
//Table
const columns2 = ref<QTableProps["columns"]>([
{
name: "no",
@ -136,8 +133,6 @@ const columns2 = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
/** คอลัมน์ที่แสดง */
const visibleColumns2 = ref<string[]>([
"no",
"prefix",
@ -150,36 +145,20 @@ const visibleColumns2 = ref<string[]>([
"statustext",
]);
const modalCommand = ref<boolean>(false);
/** popup ยืนยันส่งัว */
function saveOrder() {
dialogConfirm(
$q,
() => Ordersave(),
() => {
props.closeModal?.();
modalCommand.value = true;
},
"ยืนยันส่งไปออกคำสั่ง",
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
);
}
/** ส่งไปออกคำสั่ง */
async function Ordersave() {
const id = selected.value.map((r) => r.id);
const body = {
id,
};
showLoader();
await http
.post(config.API.resignReport, body)
.then((res: any) => {
success($q, "ส่งไปออกคำสั่งลาออกสำเร็จ");
props.closeModal?.();
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
props.fecthlist?.();
hideLoader();
});
}
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
function updateInput(value: any) {
@ -305,4 +284,10 @@ watchEffect(() => {
</q-card-actions>
</q-card>
</q-dialog>
<DialogCreateCommand
v-model:modal="modalCommand"
:command-type-code="'C-PM-17'"
:persons-id="selected.map((r) => r.id)"
/>
</template>

View file

@ -1183,7 +1183,7 @@ onMounted(async () => {
:borderless="!edit"
v-model="location"
:rules="[
(val) => !!val || `${'กรุณากรอกสถานที่ยื่นขอลาออกจากราชการ'}`,
(val:string) => !!val || `${'กรุณากรอกสถานที่ยื่นขอลาออกจากราชการ'}`,
]"
hide-bottom-space
:label="`${'สถานที่ยื่นขอลาออกจากราชการ'}`"
@ -1214,7 +1214,7 @@ onMounted(async () => {
:borderless="!edit"
:model-value="date !== null ? date2Thai(date) : null"
:rules="[
(val) =>
(val:string) =>
!!val || `${'กรุณาเลือก วันที่ยื่นขอลาออกจากราชการ'}`,
]"
hide-bottom-space
@ -1247,7 +1247,7 @@ onMounted(async () => {
:borderless="!edit"
v-model="reason"
:rules="[
(val) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
(val:string) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
]"
hide-bottom-space
:label="`${'เหตุผลที่ลาออกจากราชการ (หมายเหตุแนวตั้ง)'}`"