แก้ แต่งตั้งคณะกรรมการทดลองงาน
This commit is contained in:
parent
6cb3326ad1
commit
de115abc22
1 changed files with 55 additions and 41 deletions
|
|
@ -58,7 +58,7 @@ const pagination = ref({
|
||||||
const countRowLength = computed(() => {
|
const countRowLength = computed(() => {
|
||||||
return selected.value.length + rows.value.length == 4
|
return selected.value.length + rows.value.length == 4
|
||||||
? true
|
? true
|
||||||
: selected.value.length == 3
|
: selected.value.length == 2
|
||||||
? true
|
? true
|
||||||
: false;
|
: false;
|
||||||
});
|
});
|
||||||
|
|
@ -66,7 +66,8 @@ const countRowLength = computed(() => {
|
||||||
const optionsTypeMain = ref<OpfillterTypeSt[]>([]);
|
const optionsTypeMain = ref<OpfillterTypeSt[]>([]);
|
||||||
const optionsType = ref<OpfillterTypeSt[]>([
|
const optionsType = ref<OpfillterTypeSt[]>([
|
||||||
{ id: "chairman", value: "ประธาน" },
|
{ id: "chairman", value: "ประธาน" },
|
||||||
{ id: "committee", value: "กรรมการ" },
|
{ id: "committee", value: "ผู้บังคับบัญชา" },
|
||||||
|
{ id: "caregiver", value: "ผู้ดูแล" },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const rowsDirector = ref<MemBerType[]>([]);
|
const rowsDirector = ref<MemBerType[]>([]);
|
||||||
|
|
@ -220,7 +221,7 @@ function onAddPerson() {
|
||||||
position: item.position,
|
position: item.position,
|
||||||
positionType: item.posType,
|
positionType: item.posType,
|
||||||
positionLevel: item.posLevel,
|
positionLevel: item.posLevel,
|
||||||
role: member.value == "chairman" ? "chairman" : "committee",
|
role: member.value,
|
||||||
}));
|
}));
|
||||||
rows.value = [...rows.value, ...data];
|
rows.value = [...rows.value, ...data];
|
||||||
rows.value.sort((a, b) => (a.role === "chairman" ? -1 : 1));
|
rows.value.sort((a, b) => (a.role === "chairman" ? -1 : 1));
|
||||||
|
|
@ -229,21 +230,24 @@ function onAddPerson() {
|
||||||
|
|
||||||
async function getPerson() {
|
async function getPerson() {
|
||||||
showLoader();
|
showLoader();
|
||||||
http
|
await http
|
||||||
.post(config.API.orgProfileDirector + `?keyword=${filterKeyword.value}`, {
|
.post(config.API.orgProfileDirector, {
|
||||||
isDirector: isDirector.value,
|
isDirector: isDirector.value,
|
||||||
|
pageSize: pagination.value.rowsPerPage,
|
||||||
|
page: pagination.value.page,
|
||||||
|
keyword: filterKeyword.value,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
const data = res.data.result;
|
const data = await res.data.result.data;
|
||||||
|
const dataTotal = await res.data.result.total;
|
||||||
|
|
||||||
rowsDirector.value = data;
|
rowsDirector.value = data;
|
||||||
rowsDirector.value = rowsDirector.value.filter(
|
rowsDirector.value = rowsDirector.value.filter(
|
||||||
(item: MemBerType) =>
|
(item: MemBerType) =>
|
||||||
!rows.value.some((i: PersonsAppointData) => i.profileId == item.id)
|
!rows.value.some((i: PersonsAppointData) => i.profileId == item.id)
|
||||||
);
|
);
|
||||||
totalList.value = Math.ceil(
|
totalList.value = Math.ceil(dataTotal / pagination.value.rowsPerPage);
|
||||||
res.data.result.total / pagination.value.rowsPerPage
|
total.value = dataTotal;
|
||||||
);
|
|
||||||
total.value = data.total;
|
|
||||||
hideLoader();
|
hideLoader();
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
|
|
@ -263,7 +267,9 @@ function convertText(val: string) {
|
||||||
case "chairman":
|
case "chairman":
|
||||||
return "ประธาน";
|
return "ประธาน";
|
||||||
case "committee":
|
case "committee":
|
||||||
return "กรรมการ";
|
return "ผู้บังคับบัญชา";
|
||||||
|
case "caregiver":
|
||||||
|
return "ผู้ดูแล";
|
||||||
default:
|
default:
|
||||||
"-";
|
"-";
|
||||||
}
|
}
|
||||||
|
|
@ -340,8 +346,8 @@ async function getData() {
|
||||||
.finally(() => {});
|
.finally(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDirector() {
|
async function onDirector() {
|
||||||
getPerson();
|
await getPerson();
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -355,15 +361,17 @@ watch(
|
||||||
if (modal.value) {
|
if (modal.value) {
|
||||||
optionsTypeMain.value = optionsType.value;
|
optionsTypeMain.value = optionsType.value;
|
||||||
const optionData = optionsType.value;
|
const optionData = optionsType.value;
|
||||||
const committeeCount = rows.value.filter(
|
const caregiverCount = rows.value.filter(
|
||||||
(i) => i.role === "committee"
|
(i) => i.role === "caregiver"
|
||||||
).length;
|
).length;
|
||||||
|
|
||||||
optionsTypeMain.value = optionData.filter(
|
optionsTypeMain.value = optionData.filter(
|
||||||
(item: OpfillterTypeSt) =>
|
(item: OpfillterTypeSt) =>
|
||||||
!rows.value.some(
|
!rows.value.some(
|
||||||
(i) => i.role === "chairman" && item.id === "chairman"
|
(i) =>
|
||||||
) && !(item.id === "committee" && committeeCount >= 3)
|
(i.role === "chairman" && item.id === "chairman") ||
|
||||||
|
(i.role === "committee" && item.id === "committee")
|
||||||
|
) && !(item.id === "caregiver" && caregiverCount >= 2)
|
||||||
);
|
);
|
||||||
|
|
||||||
getPerson();
|
getPerson();
|
||||||
|
|
@ -531,6 +539,8 @@ onMounted(async () => {
|
||||||
<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">
|
||||||
|
<div class="row">
|
||||||
<q-checkbox
|
<q-checkbox
|
||||||
keep-color
|
keep-color
|
||||||
v-model="isDirector"
|
v-model="isDirector"
|
||||||
|
|
@ -540,22 +550,6 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<q-tooltip>แสดงเฉพาะผู้อำนวยการ/หัวหน้า </q-tooltip>
|
<q-tooltip>แสดงเฉพาะผู้อำนวยการ/หัวหน้า </q-tooltip>
|
||||||
</q-checkbox>
|
</q-checkbox>
|
||||||
<div class="col-12">
|
|
||||||
<div class="row">
|
|
||||||
<q-select
|
|
||||||
v-model="member"
|
|
||||||
outlined
|
|
||||||
dense
|
|
||||||
label="ประธาน/กรรมการ"
|
|
||||||
:options="optionsTypeMain"
|
|
||||||
option-value="id"
|
|
||||||
option-label="value"
|
|
||||||
map-options
|
|
||||||
emit-value
|
|
||||||
@update:model-value="selected = []"
|
|
||||||
style="width: 300px"
|
|
||||||
>
|
|
||||||
</q-select>
|
|
||||||
<q-space />
|
<q-space />
|
||||||
<q-input
|
<q-input
|
||||||
class="col-xs-12 col-sm-3 col-md-2 q-mr-sm"
|
class="col-xs-12 col-sm-3 col-md-2 q-mr-sm"
|
||||||
|
|
@ -608,7 +602,11 @@ onMounted(async () => {
|
||||||
bordered
|
bordered
|
||||||
:paging="true"
|
:paging="true"
|
||||||
dense
|
dense
|
||||||
:selection="member == 'chairman' ? 'single' : 'multiple'"
|
:selection="
|
||||||
|
member == 'chairman' || member == 'committee'
|
||||||
|
? 'single'
|
||||||
|
: 'multiple'
|
||||||
|
"
|
||||||
v-model:selected="selected"
|
v-model:selected="selected"
|
||||||
:rows-per-page-options="[1, 25, 50, 100]"
|
:rows-per-page-options="[1, 25, 50, 100]"
|
||||||
@update:pagination="updatePagination"
|
@update:pagination="updatePagination"
|
||||||
|
|
@ -670,6 +668,22 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
</d-table>
|
</d-table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
{{ member }}
|
||||||
|
<q-select
|
||||||
|
v-model="member"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
label="ประธาน/กรรมการ"
|
||||||
|
:options="optionsTypeMain"
|
||||||
|
option-value="id"
|
||||||
|
option-label="value"
|
||||||
|
map-options
|
||||||
|
emit-value
|
||||||
|
@update:model-value="selected = []"
|
||||||
|
>
|
||||||
|
</q-select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue