Merge branch 'develop' into dev-tee
This commit is contained in:
commit
1cff41d552
9 changed files with 777 additions and 148 deletions
|
|
@ -6,11 +6,13 @@ import config from "@/app.config";
|
||||||
import type { QForm } from "quasar";
|
import type { QForm } from "quasar";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
|
const { showLoader, hideLoader, messageError, date2Thai, dialogMessageNotify } = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
const employeeClass = ref<string>("");
|
const employeeClass = ref<string>("");
|
||||||
|
|
@ -154,7 +156,7 @@ const clickSearch = async (type: string) => {
|
||||||
date: date2Thai(e.date),
|
date: date2Thai(e.date),
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
dialogMessageNotify($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
||||||
rows.value = [];
|
rows.value = [];
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -183,6 +185,9 @@ const filterFn = (val: string, update: any) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const clickRedirect = (id: string) => {
|
||||||
|
router.push(`/registry/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
|
|
@ -353,10 +358,20 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<q-tr :props="props" class="cursor-pointer">
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
||||||
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||||
<q-td key="citizenId" :props="props">{{
|
<q-td
|
||||||
props.row.citizenId
|
key="citizenId"
|
||||||
}}</q-td>
|
class="text-primary"
|
||||||
<q-td key="name" :props="props">{{ props.row.name }}</q-td>
|
@click="clickRedirect(props.row.id)"
|
||||||
|
:props="props"
|
||||||
|
>{{ props.row.citizenId }}</q-td
|
||||||
|
>
|
||||||
|
<q-td
|
||||||
|
key="name"
|
||||||
|
class="text-primary"
|
||||||
|
@click="clickRedirect(props.row.id)"
|
||||||
|
:props="props"
|
||||||
|
>{{ props.row.name }}</q-td
|
||||||
|
>
|
||||||
|
|
||||||
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
||||||
<q-td key="position" :props="props">{{
|
<q-td key="position" :props="props">{{
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@ const commander = ref<any>([]);
|
||||||
const status = ref<boolean>(true);
|
const status = ref<boolean>(true);
|
||||||
|
|
||||||
const saveEdit = (id: string) => {
|
const saveEdit = (id: string) => {
|
||||||
dialogConfirm($q, () => console.log("save"));
|
dialogConfirm($q, async () => {
|
||||||
|
await postData("put");
|
||||||
|
});
|
||||||
};
|
};
|
||||||
const edit = () => {
|
const edit = () => {
|
||||||
status.value = true;
|
status.value = true;
|
||||||
|
|
@ -55,7 +57,7 @@ const fecthAssign = async (id: string) => {
|
||||||
|
|
||||||
director_id.value = res.data.data.chairman.name;
|
director_id.value = res.data.data.chairman.name;
|
||||||
director_id2.value = res.data.data.commander.name;
|
director_id2.value = res.data.data.commander.name;
|
||||||
if(mentors.value.length != 0){
|
if (mentors.value.length != 0) {
|
||||||
director_id3.value = mentors.value[0].name;
|
director_id3.value = mentors.value[0].name;
|
||||||
}
|
}
|
||||||
commander.value = res.data.data.commander;
|
commander.value = res.data.data.commander;
|
||||||
|
|
@ -127,7 +129,7 @@ const optionDirector = ref<any>([]);
|
||||||
const savaForm = async () => {
|
const savaForm = async () => {
|
||||||
await myForm.value!.validate().then((result: boolean) => {
|
await myForm.value!.validate().then((result: boolean) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
dialogConfirm($q, async () => await postData());
|
dialogConfirm($q, async () => await postData("post"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
@ -157,7 +159,7 @@ const clickdownloadFile = async (type: string) => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const postData = async () => {
|
const postData = async (action: string) => {
|
||||||
const data = await {
|
const data = await {
|
||||||
start_date: date_start.value,
|
start_date: date_start.value,
|
||||||
date_finish: date_finish.value,
|
date_finish: date_finish.value,
|
||||||
|
|
@ -169,15 +171,32 @@ const postData = async () => {
|
||||||
director2_dated: director2_dated.value,
|
director2_dated: director2_dated.value,
|
||||||
expand_month: expand_month.value,
|
expand_month: expand_month.value,
|
||||||
};
|
};
|
||||||
await http
|
if (action === "post") {
|
||||||
.post(config.API.createformReport(assignId.value), data)
|
await http
|
||||||
.then(() => {
|
.post(config.API.createformReport(assignId.value), data)
|
||||||
success($q, "บันทึกสำเร็จ");
|
.then(() => {
|
||||||
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
success($q, "บันทึกสำเร็จ");
|
||||||
})
|
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
||||||
.catch((e: any) => {
|
})
|
||||||
messageError($q, e);
|
.catch((e: any) => {
|
||||||
});
|
messageError($q, e);
|
||||||
|
});
|
||||||
|
} else if (action === "put") {
|
||||||
|
await http
|
||||||
|
.put(config.API.createformReport(assignId.value), data)
|
||||||
|
.then(() => {
|
||||||
|
success($q, "บันทึกสำเร็จ");
|
||||||
|
router.push(`/probation/detail/${personalId.value}/${assignId.value}`);
|
||||||
|
})
|
||||||
|
.catch((e: any) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
status.value = false;
|
||||||
|
// fecthAssign(assignId.value);
|
||||||
|
fecthResult(assignId.value);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const selectRuslt = () => {
|
const selectRuslt = () => {
|
||||||
if (result.value !== 3) {
|
if (result.value !== 3) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ import DialogEdit from "@/modules/07_insignia/components/4_Allocate/DialogEdit.v
|
||||||
|
|
||||||
import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main";
|
import type { OptionDataYear } from "@/modules/07_insignia/interface/index/Main";
|
||||||
import type { QTableProps, QInput } from "quasar";
|
import type { QTableProps, QInput } from "quasar";
|
||||||
import { useQuasar } from "quasar";
|
import { Loading, useQuasar } from "quasar";
|
||||||
|
import type { load } from "@/router/loader";
|
||||||
|
|
||||||
const DataStore = useAllocateDataStore();
|
const DataStore = useAllocateDataStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -45,24 +46,28 @@ const profileType = ref<string>("");
|
||||||
const filterKeyword = ref<string>("");
|
const filterKeyword = ref<string>("");
|
||||||
const roundYear = ref<number>();
|
const roundYear = ref<number>();
|
||||||
const insigniaOp = ref<any>([]);
|
const insigniaOp = ref<any>([]);
|
||||||
|
const loadView = ref<boolean>(false);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthRound();
|
await fecthRound();
|
||||||
await fecthInsigniaType();
|
// await fecthInsigniaType();
|
||||||
});
|
});
|
||||||
|
|
||||||
const fecthRound = async () => {
|
const fecthRound = async () => {
|
||||||
await http
|
await http
|
||||||
.get(config.API.noteround())
|
.get(config.API.noteround())
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
selectRoundOption.value = data.map((e: any) => ({
|
if (data.length !== 0) {
|
||||||
id: e.id,
|
selectRoundOption.value = data.map((e: any) => ({
|
||||||
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
id: e.id,
|
||||||
year: e.year,
|
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
||||||
}));
|
year: e.year,
|
||||||
selectRound.value = data[0].id;
|
}));
|
||||||
roundYear.value = data[0].year;
|
selectRound.value = data[0].id;
|
||||||
|
roundYear.value = data[0].year;
|
||||||
|
await fecthInsigniaType();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -92,6 +97,7 @@ const fecthInsigniaType = async () => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsigniaType(data);
|
DataStore.fetchDatainsigniaType(data);
|
||||||
tab.value = DataStore.insigniaType[0].name;
|
tab.value = DataStore.insigniaType[0].name;
|
||||||
|
loadView.value = true;
|
||||||
fecthInsignia();
|
fecthInsignia();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
|
|
@ -281,7 +287,12 @@ const resetFilter = () => {
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
จัดสรรเครื่องราชอิสริยาภรณ์
|
จัดสรรเครื่องราชอิสริยาภรณ์
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
|
<q-card
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
class="col-12 q-my-md q-mt-sm rounded-borders"
|
||||||
|
v-if="loadView"
|
||||||
|
>
|
||||||
<div class="bg-grey-1 col-12 row items-center">
|
<div class="bg-grey-1 col-12 row items-center">
|
||||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||||
<selector
|
<selector
|
||||||
|
|
@ -520,6 +531,14 @@ const resetFilter = () => {
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
<q-card v-else>
|
||||||
|
<div class="q-pa-md q-gutter-sm">
|
||||||
|
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||||
|
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||||
|
</q-banner>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
<DialogForm
|
<DialogForm
|
||||||
:modal="modal"
|
:modal="modal"
|
||||||
:save="save"
|
:save="save"
|
||||||
|
|
@ -535,5 +554,4 @@ const resetFilter = () => {
|
||||||
:actionType="actionType"
|
:actionType="actionType"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped></style>
|
||||||
</style>
|
|
||||||
|
|
|
||||||
|
|
@ -26,42 +26,50 @@ const action = ref<string>("");
|
||||||
const profileId = ref<string>("");
|
const profileId = ref<string>("");
|
||||||
const roundYear = ref<any>();
|
const roundYear = ref<any>();
|
||||||
const insigniaList = ref<any>([]);
|
const insigniaList = ref<any>([]);
|
||||||
|
const loadView = ref<boolean>(false);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthRound();
|
await fecthRound();
|
||||||
await fecthInsigniaType();
|
// await fecthInsigniaType();
|
||||||
});
|
});
|
||||||
const fecthRound = async () => {
|
const fecthRound = async () => {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.noteround())
|
.get(config.API.noteround())
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
selectRoundAllOption.value = [
|
if (data.length !== 0) {
|
||||||
{
|
await fecthInsigniaType();
|
||||||
name: "ทั้งหมด",
|
selectRoundAllOption.value = [
|
||||||
id: "0",
|
{
|
||||||
year: 0,
|
name: "ทั้งหมด",
|
||||||
},
|
id: "0",
|
||||||
];
|
year: 0,
|
||||||
data.map((e: any) => {
|
},
|
||||||
selectRoundOption.value.push({
|
];
|
||||||
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
data.map((e: any) => {
|
||||||
id: e.id,
|
selectRoundOption.value.push({
|
||||||
year: e.year,
|
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
||||||
|
id: e.id,
|
||||||
|
year: e.year,
|
||||||
|
});
|
||||||
|
selectRoundAllOption.value.push({
|
||||||
|
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
||||||
|
id: e.id,
|
||||||
|
year: e.year,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
selectRoundAllOption.value.push({
|
|
||||||
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
|
||||||
id: e.id,
|
|
||||||
year: e.year,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
selectRound.value = data[0].id;
|
selectRound.value = data[0].id;
|
||||||
yearRound.value = data[0].year;
|
yearRound.value = data[0].year;
|
||||||
roundYear.value = data[0].year;
|
roundYear.value = data[0].year;
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -73,7 +81,7 @@ const fecthInsignia = async () => {
|
||||||
DataStore.fetchDataInsignia(data);
|
DataStore.fetchDataInsignia(data);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
})
|
})
|
||||||
.finally(async () => {
|
.finally(async () => {
|
||||||
insigniaList.value = await DataStore.insigniaOp.filter(
|
insigniaList.value = await DataStore.insigniaOp.filter(
|
||||||
|
|
@ -88,11 +96,13 @@ const fecthInsigniaType = async () => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsigniaType(data);
|
DataStore.fetchDatainsigniaType(data);
|
||||||
tab.value = DataStore.insigniaType[0].name;
|
tab.value = DataStore.insigniaType[0].name;
|
||||||
|
loadView.value = true;
|
||||||
await fecthInsignia();
|
await fecthInsignia();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
messageError($q, err);
|
||||||
});
|
})
|
||||||
|
.finally(() => {});
|
||||||
};
|
};
|
||||||
|
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
|
|
@ -367,7 +377,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
ยืม-คืนเครื่องราชฯ
|
ยืม-คืนเครื่องราชฯ
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
|
<q-card
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
class="col-12 q-my-md q-mt-sm rounded-borders"
|
||||||
|
v-if="loadView == tr"
|
||||||
|
>
|
||||||
<q-tabs
|
<q-tabs
|
||||||
dense
|
dense
|
||||||
v-model="tab"
|
v-model="tab"
|
||||||
|
|
@ -553,6 +568,13 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:type-id="tab"
|
:type-id="tab"
|
||||||
/>
|
/>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
<q-card v-else>
|
||||||
|
<div class="q-pa-md q-gutter-sm">
|
||||||
|
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||||
|
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||||
|
</q-banner>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
</template>
|
</template>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.arrow {
|
.arrow {
|
||||||
|
|
|
||||||
|
|
@ -33,24 +33,33 @@ const personId = ref<string>();
|
||||||
const profileType = ref<string>("");
|
const profileType = ref<string>("");
|
||||||
const fileResult = ref<any>(null);
|
const fileResult = ref<any>(null);
|
||||||
const fileinvoice = ref<any>(null);
|
const fileinvoice = ref<any>(null);
|
||||||
|
const loadView = ref<boolean>(false);
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await fecthRound();
|
await fecthRound();
|
||||||
await fecthInsignia();
|
// await fecthInsignia();
|
||||||
await fecthInsigniaType();
|
// await fecthInsigniaType();
|
||||||
});
|
});
|
||||||
const fecthRound = async () => {
|
const fecthRound = async () => {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.noteround())
|
.get(config.API.noteround())
|
||||||
.then((res) => {
|
.then(async (res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
selectRoundOption.value = data.map((e: any) => ({
|
if (data.length !== 0) {
|
||||||
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
selectRoundOption.value = data.map((e: any) => ({
|
||||||
id: e.id,
|
name: "รอบการเสนอขอพระราชทานเครื่องราชปี" + " " + (e.year + 543),
|
||||||
}));
|
id: e.id,
|
||||||
selectRound.value = data[0].id;
|
}));
|
||||||
|
selectRound.value = data[0].id;
|
||||||
|
await fecthInsignia();
|
||||||
|
await fecthInsigniaType();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const fecthInsignia = async () => {
|
const fecthInsignia = async () => {
|
||||||
|
|
@ -62,6 +71,7 @@ const fecthInsignia = async () => {
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
console.log("fecthInsignia");
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const fecthInsigniaType = async () => {
|
const fecthInsigniaType = async () => {
|
||||||
|
|
@ -70,9 +80,12 @@ const fecthInsigniaType = async () => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
DataStore.fetchDatainsigniaType(data);
|
DataStore.fetchDatainsigniaType(data);
|
||||||
tab.value = DataStore.insigniaType[0].name;
|
tab.value = DataStore.insigniaType[0].name;
|
||||||
|
loadView.value = true;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
console.log("fecthInsigniaType");
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const visibleColumns = ref<String[]>([
|
const visibleColumns = ref<String[]>([
|
||||||
|
|
@ -375,7 +388,12 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
<div class="toptitle text-dark col-12 row items-center">
|
<div class="toptitle text-dark col-12 row items-center">
|
||||||
บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ
|
บันทึกผลการได้รับพระราชทานเครื่องราชอิสริยาภรณ์/การจ่ายใบกำกับ
|
||||||
</div>
|
</div>
|
||||||
<q-card flat bordered class="col-12 q-my-md q-mt-sm rounded-borders">
|
<q-card
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
class="col-12 q-my-md q-mt-sm rounded-borders"
|
||||||
|
v-if="loadView == true"
|
||||||
|
>
|
||||||
<div class="bg-grey-1 col-12 row items-center">
|
<div class="bg-grey-1 col-12 row items-center">
|
||||||
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
<div class="q-pl-md q-pr-sm text-weight-medium text-grey-7">รอบ</div>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -655,6 +673,13 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:profileType="profileType"
|
:profileType="profileType"
|
||||||
/>
|
/>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
<q-card v-else>
|
||||||
|
<div class="q-pa-md q-gutter-sm">
|
||||||
|
<q-banner inline-actions rounded class="bg-grey-1 text-center">
|
||||||
|
ไม่มีข้อมูลรอบการเสนอขอพระราชทานเครื่องราชอิสริยาภรณ์
|
||||||
|
</q-banner>
|
||||||
|
</div>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
<q-dialog v-model="modelPerview">
|
<q-dialog v-model="modelPerview">
|
||||||
<q-card style="width: 850px; max-width: 80vw">
|
<q-card style="width: 850px; max-width: 80vw">
|
||||||
|
|
|
||||||
|
|
@ -12,25 +12,19 @@ import router from "@/router";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
|
import PopupHistory from "./PopupHistory.vue";
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai, dateText, success, dialogRemove } =
|
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
||||||
mixin;
|
|
||||||
const DataStore = useOrderPlacementDataStore();
|
const DataStore = useOrderPlacementDataStore();
|
||||||
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
sortBy: "desc",
|
sortBy: "OrderDate",
|
||||||
descending: false,
|
descending: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
rowsPerPage: 10,
|
rowsPerPage: 10,
|
||||||
});
|
});
|
||||||
|
|
||||||
// แปลงเวลา ค.ศ ให้เป็น พ.ศ
|
|
||||||
const textDate = (value: Date) => {
|
|
||||||
return dateText(value);
|
|
||||||
};
|
|
||||||
|
|
||||||
const visibleColumns = ref<string[]>([
|
const visibleColumns = ref<string[]>([
|
||||||
"Order",
|
"Order",
|
||||||
"OrderType",
|
"OrderType",
|
||||||
|
|
@ -39,7 +33,7 @@ const visibleColumns = ref<string[]>([
|
||||||
"OrderBy",
|
"OrderBy",
|
||||||
"Signer",
|
"Signer",
|
||||||
"OrderStatus",
|
"OrderStatus",
|
||||||
]); //ค้นหา คอลัมน์ คอลัมน์ที่แสดง
|
]);
|
||||||
|
|
||||||
// หัวตาราง
|
// หัวตาราง
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -82,8 +76,7 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
field: "OrderDate",
|
field: "OrderDate",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
sort: (a: string, b: string) =>
|
sort: (a, b) => parseInt(a) - parseInt(b),
|
||||||
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "OrderBy",
|
name: "OrderBy",
|
||||||
|
|
@ -144,14 +137,16 @@ onMounted(async () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
const OriginalDataFetch = async () => {
|
const OriginalDataFetch = async () => {
|
||||||
|
showLoader();
|
||||||
await http
|
await http
|
||||||
.get(config.API.listOrder())
|
.get(config.API.listOrder())
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
console.log("list", res);
|
// console.log("list", res);
|
||||||
rows.value = res.data.result.map((e: any) => ({
|
rows.value = res.data.result.map((e: any) => ({
|
||||||
orderId: e.orderId,
|
orderId: e.orderId,
|
||||||
Order: e.orderName,
|
Order: e.orderName,
|
||||||
OrderNum: e.orderNo == '' ? '-' : `${e.orderNo}/${Number(e.fiscalYear) + 543}`,
|
OrderNum:
|
||||||
|
e.orderNo == "" ? "-" : `${e.orderNo}/${Number(e.fiscalYear) + 543}`,
|
||||||
fiscalYear: Number(e.fiscalYear),
|
fiscalYear: Number(e.fiscalYear),
|
||||||
OrderDate: date2Thai(e.orderDate),
|
OrderDate: date2Thai(e.orderDate),
|
||||||
OrderBy: e.orderBy,
|
OrderBy: e.orderBy,
|
||||||
|
|
@ -164,9 +159,10 @@ const OriginalDataFetch = async () => {
|
||||||
})
|
})
|
||||||
.catch((e: any) => {
|
.catch((e: any) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
hideLoader();
|
||||||
});
|
});
|
||||||
// .finally(async () => {
|
|
||||||
// });
|
|
||||||
await DataStore.DataMainOrder(rows.value);
|
await DataStore.DataMainOrder(rows.value);
|
||||||
OriginalData.value = await DataStore.DataMainOrigOrder;
|
OriginalData.value = await DataStore.DataMainOrigOrder;
|
||||||
UpdataData.value = OriginalData.value;
|
UpdataData.value = OriginalData.value;
|
||||||
|
|
@ -176,13 +172,13 @@ const OriginalDataFetch = async () => {
|
||||||
const redirectToPage = (id?: string, status?: string) => {
|
const redirectToPage = (id?: string, status?: string) => {
|
||||||
let step = 1;
|
let step = 1;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 'จัดทำร่างคำสั่ง':
|
case "จัดทำร่างคำสั่ง":
|
||||||
step = 1;
|
step = 1;
|
||||||
break;
|
break;
|
||||||
case 'บัญชีแนบท้าย':
|
case "บัญชีแนบท้าย":
|
||||||
step = 2;
|
step = 2;
|
||||||
break;
|
break;
|
||||||
case 'เลือกผู้ได้รับสำเนาคำสั่ง':
|
case "เลือกผู้ได้รับสำเนาคำสั่ง":
|
||||||
step = 3;
|
step = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -336,47 +332,136 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
<q-card flat bordered class="col-12 q-mt-sm q-pa-md">
|
||||||
<div class="row q-col-gutter-sm">
|
<div class="row q-col-gutter-sm">
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<q-select class="col-xs-12 col-sm-3 col-md-2" v-model="fiscalyear" label="ปีงบประมาณ" dense emit-value
|
<q-select
|
||||||
map-options :options="fiscalyearOP" option-value="id" option-label="name" lazy-rules hide-bottom-space
|
class="col-xs-12 col-sm-3 col-md-2"
|
||||||
:readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
|
v-model="fiscalyear"
|
||||||
@update:model-value="searchFilterTable" />
|
label="ปีงบประมาณ"
|
||||||
|
dense
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="fiscalyearOP"
|
||||||
|
option-value="id"
|
||||||
|
option-label="name"
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
:outlined="true"
|
||||||
|
:hide-dropdown-icon="false"
|
||||||
|
@update:model-value="searchFilterTable"
|
||||||
|
/>
|
||||||
<div>
|
<div>
|
||||||
<q-btn size="12px" flat round color="add" icon="mdi-plus" @click="clickAdd">
|
<q-btn
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
color="add"
|
||||||
|
icon="mdi-plus"
|
||||||
|
@click="clickAdd"
|
||||||
|
>
|
||||||
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
</div>
|
</div>
|
||||||
<q-space />
|
<q-space />
|
||||||
|
|
||||||
<q-input class="col-xs-12 col-sm-3 col-md-2" standout dense v-model="filterKeyword" ref="filterRef" outlined
|
<q-input
|
||||||
debounce="300" placeholder="ค้นหา">
|
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>
|
<template v-slot:append>
|
||||||
<q-icon v-if="filterKeyword == ''" name="search" />
|
<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>
|
</template>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
<q-select v-model="visibleColumns" multiple outlined dense options-dense :display-value="$q.lang.table.columns"
|
<q-select
|
||||||
emit-value map-options :options="columns" option-value="name" options-cover style="min-width: 150px"
|
v-model="visibleColumns"
|
||||||
class="col-xs-12 col-sm-3 col-md-2" />
|
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"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-card bordered class="col-12 filter-card q-pa-sm">
|
<q-card bordered class="col-12 filter-card q-pa-sm">
|
||||||
<div class="row col-12 q-col-gutter-sm">
|
<div class="row col-12 q-col-gutter-sm">
|
||||||
<q-select class="col-xs-12 col-sm-3 col-md-2" v-model="OrderType" label="ประเภท" dense emit-value
|
<q-select
|
||||||
map-options option-label="name" :options="OrderTypeOption" option-value="name" lazy-rules
|
class="col-xs-12 col-sm-3 col-md-2"
|
||||||
hide-bottom-space :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
|
v-model="OrderType"
|
||||||
@update:model-value="searchFilterTable" />
|
label="ประเภท"
|
||||||
<q-select class="col-xs-12 col-sm-3 col-md-2" v-model="OrderStatus" label="สถานะ" dense emit-value
|
dense
|
||||||
map-options option-label="name" :options="OrderStatusOption" option-value="name" lazy-rules
|
emit-value
|
||||||
hide-bottom-space :readonly="false" :borderless="false" :outlined="true" :hide-dropdown-icon="false"
|
map-options
|
||||||
@update:model-value="searchFilterTable" />
|
option-label="name"
|
||||||
|
:options="OrderTypeOption"
|
||||||
|
option-value="name"
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
:outlined="true"
|
||||||
|
:hide-dropdown-icon="false"
|
||||||
|
@update:model-value="searchFilterTable"
|
||||||
|
/>
|
||||||
|
<q-select
|
||||||
|
class="col-xs-12 col-sm-3 col-md-2"
|
||||||
|
v-model="OrderStatus"
|
||||||
|
label="สถานะ"
|
||||||
|
dense
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
option-label="name"
|
||||||
|
:options="OrderStatusOption"
|
||||||
|
option-value="name"
|
||||||
|
lazy-rules
|
||||||
|
hide-bottom-space
|
||||||
|
:readonly="false"
|
||||||
|
:borderless="false"
|
||||||
|
:outlined="true"
|
||||||
|
:hide-dropdown-icon="false"
|
||||||
|
@update:model-value="searchFilterTable"
|
||||||
|
/>
|
||||||
|
<q-space />
|
||||||
|
<PopupHistory :OrderTypeOption="OrderTypeOption" />
|
||||||
</div>
|
</div>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<q-table ref="table" :columns="columns" :rows="UpdataData" :filter="filterKeyword" row-key="Order" flat bordered
|
<q-table
|
||||||
:paging="true" dense class="custom-header-table" v-bind="attrs" :visible-columns="visibleColumns"
|
ref="table"
|
||||||
:pagination-label="paginationLabel" v-model:pagination="pagination">
|
:columns="columns"
|
||||||
|
:rows="UpdataData"
|
||||||
|
:filter="filterKeyword"
|
||||||
|
row-key="Order"
|
||||||
|
flat
|
||||||
|
bordered
|
||||||
|
:paging="true"
|
||||||
|
dense
|
||||||
|
class="custom-header-table"
|
||||||
|
v-bind="attrs"
|
||||||
|
:visible-columns="visibleColumns"
|
||||||
|
:pagination-label="paginationLabel"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
>
|
||||||
<template v-slot:header="props">
|
<template v-slot:header="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
|
@ -386,8 +471,13 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props" class="cursor-pointer"
|
<q-tr
|
||||||
@click="redirectToPage(props.row.orderId, props.row.OrderStatus)">
|
:props="props"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="
|
||||||
|
redirectToPage(props.row.orderId, props.row.OrderStatus)
|
||||||
|
"
|
||||||
|
>
|
||||||
<q-td key="Order" :props="props">
|
<q-td key="Order" :props="props">
|
||||||
{{ props.row.Order }}
|
{{ props.row.Order }}
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
@ -418,8 +508,16 @@ const paginationLabel = (start: string, end: string, total: string) => {
|
||||||
</q-tr>
|
</q-tr>
|
||||||
</template>
|
</template>
|
||||||
<template v-slot:pagination="scope">
|
<template v-slot:pagination="scope">
|
||||||
<q-pagination v-model="pagination.page" active-color="primary" color="dark" :max="scope.pagesNumber"
|
<q-pagination
|
||||||
:max-pages="5" size="sm" boundary-links direction-links></q-pagination>
|
v-model="pagination.page"
|
||||||
|
active-color="primary"
|
||||||
|
color="dark"
|
||||||
|
:max="scope.pagesNumber"
|
||||||
|
:max-pages="5"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
></q-pagination>
|
||||||
</template>
|
</template>
|
||||||
</q-table>
|
</q-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
412
src/modules/10_order/components/PopupHistory.vue
Normal file
412
src/modules/10_order/components/PopupHistory.vue
Normal file
|
|
@ -0,0 +1,412 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import type { DataOption } from "@/modules/04_registry/components/profileType";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import type { QForm } from "quasar";
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
const myForm = ref<QForm>();
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
|
||||||
|
const $q = useQuasar();
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
OrderTypeOption: Object,
|
||||||
|
});
|
||||||
|
|
||||||
|
const OrderTypeOption = ref<any>([]);
|
||||||
|
const modal = ref<boolean>(false);
|
||||||
|
const employeeClass = ref<string>("");
|
||||||
|
const typeKeyword = ref<string>("");
|
||||||
|
const Keyword = ref<string>("");
|
||||||
|
const positionKeyword = ref<string>("");
|
||||||
|
|
||||||
|
const reportType = ref<string>("");
|
||||||
|
const reportYear = ref<number | null>();
|
||||||
|
const reportNo = ref<string>("");
|
||||||
|
|
||||||
|
const positionOps = ref<DataOption[]>([]);
|
||||||
|
const columns = ref<any["columns"]>([
|
||||||
|
{
|
||||||
|
name: "no",
|
||||||
|
label: "ลำดับ",
|
||||||
|
field: "no",
|
||||||
|
align: "left",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "citizenId",
|
||||||
|
align: "left",
|
||||||
|
label: "เลขบัตรประชาชน",
|
||||||
|
field: "citizenId",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "name",
|
||||||
|
align: "left",
|
||||||
|
label: "ชื่อ - นามสกุล",
|
||||||
|
field: "name",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "posNo",
|
||||||
|
align: "left",
|
||||||
|
label: "เลขที่ตำแหน่ง",
|
||||||
|
field: "posNo",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "position",
|
||||||
|
align: "left",
|
||||||
|
label: "ตำแหน่ง",
|
||||||
|
field: "position",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const rows = ref<any>([]);
|
||||||
|
|
||||||
|
const clickOpenpopup = () => {
|
||||||
|
modal.value = true;
|
||||||
|
employeeClass.value = "";
|
||||||
|
if (props.OrderTypeOption != undefined) {
|
||||||
|
OrderTypeOption.value = props.OrderTypeOption.filter(
|
||||||
|
(e: any) => e.name !== "ทั้งหมด"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// const fecthPositionOfficer = async () => {
|
||||||
|
// await http
|
||||||
|
// .get(config.API.listPositionPathHistory)
|
||||||
|
// .then((res) => {
|
||||||
|
// let data = res.data.result.items;
|
||||||
|
// console.log(data);
|
||||||
|
// positionOps.value = data.map((e: any) => ({ id: e.id, name: e.name }));
|
||||||
|
// options.value = positionOps.value;
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
// const fetchPositionPerm = async () => {
|
||||||
|
// await http
|
||||||
|
// .get(config.API.listPositionEmployeePositionHistory)
|
||||||
|
// .then((res) => {
|
||||||
|
// let data = res.data.result.items;
|
||||||
|
// positionOps.value = data.map((e: any) => ({ id: e.id, name: e.name }));
|
||||||
|
// options.value = positionOps.value;
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
const clickSearch = async (type: string) => {
|
||||||
|
console.log(reportType.value);
|
||||||
|
console.log(reportYear.value);
|
||||||
|
console.log(reportNo.value);
|
||||||
|
// await myForm.value!.validate().then((result: boolean) => {
|
||||||
|
// if (result) {
|
||||||
|
// showLoader();
|
||||||
|
// let body = {};
|
||||||
|
// if (typeKeyword.value === "no") {
|
||||||
|
// Object.assign(body, {
|
||||||
|
// posNo: Keyword.value,
|
||||||
|
// });
|
||||||
|
// } else if (typeKeyword.value === "position") {
|
||||||
|
// Object.assign(body, {
|
||||||
|
// positionId: positionKeyword.value,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// http
|
||||||
|
// .post(config.API.profileHistory(type), body)
|
||||||
|
// .then((res) => {
|
||||||
|
// let data = res.data.result;
|
||||||
|
// if (data.length !== 0) {
|
||||||
|
// rows.value = data.map((e: any) => ({
|
||||||
|
// id: e.id,
|
||||||
|
// citizenId: e.citizenId,
|
||||||
|
// name: e.firstName + " " + e.lastName,
|
||||||
|
// posNo: e.posNo,
|
||||||
|
// position: e.position,
|
||||||
|
// date: date2Thai(e.date),
|
||||||
|
// }));
|
||||||
|
// } else {
|
||||||
|
// notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
||||||
|
// rows.value = [];
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .catch((err) => {
|
||||||
|
// messageError($q, err);
|
||||||
|
// rows.value = [];
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// hideLoader();
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
};
|
||||||
|
const options = ref<any>([]);
|
||||||
|
const filterFn = (val: string, update: any) => {
|
||||||
|
if (val === "") {
|
||||||
|
update(() => {
|
||||||
|
options.value = OrderTypeOption.value;
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
update(() => {
|
||||||
|
options.value = OrderTypeOption.value.filter(
|
||||||
|
(e: any) => e.name.search(val) !== -1
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(options.value);
|
||||||
|
};
|
||||||
|
const clickRedirect = (id: string) => {
|
||||||
|
router.push(`/registry/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const paging = ref<boolean>(true);
|
||||||
|
const pagination = ref({
|
||||||
|
sortBy: "order",
|
||||||
|
descending: false,
|
||||||
|
page: 1,
|
||||||
|
rowsPerPage: 10,
|
||||||
|
});
|
||||||
|
const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
|
if (paging.value == true) return " " + start + "-" + end + " ใน " + total;
|
||||||
|
else return start + "-" + end + " ใน " + total;
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<q-btn round flat color="blue" icon="mdi-history" @click="clickOpenpopup">
|
||||||
|
<q-tooltip>แสดงประวัติออกคำสั่ง</q-tooltip></q-btn
|
||||||
|
>
|
||||||
|
<q-dialog v-model="modal">
|
||||||
|
<q-card style="width: 850px; max-width: 80vw">
|
||||||
|
<q-card-section>
|
||||||
|
<div class="my-content">
|
||||||
|
<div
|
||||||
|
class="row q-pa-xs items-center bg-blue-1"
|
||||||
|
style="border-radius: 4px 4px 0px 0px"
|
||||||
|
>
|
||||||
|
<q-icon
|
||||||
|
size="20px"
|
||||||
|
color="blue-9"
|
||||||
|
name="mdi-filter-variant"
|
||||||
|
class="q-mx-sm"
|
||||||
|
/>
|
||||||
|
<div class="text-blue-9 text-subtitle2 text-weight-medium">
|
||||||
|
<span>ประวัติออกคำสั่ง</span>
|
||||||
|
</div>
|
||||||
|
<q-space />
|
||||||
|
<q-btn
|
||||||
|
color="blue-9"
|
||||||
|
icon="mdi-close"
|
||||||
|
size="12px"
|
||||||
|
flat
|
||||||
|
round
|
||||||
|
dense
|
||||||
|
v-close-popup
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<q-separator color="blue-1" />
|
||||||
|
<div class="dialog-card-contain">
|
||||||
|
<q-card-section class="q-pa-sm">
|
||||||
|
<q-form ref="myForm">
|
||||||
|
<div class="row col-12 q-col-gutter-xs">
|
||||||
|
<q-select
|
||||||
|
class="col-4"
|
||||||
|
hide-bottom-space
|
||||||
|
:rules="[(val:string) => !!val || `${'กรุณาเลือก ตำแหน่ง'}`]"
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
v-model="reportType"
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
:options="options"
|
||||||
|
option-label="name"
|
||||||
|
option-value="id"
|
||||||
|
:label="`${' ประเภท'}`"
|
||||||
|
use-input
|
||||||
|
input-debounce="0"
|
||||||
|
@filter="filterFn"
|
||||||
|
behavior="menu"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
ไม่มีข้อมูล
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template></q-select
|
||||||
|
>
|
||||||
|
<datepicker
|
||||||
|
class="col-4"
|
||||||
|
menu-class-name="modalfix"
|
||||||
|
v-model="reportYear"
|
||||||
|
:locale="'th'"
|
||||||
|
autoApply
|
||||||
|
year-picker
|
||||||
|
:enableTimePicker="false"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<template #year="{ year }">{{ year + 543 }}</template>
|
||||||
|
<template #year-overlay-value="{ value }">{{
|
||||||
|
parseInt(value + 543)
|
||||||
|
}}</template>
|
||||||
|
<template #trigger>
|
||||||
|
<q-input
|
||||||
|
class="inputgreen cursor-pointer q-mb-sm"
|
||||||
|
hide-bottom-space
|
||||||
|
outlined
|
||||||
|
dense
|
||||||
|
lazy-rules
|
||||||
|
borderless
|
||||||
|
:model-value="
|
||||||
|
reportYear == null ? null : reportYear + 543
|
||||||
|
"
|
||||||
|
:label="`${'ปีงบประมาณ'}`"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
</q-input>
|
||||||
|
</template>
|
||||||
|
</datepicker>
|
||||||
|
<q-input
|
||||||
|
class="col-4"
|
||||||
|
clearable
|
||||||
|
dense
|
||||||
|
outlined
|
||||||
|
lazy-rules
|
||||||
|
v-model="reportNo"
|
||||||
|
hide-bottom-space
|
||||||
|
label="เลขที่คำสั่ง"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<q-space />
|
||||||
|
<div>
|
||||||
|
<q-btn
|
||||||
|
dense
|
||||||
|
color="primary"
|
||||||
|
icon="mdi-magnify"
|
||||||
|
label="ค้นหา"
|
||||||
|
class="q-px-md"
|
||||||
|
@click="clickSearch(employeeClass)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-form>
|
||||||
|
</q-card-section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<q-card-section class="q-pt-none">
|
||||||
|
<q-table
|
||||||
|
flat
|
||||||
|
dense
|
||||||
|
bordered
|
||||||
|
:rows="rows"
|
||||||
|
:columns="columns"
|
||||||
|
row-key="order"
|
||||||
|
class="custom-header-table"
|
||||||
|
no-data-label="ไม่มีข้อมูล"
|
||||||
|
:pagination-label="paginationLabel"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
>
|
||||||
|
<template v-slot:header="props">
|
||||||
|
<q-tr :props="props">
|
||||||
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
||||||
|
<div class="text-grey-7 text-weight-medium">
|
||||||
|
<span class="row">{{ col.label }}</span>
|
||||||
|
</div>
|
||||||
|
</q-th>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:body="props">
|
||||||
|
<q-tr :props="props" class="cursor-pointer">
|
||||||
|
<q-td key="no" :props="props"> {{ props.rowIndex + 1 }}</q-td>
|
||||||
|
<q-td key="order" :props="props">{{ props.row.order }} </q-td>
|
||||||
|
<q-td
|
||||||
|
key="citizenId"
|
||||||
|
class="text-primary"
|
||||||
|
:props="props"
|
||||||
|
@click="clickRedirect(props.row.id)"
|
||||||
|
>{{ props.row.citizenId }}</q-td
|
||||||
|
>
|
||||||
|
<q-td
|
||||||
|
key="name"
|
||||||
|
class="text-primary"
|
||||||
|
:props="props"
|
||||||
|
@click="clickRedirect(props.row.id)"
|
||||||
|
>{{ props.row.name }}</q-td
|
||||||
|
>
|
||||||
|
|
||||||
|
<q-td key="posNo" :props="props">{{ props.row.posNo }}</q-td>
|
||||||
|
<q-td key="position" :props="props">{{
|
||||||
|
props.row.position
|
||||||
|
}}</q-td>
|
||||||
|
<q-td key="date" :props="props">{{ props.row.date }}</q-td>
|
||||||
|
</q-tr>
|
||||||
|
</template>
|
||||||
|
<template v-slot:pagination="scope">
|
||||||
|
<q-pagination
|
||||||
|
v-model="pagination.page"
|
||||||
|
color="primary"
|
||||||
|
:max="scope.pagesNumber"
|
||||||
|
:max-pages="5"
|
||||||
|
size="sm"
|
||||||
|
boundary-links
|
||||||
|
direction-links
|
||||||
|
></q-pagination>
|
||||||
|
</template>
|
||||||
|
</q-table>
|
||||||
|
</q-card-section>
|
||||||
|
|
||||||
|
<!-- <q-card-actions align="right">
|
||||||
|
<q-btn flat label="OK" color="primary" v-close-popup />
|
||||||
|
</q-card-actions> -->
|
||||||
|
</q-card>
|
||||||
|
</q-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.custom-header-table {
|
||||||
|
max-height: 64vh;
|
||||||
|
|
||||||
|
.q-table tr:nth-child(odd) td {
|
||||||
|
background: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-table tr:nth-child(even) td {
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-table thead tr {
|
||||||
|
background: #ecebeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-table thead tr th {
|
||||||
|
position: sticky;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-table thead tr:last-child th {
|
||||||
|
top: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.q-table thead tr:first-child th {
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -41,9 +41,9 @@ const {
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
const modalData = ref<any>({
|
const modalData = ref<any>({
|
||||||
salaryAmount: 0,
|
salaryAmount: null,
|
||||||
positionSalaryAmount: 0,
|
positionSalaryAmount: null,
|
||||||
monthSalaryAmount: 0,
|
monthSalaryAmount: null,
|
||||||
});
|
});
|
||||||
const myForm = ref<QForm | null>(null);
|
const myForm = ref<QForm | null>(null);
|
||||||
const myFormAdd = ref<QForm | null>(null);
|
const myFormAdd = ref<QForm | null>(null);
|
||||||
|
|
@ -129,11 +129,9 @@ const getData = async (id: string) => {
|
||||||
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
selectStatus: r.selectStatus !== null ? r.selectStatus : false,
|
||||||
sequence: r.sequence !== null ? r.sequence : 0,
|
sequence: r.sequence !== null ? r.sequence : 0,
|
||||||
refRecordId: r.refRecordId,
|
refRecordId: r.refRecordId,
|
||||||
salaryAmount: r.salaryAmount !== 0 ? r.salaryAmount : null,
|
salaryAmount: r.salaryAmount,
|
||||||
positionSalaryAmount:
|
positionSalaryAmount: r.positionSalaryAmount,
|
||||||
r.positionSalaryAmount !== 0 ? r.positionSalaryAmount : null,
|
monthSalaryAmount: r.monthSalaryAmount,
|
||||||
monthSalaryAmount:
|
|
||||||
r.monthSalaryAmount !== 0 ? r.monthSalaryAmount : null,
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// console.log("list", list);
|
// console.log("list", list);
|
||||||
|
|
@ -275,11 +273,9 @@ const fetchSalary = async (personalId: string) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
modalData.value = {
|
modalData.value = {
|
||||||
salaryAmount: data.salaryAmount !== 0 ? data.salaryAmount : null,
|
salaryAmount: data.salaryAmount === 0 && data.positionSalaryAmount === 0 && data.monthSalaryAmount===0 ? null : data.salaryAmount,
|
||||||
positionSalaryAmount:
|
positionSalaryAmount: data.salaryAmount === 0 && data.positionSalaryAmount === 0 && data.monthSalaryAmount===0 ? null : data.positionSalaryAmount,
|
||||||
data.positionSalaryAmount !== 0 ? data.positionSalaryAmount : null,
|
monthSalaryAmount: data.salaryAmount === 0 && data.positionSalaryAmount === 0 && data.monthSalaryAmount===0 ? null : data.monthSalaryAmount,
|
||||||
monthSalaryAmount:
|
|
||||||
data.monthSalaryAmount !== 0 ? data.monthSalaryAmount : null,
|
|
||||||
};
|
};
|
||||||
// console.log("data", modalData.value);
|
// console.log("data", modalData.value);
|
||||||
})
|
})
|
||||||
|
|
@ -409,7 +405,7 @@ const addlist = async (data: Object) => {
|
||||||
const save = async () => {
|
const save = async () => {
|
||||||
// console.log("save===>", rows.value);
|
// console.log("save===>", rows.value);
|
||||||
// console.log(statuscode.value);
|
// console.log(statuscode.value);
|
||||||
const check = rows.value.find((x: any) => x.salaryAmount == null);
|
const check = rows.value.find((x: any) => x.salaryAmount == 0);
|
||||||
if (
|
if (
|
||||||
(selected.value.length > 0 && !check) ||
|
(selected.value.length > 0 && !check) ||
|
||||||
(statuscode.value === true && selected.value.length > 0)
|
(statuscode.value === true && selected.value.length > 0)
|
||||||
|
|
@ -547,7 +543,7 @@ const getClass = (val: boolean) => {
|
||||||
</q-td>
|
</q-td>
|
||||||
<q-td auto-width v-if="statuscode !== true">
|
<q-td auto-width v-if="statuscode !== true">
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="props.row.salaryAmount === null"
|
v-if="props.row.salaryAmount === 0"
|
||||||
dense
|
dense
|
||||||
size="12px"
|
size="12px"
|
||||||
flat
|
flat
|
||||||
|
|
@ -628,7 +624,7 @@ const getClass = (val: boolean) => {
|
||||||
:dense="true"
|
:dense="true"
|
||||||
v-model="modalData.salaryAmount"
|
v-model="modalData.salaryAmount"
|
||||||
:label="`${'เงินเดือน'}`"
|
:label="`${'เงินเดือน'}`"
|
||||||
:rules="[(val) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
:rules="[(val: any) => !!val || `${'กรุณากรอกเงินเดือน'}`]"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -263,7 +263,16 @@ const saveUpload = () => {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader()
|
showLoader()
|
||||||
await postfileOrder();
|
await postfileOrder();
|
||||||
await postfileTailer();
|
if (code.value != 'c-pm-10' &&
|
||||||
|
code.value != 'c-pm-11' &&
|
||||||
|
code.value != 'c-pm-12' &&
|
||||||
|
code.value != 'c-pm-16' &&
|
||||||
|
code.value != 'c-pm-18' &&
|
||||||
|
code.value != 'c-pm-19' &&
|
||||||
|
code.value != 'c-pm-20' &&
|
||||||
|
code.value != 'c-pm-21') {
|
||||||
|
await postfileTailer();
|
||||||
|
}
|
||||||
await fetchAttachment(orderId.value);
|
await fetchAttachment(orderId.value);
|
||||||
await fecthstatusOrder();
|
await fecthstatusOrder();
|
||||||
hideLoader()
|
hideLoader()
|
||||||
|
|
@ -310,6 +319,9 @@ const postfileOrder = async () => {
|
||||||
formData.append("File", fileOrder.value);
|
formData.append("File", fileOrder.value);
|
||||||
await http
|
await http
|
||||||
.post(config.API.attachmentOrderId(orderId.value), formData)
|
.post(config.API.attachmentOrderId(orderId.value), formData)
|
||||||
|
.then((res) => {
|
||||||
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e)
|
messageError($q, e)
|
||||||
})
|
})
|
||||||
|
|
@ -352,10 +364,20 @@ const clickExecute = async (id: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const validateFormUpload = () => {
|
const validateFormUpload = () => {
|
||||||
return (
|
if (code.value != 'c-pm-10' &&
|
||||||
fileOrder.value !== null &&
|
code.value != 'c-pm-11' &&
|
||||||
fileTailer.value !== null
|
code.value != 'c-pm-12' &&
|
||||||
);
|
code.value != 'c-pm-16' &&
|
||||||
|
code.value != 'c-pm-18' &&
|
||||||
|
code.value != 'c-pm-19' &&
|
||||||
|
code.value != 'c-pm-20' &&
|
||||||
|
code.value != 'c-pm-21' && fileOrder.value !== null && fileTailer.value !== null) {
|
||||||
|
return true;
|
||||||
|
} else if (fileOrder.value !== null) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const validateForm = () => {
|
const validateForm = () => {
|
||||||
|
|
@ -545,17 +567,17 @@ const viewFileUpload = async (url: string) => {
|
||||||
<q-icon name="attach_file" />
|
<q-icon name="attach_file" />
|
||||||
</template>
|
</template>
|
||||||
</q-file>
|
</q-file>
|
||||||
|
|
||||||
<!-- บันทึกอัพโหลดเอกสาร -->
|
|
||||||
<div v-if="orderStatusName != 'ออกคำสั่งแล้ว'" class="row col-12 q-mt-md">
|
|
||||||
<q-space></q-space>
|
|
||||||
<q-btn unelevated label="บันทึก"
|
|
||||||
:color="validateFormUpload() && orderStatusName != 'ออกคำสั่งแล้ว' ? 'public' : 'grey'"
|
|
||||||
:disable="!validateFormUpload() || orderStatusName == 'ออกคำสั่งแล้ว'" @click="saveUpload">
|
|
||||||
</q-btn>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- บันทึกอัพโหลดเอกสาร -->
|
||||||
|
<div v-if="orderStatusName != 'ออกคำสั่งแล้ว'" class="row col-12 q-mt-md">
|
||||||
|
<q-space></q-space>
|
||||||
|
<q-btn unelevated label="บันทึก"
|
||||||
|
:color="validateFormUpload() && orderStatusName != 'ออกคำสั่งแล้ว' ? 'public' : 'grey'"
|
||||||
|
:disable="!validateFormUpload() || orderStatusName == 'ออกคำสั่งแล้ว'" @click="saveUpload">
|
||||||
|
</q-btn>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</q-form>
|
</q-form>
|
||||||
|
|
@ -640,8 +662,8 @@ const viewFileUpload = async (url: string) => {
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
<!-- ออกคำสั่ง -->
|
<!-- ออกคำสั่ง -->
|
||||||
<q-btn :disable="statusOrder == 'N' || orderStatusName === 'ออกคำสั่งแล้ว'" unelevated label="ออกคำสั่ง"
|
<q-btn v-if="orderStatusName !== 'ออกคำสั่งแล้ว'" :disable="statusOrder == 'N'" unelevated label="ออกคำสั่ง"
|
||||||
:color="statusOrder == 'Y' && orderStatusName !== 'ออกคำสั่งแล้ว' ? 'public' : 'grey'">
|
:color="statusOrder == 'Y' ? 'public' : 'grey'">
|
||||||
<q-menu>
|
<q-menu>
|
||||||
<q-list style="min-width: 150px">
|
<q-list style="min-width: 150px">
|
||||||
<q-item clickable v-close-popup @click="clickExecute(orderId)">
|
<q-item clickable v-close-popup @click="clickExecute(orderId)">
|
||||||
|
|
@ -654,6 +676,8 @@ const viewFileUpload = async (url: string) => {
|
||||||
</q-menu>
|
</q-menu>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
||||||
|
<q-btn v-else disable unelevated label="ออกคำสั่งเสร็จสิ้น" color="green"></q-btn>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<q-dialog v-model="dialog" persistent :maximized="true" transition-show="slide-up" transition-hide="slide-down">
|
<q-dialog v-model="dialog" persistent :maximized="true" transition-show="slide-up" transition-hide="slide-down">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue