Merge branch 'develop' into devTee
This commit is contained in:
commit
77ae7e5bed
11 changed files with 1590 additions and 1546 deletions
|
|
@ -92,23 +92,23 @@ const objectPositionSelectRef: FormPositionSelectRef = {
|
|||
/** ฟังก์ชั่นตรวจสอบความถูกต้องของข้อมูลในฟอร์ม */
|
||||
function validateFormPositionEdit() {
|
||||
isDisValidate.value = false;
|
||||
const hasError = [];
|
||||
for (const key in objectPositionSelectRef) {
|
||||
if (Object.prototype.hasOwnProperty.call(objectPositionSelectRef, key)) {
|
||||
const property = objectPositionSelectRef[key];
|
||||
if (property.value && typeof property.value.validate === "function") {
|
||||
const isValid = property.value.validate();
|
||||
hasError.push(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError.every((result) => result === true)) {
|
||||
if (isEditCheck.value == true) {
|
||||
saveSelectEdit();
|
||||
} else {
|
||||
onSubmitSelectEdit();
|
||||
}
|
||||
// const hasError = [];
|
||||
// for (const key in objectPositionSelectRef) {
|
||||
// if (Object.prototype.hasOwnProperty.call(objectPositionSelectRef, key)) {
|
||||
// const property = objectPositionSelectRef[key];
|
||||
// if (property.value && typeof property.value.validate === "function") {
|
||||
// const isValid = property.value.validate();
|
||||
// hasError.push(isValid);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (hasError.every((result) => result === true)) {
|
||||
if (isEditCheck.value == true) {
|
||||
saveSelectEdit();
|
||||
} else {
|
||||
onSubmitSelectEdit();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
function saveSelectEdit() {
|
||||
|
|
@ -313,6 +313,7 @@ watch(
|
|||
if (modal.value === true) {
|
||||
await fetchType();
|
||||
await fetchExecutive();
|
||||
|
||||
if (props.data) {
|
||||
const dataList = props.data;
|
||||
console.log(dataList);
|
||||
|
|
@ -342,7 +343,12 @@ watch(
|
|||
<q-separator />
|
||||
|
||||
<q-card-section class="q-pa-none">
|
||||
<form @submit.prevent="validateFormPositionEdit">
|
||||
<q-form
|
||||
greedy
|
||||
@submit.prevent
|
||||
@validation-success="validateFormPositionEdit"
|
||||
>
|
||||
<!-- @submit.prevent="validateFormPositionEdit" -->
|
||||
<div class="row q-col-gutter-sm col-12 q-pa-sm">
|
||||
<div class="col-12">
|
||||
<q-input
|
||||
|
|
@ -517,7 +523,7 @@ watch(
|
|||
color="public"
|
||||
/>
|
||||
</q-card-actions>
|
||||
</form>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,6 @@ function onSubmit() {
|
|||
level.value !== 0 ? formData.orgLevelSub : undefined,
|
||||
[nameId]: rootId,
|
||||
};
|
||||
console.log(body);
|
||||
|
||||
if (actionType.value === "ADD") {
|
||||
await http
|
||||
|
|
@ -375,7 +374,6 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
|||
for="#ocNo"
|
||||
:label="level == 0 ? 'รหัสหน่วยงาน' : 'รหัสส่วนราชการ'"
|
||||
hide-bottom-space
|
||||
class="inputNumber"
|
||||
:rules="[
|
||||
(val) =>
|
||||
!!val ||
|
||||
|
|
@ -482,14 +480,4 @@ function selectOrgLevele(val: string, status: boolean = true) {
|
|||
</template>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.inputNumber >>> input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
.inputNumber >>> input::-webkit-outer-spin-button,
|
||||
.inputNumber >>> input::-webkit-inner-spin-button {
|
||||
appearance: none;
|
||||
-webkit-appearance: none;
|
||||
-moz-appearance: none;
|
||||
}
|
||||
</style>
|
||||
<style scoped></style>
|
||||
|
|
|
|||
|
|
@ -544,8 +544,6 @@ watch(
|
|||
);
|
||||
|
||||
async function addPosition(data: RowDetailPositions) {
|
||||
console.log(data);
|
||||
|
||||
const isIdExist = await rows.value.some(
|
||||
(item: any) =>
|
||||
item.posExecutiveId == data.posExecutiveId &&
|
||||
|
|
@ -817,7 +815,7 @@ async function emitSearch(keyword: string, typeSelect: string) {
|
|||
flat
|
||||
round
|
||||
color="teal"
|
||||
@click="() => (modalAdd = true)"
|
||||
@click="() => ((modalAdd = true), (dataCopy = null))"
|
||||
><q-tooltip>สร้างตำแหน่ง</q-tooltip></q-btn
|
||||
>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ import http from "@/plugins/http";
|
|||
import config from "@/app.config";
|
||||
|
||||
interface ArrayFileList {
|
||||
id:string
|
||||
pathName:string
|
||||
fileName:string
|
||||
id: string;
|
||||
pathName: string;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
|
|
@ -40,7 +40,14 @@ const fileList = ref<ArrayFileList[]>([]);
|
|||
const $q = useQuasar(); // show dialog
|
||||
const mixin = useCounterMixin();
|
||||
const route = useRoute();
|
||||
const { success, messageError, showLoader, dialogConfirm, hideLoader,dialogRemove } = mixin;
|
||||
const {
|
||||
success,
|
||||
messageError,
|
||||
showLoader,
|
||||
dialogConfirm,
|
||||
hideLoader,
|
||||
dialogRemove,
|
||||
} = mixin;
|
||||
const profileId = ref<string>(
|
||||
route.params.personalId ? route.params.personalId.toString() : ""
|
||||
);
|
||||
|
|
@ -51,30 +58,28 @@ const file = ref<any>([]);
|
|||
const name = ref<string>("");
|
||||
const dataMain = ref<any>([]);
|
||||
|
||||
|
||||
|
||||
// const getData = async () => {
|
||||
// if (props.datainformation) {
|
||||
// dataMain.value = props.datainformation;
|
||||
// files.value = dataMain.value.docs;
|
||||
// }
|
||||
|
||||
// โค้ดเก่ายังไม่ได้ใช้
|
||||
// if (profileId.value) {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.profilePaperId(profileId.value))
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// files.value = data;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
// โค้ดเก่ายังไม่ได้ใช้
|
||||
// if (profileId.value) {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .get(config.API.profilePaperId(profileId.value))
|
||||
// .then((res) => {
|
||||
// const data = res.data.result;
|
||||
// files.value = data;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(() => {
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
// };
|
||||
|
||||
const deleteData = async (id: string) => {
|
||||
|
|
@ -229,7 +234,7 @@ async function uploadFileDoc(uploadUrl: string, file: any) {
|
|||
* ดาวน์โหลดลิงค์ไฟล์
|
||||
* @param fileName file name
|
||||
*/
|
||||
function downloadFile(fileName: string) {
|
||||
function downloadFile(fileName: string) {
|
||||
showLoader();
|
||||
http
|
||||
.get(
|
||||
|
|
@ -269,7 +274,6 @@ function deleteFile(fileName: string) {
|
|||
)
|
||||
)
|
||||
.then((res) => {
|
||||
|
||||
setTimeout(() => {
|
||||
getData();
|
||||
success($q, `ลบไฟล์สำเร็จ`);
|
||||
|
|
@ -286,7 +290,7 @@ function deleteFile(fileName: string) {
|
|||
}
|
||||
|
||||
async function getData() {
|
||||
showLoader()
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.file("ระบบบรรจุ แต่งตั้ง", "เอกสารหลักฐาน", profileId.value)
|
||||
|
|
@ -298,17 +302,16 @@ async function getData() {
|
|||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader()
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await getData();
|
||||
});
|
||||
|
||||
</script>
|
||||
<template>
|
||||
<q-card flat bordered class="col-12 row q-px-lg q-py-md">
|
||||
<q-card flat bordered class="col-12 q-px-lg q-py-md q-mt-md no-border">
|
||||
<HeaderTop
|
||||
v-model:edit="edit"
|
||||
header="เอกสารหลักฐาน"
|
||||
|
|
@ -318,8 +321,7 @@ onMounted(async () => {
|
|||
:disable="statusEdit"
|
||||
:save="uploadData"
|
||||
/>
|
||||
<q-card class="row col-12">
|
||||
|
||||
<q-card class="row col-12">
|
||||
<div class="row col-12 q-col-gutter-y-sm q-pa-sm">
|
||||
<div class="col-12 row">
|
||||
<q-file
|
||||
|
|
|
|||
|
|
@ -139,8 +139,6 @@ function updateSelected(data: TreeMain) {
|
|||
const isAll = ref<boolean>(false);
|
||||
const isBlank = ref<boolean>(false);
|
||||
async function fetchDataTable(id: string, level: number = 0) {
|
||||
console.log(props.dataRow);
|
||||
|
||||
showLoader();
|
||||
const body = {
|
||||
node: level,
|
||||
|
|
@ -196,9 +194,6 @@ async function fetchPosFind(level: number, id: string) {
|
|||
.post(config.API.orgPosFind, body)
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
|
||||
console.log(props?.dataRow);
|
||||
|
||||
expanded.value = data;
|
||||
nodeId.value = id;
|
||||
positionId.value = props?.dataRow?.posmasterId;
|
||||
|
|
@ -224,7 +219,6 @@ async function onClickSubmit() {
|
|||
} else {
|
||||
dialogConfirm($q, async () => {
|
||||
showLoader();
|
||||
|
||||
const body = {
|
||||
personalId: props?.dataRow?.personalId,
|
||||
node: dataPosMaster.node,
|
||||
|
|
@ -239,6 +233,7 @@ async function onClickSubmit() {
|
|||
posLevelId: selectedPos.value[0].posLevelId, //ชื่อตำแหน่ง
|
||||
posLevelName: selectedPos.value[0].posLevelName, //ชื่อตำแหน่ง
|
||||
reportingDate: datePos.value,
|
||||
posmasterId: dataPosMaster.id,
|
||||
typeCommand: props.typeCommand,
|
||||
};
|
||||
|
||||
|
|
@ -277,8 +272,6 @@ watch(
|
|||
() => modal.value,
|
||||
async () => {
|
||||
if (modal.value) {
|
||||
console.log(props?.dataRow);
|
||||
|
||||
await fetchOrganizationActive();
|
||||
if (props?.dataRow?.node !== null && props?.dataRow?.nodeId !== null) {
|
||||
await fetchPosFind(props?.dataRow?.node, props?.dataRow?.nodeId);
|
||||
|
|
@ -319,22 +312,18 @@ function filterNodeFn(data: any, id: string) {
|
|||
watch(
|
||||
() => isAll.value,
|
||||
(value, oldVal) => {
|
||||
console.log("value", value);
|
||||
console.log("oldVal", oldVal);
|
||||
isAll.value = value;
|
||||
|
||||
fetchDataTable(nodeId.value, nodeLevel.value);
|
||||
if (value !== oldVal) {
|
||||
fetchDataTable(nodeId.value, nodeLevel.value);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => isBlank.value,
|
||||
(value, oldVal) => {
|
||||
console.log("isBlank value", value);
|
||||
console.log("isBlank oldVal", oldVal);
|
||||
isBlank.value = value;
|
||||
|
||||
fetchDataTable(nodeId.value, nodeLevel.value);
|
||||
if (value !== oldVal) {
|
||||
fetchDataTable(nodeId.value, nodeLevel.value);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -234,14 +234,14 @@ function convertBmaOfficer(val: string) {
|
|||
* แปลงสถานะบรรจุ
|
||||
* @param val type
|
||||
*/
|
||||
function convertContainStatus(val: string) {
|
||||
function convertContainStatus(val: string, type: string = "") {
|
||||
switch (val) {
|
||||
case "UN-CONTAIN":
|
||||
return "ยังไม่บรรจุ";
|
||||
case "PREPARE-CONTAIN":
|
||||
return "เตรียมบรรจุ";
|
||||
return "เตรียม" + (type != "" ? type : "บรรจุ");
|
||||
case "CONTAIN":
|
||||
return "บรรจุแล้ว";
|
||||
return (type != "" ? type : "บรรจุ") + "แล้ว";
|
||||
case "DISCLAIM":
|
||||
return "สละสิทธิ์";
|
||||
default:
|
||||
|
|
@ -249,6 +249,21 @@ function convertContainStatus(val: string) {
|
|||
}
|
||||
}
|
||||
|
||||
function convertTypeCommand(val: string) {
|
||||
switch (val) {
|
||||
case "APPOINTED":
|
||||
return "บรรจุแต่งตั้ง";
|
||||
case "APPOINT":
|
||||
return "แต่งตั้ง";
|
||||
case "SLIP":
|
||||
return "เลื่อน";
|
||||
case "MOVE":
|
||||
return "ย้าย";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* แปลงสถานะการส่งรายชื่อ
|
||||
* @param val true/false
|
||||
|
|
@ -322,7 +337,11 @@ async function getTable() {
|
|||
posLevelCandidateName: data.posLevelCandidateName,
|
||||
posmasterId: data.posmasterId,
|
||||
|
||||
statusName: convertContainStatus(data.statusId),
|
||||
statusName:
|
||||
convertContainStatus(data.statusId) +
|
||||
(data.typeCommand != ""
|
||||
? convertTypeCommand(data.typeCommand)
|
||||
: ""),
|
||||
organizationName:
|
||||
data.root +
|
||||
" " +
|
||||
|
|
@ -854,7 +873,9 @@ onMounted(async () => {
|
|||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
(roleAdmin && props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.bmaOfficer !== 'บุคคลภายนอก' &&
|
||||
roleAdmin &&
|
||||
props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.statusId !== 'DISCLAIM')
|
||||
"
|
||||
|
|
@ -884,7 +905,9 @@ onMounted(async () => {
|
|||
|
||||
<q-item
|
||||
v-if="
|
||||
(roleAdmin && props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.bmaOfficer !== 'บุคคลภายนอก' &&
|
||||
roleAdmin &&
|
||||
props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.statusId !== 'DISCLAIM')
|
||||
"
|
||||
|
|
@ -910,7 +933,9 @@ onMounted(async () => {
|
|||
|
||||
<q-item
|
||||
v-if="
|
||||
(roleAdmin && props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.bmaOfficer !== 'บุคคลภายนอก' &&
|
||||
roleAdmin &&
|
||||
props.row.statusId === 'UN-CONTAIN') ||
|
||||
(props.row.draft === 'รอส่งตัว' &&
|
||||
props.row.statusId !== 'DISCLAIM')
|
||||
"
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ export const useSelectOrgStore = defineStore("selectorg", () => {
|
|||
isPosition: e.isPosition,
|
||||
posMasterNo:
|
||||
e.orgShortname +
|
||||
e.posMasterNoPrefix +
|
||||
(e.posMasterNoPrefix != null ? e.posMasterNoPrefix : "") +
|
||||
e.posMasterNo +
|
||||
e.posMasterNoSuffix,
|
||||
(e.posMasterNoSuffix != null ? e.posMasterNoSuffix : ""),
|
||||
positionName: e.positionName,
|
||||
posTypeName: e.posTypeName,
|
||||
posLevelName: e.posLevelName,
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -130,8 +130,6 @@ const getCommandDetail = async () => {
|
|||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -96,22 +96,22 @@ function fetchData() {
|
|||
formData.developmentProjectTechniqueActuals =
|
||||
data.developmentProjectTechniqueActuals;
|
||||
formData.projectModalPlanned = data.projectModalPlanned;
|
||||
expanded.value = [
|
||||
const arrayExpanded = [
|
||||
data.strategyChild1Planned,
|
||||
data.strategyChild2Planned,
|
||||
data.strategyChild3Planned,
|
||||
data.strategyChild4Planned,
|
||||
data.strategyChild5Planned,
|
||||
];
|
||||
expanded2.value = [
|
||||
const arrayExpanded2 = [
|
||||
data.strategyChild1Actual,
|
||||
data.strategyChild2Actual,
|
||||
data.strategyChild3Actual,
|
||||
data.strategyChild4Actual,
|
||||
data.strategyChild5Actual,
|
||||
];
|
||||
const filteredArray = expanded.value.filter((item) => item !== null);
|
||||
const filteredArray2 = expanded2.value.filter((item) => item !== null);
|
||||
const filteredArray = arrayExpanded.filter((item) => item !== null);
|
||||
const filteredArray2 = arrayExpanded2.filter((item) => item !== null);
|
||||
const lastItem = filteredArray[filteredArray.length - 1];
|
||||
const lastItem2 = filteredArray2[filteredArray2.length - 1];
|
||||
formData.strategyChildPlannedId =
|
||||
|
|
@ -122,6 +122,9 @@ function fetchData() {
|
|||
lastItem2 !== undefined ? lastItem2 : null;
|
||||
formData.strategyChildActualNode =
|
||||
lastItem2 !== undefined ? filteredArray2.length : null;
|
||||
|
||||
expanded.value = arrayExpanded.filter((e) => e !== null).slice(0, -1);
|
||||
expanded2.value = arrayExpanded2.filter((e) => e !== null).slice(0, -1);
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
|
|
|
|||
|
|
@ -359,20 +359,20 @@ onMounted(() => {
|
|||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th auto-width />
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<span class="text-weight-medium">{{ col.label }}</span>
|
||||
</q-th>
|
||||
<q-th auto-width />
|
||||
</q-tr>
|
||||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td>
|
||||
<q-icon
|
||||
v-if="props.row.isDone"
|
||||
name="mdi-check"
|
||||
color="green"
|
||||
size="xs"
|
||||
v-if="props.row.isDone"
|
||||
>
|
||||
<q-tooltip>ส่งไปบันทึกที่ทะเบียนประวัติแล้ว</q-tooltip>
|
||||
</q-icon>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue