แก้ฟิล
This commit is contained in:
parent
1d4ca69130
commit
041bdab0f7
5 changed files with 67 additions and 17 deletions
|
|
@ -24,6 +24,8 @@ async function onSubmit(data: any) {
|
||||||
formData.append("type", data.type);
|
formData.append("type", data.type);
|
||||||
formData.append("year", data.year);
|
formData.append("year", data.year);
|
||||||
formData.append("caseType", data.caseType);
|
formData.append("caseType", data.caseType);
|
||||||
|
formData.append("oc", data.oc);
|
||||||
|
formData.append("position", data.position);
|
||||||
formData.append("caseNumber", data.caseNumber);
|
formData.append("caseNumber", data.caseNumber);
|
||||||
formData.append("file", data.file);
|
formData.append("file", data.file);
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -31,6 +33,7 @@ async function onSubmit(data: any) {
|
||||||
.post(config.API.appealAdd(), formData)
|
.post(config.API.appealAdd(), formData)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
|
router.push(`/discipline-appealcomplain/${res.data.result}`)
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
messageError($q, e);
|
messageError($q, e);
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ const id = ref<string>(route.params.id as string);
|
||||||
|
|
||||||
const historyStatusOb = reactive<HistoryStatusType>({
|
const historyStatusOb = reactive<HistoryStatusType>({
|
||||||
status: "",
|
status: "",
|
||||||
|
createdFullName: "",
|
||||||
createdAt: new Date,
|
createdAt: new Date,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -43,6 +44,8 @@ const data = reactive<EditDataList>({
|
||||||
fullname: "",
|
fullname: "",
|
||||||
citizenId: "",
|
citizenId: "",
|
||||||
profileId: "",
|
profileId: "",
|
||||||
|
oc: "",
|
||||||
|
position: "",
|
||||||
lastUpdatedAt: "",
|
lastUpdatedAt: "",
|
||||||
historyStatus: [historyStatusOb],
|
historyStatus: [historyStatusOb],
|
||||||
disciplineComplaint_Appeal_Docs: [fileOb],
|
disciplineComplaint_Appeal_Docs: [fileOb],
|
||||||
|
|
@ -57,6 +60,8 @@ async function onSubmit(data: any) {
|
||||||
year: data.year,
|
year: data.year,
|
||||||
caseType: data.caseType,
|
caseType: data.caseType,
|
||||||
caseNumber: data.caseNumber,
|
caseNumber: data.caseNumber,
|
||||||
|
oc: data.oc,
|
||||||
|
position: data.position,
|
||||||
status: data.status,
|
status: data.status,
|
||||||
};
|
};
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
@ -93,6 +98,8 @@ function getData() {
|
||||||
data.fullname = dataList.fullname;
|
data.fullname = dataList.fullname;
|
||||||
data.citizenId = dataList.citizenId;
|
data.citizenId = dataList.citizenId;
|
||||||
data.profileId = dataList.profileId;
|
data.profileId = dataList.profileId;
|
||||||
|
data.oc = dataList.oc;
|
||||||
|
data.position = dataList.position;
|
||||||
data.lastUpdatedAt = dataList.lastUpdatedAt;
|
data.lastUpdatedAt = dataList.lastUpdatedAt;
|
||||||
data.disciplineComplaint_Appeal_Docs = dataList.disciplineComplaint_Appeal_Docs
|
data.disciplineComplaint_Appeal_Docs = dataList.disciplineComplaint_Appeal_Docs
|
||||||
data.historyStatus = dataList.historyStatus
|
data.historyStatus = dataList.historyStatus
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ const modalEdit = ref<boolean>(false);
|
||||||
|
|
||||||
const historyStatusOb = reactive<HistoryStatusType[]>([{
|
const historyStatusOb = reactive<HistoryStatusType[]>([{
|
||||||
status: "",
|
status: "",
|
||||||
|
createdFullName: "",
|
||||||
createdAt: new Date(),
|
createdAt: new Date(),
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
@ -85,7 +86,7 @@ const objectAppeal: MyObjectAppealRef = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** หัวข้อที่เเสดงในตารางผู้ถูกร้องเรียน */
|
/** หัวข้อที่เเสดงในตารางผู้ถูกร้องเรียน */
|
||||||
const visibleColumns = ref<string[]>(["no", "citizenId", "fullname"]);
|
const visibleColumns = ref<string[]>(["no", "citizenId", "fullname","oc",'position']);
|
||||||
/** หัวตารางผู้ถูกร้องเรียน */
|
/** หัวตารางผู้ถูกร้องเรียน */
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
|
|
||||||
|
|
@ -116,6 +117,24 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "oc",
|
||||||
|
align: "left",
|
||||||
|
label: "สังกัด",
|
||||||
|
sortable: true,
|
||||||
|
field: "oc",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "position",
|
||||||
|
align: "left",
|
||||||
|
label: "ตำแหน่ง",
|
||||||
|
sortable: true,
|
||||||
|
field: "position",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
|
/*** ฟังก์ชั่นสำหรับ validate ฟอร์ม */
|
||||||
|
|
@ -161,14 +180,17 @@ function handleSave(returnData: any) {
|
||||||
profileId: item.personId,
|
profileId: item.personId,
|
||||||
fullname: item.name,
|
fullname: item.name,
|
||||||
citizenId: item.idcard,
|
citizenId: item.idcard,
|
||||||
|
oc: item.organization,
|
||||||
|
position: item.position,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
function inputEdit(val: boolean) {
|
function inputEdit(val: boolean) {
|
||||||
return {
|
return {
|
||||||
"full-width cursor-pointer ": val,
|
"full-width cursor-pointer inputgreen ": val,
|
||||||
"full-width cursor-pointer inputgreen": !val,
|
"full-width cursor-pointer inputgreen": !val,
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function uploadFile() {
|
function uploadFile() {
|
||||||
|
|
@ -245,6 +267,8 @@ watch(props.data, async () => {
|
||||||
profileId: props.data.profileId,
|
profileId: props.data.profileId,
|
||||||
fullname: props.data.fullname,
|
fullname: props.data.fullname,
|
||||||
citizenId: props.data.citizenId,
|
citizenId: props.data.citizenId,
|
||||||
|
oc: props.data.oc,
|
||||||
|
position: props.data.position,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
@ -274,6 +298,8 @@ function onSubmit() {
|
||||||
caseType: formData.caseType,
|
caseType: formData.caseType,
|
||||||
caseNumber: formData.caseNumber,
|
caseNumber: formData.caseNumber,
|
||||||
file: formData.file,
|
file: formData.file,
|
||||||
|
oc: dataRow[0].oc,
|
||||||
|
position: dataRow[0].position,
|
||||||
status: formData.status,
|
status: formData.status,
|
||||||
};
|
};
|
||||||
props.onSubmit(data);
|
props.onSubmit(data);
|
||||||
|
|
@ -299,7 +325,6 @@ onMounted(() => {
|
||||||
<q-select
|
<q-select
|
||||||
ref="typeRef"
|
ref="typeRef"
|
||||||
:class="inputEdit(isReadonly)"
|
:class="inputEdit(isReadonly)"
|
||||||
:readonly="isReadonly"
|
|
||||||
v-model="formData.type"
|
v-model="formData.type"
|
||||||
label="ประเภท"
|
label="ประเภท"
|
||||||
dense
|
dense
|
||||||
|
|
@ -318,6 +343,7 @@ onMounted(() => {
|
||||||
<q-select
|
<q-select
|
||||||
ref="statusRef"
|
ref="statusRef"
|
||||||
v-model="formData.status"
|
v-model="formData.status"
|
||||||
|
:class="inputEdit(isReadonly)"
|
||||||
label="สถานะ"
|
label="สถานะ"
|
||||||
dense
|
dense
|
||||||
bg-color="white"
|
bg-color="white"
|
||||||
|
|
@ -357,7 +383,7 @@ onMounted(() => {
|
||||||
>
|
>
|
||||||
ผู้ยื่นอุทธณ์/ร้องทุกข์
|
ผู้ยื่นอุทธณ์/ร้องทุกข์
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="!isReadonly"
|
v-if="!isReadonly"
|
||||||
size="12px"
|
size="12px"
|
||||||
flat
|
flat
|
||||||
round
|
round
|
||||||
|
|
@ -409,10 +435,10 @@ onMounted(() => {
|
||||||
{{ props.rowIndex + 1 }}
|
{{ props.rowIndex + 1 }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="col.name === 'organization'"
|
v-else-if="col.name === 'oc'"
|
||||||
class="table_ellipsis"
|
class="table_ellipsis"
|
||||||
>
|
>
|
||||||
{{ props.row.organization }}
|
{{ props.row.oc }}
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
{{ col.value }}
|
{{ col.value }}
|
||||||
|
|
@ -426,7 +452,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row col-12">
|
<div class="row col-12">
|
||||||
<div class="col-xs-3 col-sm-3" id="title">
|
<div class="col-12" id="title">
|
||||||
<q-input
|
<q-input
|
||||||
ref="titleRef"
|
ref="titleRef"
|
||||||
dense
|
dense
|
||||||
|
|
@ -466,7 +492,6 @@ onMounted(() => {
|
||||||
class="col-2"
|
class="col-2"
|
||||||
:locale="'th'"
|
:locale="'th'"
|
||||||
autoApply
|
autoApply
|
||||||
:readonly="isReadonly"
|
|
||||||
year-picker
|
year-picker
|
||||||
:enableTimePicker="false"
|
:enableTimePicker="false"
|
||||||
>
|
>
|
||||||
|
|
@ -478,7 +503,6 @@ onMounted(() => {
|
||||||
<q-input
|
<q-input
|
||||||
dense
|
dense
|
||||||
:class="inputEdit(isReadonly)"
|
:class="inputEdit(isReadonly)"
|
||||||
:readonly="isReadonly"
|
|
||||||
lazy-rules
|
lazy-rules
|
||||||
outlined
|
outlined
|
||||||
:model-value="Number(formData.year) + 543"
|
:model-value="Number(formData.year) + 543"
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ import { useCounterMixin } from "@/stores/mixin";
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { dialogConfirm,date2Thai } = mixin;
|
const { dialogConfirm, date2Thai } = mixin;
|
||||||
const dataStore = useAppealComplainStore();
|
const dataStore = useAppealComplainStore();
|
||||||
|
|
||||||
const rows = ref<HistoryStatusType[]>([]);
|
const rows = ref<HistoryStatusType[]>([]);
|
||||||
/** หัวข้อที่เเสดงในตารางผู้ถูกร้องเรียน */
|
/** หัวข้อที่เเสดงในตารางผู้ถูกร้องเรียน */
|
||||||
const visibleColumns = ref<string[]>(["no", "status", "createdAt"]);
|
const visibleColumns = ref<string[]>(["no", "status","createdFullName", "createdAt"]);
|
||||||
/** หัวตารางผู้ถูกร้องเรียน */
|
/** หัวตารางผู้ถูกร้องเรียน */
|
||||||
const columns = ref<QTableProps["columns"]>([
|
const columns = ref<QTableProps["columns"]>([
|
||||||
{
|
{
|
||||||
|
|
@ -32,16 +32,25 @@ const columns = ref<QTableProps["columns"]>([
|
||||||
name: "status",
|
name: "status",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "สถานะ",
|
label: "สถานะ",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "status",
|
field: "status",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "createdFullName",
|
||||||
|
align: "left",
|
||||||
|
label: "ผู้ดำเนินการ",
|
||||||
|
sortable: false,
|
||||||
|
field: "createdFullName",
|
||||||
|
headerStyle: "font-size: 14px",
|
||||||
|
style: "font-size: 14px",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "createdAt",
|
name: "createdAt",
|
||||||
align: "left",
|
align: "left",
|
||||||
label: "แก้ไขเมื่อวันที่",
|
label: "วันที่แก้ไข",
|
||||||
sortable: true,
|
sortable: false,
|
||||||
field: "createdAt",
|
field: "createdAt",
|
||||||
headerStyle: "font-size: 14px",
|
headerStyle: "font-size: 14px",
|
||||||
style: "font-size: 14px",
|
style: "font-size: 14px",
|
||||||
|
|
@ -70,9 +79,11 @@ watch(
|
||||||
() => props.data,
|
() => props.data,
|
||||||
() => {
|
() => {
|
||||||
rows.value = props.data.map((item: HistoryStatusType) => ({
|
rows.value = props.data.map((item: HistoryStatusType) => ({
|
||||||
status: dataStore.statusTothai(item.status),
|
createdFullName:item.createdFullName,
|
||||||
createdAt: date2Thai(item.createdAt),
|
status: dataStore.statusTothai(item.status),
|
||||||
}));
|
createdAt: date2Thai(item.createdAt,false,true),
|
||||||
|
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,8 @@ interface RowAddList {
|
||||||
profileId:string
|
profileId:string
|
||||||
fullname:string
|
fullname:string
|
||||||
citizenId:string
|
citizenId:string
|
||||||
|
oc:string
|
||||||
|
position:string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface EditDataList {
|
interface EditDataList {
|
||||||
|
|
@ -45,6 +47,8 @@ interface EditDataList {
|
||||||
fullname: string
|
fullname: string
|
||||||
citizenId: string
|
citizenId: string
|
||||||
profileId: string
|
profileId: string
|
||||||
|
oc: string
|
||||||
|
position: string
|
||||||
lastUpdatedAt: string
|
lastUpdatedAt: string
|
||||||
historyStatus: object | null
|
historyStatus: object | null
|
||||||
disciplineComplaint_Appeal_Docs: object | null
|
disciplineComplaint_Appeal_Docs: object | null
|
||||||
|
|
@ -52,6 +56,7 @@ interface EditDataList {
|
||||||
|
|
||||||
interface HistoryStatusType {
|
interface HistoryStatusType {
|
||||||
status: string
|
status: string
|
||||||
|
createdFullName: string
|
||||||
createdAt: Date
|
createdAt: Date
|
||||||
}
|
}
|
||||||
interface FileObType {
|
interface FileObType {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue