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