no message
This commit is contained in:
parent
ab32df6dc9
commit
dbcf1f0106
2 changed files with 69 additions and 31 deletions
|
|
@ -55,6 +55,8 @@ const {
|
|||
showLoader,
|
||||
hideLoader,
|
||||
dialogConfirm,
|
||||
dialogMessageNotify,
|
||||
modalWarning
|
||||
} = mixin;
|
||||
const filterData = (options: any[], excludedGroups: any[]) => {
|
||||
return options.filter(
|
||||
|
|
@ -545,11 +547,6 @@ const putData = (id: string) => {
|
|||
role: "mentor",
|
||||
dated: date2.value instanceof Date ? dateToISO(date2.value) : dateToISO(new Date(date2.value)),
|
||||
},
|
||||
{
|
||||
personal_id: caretaker2.value.id,
|
||||
role: "mentor",
|
||||
dated: date3.value instanceof Date ? dateToISO(date3.value) : dateToISO(new Date(date3.value)),
|
||||
},
|
||||
{
|
||||
personal_id: commander.value.id,
|
||||
role: "commander",
|
||||
|
|
@ -560,6 +557,13 @@ const putData = (id: string) => {
|
|||
role: "chairman",
|
||||
},
|
||||
];
|
||||
if (caretaker2.value) {
|
||||
assign_director.push({
|
||||
personal_id: caretaker2.value.id,
|
||||
role: "mentor",
|
||||
dated: date3.value instanceof Date ? dateToISO(date3.value) : dateToISO(new Date(date3.value)),
|
||||
});
|
||||
}
|
||||
const data = {
|
||||
personalId: GUID,
|
||||
fullname: fullname.value,
|
||||
|
|
@ -621,7 +625,7 @@ const DataSave = async (id: string) => {
|
|||
hideLoader();
|
||||
});
|
||||
} else {
|
||||
notifyError($q, "กรุณากรอกข้อมูลให้ครบ");
|
||||
dialogMessageNotify($q, "กรุณากรอกข้อมูลให้ครบ");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
@ -856,7 +860,7 @@ watch(knowledge.value, () => {
|
|||
:options="filtermantor(OPcaretaker, [caretaker2])" class="col-xs-12 col-sm-6" :readonly="status != true"
|
||||
dense hide-bottom-space borderless :outlined="status == true" v-model="caretaker1"
|
||||
:label="`ผู้ดูแลคนที่ 1`" option-label="name" />
|
||||
<q-select :rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
<q-select clearable
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
|
||||
hide-bottom-space class="col-xs-12 col-sm-6" :readonly="status != true" dense borderless
|
||||
:outlined="status == true" v-model="caretaker2" :label="`ผู้ดูแลคนที่ 2`" />
|
||||
|
|
@ -866,7 +870,7 @@ watch(knowledge.value, () => {
|
|||
:options="filtermantor(OPcaretaker, [caretaker2])" class="col-xs-12 col-sm-6" :readonly="status != true"
|
||||
dense hide-bottom-space borderless :outlined="status == true" v-model="caretaker1"
|
||||
:label="`ผู้ดูแลคนที่ 1`" option-label="name" />
|
||||
<q-select :rules="[(val) => !!val || 'กรุณาเลือกผู้ดูเเล']"
|
||||
<q-select clearable
|
||||
:options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
|
||||
hide-bottom-space class="col-xs-12 col-sm-6" :readonly="status != true" dense borderless
|
||||
:outlined="status == true" v-model="caretaker2" :label="`ผู้ดูแลคนที่ 2`" />
|
||||
|
|
@ -1598,15 +1602,15 @@ watch(knowledge.value, () => {
|
|||
</template>
|
||||
</datepicker>
|
||||
</div>
|
||||
<q-select v-if="status == true" :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id"
|
||||
<q-select clearable v-if="status == true" :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id"
|
||||
option-label="name" class="col-xs-12 col-sm-8" :readonly="status != true" dense borderless
|
||||
:outlined="status == true" v-model="caretaker2" label="ผู้ดูแลคนที่ 2" />
|
||||
<q-select v-else :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
|
||||
class="col-xs-12 col-sm-8" :readonly="status != true" dense borderless :outlined="status == true"
|
||||
<q-select clearable v-else :options="filtermantor(OPcaretaker, [caretaker1])" option-value="id" option-label="name"
|
||||
class="col-xs-12 col-sm-8" :readonly="status != true " dense borderless :outlined="status == true"
|
||||
v-model="caretaker2" label="ผู้ดูแลคนที่ 2" />
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<datepicker menu-class-name="modalfix" v-model="date3" :locale="'th'" autoApply borderless
|
||||
:enableTimePicker="false" week-start="0" :readonly="status != true">
|
||||
:enableTimePicker="false" week-start="0" :readonly="status != true | !caretaker2">
|
||||
<template #year="{ year }">
|
||||
{{ year + 543 }}
|
||||
</template>
|
||||
|
|
@ -1614,7 +1618,9 @@ watch(knowledge.value, () => {
|
|||
{{ parseInt(value + 543) }}
|
||||
</template>
|
||||
<template #trigger>
|
||||
<q-input :rules="[(val) => !!val || 'กรุณาเลือกวันที่']" hide-bottom-space
|
||||
<q-input hide-bottom-space
|
||||
|
||||
:disable="!caretaker2"
|
||||
:readonly="status != true" dense s borderless :outlined="status == true"
|
||||
class="full-width datepicker" :model-value="date3 != null ? date2Thai(date3) : null"
|
||||
label="ลงวันที่">
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, onMounted } from "vue";
|
||||
import type { QTableProps } from "quasar";
|
||||
|
||||
import { useQuasar } from "quasar";
|
||||
import { useCounterMixin } from '@/stores/mixin'
|
||||
import http from "@/plugins/http";
|
||||
import config from "@/app.config";
|
||||
|
||||
const mixin = useCounterMixin()
|
||||
const { success, messageError,hideLoader,dialogConfirm } = mixin
|
||||
const fileUpload = ref<any>(null);
|
||||
const reason = ref<string>("");
|
||||
const documentTitle = ref<string>("");
|
||||
|
||||
const $q = useQuasar();
|
||||
const filterKeyword = ref<string>("");
|
||||
const filterDoc = ref<any>(null);
|
||||
|
||||
|
|
@ -48,21 +51,12 @@ const colums2 = ref<QTableProps["columns"]>([
|
|||
sortable: true,
|
||||
},
|
||||
]);
|
||||
const rows2 = ref<any>([
|
||||
{
|
||||
no: "1",
|
||||
fileName: "test1",
|
||||
annotation: "ทดสอบ",
|
||||
file: "",
|
||||
},
|
||||
{
|
||||
no: "2",
|
||||
fileName: "test2",
|
||||
annotation: "ทดสอบ",
|
||||
file: "",
|
||||
},
|
||||
]);
|
||||
const rows2 = ref<any>([]);
|
||||
|
||||
interface TypeData {
|
||||
fileName:string
|
||||
annotation:string
|
||||
}
|
||||
const props = defineProps({
|
||||
roundId: {
|
||||
type: String,
|
||||
|
|
@ -74,7 +68,45 @@ const getRequest = async () => {
|
|||
.get(config.API.requestDocNote(props.roundId as string))
|
||||
.then((res:any) =>{
|
||||
console.log(res)
|
||||
const data = res.data.result
|
||||
console.log(data)
|
||||
data.map((item:TypeData) =>{
|
||||
rows2.value.push({
|
||||
fileName:item.fileName,
|
||||
annotation:item.annotation
|
||||
})
|
||||
|
||||
}
|
||||
)
|
||||
console.log(rows2.value)
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
});
|
||||
}
|
||||
|
||||
const putRequest = () => {
|
||||
const dataAppend = new FormData()
|
||||
dataAppend.append("Name",documentTitle.value)
|
||||
dataAppend.append("Reason",reason.value)
|
||||
dataAppend.append("File",fileUpload.value)
|
||||
http
|
||||
.put(config.API.requestDocNote(props.roundId as string),dataAppend)
|
||||
.then((res) => {
|
||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {
|
||||
documentTitle.value = "";
|
||||
reason.value = "";
|
||||
fileUpload.value = null;
|
||||
getRequest();
|
||||
hideLoader();
|
||||
});
|
||||
}
|
||||
onMounted(async() => {
|
||||
console.log(props.roundId);
|
||||
|
|
@ -91,7 +123,7 @@ const pagination = ref({
|
|||
rowsPerPage: 10,
|
||||
});
|
||||
const save = () => {
|
||||
props.saveData()
|
||||
dialogConfirm($q,()=>putRequest())
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
|
@ -203,7 +235,7 @@ props.saveData()
|
|||
{{ props.row.fileName }}
|
||||
</q-td>
|
||||
<q-td key="annotation" :props="props">
|
||||
{{ props.row.annotation }}
|
||||
{{ props.row.annotation !== undefined ? props.row.annotation:"-"}}
|
||||
</q-td>
|
||||
<q-td auto-width>
|
||||
<q-btn
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue