แก้ กรรมการ
This commit is contained in:
parent
40e787af89
commit
72a1171b8f
6 changed files with 186 additions and 144 deletions
|
|
@ -67,6 +67,7 @@ const listDirector = ref<any>([]);
|
|||
const modalEditDirector = ref<boolean>(false);
|
||||
const editDirectorId = ref<string>();
|
||||
const dutyVal = ref<string>();
|
||||
const commandNoVal = ref<string>();
|
||||
|
||||
const id = ref<string>(route.params.id as string);
|
||||
const isUpdate = ref<boolean>(false);
|
||||
|
|
@ -327,16 +328,17 @@ async function fetchDatadetail() {
|
|||
);
|
||||
/** MAP รายชื่อกรรมการ หน้าหลัก */
|
||||
const dataMap = props.data.director.map((item: any) => ({
|
||||
idRaw: item.id,
|
||||
id: item.directorId,
|
||||
idRaw: item.id ? item.id:'-',
|
||||
id: item.directorId ? item.directorId:'-',
|
||||
name: `${item.prefix}${item.firstName} ${item.lastName}`,
|
||||
prefix: item.prefix,
|
||||
firstName: item.firstName,
|
||||
lastName: item.lastName,
|
||||
position: item.position,
|
||||
email: item.email,
|
||||
phone: item.phone,
|
||||
duty: item.duty,
|
||||
prefix: item.prefix ? item.prefix:'-',
|
||||
firstName: item.firstName ? item.firstName:'-',
|
||||
lastName: item.lastName ? item.lastName:'-',
|
||||
position: item.position ? item.position:'-',
|
||||
email: item.email ? item.email:'-',
|
||||
phone: item.phone ? item.phone:'-',
|
||||
duty: item.duty ? item.duty:'-',
|
||||
commandNo: item.commandNo ? item.commandNo:'-',
|
||||
check: "props",
|
||||
}));
|
||||
|
||||
|
|
@ -537,20 +539,42 @@ function emitPerson(data: PersonsArray[]) {
|
|||
});
|
||||
}
|
||||
|
||||
function openEditDirector(idVal: string, duty: string) {
|
||||
editDirectorId.value = idVal;
|
||||
function openEditDirector(data: any) {
|
||||
console.log(data)
|
||||
editDirectorId.value = data.idRaw;
|
||||
modalEditDirector.value = true;
|
||||
dutyVal.value = duty;
|
||||
dutyVal.value = data.duty;
|
||||
commandNoVal.value = data.commandNo;
|
||||
}
|
||||
|
||||
function closeEditDirector() {
|
||||
modalEditDirector.value = false;
|
||||
}
|
||||
|
||||
async function saveDuty(id: string, duty: string) {
|
||||
// async function saveDuty(id: string, duty: string) {
|
||||
// showLoader();
|
||||
// await http
|
||||
// .put(config.API.disciplinaryEditDuty(props.data.id, id), { duty: duty })
|
||||
// .then((res: any) => {
|
||||
// success($q, "บันทึกสำเร็จ");
|
||||
// closeEditDirector();
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// messageError($q, e);
|
||||
// })
|
||||
// .finally(async () => {
|
||||
// props.fetchData();
|
||||
// hideLoader();
|
||||
// });
|
||||
// }
|
||||
|
||||
async function saveDuty(id: string, duty: string, resolution: string) {
|
||||
showLoader();
|
||||
await http
|
||||
.put(config.API.disciplinaryEditDuty(props.data.id, id), { duty: duty })
|
||||
.put(config.API.disciplinaryEditDuty(props.data.id, id), {
|
||||
duty: duty,
|
||||
commandNo: resolution,
|
||||
})
|
||||
.then((res: any) => {
|
||||
success($q, "บันทึกสำเร็จ");
|
||||
closeEditDirector();
|
||||
|
|
@ -687,7 +711,8 @@ onMounted(async () => {
|
|||
v-if="
|
||||
route.name === 'disciplineDisciplinaryEdit' &&
|
||||
props.data &&
|
||||
props.data.status === 'NEW'
|
||||
props.data.status === 'NEW' &&
|
||||
mainStore.rowsCheck.length > 0
|
||||
"
|
||||
>
|
||||
<q-btn
|
||||
|
|
@ -1328,23 +1353,11 @@ onMounted(async () => {
|
|||
flat
|
||||
round
|
||||
color="blue"
|
||||
@click="
|
||||
openEditDirector(
|
||||
props.row.idRaw,
|
||||
props.row.duty
|
||||
)
|
||||
"
|
||||
@click="openEditDirector(props.row)"
|
||||
icon="mdi-pencil-outline"
|
||||
>
|
||||
<q-tooltip>แก้ไข</q-tooltip>
|
||||
</q-btn>
|
||||
<DialogDuty
|
||||
:modal="modalEditDirector"
|
||||
:close-popup="closeEditDirector"
|
||||
:id="editDirectorId"
|
||||
:duty="dutyVal"
|
||||
:save="saveDuty"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="!isReadonly"
|
||||
|
|
@ -1711,6 +1724,15 @@ onMounted(async () => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<DialogDuty
|
||||
:modal="modalEditDirector"
|
||||
:close-popup="closeEditDirector"
|
||||
:id="editDirectorId"
|
||||
:duty="dutyVal"
|
||||
:command="commandNoVal"
|
||||
:save="saveDuty"
|
||||
/>
|
||||
|
||||
<!-- Popup ผู้ถูกร้องเรียน -->
|
||||
<DialogAddPersonal
|
||||
title="ผู้ถูกร้องเรียน"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue