แก้วินัย
This commit is contained in:
parent
456cf574f6
commit
91502f6d8b
8 changed files with 80 additions and 9 deletions
|
|
@ -62,6 +62,7 @@ const nameFault = ref<string>("");
|
|||
const modalFault = ref<boolean>(false);
|
||||
const remark = ref<string>("");
|
||||
|
||||
const idRow = ref<string>("");
|
||||
const checkValue = ref<FaultTypeOption[]>(
|
||||
JSON.parse(JSON.stringify(mainStore.checkValueFaultT))
|
||||
);
|
||||
|
|
@ -264,12 +265,20 @@ function updatemodalPersonal(modal: boolean) {
|
|||
}
|
||||
|
||||
function onFault(data: any) {
|
||||
idRow.value = data.id;
|
||||
nameFault.value = data.name;
|
||||
modalFault.value = true;
|
||||
personalId.value = data.personId;
|
||||
remark.value = data.remark ?? "";
|
||||
if (data.offense !== null) {
|
||||
checkValue.value = JSON.parse(data.offense);
|
||||
} else {
|
||||
checkValue.value = JSON.parse(JSON.stringify(mainStore.checkValueFaultT));
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
idRow.value = "";
|
||||
modalFault.value = false;
|
||||
personalId.value = "";
|
||||
remark.value = "";
|
||||
|
|
@ -279,9 +288,21 @@ function close() {
|
|||
function onFaultSubmit() {
|
||||
if (checkValue.value.some((item) => item.value)) {
|
||||
dialogConfirm($q, () => {
|
||||
console.log("onFaultSubmit wait API");
|
||||
close();
|
||||
props.fetchData();
|
||||
showLoader();
|
||||
http
|
||||
.put(config.API.disciplineFault(idRow.value), {
|
||||
offense: JSON.stringify(checkValue.value),
|
||||
remark: remark.value,
|
||||
})
|
||||
.then((res) => {
|
||||
success($q, "ระบุฐานความผิด สำเร็จ");
|
||||
close();
|
||||
props.fetchData();
|
||||
})
|
||||
.catch((e) => {
|
||||
messageError($q, e);
|
||||
})
|
||||
.finally(() => {});
|
||||
});
|
||||
} else {
|
||||
dialogMessageNotify($q, "กรุณาเลือกอย่างน้อย 1 มาตรา");
|
||||
|
|
@ -413,7 +434,7 @@ watch(
|
|||
<div class="col-xs-12 q-pa-sm">
|
||||
<d-table
|
||||
ref="table"
|
||||
:columns="mainStore.columnsRespondent"
|
||||
:columns="mainStore.columnsRespondent?.filter((item:any)=>item.name !== 'isSend' && item.name !== 'remarkReject')"
|
||||
:rows="mainStore.rowsAdd"
|
||||
row-key="idcard"
|
||||
flat
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue