Merge branch 'develop' into devTee

# Conflicts:
#	src/modules/18_command/components/DialogCreateCommandORG.vue
This commit is contained in:
setthawutttty 2024-10-21 13:54:57 +07:00
commit 1b6bb495a5
10 changed files with 317 additions and 247 deletions

View file

@ -36,7 +36,8 @@ const isStaff = defineModel<boolean>("isStaff");
const rootId = defineModel<string>("rootId");
const props = defineProps({
commandTypeCode: String, //
commandTypeCode: { type: String, defult: "" }, //
commandTypeCodeArray: { type: Array, defult: [] }, //
systemName: String, //
orgPublishDate: { type: Date || undefined, defult: undefined },
});
@ -168,16 +169,23 @@ function closeModal() {
isCheckOrgPublishDate.value = false;
rows.value = [];
selected.value = [];
commandType.value = "";
}
/** ฟังก์ชันดึงข้อมูลคำสั่ง */
async function fetchCommandType() {
const data = await storeCommand.getCommandTypes(); // get store
// filter code
commandOp.value = await data.filter(
(v: ListCommand) => v.code == props.commandTypeCode
);
commandType.value = commandOp.value[0].id;
if (props.systemName === "SALARY" || props.systemName === "SALARY_EMP") {
commandOp.value = await data.filter((v: ListCommand) =>
props.commandTypeCodeArray?.includes(v.code)
);
} else {
commandOp.value = await data.filter(
(v: ListCommand) => v.code == props.commandTypeCode
);
commandType.value = commandOp.value[0].id;
}
}
/**
@ -210,20 +218,31 @@ function getPerson() {
type: group.value,
};
const pathAPI =
props.systemName === "ORGANIZATION"
? config.API.orgPosReport
: props.systemName === "SALARY"
? config.API.orgPosReport
: props.systemName === "SALARY_EMP"
? config.API.orgPosReport
: props.systemName === "ACTING"
? config.API.orgPosReport
: "";
showLoader();
http
.post(config.API.orgPosReport, body)
.post(pathAPI, body)
.then((res) => {
const data = res.data.result;
rows.value = data;
selected.value = data; //select all
hideLoader();
selected.value = rows.value;
})
.catch((e) => {
messageError($q, e);
hideLoader();
})
.finally(() => {});
.finally(() => {
hideLoader();
});
}
watch(modal, async () => {
@ -264,10 +283,18 @@ watch(modal, async () => {
emit-value
map-options
lazy-rules
use-input
hide-bottom-space
outlined
readonly
:readonly="
props.systemName !== 'SALARY' &&
props.systemName !== 'SALARY_EMP'
"
:class="
props.systemName === 'SALARY' ||
props.systemName === 'SALARY_EMP'
? 'inputgreen'
: ''
"
>
<template v-slot:no-option>
<q-item>