UI => ส่งคนไประบบออกคำสั่ง
This commit is contained in:
parent
3ca0390b87
commit
fc75e315f5
19 changed files with 816 additions and 842 deletions
|
|
@ -242,7 +242,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วุฒิการศึกษา'}`"
|
||||
type="text"
|
||||
|
|
@ -265,7 +265,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organizationPositionOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่ง/สังกัด'}`"
|
||||
type="textarea"
|
||||
|
|
@ -283,7 +283,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionTypeOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ประเภทตำแหน่ง'}`"
|
||||
/>
|
||||
|
|
@ -299,7 +299,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionLevelOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ระดับตำแหน่ง'}`"
|
||||
/>
|
||||
|
|
@ -315,7 +315,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="posNo"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่'}`"
|
||||
/>
|
||||
|
|
@ -363,7 +363,7 @@ onMounted(() => {
|
|||
:borderless="!edit"
|
||||
:readonly="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'}`"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,21 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, type PropType } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { UserData } from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
|
||||
import type { PersonData } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const storeCommand = useCommandMainStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
const { dialogConfirm, date2Thai } = mixin;
|
||||
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
|
|
@ -27,7 +23,7 @@ const props = defineProps({
|
|||
fetchData: Function,
|
||||
nextPage: Function,
|
||||
optionsType: Array,
|
||||
rows2: Array,
|
||||
rows2: Array as PropType<PersonData[]>,
|
||||
filterKeyword2: String,
|
||||
type: String,
|
||||
});
|
||||
|
|
@ -37,15 +33,22 @@ const emit = defineEmits([
|
|||
"update:selected",
|
||||
]);
|
||||
|
||||
const selected = ref<[]>([]); //รายากรที่เลือก
|
||||
const rows = ref<PersonData[]>([]); //ราชชื่อส่งไปออกคำสั่ง
|
||||
const selected = ref<PersonData[]>([]); //ราชชื่อที่เลือกส่งไปออกคำสั่ง
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"citizenId",
|
||||
"fullname",
|
||||
"organizationName",
|
||||
"typeCommand",
|
||||
"dateOfBirth",
|
||||
]);
|
||||
|
||||
const commandType = ref<string>(""); //ประเภทคำสั่ง
|
||||
const commandMainOp = ref<ListCommand[]>([]); //ข้อมูลรายการคำสั่ง
|
||||
const commandOp = ref<ListCommand[]>([]); //ตัวเลือกคำสั่ง
|
||||
const modalCommand = ref<boolean>(false); //สร้างคำสั่ง
|
||||
|
||||
/**
|
||||
* อัปเดทคค้นหา
|
||||
* @param value ตำค้นหา
|
||||
|
|
@ -89,6 +92,18 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
sort: (a: string, b: string) =>
|
||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||
},
|
||||
{
|
||||
name: "typeCommand",
|
||||
align: "left",
|
||||
label: "ประเภทคำสั่ง",
|
||||
sortable: true,
|
||||
field: "typeCommand",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (val: string) => {
|
||||
return val === "SLIP" ? "เลื่อน" : val === "MOVE" ? "ย้าย" : "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "dateOfBirth",
|
||||
align: "left",
|
||||
|
|
@ -100,7 +115,7 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
function updateInput(value: any) {
|
||||
function updateInput(value: string) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
|
|
@ -116,29 +131,40 @@ function Reset() {
|
|||
*/
|
||||
function clickAddlist() {
|
||||
dialogConfirm($q, async () => {
|
||||
let pId: string[] = [];
|
||||
let Type = props.type as string;
|
||||
selected.value.forEach((e: UserData) => {
|
||||
pId.push(e.id);
|
||||
});
|
||||
let data = {
|
||||
id: pId,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.appointEmployeeOrder(Type), data)
|
||||
.then(async () => {
|
||||
await props.fetchData?.();
|
||||
await props.clickClose?.();
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
selected.value = [];
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
modalCommand.value = true;
|
||||
await props.clickClose?.();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเลือกประเภทคำสั่ง */
|
||||
function filterSelectOrder() {
|
||||
const data = props.rows2 ? props.rows2 : [];
|
||||
selected.value = [];
|
||||
rows.value = data.filter((v: PersonData) => {
|
||||
switch (commandType.value) {
|
||||
case "C-PM-22":
|
||||
return v.typeCommand === "SLIP";
|
||||
|
||||
case "C-PM-24":
|
||||
return v.typeCommand === "MOVE";
|
||||
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟิลเตอร์ คำสั่ง
|
||||
* @param val ค่าจาก Input
|
||||
* @param update Funtion quasar
|
||||
*/
|
||||
function filterSelector(val: string, update: Function) {
|
||||
update(() => {
|
||||
commandType.value = val ? "" : commandType.value;
|
||||
commandOp.value = commandMainOp.value.filter(
|
||||
(v: ListCommand) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -149,159 +175,208 @@ function clickAddlist() {
|
|||
*/
|
||||
watch(
|
||||
() => props.Modal,
|
||||
() => {
|
||||
async () => {
|
||||
if (props.Modal === true) {
|
||||
rows.value = props.rows2 ? props.rows2 : [];
|
||||
selected.value = [];
|
||||
commandType.value = "";
|
||||
const data = await storeCommand.getCommandTypes();
|
||||
commandMainOp.value = data.filter(
|
||||
(e: ListCommand) => e.code === "C-PM-22" || e.code === "C-PM-24"
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row justify-between">
|
||||
<div class="col-5"></div>
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-form greedy @submit.prevent @validation-success="clickAddlist">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
v-model="commandType"
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
outlined
|
||||
label="ประเภทคำสั่ง"
|
||||
:options="commandOp"
|
||||
option-label="name"
|
||||
option-value="code"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="profileId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
use-input
|
||||
style="width: 350px; max-width: auto"
|
||||
@update:model-value="filterSelectOrder"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-space />
|
||||
<div class="row q-col-gutter-sm">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
v-model="props.selected"
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div v-else-if="col.name == 'status'">
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword2"
|
||||
row-key="profileId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<!-- <div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div> -->
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.nodeName !== null ? props.row.nodeName : ""
|
||||
}}
|
||||
{{
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="clickAddlist"
|
||||
color="public"
|
||||
:disable="selected.length === 0"
|
||||
><q-tooltip>ส่งไปออกคำสั่ง</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.nodeName !== null
|
||||
? props.row.nodeName
|
||||
: ""
|
||||
}}
|
||||
{{
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt
|
||||
? date2Thai(props.row.createdAt)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
type="submit"
|
||||
color="public"
|
||||
:disable="selected.length === 0 || commandType === ''"
|
||||
><q-tooltip>ส่งไปออกคำสั่ง</q-tooltip></q-btn
|
||||
>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- dialog สร้างคำสั่ง -->
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="commandType"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วุฒิการศึกษา'}`"
|
||||
type="text"
|
||||
|
|
@ -249,7 +249,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organizationPositionOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่ง/สังกัด'}`"
|
||||
type="textarea"
|
||||
|
|
@ -267,7 +267,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionTypeOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่งประเภท'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่งประเภท'}`"
|
||||
/>
|
||||
|
|
@ -283,7 +283,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionLevelOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ระดับตำแหน่ง'}`"
|
||||
/>
|
||||
|
|
@ -299,7 +299,7 @@ onMounted(() => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="posNo"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่'}`"
|
||||
/>
|
||||
|
|
@ -347,7 +347,7 @@ onMounted(() => {
|
|||
:borderless="!edit"
|
||||
:readonly="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ดำรงตำแหน่งในระดับปัจจุบันเมื่อ'}`"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -1,31 +1,27 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, type PropType } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||
|
||||
/**
|
||||
* importType
|
||||
*/
|
||||
/** importType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { UserDataNew } from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { PersonData } from "@/modules/05_placement/interface/index/Main";
|
||||
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
|
||||
|
||||
/**
|
||||
* importcomponents
|
||||
*/
|
||||
/** importcomponents*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const storeFn = useTransferDataStore();
|
||||
const storeCommand = useCommandMainStore();
|
||||
const { statusText } = storeFn;
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
|
||||
date2Thai,
|
||||
} = useCounterMixin();
|
||||
|
||||
|
|
@ -38,7 +34,7 @@ const props = defineProps({
|
|||
fetchData: Function,
|
||||
nextPage: Function,
|
||||
optionsType: Array,
|
||||
rows2: Array,
|
||||
rows2: Array as PropType<PersonData[]>,
|
||||
filterKeyword2: String,
|
||||
type: String,
|
||||
});
|
||||
|
|
@ -51,6 +47,8 @@ const emit = defineEmits([
|
|||
/**
|
||||
* table
|
||||
*/
|
||||
const rows = ref<PersonData[]>([]); //ราชชื่อส่งไปออกคำสั่ง
|
||||
const selected = ref<PersonData[]>([]); //ราชชื่อที่เลือกส่งไปออกคำสั่ง
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"citizenId",
|
||||
|
|
@ -126,227 +124,286 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const selected = ref<[]>([]);
|
||||
|
||||
const commandType = ref<string>(""); //ประเภทคำสั่ง
|
||||
const commandMainOp = ref<ListCommand[]>([]); //ข้อมูลรายการคำสั่ง
|
||||
const commandOp = ref<ListCommand[]>([]); //ตัวเลือกคำสั่ง
|
||||
const modalCommand = ref<boolean>(false);
|
||||
|
||||
/**
|
||||
* ไปหน้ารายละเอียดที่เลือก
|
||||
* @param item
|
||||
* @param id รายการที่ต้องการดูรายละเอียด
|
||||
*/
|
||||
function pageNext(item: any) {
|
||||
props.nextPage?.(item?.id);
|
||||
function pageNext(id: string) {
|
||||
props.nextPage?.(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* อัปเดท filter
|
||||
*/
|
||||
function updateInput(value: any) {
|
||||
/** อัปเดท filter*/
|
||||
function updateInput(value: string) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* รีเซ็ตค่าในช่องค้นหา
|
||||
*/
|
||||
/** รีเซ็ตค่าในช่องค้นหา*/
|
||||
function Reset() {
|
||||
emit("update:filterKeyword2", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* ยืนยันส่งไปออกคำสั่ง
|
||||
*/
|
||||
/** ยืนยันส่งไปออกคำสั่ง*/
|
||||
function sendToCommand() {
|
||||
dialogConfirm($q, async () => {
|
||||
let pId: string[] = [];
|
||||
let Type = props.type as string;
|
||||
selected.value.forEach((e: UserDataNew) => {
|
||||
pId.push(e.id);
|
||||
});
|
||||
let data = {
|
||||
id: pId,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.apppointmentReport(Type), data)
|
||||
.then(async () => {
|
||||
await props.fetchData?.();
|
||||
await props.clickClose?.();
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
selected.value = [];
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
modalCommand.value = true;
|
||||
await props.clickClose?.();
|
||||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเลือกประเภทคำสั่ง */
|
||||
function filterSelectOrder() {
|
||||
const data = props.rows2 ? props.rows2 : [];
|
||||
selected.value = [];
|
||||
rows.value = data.filter((v: PersonData) => {
|
||||
switch (commandType.value) {
|
||||
case "C-PM-05":
|
||||
return v.typeCommand === "APPOINT";
|
||||
|
||||
case "C-PM-39":
|
||||
return v.typeCommand === "SLIP";
|
||||
|
||||
case "C-PM-07":
|
||||
return v.typeCommand === "MOVE";
|
||||
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟิลเตอร์ คำสั่ง
|
||||
* @param val ค่าจาก Input
|
||||
* @param update Funtion quasar
|
||||
*/
|
||||
function filterSelector(val: string, update: Function) {
|
||||
update(() => {
|
||||
commandType.value = val ? "" : commandType.value;
|
||||
commandOp.value = commandMainOp.value.filter(
|
||||
(v: ListCommand) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อ props.modal เป็น true
|
||||
*
|
||||
* กำหนดให้ selected เป็นค่าว่าง
|
||||
*/
|
||||
watch(
|
||||
() => props.Modal,
|
||||
() => {
|
||||
async () => {
|
||||
if (props.Modal === true) {
|
||||
rows.value = props.rows2 ? props.rows2 : [];
|
||||
selected.value = [];
|
||||
commandType.value = "";
|
||||
const data = await storeCommand.getCommandTypes();
|
||||
commandMainOp.value = data.filter(
|
||||
(e: ListCommand) =>
|
||||
e.code === "C-PM-05" || e.code === "C-PM-39" || e.code === "C-PM-07"
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row justify-between">
|
||||
<div class="col-5"></div>
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-form greedy @submit.prevent @validation-success="sendToCommand">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่ง'" :close="clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
v-model="commandType"
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
outlined
|
||||
label="ประเภทคำสั่ง"
|
||||
:options="commandOp"
|
||||
option-label="name"
|
||||
option-value="code"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="profileId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="pageNext(props.row)"
|
||||
use-input
|
||||
style="width: 350px; max-width: auto"
|
||||
@update:model-value="filterSelectOrder"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn
|
||||
) "
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
<q-space />
|
||||
<div class="row q-col-gutter-sm">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{ props.row.status ? statusText(props.row.status) : "-" }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.nodeName !== null ? props.row.nodeName : ""
|
||||
}}
|
||||
{{
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt ? date2Thai(props.row.createdAt) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="sendToCommand"
|
||||
color="public"
|
||||
:disable="selected.length === 0"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่ง</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword2"
|
||||
row-key="profileId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td auto-width>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td
|
||||
v-for="col in props.cols"
|
||||
:key="col.name"
|
||||
:props="props"
|
||||
@click="pageNext(props.row.id)"
|
||||
>
|
||||
<div v-if="col.name == 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'fullname'">
|
||||
{{
|
||||
props.row.firstName
|
||||
? `${props.row.prefix ?? ""}${
|
||||
props.row.firstName ?? ""
|
||||
} ${props.row.lastName ?? ""}`
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div v-else-if="col.name == 'status'">
|
||||
{{
|
||||
props.row.status ? statusText(props.row.status) : "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'dateOfBirth'">
|
||||
{{
|
||||
props.row.dateOfBirth
|
||||
? date2Thai(props.row.dateOfBirth)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else-if="col.name == 'organizationName'">
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.root !== null ? props.row.root : "-" }}
|
||||
{{
|
||||
props.row.rootShortName !== null
|
||||
? `(${props.row.rootShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{
|
||||
props.row.nodeName !== null
|
||||
? props.row.nodeName
|
||||
: ""
|
||||
}}
|
||||
{{
|
||||
props.row.nodeShortName !== null
|
||||
? `(${props.row.nodeShortName}${props.row.posMasterNo})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="col.name == 'createdAt'">
|
||||
{{
|
||||
props.row.createdAt
|
||||
? date2Thai(props.row.createdAt)
|
||||
: "-"
|
||||
}}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
type="submit"
|
||||
color="public"
|
||||
:disable="selected.length === 0 || commandType === ''"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่ง</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<!-- dialog สร้างคำสั่ง -->
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="commandType"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import { useQuasar } from "quasar";
|
|||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* importType
|
||||
|
|
@ -17,22 +15,15 @@ import type { officerType } from "@/modules/05_placement/interface/response/offi
|
|||
* importComponents
|
||||
*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
/**
|
||||
* use
|
||||
*/
|
||||
const $q = useQuasar();
|
||||
const { statusText } = useTransferDataStore();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
findOrgNameOld,
|
||||
findPosMasterNoOld,
|
||||
date2Thai,
|
||||
} = useCounterMixin();
|
||||
const { dialogConfirm, findOrgNameOld, findPosMasterNoOld, date2Thai } =
|
||||
useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -186,32 +177,15 @@ const visibleColumns2 = ref<string[]>([
|
|||
"status",
|
||||
]);
|
||||
const selected = ref<officerType[]>([]); //รายการที่เลือก
|
||||
const modalCommand = ref<boolean>(false);
|
||||
|
||||
/**
|
||||
* ยืนยันการส่งไปออกคำสั่ง
|
||||
*/
|
||||
/** ยืนยันการส่งไปออกคำสั่ง*/
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => {
|
||||
const id = selected.value.map((item) => item.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
showLoader();
|
||||
http
|
||||
.post(config.API.officerMainReport(), body)
|
||||
.then(async () => {
|
||||
await props.getData?.();
|
||||
await success($q, "ส่งไปออกคำสั่งช่วยราชการสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
props.closeModal?.();
|
||||
modalCommand.value = true;
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
|
|
@ -222,20 +196,17 @@ function saveOrder() {
|
|||
* อัปเดทคค้นหา
|
||||
* @param value ตำค้นหา
|
||||
*/
|
||||
function updateInput(value: any) {
|
||||
function updateInput(value: string) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* รีเซ็ตค่าในช่องค้นหา
|
||||
*/
|
||||
/** รีเซ็ตค่าในช่องค้นหา*/
|
||||
function Reset() {
|
||||
emit("update:filterKeyword2", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อ props.modal เป็น true
|
||||
*
|
||||
* กำหนดให้ selected เป็นค่าว่าง
|
||||
*/
|
||||
watch(
|
||||
|
|
@ -358,4 +329,10 @@ watch(
|
|||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="'C-PM-15'"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,26 +1,24 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { ref, watch, type PropType } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
import type { QTableProps } from "quasar";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* importComponents
|
||||
*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ListCommand } from "@/modules/18_command/interface/index/Main";
|
||||
import type { listMain } from "@/modules/05_placement/interface/response/OhterMain";
|
||||
|
||||
/** importComponents*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const storeCommand = useCommandMainStore();
|
||||
const storeFn = useTransferDataStore();
|
||||
const { statusText } = storeFn;
|
||||
const { showLoader, success, messageError, dialogConfirm, date2Thai } =
|
||||
useCounterMixin();
|
||||
const { dialogConfirm, date2Thai } = useCounterMixin();
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -31,7 +29,7 @@ const props = defineProps({
|
|||
resetFilter: Function,
|
||||
fecthlistOthet: Function,
|
||||
optionsType: Array,
|
||||
rows2: Array,
|
||||
rows2: Array as PropType<listMain[]>,
|
||||
filterKeyword2: String,
|
||||
type: String,
|
||||
});
|
||||
|
|
@ -41,12 +39,9 @@ const emit = defineEmits([
|
|||
"update:selected",
|
||||
]);
|
||||
|
||||
const selected = ref<any[]>([]); //รายการทีี่เลือก
|
||||
const OptionsTypeFn = ref<any[]>([]); //ตัวเลือกประเภทคำสั่ง
|
||||
|
||||
/**
|
||||
* Table
|
||||
*/
|
||||
//Table
|
||||
const rows = ref<listMain[]>([]); //ราชชื่อส่งไปออกคำสั่ง
|
||||
const selected = ref<listMain[]>([]); //ราชชื่อที่เลือกส่งไปออกคำสั่ง
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
"fullname",
|
||||
|
|
@ -128,18 +123,14 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
/**
|
||||
* update filter
|
||||
*/
|
||||
function updateInput(value: any) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
const commandType = ref<string>(""); //ประเภทคำสั่ง
|
||||
const commandMainOp = ref<ListCommand[]>([]); //ข้อมูลรายการคำสั่ง
|
||||
const commandOp = ref<ListCommand[]>([]); //ตัวเลือกคำสั่ง
|
||||
const modalCommand = ref<boolean>(false); //สร้างคำสั่ง
|
||||
|
||||
/**
|
||||
* update ประเภทคำสั่ง
|
||||
*/
|
||||
function updateInputType(value: any) {
|
||||
emit("update:type", value);
|
||||
/** update filter*/
|
||||
function updateInput(value: string) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -154,62 +145,40 @@ function Reset() {
|
|||
*/
|
||||
function clickAddlist() {
|
||||
dialogConfirm($q, async () => {
|
||||
let pId: string[] = [];
|
||||
let Type = props.type as string;
|
||||
selected.value.forEach((e: any) => {
|
||||
pId.push(e.id);
|
||||
});
|
||||
let data = {
|
||||
id: pId,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.otherReport(Type), data)
|
||||
.then(() => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
props.fecthlistOthet?.();
|
||||
selected.value = [];
|
||||
props.clickClose?.();
|
||||
});
|
||||
modalCommand.value = true;
|
||||
props.clickClose?.();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* filter OptionsType
|
||||
* @param val คำค้นหา
|
||||
* @param update Function
|
||||
* ฟิลเตอร์ คำสั่ง
|
||||
* @param val ค่าจาก Input
|
||||
* @param update Funtion quasar
|
||||
*/
|
||||
function filterFnOptionsType(val: string, update: Function) {
|
||||
if (val == "") {
|
||||
update(() => {
|
||||
OptionsTypeFn.value = props.optionsType || [];
|
||||
});
|
||||
} else {
|
||||
update(() => {
|
||||
if (props.optionsType) {
|
||||
OptionsTypeFn.value = props.optionsType.filter(
|
||||
(e: any) => e.name.search(val) !== -1
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
function filterSelector(val: string, update: Function) {
|
||||
update(() => {
|
||||
commandType.value = val ? "" : commandType.value;
|
||||
commandOp.value = commandMainOp.value.filter(
|
||||
(v: ListCommand) => v.name.indexOf(val) > -1
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อ props.modal เป็น true
|
||||
*
|
||||
* เมื่อ props.modal เป็น tru
|
||||
* กำหนดให้ selected เป็นค่าว่าง
|
||||
*/
|
||||
watch(
|
||||
() => props.Modal,
|
||||
() => {
|
||||
async () => {
|
||||
if (props.Modal === true) {
|
||||
rows.value = props.rows2 ? props.rows2 : [];
|
||||
selected.value = [];
|
||||
commandType.value = "";
|
||||
const data = await storeCommand.getCommandTypes();
|
||||
commandMainOp.value = data.filter(
|
||||
(e: ListCommand) => e.code === "C-PM-08" || e.code === "C-PM-09"
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
@ -218,27 +187,32 @@ watch(
|
|||
<template>
|
||||
<q-dialog v-model="props.Modal">
|
||||
<q-card style="width: 1200px; max-width: 80vw">
|
||||
<DialogHeader :tittle="'ส่งไปออกคำสั่งอื่นๆ'" :close="props.clickClose" />
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row justify-between">
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-form greedy @submit.prevent @validation-success="clickAddlist">
|
||||
<DialogHeader
|
||||
:tittle="'ส่งไปออกคำสั่งอื่นๆ'"
|
||||
:close="props.clickClose"
|
||||
/>
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<div class="row q-col-gutter-sm">
|
||||
<div class="row col-12">
|
||||
<q-select
|
||||
outlined
|
||||
v-model="commandType"
|
||||
dense
|
||||
:model-value="type"
|
||||
@update:model-value="updateInputType"
|
||||
:options="OptionsTypeFn"
|
||||
outlined
|
||||
label="ประเภทคำสั่ง"
|
||||
style="width: 400px; max-width: auto"
|
||||
:options="commandOp"
|
||||
option-label="name"
|
||||
option-value="code"
|
||||
emit-value
|
||||
map-options
|
||||
option-label="name"
|
||||
option-value="id"
|
||||
use-input
|
||||
@filter="filterFnOptionsType"
|
||||
><template v-slot:no-option>
|
||||
style="width: 350px; max-width: auto"
|
||||
@filter="(inputValue:string,
|
||||
doneFn:Function) => filterSelector(inputValue, doneFn
|
||||
) "
|
||||
>
|
||||
<template v-slot:no-option>
|
||||
<q-item>
|
||||
<q-item-section class="text-grey">
|
||||
ไม่มีข้อมูล
|
||||
|
|
@ -246,104 +220,111 @@ watch(
|
|||
</q-item>
|
||||
</template>
|
||||
</q-select>
|
||||
</q-toolbar>
|
||||
</div>
|
||||
<div class="col-5">
|
||||
<q-toolbar style="padding: 0">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
style="width: 850px; max-width: auto"
|
||||
<q-space />
|
||||
<div class="row q-col-gutter-sm">
|
||||
<q-input
|
||||
borderless
|
||||
outlined
|
||||
dense
|
||||
debounce="300"
|
||||
:model-value="filterKeyword2"
|
||||
@update:model-value="updateInput"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="props.rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="profileId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword2 == ''" name="search" />
|
||||
<q-icon
|
||||
v-if="filterKeyword2 !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="Reset"
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select
|
||||
v-model="visibleColumns2"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns2"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="gt-xs q-ml-sm"
|
||||
/>
|
||||
</q-toolbar>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else
|
||||
:class="
|
||||
col.name === 'affiliation' ? 'table_ellipsis' : ''
|
||||
"
|
||||
>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<d-table
|
||||
:columns="columns2"
|
||||
:rows="props.rows2"
|
||||
:filter="filterKeyword2"
|
||||
row-key="profileId"
|
||||
flat
|
||||
:visible-columns="visibleColumns2"
|
||||
selection="multiple"
|
||||
v-model:selected="selected"
|
||||
>
|
||||
<template v-slot:header-selection="scope">
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="scope.selected"
|
||||
/>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-checkbox
|
||||
keep-color
|
||||
color="primary"
|
||||
dense
|
||||
v-model="props.selected"
|
||||
/>
|
||||
</q-td>
|
||||
<q-td v-for="col in props.cols" :key="col.id">
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else
|
||||
:class="col.name === 'affiliation' ? 'table_ellipsis' : ''"
|
||||
>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
</d-table>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
@click="clickAddlist"
|
||||
:disable="selected.length === 0"
|
||||
color="public"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่ง</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn
|
||||
label="ส่งไปออกคำสั่ง"
|
||||
type="submit"
|
||||
:disable="selected.length === 0 || commandType === ''"
|
||||
color="public"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่ง</q-tooltip>
|
||||
</q-btn>
|
||||
</q-card-actions>
|
||||
</q-form>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="commandType"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -9,9 +9,7 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* impotyType
|
||||
*/
|
||||
/** impotyType*/
|
||||
import type { resApiData } from "@/modules/05_placement/interface/response/OhterMain";
|
||||
import type { QForm } from "quasar";
|
||||
import type { DataProfile } from "@/modules/05_placement/interface/index/Main";
|
||||
|
|
@ -237,7 +235,7 @@ onMounted(async () => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="educationOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกวุฒิการศึกษา'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'วุฒิการศึกษา'}`"
|
||||
type="text"
|
||||
|
|
@ -258,7 +256,7 @@ onMounted(async () => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="organizationPositionOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกตำแหน่ง/สังกัด'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตำแหน่ง/สังกัด'}`"
|
||||
type="textarea"
|
||||
|
|
@ -275,7 +273,7 @@ onMounted(async () => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionTypeOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกประเภทตำแหน่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ประเภทตำแหน่ง'}`"
|
||||
/>
|
||||
|
|
@ -291,7 +289,7 @@ onMounted(async () => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="positionLevelOld"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกระดับตำแหน่ง'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ระดับตำแหน่ง'}`"
|
||||
/>
|
||||
|
|
@ -307,7 +305,7 @@ onMounted(async () => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
v-model="posNo"
|
||||
:rules="[(val) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณากรอกเลขที่'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'เลขที่'}`"
|
||||
/>
|
||||
|
|
@ -355,7 +353,7 @@ onMounted(async () => {
|
|||
:readonly="!edit"
|
||||
:borderless="!edit"
|
||||
:model-value="date !== null ? date2Thai(date) : null"
|
||||
:rules="[(val) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
:rules="[(val:string) => !!val || `${'กรุณาเลือกตั้งแต่วัน'}`]"
|
||||
hide-bottom-space
|
||||
:label="`${'ตั้งแต่วัน'}`"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ import { ref, watchEffect } from "vue";
|
|||
import { useQuasar } from "quasar";
|
||||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { ResponseRow } from "@/modules/05_placement/interface/response/Receive";
|
||||
|
|
@ -12,19 +10,14 @@ import type { ResponseRow } from "@/modules/05_placement/interface/response/Rece
|
|||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
const transferStore = useTransferDataStore();
|
||||
const { statusText } = transferStore;
|
||||
const $q = useQuasar();
|
||||
const selected = ref<ResponseRow[]>([]);
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
const { dialogConfirm, date2Thai } = mixin;
|
||||
|
||||
/**
|
||||
* props
|
||||
|
|
@ -128,54 +121,33 @@ const visibleColumns2 = ref<string[]>([
|
|||
"status",
|
||||
]);
|
||||
|
||||
/**
|
||||
* ฟังก์ชันยืนยันการส่งออกคำสั่ง
|
||||
*/
|
||||
const modalCommand = ref<boolean>(false); //สร้าง/เลือกคำสั่ง
|
||||
|
||||
/** ฟังก์ชันยืนยันการส่งออกคำสั่ง*/
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const id = selected.value.map((r: ResponseRow) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.receiveReport, body)
|
||||
.then(async () => {
|
||||
await props.fecthlistRecevice?.();
|
||||
success($q, "ส่งไปออกคำสั่งรับโอนสำเร็จ");
|
||||
props.clickClose?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
hideLoader();
|
||||
});
|
||||
props?.clickClose?.();
|
||||
modalCommand.value = true;
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันอัปเดทค่าในช่องค้นหา
|
||||
*/
|
||||
function updateInput(value: any) {
|
||||
/** ฟังก์ชันอัปเดทค่าในช่องค้นหา*/
|
||||
function updateInput(value: string) {
|
||||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* ฟังก์ชันรีเซ็ตค่าในช่องค้นหา
|
||||
*/
|
||||
/** ฟังก์ชันรีเซ็ตค่าในช่องค้นหา*/
|
||||
function onReset() {
|
||||
emit("update:filterKeyword2", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* เมื่อ props.modal เป็น true
|
||||
*
|
||||
* กำหนดให้ selected เป็นค่าว่าง
|
||||
*/
|
||||
watchEffect(() => {
|
||||
|
|
@ -334,4 +306,10 @@ watchEffect(() => {
|
|||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="'C-PM-14'"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -2,42 +2,23 @@
|
|||
import { ref, computed, watch } from "vue";
|
||||
import { useQuasar } from "quasar";
|
||||
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
/**
|
||||
* impportType
|
||||
*/
|
||||
/** impportType*/
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { officerType } from "@/modules/05_placement/interface/response/officer";
|
||||
|
||||
/**
|
||||
* importComponents
|
||||
*/
|
||||
/** importComponents*/
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
/**
|
||||
* importStore
|
||||
*/
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
|
||||
const $q = useQuasar();
|
||||
const { statusText } = useTransferDataStore();
|
||||
const mixin = useCounterMixin();
|
||||
const {
|
||||
showLoader,
|
||||
success,
|
||||
messageError,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
findPosMasterNoOld,
|
||||
date2Thai,
|
||||
} = mixin;
|
||||
const { dialogConfirm, findPosMasterNoOld, date2Thai } = mixin;
|
||||
|
||||
/**
|
||||
* props
|
||||
*/
|
||||
/** props*/
|
||||
const props = defineProps({
|
||||
Modal: Boolean,
|
||||
closeModal: Function,
|
||||
|
|
@ -47,9 +28,7 @@ const props = defineProps({
|
|||
});
|
||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
||||
|
||||
/**
|
||||
* table
|
||||
*/
|
||||
//table
|
||||
const selected = ref<officerType[]>([]);
|
||||
const columns2 = ref<QTableProps["columns"]>([
|
||||
{
|
||||
|
|
@ -155,41 +134,22 @@ const visibleColumns2 = ref<string[]>([
|
|||
"status",
|
||||
]);
|
||||
|
||||
/**
|
||||
* chech การเลือกรายชื่อส่งตัวกลับ
|
||||
*/
|
||||
const modalCommand = ref<boolean>(false); //สร้าง/เลือกคำสั่ง
|
||||
|
||||
/** chech การเลือกรายชื่อส่งตัวกลับ*/
|
||||
const checkSelected = computed(() => {
|
||||
if (selected.value.length === 0) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* ยืนยันการส่งออกคำสั่งส่งตัวกลับ
|
||||
*/
|
||||
/** ยืนยันการส่งออกคำสั่งส่งตัวกลับ*/
|
||||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
const id = selected.value.map((item) => item.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.repatriationMainReport(), body)
|
||||
.then(async () => {
|
||||
await props.getData?.();
|
||||
await success($q, "ส่งไปออกคำสั่งส่งตัวกลับสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
props.closeModal?.();
|
||||
modalCommand.value = true;
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
|
|
@ -204,9 +164,7 @@ function updateInput(value: string | number | null) {
|
|||
emit("update:filterKeyword2", value);
|
||||
}
|
||||
|
||||
/**
|
||||
* รีเซ็ตค่าในช่องค้นหา
|
||||
*/
|
||||
/** รีเซ็ตค่าในช่องค้นหา*/
|
||||
function Reset() {
|
||||
emit("update:filterKeyword2", "");
|
||||
}
|
||||
|
|
@ -330,4 +288,10 @@ watch(
|
|||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="'C-PM-16'"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -226,7 +226,6 @@ interface DataProfile {
|
|||
child3ShortName: string | null;
|
||||
child4: string | null;
|
||||
child4ShortName: string | null;
|
||||
|
||||
child1Old?: string | null;
|
||||
child1ShortNameOld?: string | null;
|
||||
child2Old?: string | null;
|
||||
|
|
@ -235,7 +234,6 @@ interface DataProfile {
|
|||
child3ShortNameOld?: string | null;
|
||||
child4Old?: string | null;
|
||||
child4ShortNameOld?: string | null;
|
||||
|
||||
createdAt: string | Date;
|
||||
dateEnd: string | Date;
|
||||
dateStart: string | Date;
|
||||
|
|
@ -340,9 +338,9 @@ interface PersonData {
|
|||
deferment: boolean;
|
||||
statusName: string;
|
||||
organizationName: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
|
||||
export type {
|
||||
DataOption,
|
||||
DataOptionInsignia,
|
||||
|
|
@ -368,7 +366,7 @@ export type {
|
|||
ListDataText,
|
||||
ListMenu,
|
||||
DataEducation,
|
||||
PersonData
|
||||
PersonData,
|
||||
};
|
||||
|
||||
export { AddressDataDefualt, FamilyDataDefualt };
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ interface listMain {
|
|||
amountOld: number;
|
||||
positionDate: Date;
|
||||
leaveDate: Date;
|
||||
id: string;
|
||||
}
|
||||
//ข้อมูลจาก api
|
||||
interface listMainAPI {
|
||||
|
|
|
|||
|
|
@ -9,19 +9,16 @@ import { useTransferDataStore } from "@/modules/05_placement/store";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
/**
|
||||
* importType
|
||||
*/
|
||||
/** importType*/
|
||||
import type {
|
||||
listAppointType,
|
||||
resData,
|
||||
} from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
import type { QTableProps } from "quasar";
|
||||
import type { PersonData } from "@/modules/05_placement/interface/index/Main";
|
||||
|
||||
/**
|
||||
* importComponents
|
||||
*/
|
||||
/** importComponents*/
|
||||
import Dialogbody from "@/modules/05_placement/components/AppointMent/DialogOrders.vue"; //ส่งไปออกคำสั่ง
|
||||
import DialogOrgSelect from "@/components/Dialogs/DialogOrgSelect.vue"; // เลือกหน่วยงาน
|
||||
|
||||
|
|
@ -52,11 +49,9 @@ const listRecevice = ref<resData[]>([]); //ข้อมูลรายการ
|
|||
const optionsType = ref<OpType[]>([]);
|
||||
const type = ref<string>("");
|
||||
|
||||
/**
|
||||
* Table
|
||||
*/
|
||||
const rows = ref<listAppointType[]>([]); //รายการแต่งตั้ง-เลื่อน-ย้าย
|
||||
const rows2 = ref<listAppointType[]>([]); //รายการออกคำสั่ง
|
||||
//table
|
||||
const rows = ref<PersonData[]>([]); //รายการแต่งตั้ง-เลื่อน-ย้าย
|
||||
const rows2 = ref<PersonData[]>([]); //รายการออกคำสั่ง
|
||||
const filterKeyword = ref<string>(""); //คำค้นหารายการแต่งตั้ง-เลื่อน-ย้าย
|
||||
const filterKeyword2 = ref<string>(""); //คำค้นหารายการออกคำสั่ง
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -159,18 +154,14 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
|
||||
/**
|
||||
* รีเซ็ตคำค้นหารายการ
|
||||
*/
|
||||
/** รีเซ็ตคำค้นหารายการ*/
|
||||
function resetFilter() {
|
||||
filterKeyword.value = "";
|
||||
filterKeyword2.value = "";
|
||||
filterRef.value.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch รายการแต่งตั้ง-เลื่อน-ย้าย
|
||||
*/
|
||||
/** fetch รายการแต่งตั้ง-เลื่อน-ย้าย*/
|
||||
async function fecthlistappointment() {
|
||||
showLoader();
|
||||
await http
|
||||
|
|
@ -234,9 +225,7 @@ function nextPage(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิด popup เลือกหน่วยงาน
|
||||
*/
|
||||
/** เปิด popup เลือกหน่วยงาน*/
|
||||
function openModalTree(data: any, type: string) {
|
||||
personalId.value = data.id;
|
||||
typeModal.value = type;
|
||||
|
|
@ -247,9 +236,7 @@ function openModalTree(data: any, type: string) {
|
|||
modalTree.value = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* ยืนยันการเลือกหน่วยงานที่แต่งตั้ง
|
||||
*/
|
||||
/** ยืนยันการเลือกหน่วยงานที่แต่งตั้ง*/
|
||||
function onSave(data: any) {
|
||||
const dataAppoint = {
|
||||
node: data.node,
|
||||
|
|
@ -283,24 +270,18 @@ function onSave(data: any) {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิด popup ส่งไปออกคำสั่ง
|
||||
*/
|
||||
/** เปิด popup ส่งไปออกคำสั่ง*/
|
||||
function sendToCommand() {
|
||||
modal.value = true;
|
||||
filterKeyword2.value = "";
|
||||
}
|
||||
|
||||
/**
|
||||
* ปิด popup ส่งไปออกคำสั่ง
|
||||
*/
|
||||
/** ปิด popup ส่งไปออกคำสั่ง*/
|
||||
function clickClose() {
|
||||
modal.value = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อมีการเรียกใช้ Components
|
||||
*/
|
||||
/** ทำงานเมื่อมีการเรียกใช้ Components*/
|
||||
onMounted(() => {
|
||||
fecthlistappointment();
|
||||
});
|
||||
|
|
@ -582,9 +563,9 @@ onMounted(() => {
|
|||
v-model:type="type"
|
||||
:click-close="clickClose"
|
||||
:options-type="optionsType"
|
||||
:rows2="rows2"
|
||||
:next-page="nextPage"
|
||||
:fetch-data="fecthlistappointment"
|
||||
:rows2="rows2"
|
||||
/>
|
||||
|
||||
<DialogOrgSelect
|
||||
|
|
|
|||
|
|
@ -10,11 +10,8 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import type {
|
||||
listAppointType,
|
||||
resData,
|
||||
} from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { PersonData } from "@/modules/05_placement/interface/index/Main";
|
||||
import type { resData } from "@/modules/05_placement/interface/response/AppointMent";
|
||||
import type { OpType } from "@/modules/05_placement/interface/response/Main";
|
||||
|
||||
import DialogOrgSelectEmployee from "@/components/Dialogs/DialogOrgSelectEmployee.vue"; //เลือกหน่วยงาน
|
||||
|
|
@ -49,8 +46,8 @@ const optionsType = ref<OpType[]>([]);
|
|||
const type = ref<string>("");
|
||||
|
||||
// Table
|
||||
const rows = ref<listAppointType[]>([]); //รายการปรับระดับชั้นงานลูกจ้าง
|
||||
const rows2 = ref<listAppointType[]>([]); //รายการออกคำสั่ง
|
||||
const rows = ref<PersonData[]>([]); //รายการปรับระดับชั้นงานลูกจ้าง
|
||||
const rows2 = ref<PersonData[]>([]); //รายการออกคำสั่ง
|
||||
const filterKeyword = ref<string>(""); //คำค้นหารายการปรับระดับชั้นงานลูกจ้าง
|
||||
const filterKeyword2 = ref<string>(""); //คำค้นหารายการออกคำสั่ง
|
||||
const visibleColumns = ref<string[]>([
|
||||
|
|
@ -59,6 +56,7 @@ const visibleColumns = ref<string[]>([
|
|||
"fullname",
|
||||
"organizationName",
|
||||
"dateOfBirth",
|
||||
"typeCommand",
|
||||
"createdAt",
|
||||
"status",
|
||||
]);
|
||||
|
|
@ -114,6 +112,18 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "typeCommand",
|
||||
align: "left",
|
||||
label: "ประเภทคำสั่ง",
|
||||
sortable: true,
|
||||
field: "typeCommand",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
format: (val: string) => {
|
||||
return val === "SLIP" ? "เลื่อน" : val === "MOVE" ? "ย้าย" : "-";
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "createdAt",
|
||||
align: "left",
|
||||
|
|
@ -527,9 +537,9 @@ onMounted(() => {
|
|||
v-model:type="type"
|
||||
:click-close="clickClose"
|
||||
:options-type="optionsType"
|
||||
:rows2="rows2"
|
||||
:next-page="nextPage"
|
||||
:fetch-data="fecthlistappointment"
|
||||
:rows2="rows2"
|
||||
/>
|
||||
|
||||
<DialogOrgSelectEmployee
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ const {
|
|||
} = useCounterMixin();
|
||||
|
||||
const modal = ref<boolean>(false);
|
||||
const type = ref<string>("");
|
||||
const optionsType = ref<OpType[]>([]);
|
||||
|
||||
/**
|
||||
* Table
|
||||
|
|
@ -163,29 +161,6 @@ async function fecthlistOthet() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch รายการข้อมูลประเภทคำสั่ง
|
||||
*/
|
||||
function fecthTypeOption() {
|
||||
showLoader();
|
||||
type.value = "";
|
||||
http
|
||||
.get(config.API.typeOrder())
|
||||
.then((res) => {
|
||||
// หาคำสั่ง เฉพาะ C-PM-08 และ C-PM-09
|
||||
optionsType.value = res.data.result.filter(
|
||||
(e: OpType) =>
|
||||
e.commandCode === "C-PM-08" || e.commandCode === "C-PM-09"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* รีเซ็ตข้อมูลในช่อง input
|
||||
*/
|
||||
|
|
@ -200,9 +175,6 @@ function resetFilter() {
|
|||
function popup() {
|
||||
modal.value = true;
|
||||
filterKeyword2.value = "";
|
||||
type.value = "";
|
||||
// fetch รายการข้อมูลประเภทคำสั่ง
|
||||
fecthTypeOption();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -380,9 +352,7 @@ onMounted(() => {
|
|||
<Dialogbody
|
||||
v-model:Modal="modal"
|
||||
v-model:filter-keyword2="filterKeyword2"
|
||||
v-model:type="type"
|
||||
:click-close="clickClose"
|
||||
:options-type="optionsType"
|
||||
:rows2="rows2"
|
||||
:fecthlistOthet="fecthlistOthet"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import { useCounterMixin } from "@/stores/mixin";
|
|||
import { useTransferDataStore } from "@/modules/05_placement/store";
|
||||
|
||||
import type { ResponseItems } from "@/modules/06_retirement/interface/response/Main";
|
||||
|
||||
import DialogCreateCommand from "@/modules/18_command/components/DialogCreateCommand.vue";
|
||||
import DialogHeader from "@/modules/06_retirement/components/DialogHeader.vue";
|
||||
|
||||
/** use */
|
||||
|
|
@ -98,7 +100,6 @@ const columns2 = ref<QTableProps["columns"]>([
|
|||
format: (val) => statusText(val),
|
||||
},
|
||||
]);
|
||||
|
||||
/** คอลัมน์ที่แสดง */
|
||||
const visibleColumns2 = ref<string[]>([
|
||||
"no",
|
||||
|
|
@ -118,6 +119,8 @@ const props = defineProps({
|
|||
filterKeyword2: String,
|
||||
});
|
||||
|
||||
const modalCommand = ref<boolean>(false);
|
||||
|
||||
/**
|
||||
* ฟังก์ชั่นการ Selected Data
|
||||
*/
|
||||
|
|
@ -131,34 +134,15 @@ const checkSelected = computed(() => {
|
|||
function saveOrder() {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
() => Ordersave(),
|
||||
() => {
|
||||
modalCommand.value = true;
|
||||
props.closeModal?.();
|
||||
},
|
||||
"ยืนยันส่งไปออกคำสั่ง",
|
||||
"ต้องการยืนยันส่งไปออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
}
|
||||
|
||||
//ส่งไปออกคำสั่ง
|
||||
async function Ordersave() {
|
||||
const id = selected.value.map((r) => r.id);
|
||||
const body = {
|
||||
id,
|
||||
};
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.outReport, body)
|
||||
.then((res: any) => {
|
||||
success($q, "ส่งไปออกคำสั่งสำเร็จ");
|
||||
props.closeModal?.();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
props.fecthlistRecevice?.();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
const emit = defineEmits(["update:filterKeyword2", "update:selected"]);
|
||||
function updateInput(value: any) {
|
||||
emit("update:filterKeyword2", value);
|
||||
|
|
@ -275,4 +259,10 @@ watchEffect(() => {
|
|||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogCreateCommand
|
||||
v-model:modal="modalCommand"
|
||||
:command-type-code="'C-PM-18'"
|
||||
:persons-id="selected.map((r) => r.id)"
|
||||
/>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -309,7 +309,7 @@ onMounted(async () => {
|
|||
lazy-rules
|
||||
mask="###,###,###,###"
|
||||
reverse-fill-mask
|
||||
class="inputgreen"
|
||||
:class="getClass(edit)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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="`${'เหตุผลที่ลาออกจากราชการ (หมายเหตุแนวตั้ง)'}`"
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ async function getListCommandDraf() {
|
|||
await http
|
||||
.get(
|
||||
config.API.commandList +
|
||||
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&year=${commandYear.value}&keyword=${filter.value}&status=DRAFT`
|
||||
`?page=${pagination.value.page}&pageSize=${pagination.value.rowsPerPage}&year=${commandYear.value}&keyword=${filter.value}&status=DRAFT&commandTypeId=${commandType.value}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
totalList.value = Math.ceil(
|
||||
|
|
@ -280,6 +280,15 @@ watch(modal, () => {
|
|||
fetchCommandType();
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => selectCreate.value,
|
||||
async () => {
|
||||
if (selectCreate.value == "DRAF") {
|
||||
getListCommandDraf();
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue