file step 2
This commit is contained in:
parent
a3787f976a
commit
6d88cbb772
6 changed files with 122 additions and 24 deletions
|
|
@ -24,5 +24,5 @@ export default {
|
|||
|
||||
/**document */
|
||||
loadPathDocument: (val: string, id: string) =>
|
||||
`${env.API_URI}/document/${val}/${id}`,
|
||||
`${evaluation}/document/${val}/${id}`,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -68,12 +68,24 @@ const commanderFullnameRef = ref<object | null>(null);
|
|||
const commanderPositionRef = ref<object | null>(null);
|
||||
const commanderAboveFullnameRef = ref<object | null>(null);
|
||||
const commanderAbovePositionRef = ref<object | null>(null);
|
||||
const fileEvaluation1Ref = ref<object | null>(null);
|
||||
const fileEvaluation2Ref = ref<object | null>(null);
|
||||
const fileEvaluation3Ref = ref<object | null>(null);
|
||||
const fileEvaluation4Ref = ref<object | null>(null);
|
||||
const fileEvaluation5Ref = ref<object | null>(null);
|
||||
const fileEvaluation6Ref = ref<object | null>(null);
|
||||
|
||||
const formCommandRef: FormCommandRef = {
|
||||
commanderFullname: commanderFullnameRef,
|
||||
commanderPosition: commanderPositionRef,
|
||||
commanderAboveFullname: commanderAboveFullnameRef,
|
||||
commanderAbovePosition: commanderAbovePositionRef,
|
||||
fileEvaluation1: fileEvaluation1Ref,
|
||||
fileEvaluation2: fileEvaluation2Ref,
|
||||
fileEvaluation3: fileEvaluation3Ref,
|
||||
fileEvaluation4: fileEvaluation4Ref,
|
||||
fileEvaluation5: fileEvaluation5Ref,
|
||||
fileEvaluation6: fileEvaluation6Ref,
|
||||
};
|
||||
|
||||
async function onCilckNextStep() {
|
||||
|
|
@ -147,6 +159,8 @@ async function saveStep2() {
|
|||
}
|
||||
|
||||
function updateformCommand(val: any, ref: any) {
|
||||
console.log(ref);
|
||||
|
||||
formCommand.commanderFullname = val.commanderFullname;
|
||||
formCommand.commanderPosition = val.commanderPosition;
|
||||
formCommand.commanderAboveFullname = val.commanderAboveFullname;
|
||||
|
|
@ -156,6 +170,12 @@ function updateformCommand(val: any, ref: any) {
|
|||
commanderPositionRef.value = ref.commanderPositionRef;
|
||||
commanderAboveFullnameRef.value = ref.commanderAboveFullnameRef;
|
||||
commanderAbovePositionRef.value = ref.commanderAbovePositionRef;
|
||||
fileEvaluation1Ref.value = ref.fileEvaluation1Ref;
|
||||
fileEvaluation2Ref.value = ref.fileEvaluation2Ref;
|
||||
fileEvaluation3Ref.value = ref.fileEvaluation3Ref;
|
||||
fileEvaluation4Ref.value = ref.fileEvaluation4Ref;
|
||||
fileEvaluation5Ref.value = ref.fileEvaluation5Ref;
|
||||
fileEvaluation6Ref.value = ref.fileEvaluation6Ref;
|
||||
}
|
||||
|
||||
async function validateStep2() {
|
||||
|
|
@ -217,8 +237,6 @@ function fetchMeeting() {
|
|||
const modalHistory = ref<boolean>(false);
|
||||
function onClickPopupHistory() {
|
||||
modalHistory.value = !modalHistory.value;
|
||||
|
||||
console.log(modalHistory.value);
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
|
|
@ -232,6 +250,7 @@ onMounted(async () => {
|
|||
<div class="toptitle">
|
||||
{{ props.title }}
|
||||
<q-btn
|
||||
v-if="store.evaluateId"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
|
|
@ -360,7 +379,11 @@ onMounted(async () => {
|
|||
:fetchMeeting="fetchMeeting"
|
||||
/>
|
||||
|
||||
<PopupHistory :modal="modalHistory" :close="onClickPopupHistory" />
|
||||
<PopupHistory
|
||||
:modal="modalHistory"
|
||||
:close="onClickPopupHistory"
|
||||
:id="store.evaluateId"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
|
|
@ -40,6 +40,12 @@ const commanderFullnameRef = ref<object | null>(null);
|
|||
const commanderPositionRef = ref<object | null>(null);
|
||||
const commanderAboveFullnameRef = ref<object | null>(null);
|
||||
const commanderAbovePositionRef = ref<object | null>(null);
|
||||
const fileEvaluation1Ref = ref<object | null>(null);
|
||||
const fileEvaluation2Ref = ref<object | null>(null);
|
||||
const fileEvaluation3Ref = ref<object | null>(null);
|
||||
const fileEvaluation4Ref = ref<object | null>(null);
|
||||
const fileEvaluation5Ref = ref<object | null>(null);
|
||||
const fileEvaluation6Ref = ref<object | null>(null);
|
||||
|
||||
const updateInput = (value: any) => {
|
||||
const ref = {
|
||||
|
|
@ -47,6 +53,12 @@ const updateInput = (value: any) => {
|
|||
commanderPositionRef: commanderPositionRef.value,
|
||||
commanderAboveFullnameRef: commanderAboveFullnameRef.value,
|
||||
commanderAbovePositionRef: commanderAbovePositionRef.value,
|
||||
fileEvaluation1Ref: fileEvaluation1Ref.value,
|
||||
fileEvaluation2Ref: fileEvaluation2Ref.value,
|
||||
fileEvaluation3Ref: fileEvaluation3Ref.value,
|
||||
fileEvaluation4Ref: fileEvaluation4Ref.value,
|
||||
fileEvaluation5Ref: fileEvaluation5Ref.value,
|
||||
fileEvaluation6Ref: fileEvaluation6Ref.value,
|
||||
};
|
||||
emit("update:form", value, ref);
|
||||
};
|
||||
|
|
@ -130,6 +142,12 @@ onMounted(async () => {
|
|||
commanderPositionRef: commanderPositionRef.value,
|
||||
commanderAboveFullnameRef: commanderAboveFullnameRef.value,
|
||||
commanderAbovePositionRef: commanderAbovePositionRef.value,
|
||||
fileEvaluation1Ref: fileEvaluation1Ref.value,
|
||||
fileEvaluation2Ref: fileEvaluation2Ref.value,
|
||||
fileEvaluation3Ref: fileEvaluation3Ref.value,
|
||||
fileEvaluation4Ref: fileEvaluation4Ref.value,
|
||||
fileEvaluation5Ref: fileEvaluation5Ref.value,
|
||||
fileEvaluation6Ref: fileEvaluation6Ref.value,
|
||||
};
|
||||
emit("update:form", formCommand, ref);
|
||||
props.evaluateId && (await fetchPathUpload("เล่ม 1", props.evaluateId));
|
||||
|
|
@ -181,6 +199,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation1Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation1"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -247,6 +267,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation2Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation2"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -314,6 +336,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation3Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation3"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -380,6 +404,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation4Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation4"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -445,6 +471,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation5Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation5"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
@ -511,6 +539,8 @@ onMounted(async () => {
|
|||
</div>
|
||||
<div class="col-xs-12 col-sm-10 row">
|
||||
<q-file
|
||||
ref="fileEvaluation6Ref"
|
||||
:rules="[(val) => !!val || 'เลือกไฟล']"
|
||||
v-model="fileEvaluation6"
|
||||
class="col-12"
|
||||
outlined
|
||||
|
|
|
|||
|
|
@ -1,25 +1,26 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
import { ref, watch } from "vue";
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
import HeaderDialog from "@/components/DialogHeader.vue";
|
||||
|
||||
import type { QTableProps } from "quasar";
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const mixins = useCounterMixin();
|
||||
const { showLoader, hideLoader, date2Thai } = mixins;
|
||||
|
||||
/** รับ props Tab 1 */
|
||||
const props = defineProps({
|
||||
id: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
modal: {
|
||||
type: Boolean,
|
||||
require: true,
|
||||
},
|
||||
// fetchDirector: {
|
||||
// type: Function,
|
||||
// require: true,
|
||||
// default: () => "",
|
||||
// },
|
||||
// fetchMeeting: {
|
||||
// type: Function,
|
||||
// require: true,
|
||||
// default: () => "",
|
||||
// },
|
||||
close: {
|
||||
type: Function,
|
||||
default: () => "",
|
||||
|
|
@ -37,33 +38,60 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "statusEdit",
|
||||
name: "Step",
|
||||
align: "left",
|
||||
label: "การแก้ไข",
|
||||
sortable: true,
|
||||
field: "statusEdit",
|
||||
field: "Step",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "operator",
|
||||
name: "LastUpdateFullName",
|
||||
align: "left",
|
||||
label: "ผู้ดำเนินการ",
|
||||
sortable: true,
|
||||
field: "operator",
|
||||
field: "LastUpdateFullName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "dateEdit",
|
||||
name: "LastUpdatedAt",
|
||||
align: "left",
|
||||
label: "วันที่แก้ไข",
|
||||
sortable: true,
|
||||
field: "dateEdit",
|
||||
field: "LastUpdatedAt",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
]);
|
||||
const row = ref<any>();
|
||||
|
||||
async function fetchListHistory(id: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.get(config.API.evaluationHistory(id))
|
||||
.then((res) => {
|
||||
const data = res.data.result;
|
||||
const list = data.map((e: any) => ({
|
||||
Step: e.Step,
|
||||
LastUpdateFullName: e.LastUpdateFullName,
|
||||
LastUpdatedAt: date2Thai(e.LastUpdatedAt),
|
||||
}));
|
||||
row.value = list;
|
||||
})
|
||||
.catch((err) => {})
|
||||
.finally(() => {
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.modal,
|
||||
() => {
|
||||
props.modal && props.id && fetchListHistory(props.id);
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<template>
|
||||
<q-dialog v-model="props.modal">
|
||||
|
|
@ -81,6 +109,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
bordered
|
||||
class="custom-header-table"
|
||||
:columns="columns"
|
||||
:rows="row"
|
||||
dense
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,12 @@ interface FormCommandRef {
|
|||
commanderPosition: object | null;
|
||||
commanderAboveFullname: object | null;
|
||||
commanderAbovePosition: object | null;
|
||||
fileEvaluation1: object | null;
|
||||
fileEvaluation2: object | null;
|
||||
fileEvaluation3: object | null;
|
||||
fileEvaluation4: object | null;
|
||||
fileEvaluation5: object | null;
|
||||
fileEvaluation6: object | null;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,17 @@ async function fetchCheckStep(id: string) {
|
|||
}
|
||||
|
||||
async function saveEvaluation(body: any) {
|
||||
console.log(body);
|
||||
const data = {
|
||||
IsEducationalQft: body.isEducationalQft,
|
||||
IsGovermantServiceHtr: body.isGovermantServiceHtr,
|
||||
IsOperatingExp: body.isOperatingExp,
|
||||
IsMinPeriodOfTenure: body.isMinPeriodOfTenure,
|
||||
IsHaveSpecificQft: body.isHaveSpecificQft,
|
||||
IsHaveProLicense: body.isHaveProLicense,
|
||||
IsHaveMinPeriodOrHoldPos: body.isHaveMinPeriodOrHoldPos,
|
||||
};
|
||||
console.log(data);
|
||||
|
||||
// const form = {
|
||||
// UserId: "08dbca3a-8b6a-4a4e-8b23-1f62e4f30ef6",
|
||||
// CitizenId: "1540200054020",
|
||||
|
|
@ -170,7 +180,7 @@ async function saveEvaluation(body: any) {
|
|||
|
||||
showLoader();
|
||||
await http
|
||||
.post(config.API.evaluationCheckspec(), body)
|
||||
.post(config.API.evaluationCheckspec(), data)
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue