api workflow
This commit is contained in:
parent
079a1c1972
commit
619e93231c
3 changed files with 52 additions and 25 deletions
|
|
@ -7,6 +7,7 @@ import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
|
||||||
import type { QTableProps } from "quasar";
|
import type { QTableProps } from "quasar";
|
||||||
|
import type { DataCommander } from "@/components/Workflow/interface/response/Main";
|
||||||
|
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
|
|
@ -21,16 +22,8 @@ const { stateId, fetchData } = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
/** table*/
|
/** table*/
|
||||||
const selected = ref<any[]>([]);
|
const selected = ref<DataCommander[]>([]);
|
||||||
const rows = ref<any[]>([
|
const rows = ref<DataCommander[]>([]);
|
||||||
{
|
|
||||||
id: "1",
|
|
||||||
fullName: "นายศรัณย์ ศิลาดี",
|
|
||||||
position: "นักบริหาร",
|
|
||||||
posType: "บริหาร(สูง)",
|
|
||||||
organization: "",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
name: "fullName",
|
name: "fullName",
|
||||||
|
|
@ -38,6 +31,9 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
label: "ชื่อ-นามสกุล",
|
label: "ชื่อ-นามสกุล",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
field: "fullName",
|
field: "fullName",
|
||||||
|
format(val, row) {
|
||||||
|
return `${row.prefix}${row.firstName} ${row.lastName}`;
|
||||||
|
},
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
|
@ -50,20 +46,20 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// name: "posType",
|
||||||
|
// align: "left",
|
||||||
|
// label: "ประเภทตำแหน่ง",
|
||||||
|
// sortable: true,
|
||||||
|
// field: "posType",
|
||||||
|
// headerStyle: "font-size: 14px",
|
||||||
|
// style: "font-size: 14px",
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
name: "posType",
|
name: "orgRoot",
|
||||||
align: "left",
|
|
||||||
label: "ประเภทตำแหน่ง",
|
|
||||||
sortable: true,
|
|
||||||
field: "posType",
|
|
||||||
headerStyle: "font-size: 14px",
|
|
||||||
style: "font-size: 14px",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "organization",
|
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สังกัด",
|
label: "สังกัด",
|
||||||
field: "organization",
|
field: "orgRoot",
|
||||||
sortable: true,
|
sortable: true,
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
|
@ -74,8 +70,22 @@ const isAcceptSetting = ref<boolean>(false);
|
||||||
const isApproveSetting = ref<boolean>(false);
|
const isApproveSetting = ref<boolean>(false);
|
||||||
const isReasonSetting = ref<boolean>(false);
|
const isReasonSetting = ref<boolean>(false);
|
||||||
|
|
||||||
function fetchLists() {}
|
async function fetchLists() {
|
||||||
|
showLoader();
|
||||||
|
await http
|
||||||
|
.get(config.API.workflow + `commander`)
|
||||||
|
.then(async (res) => {
|
||||||
|
rows.value = res.data.result;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** ฟังก์ชันยืนยัน*/
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -104,6 +114,9 @@ function onCloseModal() {
|
||||||
modal.value = false;
|
modal.value = false;
|
||||||
selected.value = [];
|
selected.value = [];
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
|
isAcceptSetting.value = false;
|
||||||
|
isApproveSetting.value = false;
|
||||||
|
isReasonSetting.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(modal, (val) => {
|
watch(modal, (val) => {
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ onMounted(async () => {
|
||||||
:color="state < index + 1 ? 'grey-4' : ''"
|
:color="state < index + 1 ? 'grey-4' : ''"
|
||||||
>
|
>
|
||||||
<!-- Darft -->
|
<!-- Darft -->
|
||||||
<div class="row q-col-gutter-sm" v-if="state === 1">
|
<div class="row q-col-gutter-sm" v-if="state === 1 && index === 0">
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="isChangeState"
|
v-if="isChangeState"
|
||||||
|
|
@ -149,7 +149,9 @@ onMounted(async () => {
|
||||||
>
|
>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-item-label
|
<q-item-label
|
||||||
>{{ item.createdFullName }}
|
>{{
|
||||||
|
`${item.prefix}${item.firstName} ${item.lastName}`
|
||||||
|
}}
|
||||||
<!-- {{ `(${item.position})` }} -->
|
<!-- {{ `(${item.position})` }} -->
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
<q-item-label caption lines="2">{{
|
<q-item-label caption lines="2">{{
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,18 @@ interface StateUserComments {
|
||||||
profileId: string;
|
profileId: string;
|
||||||
reason: string;
|
reason: string;
|
||||||
stateId: string;
|
stateId: string;
|
||||||
|
firstName: string;
|
||||||
|
lastName: string;
|
||||||
|
prefix: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { DataListState };
|
interface DataCommander {
|
||||||
|
firstName: string;
|
||||||
|
id: string;
|
||||||
|
lastName: string;
|
||||||
|
orgRoot: string;
|
||||||
|
position: string;
|
||||||
|
prefix: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type { DataListState, DataCommander };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue