แก้ไขขอโอน รับโอน รายการช่วยราชการ รายการส่งตัวกลับ รายการลาออก

This commit is contained in:
Thanit Konmek 2023-08-22 15:24:49 +07:00
parent a3eabec197
commit 9505fb5dbb
14 changed files with 789 additions and 107 deletions

View file

@ -82,6 +82,7 @@
label="แก้ไข"
style="width: 80px"
@click="edit = !edit"
v-if="!(status == 'REPORT' || status == 'DONE')"
/>
</div>
<div class="q-gutter-sm" v-else>
@ -616,7 +617,7 @@ const title = ref<ResponseTitle>({
positionTypeOld: "",
});
const value = ref<number>(123554);
const status = ref<string>("");
const myForm = ref<QForm | null>(null);
const edit = ref<boolean>(false);
@ -790,6 +791,7 @@ const getData = async () => {
posNo.value = data.positionNumberOld ?? "";
salary.value = data.amountOld ?? 0;
reason.value = data.reason ?? "";
status.value = data.status ?? "";
await calRetire(new Date(dateToISO(new Date(data.dateOfBirth))));
dateBefore.value = new Date(data.dateOfBirth);

View file

@ -2,12 +2,13 @@
import { ref, computed, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useTransferDataStore } from "@/modules/05_placement/store";
import http from "@/plugins/http";
import config from "@/app.config";
import { useRouter } from "vue-router";
import DialogFooter from "@/modules/05_placement/components/Receive/DialogFooter.vue";
import DialogHeader from "@/modules/05_placement/components/Receive/DialogHeader.vue";
import DialogOrgTree from "@/modules/05_placement/components/Receive/receiveModal.vue";
@ -20,6 +21,8 @@ import type {
const $q = useQuasar();
const router = useRouter();
const mixin = useCounterMixin(); //
const transferStore = useTransferDataStore();
const { statusText } = transferStore;
const {
showLoader,
hideLoader,
@ -34,6 +37,11 @@ const selected = ref<ResponseRow[]>([]);
const modal = ref<boolean>(false);
const popup = () => {
const row = filters.value.filter(
(r: ResponseRow) =>
r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
);
rows2.value = row;
modal.value = true;
};
@ -46,6 +54,8 @@ const visibleColumns = ref<string[]>([
"fullname",
"organizationName",
"birthday",
"dateText",
"statusText",
]);
const visibleColumns2 = ref<string[]>([
@ -54,6 +64,8 @@ const visibleColumns2 = ref<string[]>([
"fullname",
"organizationName",
"birthday",
"dateText",
"statusText",
]); //
const filterKeyword = ref<string>("");
const filterKeyword2 = ref<string>("");
@ -96,6 +108,8 @@ const columns = ref<QTableProps["columns"]>([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "citizenId",
@ -105,6 +119,8 @@ const columns = ref<QTableProps["columns"]>([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@ -114,6 +130,8 @@ const columns = ref<QTableProps["columns"]>([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationName",
@ -134,6 +152,31 @@ const columns = ref<QTableProps["columns"]>([
field: "birthday",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateText",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "dateText",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
sortOrder: "da",
},
{
name: "statusText",
align: "left",
label: "สถานะ",
sortable: true,
field: "statusText",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
const columns2 = ref<QTableProps["columns"]>([
@ -145,6 +188,8 @@ const columns2 = ref<QTableProps["columns"]>([
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "citizenId",
@ -154,6 +199,8 @@ const columns2 = ref<QTableProps["columns"]>([
field: "citizenId",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fullname",
@ -163,6 +210,8 @@ const columns2 = ref<QTableProps["columns"]>([
field: "fullname",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "organizationName",
@ -183,6 +232,31 @@ const columns2 = ref<QTableProps["columns"]>([
field: "birthday",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "dateText",
align: "left",
label: "วันที่ดำเนินการ",
sortable: true,
field: "dateText",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
sortOrder: "da",
},
{
name: "statusText",
align: "left",
label: "สถานะ",
sortable: true,
field: "statusText",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
@ -218,8 +292,12 @@ const fecthlistRecevice = async () => {
positionPath: e.positionPath,
birthday: e.dateOfBirth == null ? "-" : 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) : "-",
});
});
// console.log(list);
rows.value = list;
filters.value = list;
})
@ -243,12 +321,6 @@ const checkSelected = computed(() => {
}
});
const row = filters.value.filter(
(r: ResponseRow) =>
r.status == "WAITTING" || r.status == "PENDING" || r.status == "APPROVE"
);
rows2.value = row;
const add = () => {
router.push(`/receive/add`);
};
@ -465,6 +537,20 @@ const saveOrder = async () => {
>
{{ props.row.birthday }}
</q-td>
<q-td
key="dateText"
:props="props"
@click="nextPage(props.row)"
>
{{ props.row.dateText }}
</q-td>
<q-td
key="statusText"
:props="props"
@click="nextPage(props.row)"
>
{{ props.row.statusText }}
</q-td>
<q-td auto-width>
<q-btn
icon="mdi-dots-vertical"
@ -483,6 +569,10 @@ const saveOrder = async () => {
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"
@ -490,7 +580,12 @@ const saveOrder = async () => {
class="q-py-sm"
>
<q-icon
color="primary"
:color="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
? 'grey'
: 'primary'
"
size="xs"
name="mdi-bookmark-outline"
/>
@ -503,6 +598,10 @@ const saveOrder = async () => {
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"
@ -510,7 +609,16 @@ const saveOrder = async () => {
class="q-py-sm"
>
<q-tooltip>ลบขอม</q-tooltip>
<q-icon color="red" size="xs" name="mdi-delete" />
<q-icon
:color="
props.row.status == 'REPORT' ||
props.row.status == 'DONE'
? 'grey'
: 'red'
"
size="xs"
name="mdi-delete"
/>
</q-item-section>
<q-item-section>ลบ</q-item-section>
</q-item>
@ -660,6 +768,16 @@ const saveOrder = async () => {
<q-td key="birthday" :props="props" @click="nextPage(props.row)">
{{ props.row.birthday }}
</q-td>
<q-td key="dateText" :props="props" @click="nextPage(props.row)">
{{ props.row.dateText }}
</q-td>
<q-td
key="statusText"
:props="props"
@click="nextPage(props.row)"
>
{{ props.row.statusText }}
</q-td>
</q-tr>
</template>
</d-table>