ดักค่าว่าง การออกคำสั่ง บรรจุ
This commit is contained in:
parent
c072e8dc61
commit
eba56761ce
10 changed files with 776 additions and 232 deletions
|
|
@ -52,8 +52,15 @@ const popup = () => {
|
|||
(r.status == "WAITTING" ||
|
||||
r.status == "PENDING" ||
|
||||
r.status == "APPROVE") &&
|
||||
r.positionNumber != null
|
||||
r.positionNumber != null &&
|
||||
r.educationOld &&
|
||||
r.organizationPositionOld &&
|
||||
r.positionTypeOld &&
|
||||
r.positionLevelOld &&
|
||||
r.positionNumberOld &&
|
||||
r.amountOld !== null
|
||||
);
|
||||
|
||||
rows2.value = row;
|
||||
modal.value = true;
|
||||
};
|
||||
|
|
@ -147,27 +154,28 @@ const columns = ref<QTableProps["columns"]>([
|
|||
},
|
||||
]);
|
||||
|
||||
//save file
|
||||
//save file
|
||||
const SaveData = async () => {
|
||||
myForm.value.validate().then((result: boolean) => {
|
||||
if (result) {
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await clickCloseUpload();
|
||||
hideLoader();
|
||||
|
||||
});
|
||||
}})};
|
||||
const formData = new FormData();
|
||||
formData.append("File", files.value);
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.receiveFile(personalId.value), formData)
|
||||
.then(() => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(async () => {
|
||||
await clickCloseUpload();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const fecthlistRecevice = async () => {
|
||||
showLoader();
|
||||
|
|
@ -175,6 +183,7 @@ const fecthlistRecevice = async () => {
|
|||
.get(config.API.receiveData())
|
||||
.then((res: any) => {
|
||||
const response = res.data.result;
|
||||
|
||||
listRecevice.value = response;
|
||||
let list: ResponseRow[] = [];
|
||||
response.map((e: ResponseData) => {
|
||||
|
|
@ -194,12 +203,23 @@ const fecthlistRecevice = async () => {
|
|||
organizationShortName: e.organizationShortName,
|
||||
positionNumber: e.positionNumber,
|
||||
positionPath: e.positionPath,
|
||||
birthday: e.dateOfBirth == null ? "-" : date2Thai(e.dateOfBirth) &&
|
||||
e.dateOfBirth.toString() === "0001-01-01T00:00:00" ? "-" : date2Thai(e.dateOfBirth),
|
||||
birthday:
|
||||
e.dateOfBirth == null
|
||||
? "-"
|
||||
: date2Thai(e.dateOfBirth) &&
|
||||
e.dateOfBirth.toString() === "0001-01-01T00:00:00"
|
||||
? "-"
|
||||
: date2Thai(e.dateOfBirth),
|
||||
status: e.status,
|
||||
statusText: statusText(e.status ?? ""),
|
||||
createdAt: e.createdAt !== null ? new Date(e.createdAt) : null,
|
||||
dateText: e.createdAt !== null ? date2Thai(e.createdAt) : "-",
|
||||
educationOld: e.educationOld ?? "",
|
||||
organizationPositionOld: e.organizationPositionOld ?? "",
|
||||
positionTypeOld: e.positionTypeOld,
|
||||
positionLevelOld: e.positionLevelOld,
|
||||
positionNumberOld: e.positionNumberOld,
|
||||
amountOld: e.amountOld,
|
||||
});
|
||||
});
|
||||
rows.value = list;
|
||||
|
|
@ -231,7 +251,7 @@ const clickClose = () => {
|
|||
// ปิดโมเดลอัปเดตไฟล์
|
||||
const clickCloseUpload = () => {
|
||||
modalupload.value = false;
|
||||
files.value = null
|
||||
files.value = null;
|
||||
};
|
||||
// ปิดโมเดลโครงสร้าง
|
||||
const openModalTree = (id: string) => {
|
||||
|
|
@ -292,26 +312,62 @@ onMounted(() => {
|
|||
<q-btn flat round color="primary" @click="add" icon="mdi-plus">
|
||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||
</q-btn>
|
||||
<q-btn size="14px" flat round color="add" icon="mdi-account-arrow-right" @click="popup()" >
|
||||
<q-btn
|
||||
size="14px"
|
||||
flat
|
||||
round
|
||||
color="add"
|
||||
icon="mdi-account-arrow-right"
|
||||
@click="popup()"
|
||||
>
|
||||
<q-tooltip>ส่งไปออกคำสั่งรับโอน</q-tooltip>
|
||||
</q-btn>
|
||||
<q-space />
|
||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword"
|
||||
ref="filterRef" outlined debounce="300" placeholder="ค้นหา" >
|
||||
<q-input
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
standout
|
||||
dense
|
||||
v-model="filterKeyword"
|
||||
ref="filterRef"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
>
|
||||
<template v-slot:append>
|
||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
||||
<q-icon v-if="filterKeyword !== ''" name="clear" class="cursor-pointer" @click="resetFilter" />
|
||||
<q-icon
|
||||
v-if="filterKeyword !== ''"
|
||||
name="clear"
|
||||
class="cursor-pointer"
|
||||
@click="resetFilter"
|
||||
/>
|
||||
</template>
|
||||
</q-input>
|
||||
<q-select v-model="visibleColumns" multiple outlined dense options-dense
|
||||
:display-value="$q.lang.table.columns" emit-value map-options
|
||||
:options="columns" option-value="name" options-cover style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm" />
|
||||
<q-select
|
||||
v-model="visibleColumns"
|
||||
multiple
|
||||
outlined
|
||||
dense
|
||||
options-dense
|
||||
:display-value="$q.lang.table.columns"
|
||||
emit-value
|
||||
map-options
|
||||
:options="columns"
|
||||
option-value="name"
|
||||
options-cover
|
||||
style="min-width: 150px"
|
||||
class="col-xs-12 col-sm-3 col-md-2 q-ml-sm"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="col-12 q-pt-sm">
|
||||
<d-table :columns="columns" :rows="rows" :filter="filterKeyword" row-key="fullname"
|
||||
:visible-columns="visibleColumns" >
|
||||
<d-table
|
||||
:columns="columns"
|
||||
:rows="rows"
|
||||
:filter="filterKeyword"
|
||||
row-key="fullname"
|
||||
:visible-columns="visibleColumns"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||
|
|
@ -322,25 +378,60 @@ onMounted(() => {
|
|||
</template>
|
||||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td key="no" :props="props" @click="nextPage(props.row.personalId)">
|
||||
<q-td
|
||||
key="no"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.rowIndex + 1 }}
|
||||
</q-td>
|
||||
<q-td key="citizenId" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="citizenId"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.citizenId }}
|
||||
</q-td>
|
||||
<q-td key="fullname" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="fullname"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.fullname }}
|
||||
</q-td>
|
||||
<q-td key="organizationName" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<div v-if=" props.row.orgName !== null || props.row.positionPath !== null " >
|
||||
<q-td
|
||||
key="organizationName"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
<div
|
||||
v-if="
|
||||
props.row.orgName !== null ||
|
||||
props.row.positionPath !== null
|
||||
"
|
||||
>
|
||||
<div class="col-4">
|
||||
<div class="text-weight-medium">
|
||||
{{ props.row.orgName !== null ? props.row.orgName : "-" }}
|
||||
{{ props.row.organizationShortName !== null ? `(${props.row.organizationShortName})` : "" }}
|
||||
{{
|
||||
props.row.orgName !== null ? props.row.orgName : "-"
|
||||
}}
|
||||
{{
|
||||
props.row.organizationShortName !== null
|
||||
? `(${props.row.organizationShortName})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
<div class="text-weight-light">
|
||||
{{ props.row.positionPath !== null ? props.row.positionPath : "-" }}
|
||||
{{ props.row.positionNumber !== null ? `(${props.row.positionNumber})` : "" }}
|
||||
{{
|
||||
props.row.positionPath !== null
|
||||
? props.row.positionPath
|
||||
: "-"
|
||||
}}
|
||||
{{
|
||||
props.row.positionNumber !== null
|
||||
? `(${props.row.positionNumber})`
|
||||
: ""
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -350,46 +441,119 @@ onMounted(() => {
|
|||
</div>
|
||||
</div>
|
||||
</q-td>
|
||||
<q-td key="birthday" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="birthday"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.birthday }}
|
||||
</q-td>
|
||||
<q-td key="dateText" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="dateText"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.dateText }}
|
||||
</q-td>
|
||||
<q-td key="statusText" :props="props" @click="nextPage(props.row.personalId)" >
|
||||
<q-td
|
||||
key="statusText"
|
||||
:props="props"
|
||||
@click="nextPage(props.row.personalId)"
|
||||
>
|
||||
{{ props.row.statusText }}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn icon="mdi-dots-vertical" size="12px" color="grey-7"
|
||||
flat round dense >
|
||||
<q-menu transition-show="jump-down" transition-hide="jump-up" >
|
||||
<q-btn
|
||||
icon="mdi-dots-vertical"
|
||||
size="12px"
|
||||
color="grey-7"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
>
|
||||
<q-menu
|
||||
transition-show="jump-down"
|
||||
transition-hide="jump-up"
|
||||
>
|
||||
<q-list dense style="min-width: 100px">
|
||||
<q-item clickable v-close-popup @click="openModalTree(props.row.personalId)"
|
||||
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " >
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm" >
|
||||
<q-icon :color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'primary' "
|
||||
size="xs" name="mdi-bookmark-outline" />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openModalTree(props.row.personalId)"
|
||||
:disable="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
:color="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'primary'
|
||||
"
|
||||
size="xs"
|
||||
name="mdi-bookmark-outline"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section
|
||||
>เลือกหน่วยงานที่รับโอน</q-item-section
|
||||
>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="openUpload(props.row.personalId)" :disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' ">
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm" >
|
||||
<q-icon size="xs" name="attach_file"
|
||||
:color=" props.row.status == 'REPORT' || props.row.status == 'DONE' ? 'grey' : 'blue' " />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openUpload(props.row.personalId)"
|
||||
:disable="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-icon
|
||||
size="xs"
|
||||
name="attach_file"
|
||||
:color="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'blue'
|
||||
"
|
||||
/>
|
||||
</q-item-section>
|
||||
<q-item-section>อัปโหลดเอกสาร</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="openDelete(props.row.personalId)"
|
||||
:disable=" props.row.status == 'REPORT' || props.row.status == 'DONE' " >
|
||||
<q-item-section style="min-width: 0px" avatar class="q-py-sm" >
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
@click="openDelete(props.row.personalId)"
|
||||
:disable="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE'
|
||||
"
|
||||
>
|
||||
<q-item-section
|
||||
style="min-width: 0px"
|
||||
avatar
|
||||
class="q-py-sm"
|
||||
>
|
||||
<q-tooltip>ลบข้อมูล</q-tooltip>
|
||||
<q-icon
|
||||
:color="
|
||||
props.row.status == 'REPORT' ||
|
||||
props.row.status == 'DONE' ? 'grey' : 'red' "
|
||||
props.row.status == 'DONE'
|
||||
? 'grey'
|
||||
: 'red'
|
||||
"
|
||||
size="xs"
|
||||
name="mdi-delete"
|
||||
/>
|
||||
|
|
@ -423,8 +587,18 @@ onMounted(() => {
|
|||
<q-card-section class="q-py-sm">
|
||||
<div class="col-12 row items-center q-col-gutter-sm">
|
||||
<div class="col-12">
|
||||
<q-file ref="myForm" outlined dense v-model="files" label="อัปโหลดเอกสาร" lazy-rules
|
||||
:rules="[(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน']" hide-bottom-space >
|
||||
<q-file
|
||||
ref="myForm"
|
||||
outlined
|
||||
dense
|
||||
v-model="files"
|
||||
label="อัปโหลดเอกสาร"
|
||||
lazy-rules
|
||||
:rules="[
|
||||
(val) => val || 'กรุณาเลือกไฟล์หนังสือถึงหน่วยงานที่รับโอน',
|
||||
]"
|
||||
hide-bottom-space
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="attach_file" />
|
||||
</template>
|
||||
|
|
@ -435,7 +609,13 @@ onMounted(() => {
|
|||
<q-separator />
|
||||
<div class="row q-px-sm q-py-xs">
|
||||
<q-space />
|
||||
<q-btn flat round color="public" @click="SaveData()" icon="mdi-content-save-outline" >
|
||||
<q-btn
|
||||
flat
|
||||
round
|
||||
color="public"
|
||||
@click="SaveData()"
|
||||
icon="mdi-content-save-outline"
|
||||
>
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue