Compare commits
13 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
926c47f273 | ||
|
|
d6e75d6966 | ||
|
|
170568384d | ||
|
|
7f25ed4ef1 | ||
|
|
8a0a6ea873 | ||
| 833718d276 | |||
| 73335d7dd5 | |||
|
|
07659ecc6c | ||
|
|
9d9cd92d6b | ||
|
|
40ebaa646f | ||
|
|
c700cf0abd | ||
|
|
b0b834cb9b | ||
|
|
0d5cb36fb2 |
9 changed files with 100 additions and 38 deletions
|
|
@ -27,6 +27,7 @@ export default {
|
|||
placementDefermentInfo: (id: string) => `${placement}/pass/deferment/${id}`,
|
||||
placementDisclaimInfo: (id: string) => `${placement}/pass/disclaim/${id}`,
|
||||
placementUpdatePass: `${placement}/pass/update-status`,
|
||||
placementUpdateDraftStatus: `${placement}/update/draft-status`,
|
||||
|
||||
//personal
|
||||
placementPersonalId: (personalId: string) =>
|
||||
|
|
|
|||
|
|
@ -402,6 +402,7 @@ const modalDialogSalary = ref<boolean>(false); //แสดง popup ตำแห
|
|||
const isStatusEdit = ref<boolean>(false); //สถานะแก้ไขข้อมูลตำแหน่งเงินเดือน
|
||||
const salaryId = ref<string>(""); //id ที่ต้องการแก้ไข
|
||||
const dataLevel = ref<DataPosType[]>([]); //รายการ ตำแหน่งเงินเดือน
|
||||
const idCommandId = ref<boolean>(false); //เช็คว่ามี commandId หรือไม่
|
||||
|
||||
const commandCodeOptions = ref<DataOption[]>(store.commandCodeData); //รายการปรเภทคำสั่ง
|
||||
const posTypeOptions = ref<DataOption[]>(store.posTypeData); //รายการประเภทตำแหน่ง | กลุ่มงาน
|
||||
|
|
@ -658,6 +659,7 @@ async function onClickOpenDialog(
|
|||
} else {
|
||||
await fetchOptionGroup();
|
||||
}
|
||||
idCommandId.value = statusEdit ? (data.commandId ? true : false) : false;
|
||||
commandCodeOptions.value = store.commandCodeData;
|
||||
posTypeOptions.value = store.posTypeData;
|
||||
posLevelOptions.value = store.posLevelData;
|
||||
|
|
@ -978,6 +980,7 @@ onMounted(async () => {
|
|||
<q-tooltip>ประวัติแก้ไขตำแหน่ง/เงินเดือน</q-tooltip>
|
||||
</q-btn>
|
||||
|
||||
<!-- :disable="(props.row.commandId !== null && props.row.commandId !== '') || props.row.commandType === 'C-PM-47'" -->
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
|
|
@ -985,11 +988,7 @@ onMounted(async () => {
|
|||
checkPermission($route)?.attrOwnership === 'OWNER'
|
||||
"
|
||||
flat
|
||||
:disable="
|
||||
(props.row.commandId !== null && props.row.commandId !== '') ||
|
||||
props.row.commandType === 'C-PM-47'
|
||||
"
|
||||
:color="props.row.commandId ? 'grey' : 'edit'"
|
||||
color="edit"
|
||||
dense
|
||||
round
|
||||
icon="edit"
|
||||
|
|
@ -1154,7 +1153,8 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="classInput(true)"
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -1174,7 +1174,8 @@ onMounted(async () => {
|
|||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
class="inputgreen"
|
||||
:class="classInput(!idCommandId)"
|
||||
:disabled="idCommandId"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -1191,6 +1192,8 @@ onMounted(async () => {
|
|||
: formData.commandYear + 543
|
||||
"
|
||||
label="ปี พ.ศ."
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ const keyword = ref<string>(""); //คำค้นหา
|
|||
const modalCommand = ref<boolean>(false);
|
||||
const command = ref<string>("");
|
||||
const commandId = ref<string>("");
|
||||
const idCommandId = ref<boolean>(false); //สถานะการมีคำสั่ง
|
||||
const baseColumns = ref<QTableColumn[]>([
|
||||
{
|
||||
name: "commandDateAffect",
|
||||
|
|
@ -638,6 +639,7 @@ async function onClickOpenDialog(
|
|||
} else {
|
||||
await fetchOptionGroup();
|
||||
}
|
||||
idCommandId.value = statusEdit && data.commandId ? true : false;
|
||||
commandCodeOptions.value = store.commandCodeData;
|
||||
posTypeOptions.value = store.posTypeData;
|
||||
posLevelOptions.value = store.posLevelData;
|
||||
|
|
@ -939,6 +941,10 @@ onMounted(async () => {
|
|||
>
|
||||
<q-tooltip>ประวัติแก้ไขตำแหน่ง/เงินเดือน</q-tooltip>
|
||||
</q-btn>
|
||||
<!-- :disable="
|
||||
(props.row.commandId !== null && props.row.commandId !== '') ||
|
||||
props.row.commandType === 'C-PM-47'
|
||||
" -->
|
||||
<q-btn
|
||||
v-if="
|
||||
!isLeave &&
|
||||
|
|
@ -946,11 +952,7 @@ onMounted(async () => {
|
|||
checkPermission($route)?.attrOwnership === 'OWNER'
|
||||
"
|
||||
flat
|
||||
:disable="
|
||||
(props.row.commandId !== null && props.row.commandId !== '') ||
|
||||
props.row.commandType === 'C-PM-47'
|
||||
"
|
||||
:color="props.row.commandId ? 'grey' : 'edit'"
|
||||
color="edit"
|
||||
dense
|
||||
round
|
||||
icon="edit"
|
||||
|
|
@ -1119,7 +1121,8 @@ onMounted(async () => {
|
|||
<div class="row q-col-gutter-sm">
|
||||
<div class="col-6">
|
||||
<q-input
|
||||
:class="classInput(true)"
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
|
|
@ -1139,7 +1142,8 @@ onMounted(async () => {
|
|||
autoApply
|
||||
year-picker
|
||||
:enableTimePicker="false"
|
||||
class="inputgreen"
|
||||
:class="classInput(!idCommandId)"
|
||||
:disable="idCommandId"
|
||||
>
|
||||
<template #year="{ year }">{{ year + 543 }}</template>
|
||||
<template #year-overlay-value="{ value }">{{
|
||||
|
|
@ -1156,6 +1160,8 @@ onMounted(async () => {
|
|||
: formData.commandYear + 543
|
||||
"
|
||||
label="ปี พ.ศ."
|
||||
:class="classInput(!idCommandId)"
|
||||
:readonly="idCommandId"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon
|
||||
|
|
|
|||
|
|
@ -967,6 +967,28 @@ function onUpdateStatus(id: string) {
|
|||
);
|
||||
}
|
||||
|
||||
function onUpdateDraftStatus(id: string) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
showLoader();
|
||||
try {
|
||||
await http.post(config.API.placementUpdateDraftStatus, {
|
||||
personalId: id,
|
||||
});
|
||||
await success($q, "บันทึกสำเร็จ");
|
||||
await getTable();
|
||||
} catch (error) {
|
||||
messageError($q, error);
|
||||
} finally {
|
||||
hideLoader();
|
||||
}
|
||||
},
|
||||
"ยืนยันการยกเลิกการส่งตัว",
|
||||
"ต้องการยกเลิกการส่งตัวรายชื่อนี้ใช่หรือไม่ ?"
|
||||
);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getWorkFlow();
|
||||
await getTable();
|
||||
|
|
@ -1029,6 +1051,30 @@ onMounted(async () => {
|
|||
</q-item-section>
|
||||
<q-item-section>รายละเอียด</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
checkPermission($route)?.attrIsUpdate &&
|
||||
props.row.isDraft &&
|
||||
props.row.statusId === 'PREPARE-CONTAIN' &&
|
||||
(DataStore.isOfficer || checkPermission($route)?.attrOwnership == 'OWNER')
|
||||
"
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="onUpdateDraftStatus(props.row.personalId)"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
color="red"
|
||||
size="xs"
|
||||
name="mdi-account-arrow-left-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>ยกเลิกการส่งตัว</q-item-section>
|
||||
</q-item>
|
||||
|
||||
<q-item
|
||||
v-if="
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ async function fetchDataRetirement() {
|
|||
firstNameTH: filter.value.firstNameTH.trim(),
|
||||
lastNameTH: filter.value.lastNameTH.trim(),
|
||||
});
|
||||
const data: RetirementOld = response.data.data;
|
||||
const data: RetirementOld = response.data.result;
|
||||
pagination.value.rowsNumber = data.totalRecords;
|
||||
rows.value = data.dataRecords;
|
||||
} catch (error) {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ let formData = reactive<FormDataDetail>({
|
|||
});
|
||||
const commandVolume = ref<string>(""); //เล่มที่
|
||||
const commandChapter = ref<string>(""); //ตอนที่
|
||||
const isIdofficer = ref<boolean>(false); //เช็ค สกจ.
|
||||
|
||||
const rows = ref<Array<DataOperators>>([]);
|
||||
const columns = ref<QTableProps["columns"]>([
|
||||
|
|
@ -114,17 +113,7 @@ const visibleColumns = ref<Array<string>>([
|
|||
|
||||
const modalAddOperator = ref<boolean>(false); // แสดงเพิ่มรายชื่อลงนามในแนบท้ายคำสั่ง
|
||||
|
||||
/** ฟังก์ชันเช็ค สกจ.*/
|
||||
async function fetchCheckIdofficer() {
|
||||
await http
|
||||
.get(config.API.checkIdofficer)
|
||||
.then((res) => {
|
||||
isIdofficer.value = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ฟังก์ชันบันทึกข้อมูลรายละเอียดคำสั่ง
|
||||
|
|
@ -133,7 +122,7 @@ async function fetchCheckIdofficer() {
|
|||
async function onSubmit() {
|
||||
//ถ้าเป็น สกจ. ต้องเลือกประเภทคำสั่งด้วย
|
||||
if (
|
||||
isIdofficer.value &&
|
||||
store.isIdofficer &&
|
||||
formData.isBangkok !== "BANGKOK" &&
|
||||
formData.isBangkok !== "OFFICE"
|
||||
) {
|
||||
|
|
@ -225,7 +214,6 @@ function onDeleteData(id: string) {
|
|||
onMounted(async () => {
|
||||
try {
|
||||
showLoader();
|
||||
await fetchCheckIdofficer();
|
||||
await fetchDataOperatorList();
|
||||
formData.commandNo = props.formCommandList.commandNo;
|
||||
formData.commandYear = props.formCommandList.commandYear;
|
||||
|
|
@ -235,7 +223,7 @@ onMounted(async () => {
|
|||
formData.issue = props.formCommandList.issue;
|
||||
formData.commandAffectDate = props.formCommandList.commandAffectDate;
|
||||
formData.commandExcecuteDate = props.formCommandList.commandExcecuteDate;
|
||||
formData.isBangkok = !isIdofficer.value
|
||||
formData.isBangkok = !store.isIdofficer
|
||||
? null
|
||||
: props.formCommandList.isBangkok;
|
||||
commandCode.value = props.formCommandList.commandCode;
|
||||
|
|
@ -500,7 +488,7 @@ onMounted(async () => {
|
|||
|
||||
<div
|
||||
class="col-12 q-gutter-sm"
|
||||
v-if="isIdofficer && commandCode !== 'C-PM-47'"
|
||||
v-if="store.isIdofficer && commandCode !== 'C-PM-47'"
|
||||
>
|
||||
<q-radio
|
||||
:disable="store.readonly"
|
||||
|
|
|
|||
|
|
@ -292,7 +292,10 @@ function onConfirmOrder() {
|
|||
if (
|
||||
store?.dataCommand?.commandNo !== "" &&
|
||||
store?.dataCommand?.commandAffectDate !== null &&
|
||||
store?.dataCommand?.commandExcecuteDate !== null
|
||||
store?.dataCommand?.commandExcecuteDate !== null &&
|
||||
(!store.isIdofficer ||
|
||||
store?.dataCommand?.isBangkok === "BANGKOK" ||
|
||||
store?.dataCommand?.isBangkok === "OFFICE")
|
||||
) {
|
||||
dialogConfirm(
|
||||
$q,
|
||||
|
|
@ -316,10 +319,10 @@ function onConfirmOrder() {
|
|||
"คุณต้องการยืนยันการส่งออกคำสั่งใช่หรือไม่?"
|
||||
);
|
||||
} else {
|
||||
dialogMessageNotify(
|
||||
$q,
|
||||
"ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ"
|
||||
);
|
||||
const messageWarning = !store.isIdofficer
|
||||
? "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม และวันที่คำสั่งมีผลให้ครบ"
|
||||
: "ไม่สามารถดำเนินการต่อได้ กรุณากรอกเลขที่คำสั่ง วันที่ลงนาม วันที่คำสั่งมีผล และเลือกคำสั่งให้ครบ";
|
||||
dialogMessageNotify($q, messageWarning);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
|
|||
const readonly = ref<boolean>(false);
|
||||
const dataCommand = ref<FormDataDetail>();
|
||||
const status = ref<string>("");
|
||||
const isSalary = ref<boolean>(false)
|
||||
const isSalary = ref<boolean>(false);
|
||||
const isIdofficer = ref<boolean>(false);
|
||||
function checkStep(val: string) {
|
||||
status.value = val;
|
||||
switch (val) {
|
||||
|
|
@ -39,6 +40,7 @@ export const useCommandDetail = defineStore("commandDetailStore", () => {
|
|||
readonly,
|
||||
status,
|
||||
dataCommand,
|
||||
isSalary
|
||||
isSalary,
|
||||
isIdofficer,
|
||||
};
|
||||
});
|
||||
|
|
|
|||
|
|
@ -92,12 +92,25 @@ async function fetchDataCommandList() {
|
|||
});
|
||||
}
|
||||
|
||||
/** ฟังก์ชันเช็ค สกจ.*/
|
||||
async function fetchCheckIdofficer() {
|
||||
await http
|
||||
.get(config.API.checkIdofficer)
|
||||
.then((res) => {
|
||||
store.isIdofficer = res.data.result;
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* ทำงานเมื่อ Components ถูกเรียกใช้งาน
|
||||
* กำหนดค่า `store.readonly` เมื่อ route.name เป็น "commandViewDetailPage" จะอ่านข้อมูลได้อย่างเดียว
|
||||
*/
|
||||
onMounted(async () => {
|
||||
await fetchDataCommandList();
|
||||
await fetchCheckIdofficer();
|
||||
store.readonly =
|
||||
route.name === "commandViewDetailPage" ||
|
||||
formCommandList.status === "REPORTED" ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue