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