popup แก้ไข มติอกก
This commit is contained in:
parent
8783a54691
commit
155a3b206d
3 changed files with 93 additions and 14 deletions
|
|
@ -32,7 +32,7 @@ export default {
|
|||
listExitInterview: () => `${retirement}/resign/questionnaire`,
|
||||
ExitInterviewByid: (id: string) => `${retirement}/resign/questionnaire/${id}`,
|
||||
ExitInterviewReport: `${retirement}/resign/questionnaire/report`,
|
||||
AppointInterview:(id: string) =>`${retirement}/resign/questionnaire/appoint/${id}`,
|
||||
AppointInterview: (id: string) => `${retirement}/resign/questionnaire/appoint/${id}`,
|
||||
// ปลดออก
|
||||
retirementDischarge,
|
||||
listDischarge: () => `${retirement}/discharge`,
|
||||
|
|
@ -52,5 +52,9 @@ export default {
|
|||
outReport: `${retirement}/out/report`,
|
||||
|
||||
fileRetirement: (id: string) => `${retirement}/upload/${id}`,
|
||||
checkfileupload: (id: string) => `${retirement}/upload/check/${id}`
|
||||
checkfileupload: (id: string) => `${retirement}/upload/check/${id}`,
|
||||
|
||||
editDetail: (retireId: string) => `${retirement}/detail/${retireId}`
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
import { ref, watch } from "vue";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
|
||||
const reason = ref<string>("");
|
||||
const reason = ref<string | undefined>("");
|
||||
const props = defineProps({
|
||||
modal: {
|
||||
type: Boolean,
|
||||
|
|
@ -18,16 +18,21 @@ const props = defineProps({
|
|||
},
|
||||
clickClose: {
|
||||
type: Function,
|
||||
default: () => { },
|
||||
default: () => {},
|
||||
},
|
||||
savaForm: {
|
||||
type: Function,
|
||||
default: () => { },
|
||||
default: () => {},
|
||||
},
|
||||
textReport: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
watch(props, () => {
|
||||
if (props.modal === true) {
|
||||
if (props.modal === true && props.textReport == "") {
|
||||
reason.value = "";
|
||||
} else {
|
||||
reason.value = props.textReport;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -51,18 +56,31 @@ const submit = () => {
|
|||
<div class="row col-12 q-col-gutter-sm">
|
||||
<div class="col-xs-12">
|
||||
<div class="col-12 row q-py-sm items-center q-col-gutter-sm">
|
||||
|
||||
<q-input type="textarea" class="full-width inputgreen cursor-pointer" hide-bottom-space outlined dense
|
||||
lazy-rules :rules="[(val) => !!val || `กรุณากรอก${label}`]" v-model="reason" :label="`${label}`" />
|
||||
|
||||
|
||||
<q-input
|
||||
type="textarea"
|
||||
class="full-width inputgreen cursor-pointer"
|
||||
hide-bottom-space
|
||||
outlined
|
||||
dense
|
||||
lazy-rules
|
||||
:rules="[(val) => !!val || `กรุณากรอก${label}`]"
|
||||
v-model="reason"
|
||||
:label="`${label}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-separator />
|
||||
<q-card-actions align="right">
|
||||
<q-btn dense unelevated label="บันทึก" color="public" @click="submit" class="q-px-md">
|
||||
<q-btn
|
||||
dense
|
||||
unelevated
|
||||
label="บันทึก"
|
||||
color="public"
|
||||
@click="submit"
|
||||
class="q-px-md"
|
||||
>
|
||||
<!-- icon="mdi-content-save-outline" -->
|
||||
<q-tooltip>บันทึก</q-tooltip>
|
||||
</q-btn>
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@ import { useRouter } from "vue-router";
|
|||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
import DialogHeader from "@/components/DialogHeader.vue";
|
||||
import DialogPopupReason from "@/components/Dialogs/PopupReason.vue";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const $q = useQuasar();
|
||||
const mixin = useCounterMixin();
|
||||
const { showLoader, hideLoader, messageError, success } = mixin;
|
||||
const { showLoader, hideLoader, messageError, success, dialogConfirm } = mixin;
|
||||
// const type_params = route.params.type;
|
||||
// const year_params = route.params.year;
|
||||
const retireld_params = route.params.retirementId;
|
||||
|
|
@ -26,6 +27,8 @@ const retireld = ref<string>(retireld_params.toString());
|
|||
const profileId = ref<string>("");
|
||||
const filter = ref<string>("");
|
||||
const statusUpload = ref<boolean>();
|
||||
const modalEdit = ref<boolean>(false);
|
||||
const textReport = ref<string>("");
|
||||
|
||||
const columns = ref<any["columns"]>([
|
||||
{
|
||||
|
|
@ -177,6 +180,7 @@ const fecthlistprofile = async (id: string) => {
|
|||
round.value = res.data.result.round;
|
||||
statusReport.value = res.data.result.json;
|
||||
typeReport.value = res.data.result.typeReport;
|
||||
textReport.value = res.data.result.detail;
|
||||
rows.value = res.data.result.profile.map((e: any) => ({
|
||||
id: e.id,
|
||||
profileId: e.profileId,
|
||||
|
|
@ -312,6 +316,7 @@ const uploadFile = async (event: any) => {
|
|||
console.log(selectedFile);
|
||||
const formdata = new FormData();
|
||||
formdata.append("file", selectedFile);
|
||||
|
||||
await http
|
||||
.put(config.API.fileRetirement(retireld.value.toString()), formdata)
|
||||
.then((res) => {
|
||||
|
|
@ -381,6 +386,36 @@ const downloadFile = (response: any, filename: string) => {
|
|||
// return "color: #26a69a;";
|
||||
// } else return "";
|
||||
// };
|
||||
const saveEdiitReport = (reason: string) => {
|
||||
const formdata = new FormData();
|
||||
formdata.append("Detail", reason);
|
||||
dialogConfirm(
|
||||
$q,
|
||||
async () => {
|
||||
await http
|
||||
.put(config.API.editDetail(retireld.value), formdata)
|
||||
.then(() => {
|
||||
success($q, "แก้ไขข้อความสำเร็จ");
|
||||
})
|
||||
.catch((err) => {
|
||||
messageError($q, err);
|
||||
})
|
||||
.finally(() => {
|
||||
fecthlistprofile(retireld.value);
|
||||
closemodalEditReport();
|
||||
});
|
||||
},
|
||||
"ยืนยันการแก้ไขข้อมูล",
|
||||
"ต้องการยืนยันการแก้ไขข้อมูลนี้หรือไม่ ?"
|
||||
);
|
||||
};
|
||||
const openmodalEditReport = () => {
|
||||
modalEdit.value = true;
|
||||
};
|
||||
const closemodalEditReport = () => {
|
||||
modalEdit.value = false;
|
||||
};
|
||||
|
||||
const paging = ref<boolean>(true);
|
||||
const pagination = ref({
|
||||
sortBy: "order",
|
||||
|
|
@ -427,9 +462,22 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
<!-- <q-btn flat round style="color: #016987;" icon="save" @click="saveList">
|
||||
<q-tooltip>บันทึกข้อมูล</q-tooltip>
|
||||
</q-btn> -->
|
||||
<q-btn color="primary" flat round icon="download">
|
||||
<q-btn color="primary" flat round icon="mdi-dots-vertical">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 100px">
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
type="a"
|
||||
@click="openmodalEditReport()"
|
||||
target="_blank"
|
||||
>
|
||||
<q-item-section avatar
|
||||
><q-icon color="primary" name="mdi-pencil"
|
||||
/></q-item-section>
|
||||
<q-item-section>แก้ไข มติ อ.ก.ก. </q-item-section>
|
||||
</q-item>
|
||||
<q-separator />
|
||||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
|
|
@ -743,6 +791,15 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
|||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
<DialogPopupReason
|
||||
:modal="modalEdit"
|
||||
title="แก้ไขมติ อ.ก.ก."
|
||||
label="มติ อ.ก.ก."
|
||||
:click-close="closemodalEditReport"
|
||||
:savaForm="saveEdiitReport"
|
||||
:textReport="textReport"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<style lang="scss" scope>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue