แก้โค้ดตาม issue

This commit is contained in:
STW_TTTY\stwtt 2024-07-09 10:39:49 +07:00
parent 3968d2b1a0
commit bb6afbb98e
12 changed files with 323 additions and 252 deletions

View file

@ -11,31 +11,31 @@ export const apiUrlConfigReport = import.meta.env.VITE_API_REPORT_URL;
const config = ref<any>({ const config = ref<any>({
development: { development: {
// API_URI: "http://localhost:13001/api/v1", // API_URI: "http://localhost:13001/api/v1",
API_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_URI: "https://bma-ehr.frappet.com/api/v1",
// API_URI_ORG_SERVICE: "https://localhost:7056/api/v1", //ใช้ชั่วคราว // API_URI_ORG_SERVICE: "https://localhost:7056/api/v1", //ใช้ชั่วคราว
API_URI_ORG_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว API_URI_ORG_SERVICE: "https://bma-ehr.frappet.com/api/v1", //ใช้ชั่วคราว
// API_URI_ORG_EMPLOYEE_SERVICE: "https://localhost:7208/api/v1", //ใช้ชั่วคราว // API_URI_ORG_EMPLOYEE_SERVICE: "https://localhost:7208/api/v1", //ใช้ชั่วคราว
API_URI_ORG_EMPLOYEE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว API_URI_ORG_EMPLOYEE_SERVICE: "https://bma-ehr.frappet.com/api/v1", //ใช้ชั่วคราว
// API_URI_PROFILE_SERVICE: "https://localhost:7159/api/v1", // API_URI_PROFILE_SERVICE: "https://localhost:7159/api/v1",
API_URI_PROFILE_SERVICE: "https://bma-ehr.frappet.synology.me/api/v1", //ใช้ชั่วคราว API_URI_PROFILE_SERVICE: "https://bma-ehr.frappet.com/api/v1", //ใช้ชั่วคราว
// API_CANDIDATE_URI: "https://localhost:7007/api/v1", // API_CANDIDATE_URI: "https://localhost:7007/api/v1",
API_CANDIDATE_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_CANDIDATE_URI: "https://bma-ehr.frappet.com/api/v1",
// API_REPORT_URI: "https://localhost:7187/api/v1", // API_REPORT_URI: "https://localhost:7187/api/v1",
API_REPORT_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_REPORT_URI: "https://bma-ehr.frappet.com/api/v1",
// API_PLACEMENT_URI: "https://localhost:7260/api", // API_PLACEMENT_URI: "https://localhost:7260/api",
API_PLACEMENT_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_PLACEMENT_URI: "https://bma-ehr.frappet.com/api/v1",
API_URI_ORG_TREE: API_URI_ORG_TREE:
"https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json", "https://s3cluster.frappet.com/bma-ehr-fpt/organization/strueture/tree_20230712_172702.json",
MEET_URI: "meet.frappet.com", MEET_URI: "meet.frappet.com",
API_RETIREMENT_URI: "https://bma-ehr.frappet.synology.me/api/v1", API_RETIREMENT_URI: "https://bma-ehr.frappet.com/api/v1",
// API_PROBATION_URI: "https://ehr.joolsoft.com/v1", // API_PROBATION_URI: "https://ehr.joolsoft.com/v1",
API_PROBATION_URI: "https://bma-ehr.frappet.synology.me/api/v1/probation", API_PROBATION_URI: "https://bma-ehr.frappet.com/api/v1/probation",
// API_PROBATION_URI: "http://192.168.1.151:7776/v1", // API_PROBATION_URI: "http://192.168.1.151:7776/v1",
API_REPORT2_URI: "https://bma-ehr.frappet.synology.me/api/v2", API_REPORT2_URI: "https://bma-ehr.frappet.synology.me/api/v2",
LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me", LINK_EVALUATE_PUBLISH: "https://bma-ehr-publish.frappet.synology.me",
API_REPORT_TEMPLATE_URI: API_REPORT_TEMPLATE_URI:
"https://report-server.frappet.synology.me/api/v1/report-template", "https://report-server.frappet.synology.me/api/v1/report-template",
API_SUPPORT_URI: "https://bma-ehr.frappet.synology.me/api/v1/support", API_SUPPORT_URI: "https://bma-ehr.frappet.com/api/v1/support",
}, },
test: { test: {
API_URI: "http://localhost:5010/api/v1", API_URI: "http://localhost:5010/api/v1",

View file

@ -1706,52 +1706,50 @@ const fetchData = async () => {
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rows.value = []; rows.value = [];
data.map((e: any) => { rows.value = data.map((e: any) => ({
rows.value.push({ id: e.id,
id: e.id, date: new Date(e.date),
date: new Date(e.date), amount: e.amount,
amount: e.amount, positionSalaryAmount: e.positionSalaryAmount,
positionSalaryAmount: e.positionSalaryAmount, mouthSalaryAmount: e.mouthSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount, oc: e.oc,
oc: e.oc, ocId: e.ocId,
ocId: e.ocId, position: e.position,
position: e.position, positionName: e.positionName,
positionName: e.positionName, positionId:
positionId: e.positionId !== "00000000-0000-0000-0000-000000000000"
e.positionId !== "00000000-0000-0000-0000-000000000000" ? e.positionId
? e.positionId : "",
: "", posNo: e.posNo,
posNo: e.posNo, posNoId:
posNoId: e.posNoId !== "00000000-0000-0000-0000-000000000000"
e.posNoId !== "00000000-0000-0000-0000-000000000000" ? e.posNoId
? e.posNoId : "",
: "", positionLine: e.positionLine,
positionLine: e.positionLine, positionLineName: e.positionLineName,
positionLineName: e.positionLineName, positionLineId: e.positionLineId,
positionLineId: e.positionLineId, positionPathSide: e.positionPathSide,
positionPathSide: e.positionPathSide, positionPathSideId: e.positionPathSideId,
positionPathSideId: e.positionPathSideId, positionPathSideName: e.positionPathSideName,
positionPathSideName: e.positionPathSideName, positionType: e.positionType,
positionType: e.positionType, positionTypeId: e.positionTypeId,
positionTypeId: e.positionTypeId, positionLevelId: e.positionLevelId,
positionLevelId: e.positionLevelId, positionLevel: e.positionLevel,
positionLevel: e.positionLevel, positionExecutive: e.positionExecutive,
positionExecutive: e.positionExecutive, positionExecutiveId: e.positionExecutiveId,
positionExecutiveId: e.positionExecutiveId, positionExecutiveName: e.positionExecutiveName,
positionExecutiveName: e.positionExecutiveName, positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSide: e.positionExecutiveSide, positionExecutiveSideId: e.positionExecutiveSideId,
positionExecutiveSideId: e.positionExecutiveSideId, salaryClass: e.salaryClass,
salaryClass: e.salaryClass, salaryRef: e.salaryRef,
salaryRef: e.salaryRef, salaryStatus: e.salaryStatus,
salaryStatus: e.salaryStatus, refCommandNo: e.refCommandNo,
refCommandNo: e.refCommandNo, createdFullName: e.createdFullName,
createdFullName: e.createdFullName, orgName: e.orgName,
orgName: e.orgName, agencyName: e.agencyName,
agencyName: e.agencyName, cLevel: e.cLevel,
cLevel: e.cLevel, createdAt: new Date(e.createdAt),
createdAt: new Date(e.createdAt), }));
});
});
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -2257,46 +2255,44 @@ const clickHistory = async (row: RequestItemsObject) => {
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: any) => { rowsHistory.value = data.map((e: any) => ({
rowsHistory.value.push({ id: e.id,
id: e.id, date: new Date(e.date),
date: new Date(e.date), amount: e.amount,
amount: e.amount, positionSalaryAmount: e.positionSalaryAmount,
positionSalaryAmount: e.positionSalaryAmount, mouthSalaryAmount: e.mouthSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount, oc: e.oc,
oc: e.oc, ocId: e.ocId,
ocId: e.ocId, position: e.position,
position: e.position, positionId: e.positionId,
positionId: e.positionId, positionName: e.positionName,
positionName: e.positionName, posNo: e.posNo,
posNo: e.posNo, posNoId: e.posNoId,
posNoId: e.posNoId, positionLine: e.positionLine,
positionLine: e.positionLine, positionLineName: e.positionLineName,
positionLineName: e.positionLineName, positionLineId: e.positionLineId,
positionLineId: e.positionLineId, positionPathSide: e.positionPathSide,
positionPathSide: e.positionPathSide, positionPathSideId: e.positionPathSideId,
positionPathSideId: e.positionPathSideId, positionPathSideName: e.positionPathSideName,
positionPathSideName: e.positionPathSideName, positionType: e.positionType,
positionType: e.positionType, positionTypeId: e.positionTypeId,
positionTypeId: e.positionTypeId, positionLevel: e.positionLevel,
positionLevel: e.positionLevel, positionLevelId: e.positionLevelId,
positionLevelId: e.positionLevelId, positionExecutive: e.positionExecutive,
positionExecutive: e.positionExecutive, positionExecutiveId: e.positionExecutiveId,
positionExecutiveId: e.positionExecutiveId, positionExecutiveName: e.positionExecutiveName,
positionExecutiveName: e.positionExecutiveName, positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSide: e.positionExecutiveSide, positionExecutiveSideId: e.positionExecutiveSideId,
positionExecutiveSideId: e.positionExecutiveSideId, salaryClass: e.salaryClass,
salaryClass: e.salaryClass, salaryStatus: e.salaryStatus,
salaryStatus: e.salaryStatus, salaryRef: e.salaryRef,
salaryRef: e.salaryRef, refCommandNo: e.refCommandNo,
refCommandNo: e.refCommandNo, createdFullName: e.createdFullName,
createdFullName: e.createdFullName, orgName: e.orgName,
orgName: e.orgName, agencyName: e.agencyName,
agencyName: e.agencyName, cLevel: e.cLevel,
cLevel: e.cLevel, createdAt: new Date(e.createdAt),
createdAt: new Date(e.createdAt), }));
});
});
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -299,6 +299,8 @@ function deleteProductivitys(item: number) {
} }
} }
/** get ข้อมูล */ /** get ข้อมูล */
async function getUser() { async function getUser() {
await http await http
@ -980,17 +982,18 @@ watch(knowledge.value, () => {
* @param update fn * @param update fn
*/ */
function filterFnCaretaker(val: string, update: any) { function filterFnCaretaker(val: string, update: any) {
const dataFilter = filtermantor(OPcaretaker.value, [caretaker2.value]).filter(
(i: any) => i.id !== chairman.value.id
);
if (val == "") { if (val == "") {
update(() => { update(() => {
optionCaretaker.value = filtermantor(OPcaretaker.value, [ optionCaretaker.value = dataFilter;
caretaker2.value,
]);
}); });
} else { } else {
update(() => { update(() => {
optionCaretaker.value = filtermantor(OPcaretaker.value, [ optionCaretaker.value = dataFilter.filter(
caretaker2.value, (e: any) => e.name.search(val) !== -1
]).filter((e: any) => e.name.search(val) !== -1); );
}); });
} }
} }
@ -1002,17 +1005,18 @@ function filterFnCaretaker(val: string, update: any) {
*/ */
function filterFnCaretaker2(val: string, update: any) { function filterFnCaretaker2(val: string, update: any) {
const dataFilter = filtermantor(OPcaretaker.value, [caretaker1.value]).filter(
(i: any) => i.id !== chairman.value.id
);
if (val == "") { if (val == "") {
update(() => { update(() => {
optionCaretaker2.value = filtermantor(OPcaretaker.value, [ optionCaretaker2.value = dataFilter;
caretaker1.value,
]);
}); });
} else { } else {
update(() => { update(() => {
optionCaretaker2.value = filtermantor(OPcaretaker.value, [ optionCaretaker2.value = dataFilter.filter(
caretaker1.value, (e: any) => e.name.search(val) !== -1
]).filter((e: any) => e.name.search(val) !== -1); );
}); });
} }
} }
@ -1024,13 +1028,16 @@ function filterFnCaretaker2(val: string, update: any) {
*/ */
function filterFnCommander(val: string, update: any) { function filterFnCommander(val: string, update: any) {
const dataFilter = OPcommander.value.filter(
(i: any) => i.id !== chairman.value.id
);
if (val == "") { if (val == "") {
update(() => { update(() => {
OPcommanderFn.value = OPcommander.value; OPcommanderFn.value = dataFilter;
}); });
} else { } else {
update(() => { update(() => {
OPcommanderFn.value = OPcommander.value.filter( OPcommanderFn.value = dataFilter.filter(
(e: any) => e.name.search(val) !== -1 (e: any) => e.name.search(val) !== -1
); );
}); });
@ -1044,13 +1051,19 @@ function filterFnCommander(val: string, update: any) {
*/ */
function filterFnChairman(val: string, update: any) { function filterFnChairman(val: string, update: any) {
const dataFilter = OPchairman.value.filter(
(i: any) =>
i.id !== caretaker1.value.id &&
i.id !== caretaker2.value.id &&
i.id !== commander.value.id
);
if (val == "") { if (val == "") {
update(() => { update(() => {
OPchairmanFn.value = OPchairman.value; OPchairmanFn.value = dataFilter;
}); });
} else { } else {
update(() => { update(() => {
OPchairmanFn.value = OPchairman.value.filter( OPchairmanFn.value = dataFilter.filter(
(e: any) => e.name.search(val) !== -1 (e: any) => e.name.search(val) !== -1
); );
}); });

View file

@ -972,39 +972,37 @@ const fetchData = async () => {
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rows.value = []; rows.value = [];
data.map((e: ResponseObject) => { rows.value = data.map((e: ResponseObject) => ({
rows.value.push({ id: e.id,
id: e.id, date: new Date(e.date),
date: new Date(e.date), amount: e.amount,
amount: e.amount, positionSalaryAmount: e.positionSalaryAmount,
positionSalaryAmount: e.positionSalaryAmount, mouthSalaryAmount: e.mouthSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount, oc: e.oc,
oc: e.oc, ocId: e.ocId,
ocId: e.ocId, position: e.position,
position: e.position, positionId: e.positionId,
positionId: e.positionId, posNo: e.posNo,
posNo: e.posNo, posNoId: e.posNoId,
posNoId: e.posNoId, positionLine: e.positionLine,
positionLine: e.positionLine, positionLineId: e.positionLineId,
positionLineId: e.positionLineId, positionPathSide: e.positionPathSide,
positionPathSide: e.positionPathSide, positionPathSideId: e.positionPathSideId,
positionPathSideId: e.positionPathSideId, positionType: e.positionType,
positionType: e.positionType, positionTypeId: e.positionTypeId,
positionTypeId: e.positionTypeId, positionLevel: e.positionLevel,
positionLevel: e.positionLevel, positionLevelId: e.positionLevelId,
positionLevelId: e.positionLevelId, positionExecutive: e.positionExecutive,
positionExecutive: e.positionExecutive, positionExecutiveId: e.positionExecutiveId,
positionExecutiveId: e.positionExecutiveId, positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSide: e.positionExecutiveSide, positionExecutiveSideId: e.positionExecutiveSideId,
positionExecutiveSideId: e.positionExecutiveSideId, salaryClass: e.salaryClass,
salaryClass: e.salaryClass, salaryRef: e.salaryRef,
salaryRef: e.salaryRef, salaryStatus: e.salaryStatus,
salaryStatus: e.salaryStatus, refCommandNo: e.refCommandNo,
refCommandNo: e.refCommandNo, createdFullName: e.createdFullName,
createdFullName: e.createdFullName, createdAt: new Date(e.createdAt),
createdAt: new Date(e.createdAt), }));
});
});
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
@ -1450,39 +1448,37 @@ const clickHistory = async (row: RequestItemsObject) => {
.then((res) => { .then((res) => {
let data = res.data.result; let data = res.data.result;
rowsHistory.value = []; rowsHistory.value = [];
data.map((e: ResponseObject) => { rowsHistory.value = data.map((e: ResponseObject) => ({
rowsHistory.value.push({ id: e.id,
id: e.id, date: new Date(e.date),
date: new Date(e.date), amount: e.amount,
amount: e.amount, positionSalaryAmount: e.positionSalaryAmount,
positionSalaryAmount: e.positionSalaryAmount, mouthSalaryAmount: e.mouthSalaryAmount,
mouthSalaryAmount: e.mouthSalaryAmount, oc: e.oc,
oc: e.oc, ocId: e.ocId,
ocId: e.ocId, position: e.position,
position: e.position, positionId: e.positionId,
positionId: e.positionId, posNo: e.posNo,
posNo: e.posNo, posNoId: e.posNoId,
posNoId: e.posNoId, positionLine: e.positionLine,
positionLine: e.positionLine, positionLineId: e.positionLineId,
positionLineId: e.positionLineId, positionPathSide: e.positionPathSide,
positionPathSide: e.positionPathSide, positionPathSideId: e.positionPathSideId,
positionPathSideId: e.positionPathSideId, positionType: e.positionType,
positionType: e.positionType, positionTypeId: e.positionTypeId,
positionTypeId: e.positionTypeId, positionLevel: e.positionLevel,
positionLevel: e.positionLevel, positionLevelId: e.positionLevelId,
positionLevelId: e.positionLevelId, positionExecutive: e.positionExecutive,
positionExecutive: e.positionExecutive, positionExecutiveId: e.positionExecutiveId,
positionExecutiveId: e.positionExecutiveId, positionExecutiveSide: e.positionExecutiveSide,
positionExecutiveSide: e.positionExecutiveSide, positionExecutiveSideId: e.positionExecutiveSideId,
positionExecutiveSideId: e.positionExecutiveSideId, salaryClass: e.salaryClass,
salaryClass: e.salaryClass, salaryRef: e.salaryRef,
salaryRef: e.salaryRef, refCommandNo: e.refCommandNo,
refCommandNo: e.refCommandNo, salaryStatus: e.salaryStatus,
salaryStatus: e.salaryStatus, createdFullName: e.createdFullName,
createdFullName: e.createdFullName, createdAt: new Date(e.createdAt),
createdAt: new Date(e.createdAt), }));
});
});
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);

View file

@ -899,6 +899,7 @@ const getClass = (val: boolean) => {
:rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]" :rules="[(val) => !!val || `${'กรุณากรอก พ.ศ.'}`]"
:label="`${'พ.ศ.'}`" :label="`${'พ.ศ.'}`"
dense dense
hide-bottom-space
outlined outlined
> >
</q-input> </q-input>
@ -927,6 +928,7 @@ const getClass = (val: boolean) => {
:class="getClass(true)" :class="getClass(true)"
outlined outlined
dense dense
hide-bottom-space
class="full-width datepicker" class="full-width datepicker"
:model-value=" :model-value="
dateCommand != null ? date2Thai(dateCommand) : null dateCommand != null ? date2Thai(dateCommand) : null

View file

@ -863,6 +863,7 @@ const title = computed(() => {
autoApply autoApply
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
@update:model-value="formDetail.endDate = null"
> >
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{
@ -906,6 +907,7 @@ const title = computed(() => {
autoApply autoApply
:enableTimePicker="false" :enableTimePicker="false"
week-start="0" week-start="0"
:min-date="formDetail.startDate"
> >
<template #year="{ year }">{{ year + 543 }}</template> <template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{ <template #year-overlay-value="{ value }">{{

View file

@ -349,7 +349,7 @@ onMounted(() => {
<d-table <d-table
ref="table" ref="table"
:columns="columns" :columns="columns"
:rows="rows.length !== 0 ? rows[item.id]:[]" :rows="rows[item.id].length !== 0 ? rows[item.id]:[]"
row-key="id" row-key="id"
flat flat
bordered bordered

View file

@ -441,6 +441,21 @@ onMounted(() => {
<q-separator /> <q-separator />
<q-card-section > <q-card-section >
<div class="row q-col-gutter-sm"> <div class="row q-col-gutter-sm">
<div class="col-12">
<q-input
dense
outlined
class="inputgreen"
label="ชื่อตัวชี้วัด"
v-model="formIndicators.indicators"
hide-bottom-space
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกชื่อตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-6"> <div class="col-6">
<q-select <q-select
dense dense
@ -461,23 +476,9 @@ onMounted(() => {
]" ]"
/> />
</div> </div>
<div class="col-4">
<q-input
dense
outlined
class="inputgreen"
label="ชื่อตัวชี้วัด"
v-model="formIndicators.indicators"
hide-bottom-space
:rules="[
(val:string) =>
!!val || `${'กรุณากรอกชื่อตัวชี้วัด'}`,
]"
/>
</div>
<div class="col-2"> <div class="col-6">
<q-input <q-input
dense dense
outlined outlined

View file

@ -133,7 +133,7 @@ onMounted(() => {
<q-tab-panel name="Target"> <Target /></q-tab-panel> <q-tab-panel name="Target"> <Target /></q-tab-panel>
<q-tab-panel name="ProjectDetail" style="padding: 0px"> <ProjectDetail /> </q-tab-panel> <q-tab-panel name="ProjectDetail" style="padding: 0px"> <ProjectDetail /> </q-tab-panel>
<q-tab-panel name="FollowResult"> <FollowResult /> </q-tab-panel> <q-tab-panel name="FollowResult"> <FollowResult /> </q-tab-panel>
<q-tab-panel name="Other" style="padding: 0px"> <Other /> </q-tab-panel> <q-tab-panel name="Other" style="padding: 0px"> <Other :status="status"/> </q-tab-panel>
<q-tab-panel name="Record"> <Record /> </q-tab-panel> <q-tab-panel name="Record"> <Record /> </q-tab-panel>
</q-tab-panels> </q-tab-panels>
</div> </div>

View file

@ -23,6 +23,7 @@ const {
const route = useRoute(); const route = useRoute();
const projectId = ref<string>(route.params.id.toLocaleString()); const projectId = ref<string>(route.params.id.toLocaleString());
const status = defineModel<string>('status',{required:true})
const provinceOp = ref<DataOption[]>([]); const provinceOp = ref<DataOption[]>([]);
const provinceOpMain = ref<DataOption[]>([]); const provinceOpMain = ref<DataOption[]>([]);
const budgetOp = ref<DataOption[]>([ const budgetOp = ref<DataOption[]>([
@ -475,7 +476,7 @@ onMounted(() => {
reverse-fill-mask reverse-fill-mask
/> />
</div> </div>
<div class="col-3"> <div class="col-3" v-if="status == 'FINISH'">
<q-input <q-input
outlined outlined
dense dense

View file

@ -15,6 +15,11 @@ import { useDevelopmentDataStore } from "@/modules/15_development/store/developm
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
const other1 = ref<boolean>(false);
const other2 = ref<boolean>(false);
const otherInput1 = ref<string>("");
const otherInput2 = ref<string>("");
const $q = useQuasar(); const $q = useQuasar();
const store = useDevelopmentDataStore(); const store = useDevelopmentDataStore();
const route = useRoute(); const route = useRoute();
@ -161,7 +166,9 @@ async function onSubmit() {
projectModal: formData.projectModal, projectModal: formData.projectModal,
isBackPlanned: formData.isBackPlanned, isBackPlanned: formData.isBackPlanned,
isHoldPlanned: formData.isHoldPlanned, isHoldPlanned: formData.isHoldPlanned,
projectDayBackPlanned: formData.isBackPlanned ? formData.projectDayBackPlanned:null, projectDayBackPlanned: formData.isBackPlanned
? formData.projectDayBackPlanned
: null,
projectDayHoldPlanned: formData.projectDayHoldPlanned, projectDayHoldPlanned: formData.projectDayHoldPlanned,
projectNigthHoldPlanned: formData.projectNigthHoldPlanned, projectNigthHoldPlanned: formData.projectNigthHoldPlanned,
developmentProjectTechniquePlanneds: developmentProjectTechniquePlanneds:
@ -206,6 +213,15 @@ function updateSelected(data: DataStrategic, type: string) {
} }
} }
function checkOther(type: number, val: boolean) {
if(val == false){
if(type == 1){
otherInput1.value = ''
}else if(type == 2){
otherInput2.value = ''
}
}
}
/** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */ /** ดึงข้อมูลเมื่อคอมโพเนนต์โหลดเสร็จสมบูรณ์ */
onMounted(() => { onMounted(() => {
fetchData(); fetchData();
@ -232,7 +248,6 @@ onMounted(() => {
/> />
</div> </div>
<q-card bordered class="col-12 q-my-sm"> <q-card bordered class="col-12 q-my-sm">
<div <div
class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md" class="col-xs-12 col-sm-12 text-weight-medium bg-grey-3 q-py-xs q-px-md"
@ -285,7 +300,9 @@ onMounted(() => {
<q-item <q-item
clickable clickable
@click.stop="updateSelected(prop.node, '1')" @click.stop="updateSelected(prop.node, '1')"
:active="formData.strategyChildPlannedId == prop.node.id" :active="
formData.strategyChildPlannedId == prop.node.id
"
active-class="my-list-link text-primary text-weight-medium" active-class="my-list-link text-primary text-weight-medium"
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list" class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
> >
@ -448,7 +465,29 @@ onMounted(() => {
type="checkbox" type="checkbox"
/> />
</div> </div>
<div class="col-12 q-mb-lg">
<div class="row">
<div class="col-4 relative-position">
<div class="other_custom">
<q-checkbox
v-model="other1"
label="อื่นๆ"
size="sm"
color="primary"
keep-color
:disable="store.projectStatus === 'FINISH'"
@update:model-value="checkOther(1, other1)"
/>
</div>
</div>
<div class="col-8 relative-position">
<div class="other_custom_input" v-if="other1 == true">
<q-input v-model="otherInput1" dense outlined label="กรุณากรอก อื่นๆ"></q-input>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4"> <div class="col-12 col-sm-6 col-md-4">
<q-input <q-input
:disable="store.projectStatus === 'FINISH'" :disable="store.projectStatus === 'FINISH'"
@ -534,6 +573,28 @@ onMounted(() => {
type="checkbox" type="checkbox"
/> />
</div> </div>
<div class="col-12 q-mb-lg">
<div class="row">
<div class="col-4 relative-position">
<div class="other_custom">
<q-checkbox
v-model="other2"
label="อื่นๆ"
size="sm"
color="primary"
keep-color
@update:model-value="checkOther(2, other2)"
/>
</div>
</div>
<div class="col-8 relative-position">
<div class="other_custom_input" v-if="other2 == true">
<q-input v-model="otherInput2" dense outlined label="กรุณากรอก อื่นๆ"></q-input>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-6 col-md-4"> <div class="col-12 col-sm-6 col-md-4">
<q-input <q-input
dense dense
@ -573,4 +634,14 @@ onMounted(() => {
font-weight: 600; font-weight: 600;
border: 1px solid rgba(175, 185, 196, 0.217); border: 1px solid rgba(175, 185, 196, 0.217);
} }
.other_custom {
position: absolute;
left: -7px;
top: -29px;
}
.other_custom_input {
position: absolute;
top: -25px;
width: 100%;
}
</style> </style>

View file

@ -1104,6 +1104,47 @@ onMounted(() => {
v-for="(items, index) in formGroupTarget.positions" v-for="(items, index) in formGroupTarget.positions"
class="col-12 row q-col-gutter-sm" class="col-12 row q-col-gutter-sm"
> >
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
class="inputgreen"
v-model="items.posTypeId"
:options="posTypeOp"
option-label="name"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ประเภทตำแหน่ง"
@update:model-value="updatePosTypeName"
/>
</div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
class="inputgreen"
v-model="items.posLevelId"
:options="
posTypeMain.find((v) => items.posTypeId === v.id)
?.posLevels || []
"
option-label="posLevelName"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ระดับตำแหน่ง"
/>
</div>
<div <div
class="col" class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'" v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
@ -1121,58 +1162,6 @@ onMounted(() => {
]" ]"
/> />
</div> </div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
hide-bottom-space
lazy-rules
class="inputgreen"
v-model="items.posTypeId"
:options="posTypeOp"
option-label="name"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ประเภทตำแหน่ง"
@update:model-value="updatePosTypeName"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกประเภทตำแหน่ง'}`,
]"
/>
</div>
<div
class="col"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"
>
<q-select
dense
outlined
hide-bottom-space
lazy-rules
class="inputgreen"
v-model="items.posLevelId"
:options="
posTypeMain.find((v) => items.posTypeId === v.id)
?.posLevels || []
"
option-label="posLevelName"
option-value="id"
emit-value
map-options
input-class="text-red"
label="ระดับตำแหน่ง"
:rules="[
(val:string) =>
!!val || `${'กรุณาเลือกระดับ'}`,
]"
/>
</div>
<div <div
class="col-1 q-mt-sm" class="col-1 q-mt-sm"
v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'" v-if="formGroupTarget.groupTarget !== 'OUTSIDERS'"