[Edit SIT] แก้ไขช่วยราชการ และส่งตัวกลับ
This commit is contained in:
parent
3f02f9b53e
commit
1bfcdae54b
7 changed files with 136 additions and 9 deletions
|
|
@ -238,4 +238,5 @@ export default {
|
||||||
`${registryNew}${type}/assistance/${id}`,
|
`${registryNew}${type}/assistance/${id}`,
|
||||||
profileAssistanceHistory: (id: string, type: string) =>
|
profileAssistanceHistory: (id: string, type: string) =>
|
||||||
`${registryNew}${type}/assistance/history/${id}`,
|
`${registryNew}${type}/assistance/history/${id}`,
|
||||||
|
profileAssistanceReturn: `${env.API_URI}/placement/repatriation`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,14 @@ import { ref, onMounted, reactive } from "vue";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { checkPermission } from "@/utils/permissions";
|
import { checkPermission } from "@/utils/permissions";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { QTableColumn } from "quasar";
|
import type { QTableColumn } from "quasar";
|
||||||
|
import type { DataOption } from "@/modules/04_registryPerson/interface/index/Main";
|
||||||
import type { DatAssistance } from "@/modules/04_registryPerson/interface/request/Government";
|
import type { DatAssistance } from "@/modules/04_registryPerson/interface/request/Government";
|
||||||
import type {
|
import type {
|
||||||
ResAssistanceData,
|
ResAssistanceData,
|
||||||
|
|
@ -21,6 +22,7 @@ import DialogHistory from "@/modules/04_registryPerson/components/detail/DialogH
|
||||||
import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue";
|
import DialogPreviewCommand from "@/modules/18_command/components/DialogPreviewCommand.vue";
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const {
|
const {
|
||||||
|
|
@ -46,10 +48,22 @@ const isLeave = defineModel<boolean>("isLeave", {
|
||||||
});
|
});
|
||||||
|
|
||||||
const baseColumns = ref<QTableColumn[]>([
|
const baseColumns = ref<QTableColumn[]>([
|
||||||
|
{
|
||||||
|
name: "commandName",
|
||||||
|
align: "left",
|
||||||
|
label: "ประเภทคำสั่ง",
|
||||||
|
sortable: true,
|
||||||
|
field: "commandName",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
sort: (a: string, b: string) =>
|
||||||
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "agency",
|
name: "agency",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "หน่วยงานที่ให้ช่วยราชการ",
|
label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "agency",
|
field: "agency",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
|
|
@ -128,6 +142,7 @@ const baseColumns = ref<QTableColumn[]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const baseVisibleColumns = ref<string[]>([
|
const baseVisibleColumns = ref<string[]>([
|
||||||
|
"commandName",
|
||||||
"agency",
|
"agency",
|
||||||
"dateStart",
|
"dateStart",
|
||||||
"dateEnd",
|
"dateEnd",
|
||||||
|
|
@ -168,12 +183,24 @@ const modalCommand = ref<boolean>(false);
|
||||||
const command = ref<string>("");
|
const command = ref<string>("");
|
||||||
const commandId = ref<string>("");
|
const commandId = ref<string>("");
|
||||||
|
|
||||||
|
const commandCodeOptions = ref<DataOption[]>([
|
||||||
|
{
|
||||||
|
name: "ให้ช่วยราชการ",
|
||||||
|
id: "ให้ช่วยราชการ",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "ให้ข้าราชการกลับไปปฏิบัติงานทางต้นสังกัดเดิม",
|
||||||
|
id: "ให้ข้าราชการกลับไปปฏิบัติงานทางต้นสังกัดเดิม",
|
||||||
|
},
|
||||||
|
]); //รายการปรเภทคำสั่ง
|
||||||
|
|
||||||
const formData = reactive<DatAssistance>({
|
const formData = reactive<DatAssistance>({
|
||||||
agency: "",
|
agency: "",
|
||||||
dateStart: null,
|
dateStart: null,
|
||||||
dateEnd: null,
|
dateEnd: null,
|
||||||
commandNo: "",
|
commandNo: "",
|
||||||
document: "",
|
document: "",
|
||||||
|
commandName: "",
|
||||||
// isUpload: false,
|
// isUpload: false,
|
||||||
});
|
});
|
||||||
const fileUpload = ref<File>();
|
const fileUpload = ref<File>();
|
||||||
|
|
@ -353,6 +380,7 @@ function openEditDialog(data: ResAssistanceData) {
|
||||||
formData.dateEnd = data.dateEnd;
|
formData.dateEnd = data.dateEnd;
|
||||||
formData.commandNo = data.commandNo;
|
formData.commandNo = data.commandNo;
|
||||||
formData.document = data.document;
|
formData.document = data.document;
|
||||||
|
formData.commandName = data.commandName;
|
||||||
isUpload.value = data.isUpload;
|
isUpload.value = data.isUpload;
|
||||||
if (isUpload.value) {
|
if (isUpload.value) {
|
||||||
onDownloadFile(data.id, false);
|
onDownloadFile(data.id, false);
|
||||||
|
|
@ -379,10 +407,34 @@ function closeDialogForm() {
|
||||||
formData.dateEnd = null;
|
formData.dateEnd = null;
|
||||||
formData.commandNo = "";
|
formData.commandNo = "";
|
||||||
formData.document = "";
|
formData.document = "";
|
||||||
|
formData.commandName = "";
|
||||||
isUpload.value = false;
|
isUpload.value = false;
|
||||||
fileUpload.value = undefined;
|
fileUpload.value = undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ฟังก์ชันส่งตัวกลับ
|
||||||
|
* @param refId ของช่วยราชการ
|
||||||
|
*/
|
||||||
|
async function onReturner(refId: string) {
|
||||||
|
showLoader();
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("OfficerId", refId);
|
||||||
|
formData.append("Id", profileId.value);
|
||||||
|
|
||||||
|
await http
|
||||||
|
.post(config.API.profileAssistanceReturn, formData)
|
||||||
|
.then(async () => {
|
||||||
|
router.push("/placement/repatriate");
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
});
|
});
|
||||||
|
|
@ -510,6 +562,26 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn
|
||||||
|
v-if="
|
||||||
|
checkPermission($route)?.attrIsUpdate &&
|
||||||
|
props.row.commandName === 'ให้ช่วยราชการ'
|
||||||
|
"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
:color="
|
||||||
|
!props.row.refId || props.row.status !== 'PENDING'
|
||||||
|
? 'grey-5'
|
||||||
|
: 'primary'
|
||||||
|
"
|
||||||
|
:disable="!props.row.refId || props.row.status !== 'PENDING'"
|
||||||
|
icon="mdi-account-arrow-left-outline"
|
||||||
|
@click.stop.prevent="onReturner(props.row.refId)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ส่งตัวกลับ</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td v-for="col in props.cols" :key="col.id">
|
<q-td v-for="col in props.cols" :key="col.id">
|
||||||
<div
|
<div
|
||||||
|
|
@ -569,6 +641,22 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
<q-tooltip>แก้ไขข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
<q-btn
|
||||||
|
v-if="checkPermission($route)?.attrIsUpdate"
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
round
|
||||||
|
:color="
|
||||||
|
!props.row.refId || props.row.status !== 'PENDING'
|
||||||
|
? 'grey-5'
|
||||||
|
: 'primary'
|
||||||
|
"
|
||||||
|
:disable="!props.row.refId || props.row.status !== 'PENDING'"
|
||||||
|
icon="mdi-account-arrow-left-outline"
|
||||||
|
@click.stop.prevent="onReturner(props.row.refId)"
|
||||||
|
>
|
||||||
|
<q-tooltip>ส่งตัวกลับ</q-tooltip>
|
||||||
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
@ -643,6 +731,36 @@ onMounted(() => {
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section style="max-height: 50vh">
|
<q-card-section style="max-height: 50vh">
|
||||||
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
<div class="row col-12 q-col-gutter-x-xs q-col-gutter-y-xs">
|
||||||
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||||
|
<!-- :rules="[(val: string) => !!val || 'กรุณาเลือกประเภทคำสั่ง']" -->
|
||||||
|
<q-select
|
||||||
|
outlined
|
||||||
|
class="full-width inputgreen cursor-pointer"
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
borderless
|
||||||
|
v-model="formData.commandName"
|
||||||
|
:label="`${'ประเภทคำสั่ง'}`"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
:options="commandCodeOptions"
|
||||||
|
option-value="id"
|
||||||
|
hide-bottom-space
|
||||||
|
use-input
|
||||||
|
hide-selected
|
||||||
|
fill-input
|
||||||
|
input-debounce="0"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||||
<q-input
|
<q-input
|
||||||
class="full-width inputgreen cursor-pointer"
|
class="full-width inputgreen cursor-pointer"
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,9 @@ const baseColumns = ref<QTableColumn[]>([
|
||||||
label: "ประเภทคำสั่ง",
|
label: "ประเภทคำสั่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "commandCode",
|
field: "commandCode",
|
||||||
|
format(val, row) {
|
||||||
|
return row.commandName;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -804,7 +807,7 @@ function onClikcHistory(id: string) {
|
||||||
*/
|
*/
|
||||||
function onRefCommand(data: ResListSalary) {
|
function onRefCommand(data: ResListSalary) {
|
||||||
modalCommand.value = true;
|
modalCommand.value = true;
|
||||||
command.value = data.refCommandNo;
|
command.value = `${data.commandNo}/${Number(data.commandYear) + 543}`;
|
||||||
commandId.value = data.commandId;
|
commandId.value = data.commandId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -206,6 +206,9 @@ const baseColumns = ref<QTableColumn[]>([
|
||||||
label: "ประเภทคำสั่ง",
|
label: "ประเภทคำสั่ง",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "commandCode",
|
field: "commandCode",
|
||||||
|
format(val, row) {
|
||||||
|
return row.commandName;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a: string, b: string) =>
|
||||||
|
|
@ -794,7 +797,7 @@ const classInput = (val: boolean) => {
|
||||||
|
|
||||||
function onRefCommand(data: ResListSalary) {
|
function onRefCommand(data: ResListSalary) {
|
||||||
modalCommand.value = true;
|
modalCommand.value = true;
|
||||||
command.value = data.refCommandNo;
|
command.value = `${data.commandNo}/${Number(data.commandYear) + 543}`;
|
||||||
commandId.value = data.commandId;
|
commandId.value = data.commandId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ interface DatAssistance {
|
||||||
agency: string;
|
agency: string;
|
||||||
commandNo: string;
|
commandNo: string;
|
||||||
document: string;
|
document: string;
|
||||||
|
commandName: string;
|
||||||
// isUpload: boolean;
|
// isUpload: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ interface ResActingPosData {
|
||||||
interface ResAssistanceData {
|
interface ResAssistanceData {
|
||||||
agency: string;
|
agency: string;
|
||||||
commandNo: string;
|
commandNo: string;
|
||||||
|
commandName: string;
|
||||||
commandId: string;
|
commandId: string;
|
||||||
createdAt: Date | null;
|
createdAt: Date | null;
|
||||||
createdFullName: string;
|
createdFullName: string;
|
||||||
|
|
|
||||||
|
|
@ -80,11 +80,11 @@ const baseItemsMenu = ref<DataOptionSys[]>([
|
||||||
name: "ช่วยราชการ",
|
name: "ช่วยราชการ",
|
||||||
system: "SYS_TEMPDUTY",
|
system: "SYS_TEMPDUTY",
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: "2",
|
// id: "2",
|
||||||
name: "ส่งตัวกลับ",
|
// name: "ส่งตัวกลับ",
|
||||||
system: "SYS_TEMPDUTY2",
|
// system: "SYS_TEMPDUTY2",
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
id: "3",
|
id: "3",
|
||||||
name: "แต่งตั้ง-เลื่อน-ย้าย",
|
name: "แต่งตั้ง-เลื่อน-ย้าย",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue