Merge branch 'develop' of github.com:Frappet/hrms-mgt into develop
This commit is contained in:
commit
954b78575f
4 changed files with 39 additions and 26 deletions
|
|
@ -120,7 +120,7 @@ export default {
|
||||||
historyDirectorbyId: (id: string, type: string) =>
|
historyDirectorbyId: (id: string, type: string) =>
|
||||||
`${disciplineMain}/director/${type}/${id}`,
|
`${disciplineMain}/director/${type}/${id}`,
|
||||||
historyOrderById: (id: string) =>
|
historyOrderById: (id: string) =>
|
||||||
`${env.API_URI}/order/history/discipline/${id}`,
|
`${env.API_URI}/discipline/result/order/history/${id}`,
|
||||||
|
|
||||||
complaintbyGetId: (id: string, page?: string) =>
|
complaintbyGetId: (id: string, page?: string) =>
|
||||||
`${disciplineMain}/complaint/${page}/${id}`,
|
`${disciplineMain}/complaint/${page}/${id}`,
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,17 @@ import type { QTableProps } from "quasar";
|
||||||
import http from "@/plugins/http";
|
import http from "@/plugins/http";
|
||||||
import config from "@/app.config";
|
import config from "@/app.config";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
import { useCommandMainStore } from "@/modules/18_command/store/Main";
|
||||||
import type { HistoryResultCommand } from "@/modules/11_discipline/interface/index/Main";
|
import type { HistoryResultCommand } from "@/modules/11_discipline/interface/index/Main";
|
||||||
import DialogHeader from "@/components/DialogHeader.vue";
|
import DialogHeader from "@/components/DialogHeader.vue";
|
||||||
|
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
const storeCommand = useCommandMainStore();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, messageError, hideLoader, date2Thai } = mixin;
|
const { showLoader, messageError, hideLoader, date2Thai } = mixin;
|
||||||
|
|
||||||
const props = defineProps({
|
const modal = defineModel<boolean>("modal", { required: true });
|
||||||
modal: Boolean,
|
const personId = defineModel<string>("personId", { required: true });
|
||||||
personId: {
|
|
||||||
type: String,
|
|
||||||
default: "",
|
|
||||||
},
|
|
||||||
close: Function,
|
|
||||||
});
|
|
||||||
const rows = ref<HistoryResultCommand[]>([]);
|
const rows = ref<HistoryResultCommand[]>([]);
|
||||||
|
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
@ -77,21 +73,38 @@ function getHistory(id: string) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function getCommand() {
|
||||||
|
if (storeCommand.commandTypes.length > 0) return;
|
||||||
|
await storeCommand.getCommandTypes();
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertCommand(codeType: string) {
|
||||||
|
const data = storeCommand.commandTypes.find(
|
||||||
|
(items: any) => items.code == codeType
|
||||||
|
);
|
||||||
|
if (data) return data.name;
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
modal.value = false;
|
||||||
|
}
|
||||||
watch(
|
watch(
|
||||||
() => props.modal,
|
() => [modal.value, personId.value],
|
||||||
() => {
|
async ([newModal, newPersonId], [oldModal, oldPersonId]) => {
|
||||||
if (props.modal) {
|
if (newModal && newPersonId !== oldPersonId) {
|
||||||
getHistory(props.personId);
|
rows.value = [];
|
||||||
|
await getCommand();
|
||||||
|
await getHistory(personId.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<q-dialog v-model="props.modal" persistent>
|
<q-dialog v-model="modal" persistent>
|
||||||
<q-card style="min-width: 40vw">
|
<q-card style="min-width: 40vw">
|
||||||
<q-form ref="myForm">
|
<q-form ref="myForm">
|
||||||
<DialogHeader :tittle="`ประวัติการออกคำสั่ง`" :close="props.close" />
|
<DialogHeader :tittle="`ประวัติการออกคำสั่ง`" :close="close" />
|
||||||
<q-separator />
|
<q-separator />
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<d-table
|
<d-table
|
||||||
|
|
@ -116,7 +129,14 @@ watch(
|
||||||
<div v-if="col.name == 'no'">
|
<div v-if="col.name == 'no'">
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-else-if="col.name == 'commandSubject'">
|
||||||
|
{{
|
||||||
|
props.row.commandSubject
|
||||||
|
? convertCommand(props.row.commandSubject)
|
||||||
|
: "-"
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
</div>
|
</div>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
|
||||||
|
|
@ -249,12 +249,6 @@ function openDetial(id: string) {
|
||||||
modalHistory.value = true;
|
modalHistory.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** xbf ikp]tgvupf */
|
|
||||||
function closeDetail() {
|
|
||||||
modalHistory.value = false;
|
|
||||||
personalId.value = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** เปิดรายละเอียด */
|
/** เปิดรายละเอียด */
|
||||||
function onclickViewinfo(id: string, type: string) {
|
function onclickViewinfo(id: string, type: string) {
|
||||||
modalPersonal.value = true;
|
modalPersonal.value = true;
|
||||||
|
|
@ -833,9 +827,8 @@ watch(
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<DialogHistory
|
<DialogHistory
|
||||||
:modal="modalHistory"
|
v-model:modal="modalHistory"
|
||||||
:close="closeDetail"
|
v-model:person-id="personalId"
|
||||||
:person-id="personalId"
|
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import type {
|
||||||
import type {
|
import type {
|
||||||
DataResult,
|
DataResult,
|
||||||
DataResultList,
|
DataResultList,
|
||||||
} from "@/modules/11_discipline/interface/response/Result";
|
} from "@/modules/11_discipline/interface/response/result";
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const storeMain = useDisciplineMainStore();
|
const storeMain = useDisciplineMainStore();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue