Merge branch 'develop' into nice_dev
# Conflicts: # src/api/11_discipline/api.discipline.ts
This commit is contained in:
parent
73a0384fa8
commit
eafbc65bf2
6 changed files with 104 additions and 28 deletions
|
|
@ -53,4 +53,8 @@ export default {
|
||||||
disciplineComplaintsById: (id: string) =>
|
disciplineComplaintsById: (id: string) =>
|
||||||
`${discipline}/disciplinary/complaint/${id}`,
|
`${discipline}/disciplinary/complaint/${id}`,
|
||||||
disciplineDirector: () => `${discipline}/director`,
|
disciplineDirector: () => `${discipline}/director`,
|
||||||
|
disciplineDoc: (type: string, id: string) =>
|
||||||
|
`${discipline}/disciplinary/${type}/file/${id}`,
|
||||||
|
disciplineByIdDoc: (type: string, id: string, docId: string) =>
|
||||||
|
`${discipline}/disciplinary/${type}/file/${id}/${docId}`,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -244,6 +244,7 @@ watch(
|
||||||
:on-submit="onSubmit"
|
:on-submit="onSubmit"
|
||||||
:data="data"
|
:data="data"
|
||||||
@submit:disciplinary="onSubmitDisciplinary"
|
@submit:disciplinary="onSubmitDisciplinary"
|
||||||
|
:fetchData="fetchDetailDisciplinary"
|
||||||
/>
|
/>
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
|
|
|
||||||
|
|
@ -204,6 +204,10 @@ const props = defineProps({
|
||||||
type: Function,
|
type: Function,
|
||||||
default: () => "",
|
default: () => "",
|
||||||
},
|
},
|
||||||
|
fetchData: {
|
||||||
|
type: Function,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emit = defineEmits(["submit:disciplinary"]);
|
const emit = defineEmits(["submit:disciplinary"]);
|
||||||
|
|
||||||
|
|
@ -890,7 +894,10 @@ onMounted(async () => {
|
||||||
label="ระดับโทษความผิด"
|
label="ระดับโทษความผิด"
|
||||||
:rules="[(val) => !!val || `${'กรุณาเลือกระดับโทษความผิด'}`]"
|
:rules="[(val) => !!val || `${'กรุณาเลือกระดับโทษความผิด'}`]"
|
||||||
lazy-rules
|
lazy-rules
|
||||||
/>
|
group-label="group"
|
||||||
|
group-values="options"
|
||||||
|
>
|
||||||
|
</q-select>
|
||||||
|
|
||||||
<q-input
|
<q-input
|
||||||
class="col-xs-12 col-sm-3"
|
class="col-xs-12 col-sm-3"
|
||||||
|
|
@ -983,24 +990,32 @@ onMounted(async () => {
|
||||||
label="ไฟล์เอกสารหลักฐานสรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"
|
label="ไฟล์เอกสารหลักฐานสรุปพยานหลักฐานสนับสนุนข้อกล่าวหา"
|
||||||
:files="disciplineDisciplinary_DocSummaryEvidences"
|
:files="disciplineDisciplinary_DocSummaryEvidences"
|
||||||
:id="id"
|
:id="id"
|
||||||
|
type="summaryEvidence"
|
||||||
|
:fetchData="props.fetchData"
|
||||||
/>
|
/>
|
||||||
<UploadFile
|
<UploadFile
|
||||||
title="อัปโหลดบันทึกถ้อยคำของผู้กล่าวหา"
|
title="อัปโหลดบันทึกถ้อยคำของผู้กล่าวหา"
|
||||||
label="ไฟล์เอกสารบันทึกถ้อยคำของผู้กล่าวหา"
|
label="ไฟล์เอกสารบันทึกถ้อยคำของผู้กล่าวหา"
|
||||||
:files="disciplineDisciplinary_DocRecordAccusers"
|
:files="disciplineDisciplinary_DocRecordAccusers"
|
||||||
:id="id"
|
:id="id"
|
||||||
|
type="recordAccuser"
|
||||||
|
:fetchData="props.fetchData"
|
||||||
/>
|
/>
|
||||||
<UploadFile
|
<UploadFile
|
||||||
title="อัปโหลดพยานและการบันทึกถ้อยคำ"
|
title="อัปโหลดพยานและการบันทึกถ้อยคำ"
|
||||||
label="ไฟล์เอกสารพยานและการบันทึกถ้อยคำ"
|
label="ไฟล์เอกสารพยานและการบันทึกถ้อยคำ"
|
||||||
:files="disciplineDisciplinary_DocWitnessess"
|
:files="disciplineDisciplinary_DocWitnessess"
|
||||||
:id="id"
|
:id="id"
|
||||||
|
type="witnesses"
|
||||||
|
:fetchData="props.fetchData"
|
||||||
/>
|
/>
|
||||||
<UploadFile
|
<UploadFile
|
||||||
title="อัปโหลดไฟล์เอกสารหลักฐานอื่น ๆ"
|
title="อัปโหลดไฟล์เอกสารหลักฐานอื่น ๆ"
|
||||||
label="ไฟล์เอกสารหลักฐานอื่น ๆ"
|
label="ไฟล์เอกสารหลักฐานอื่น ๆ"
|
||||||
:files="disciplineDisciplinary_DocOthers"
|
:files="disciplineDisciplinary_DocOthers"
|
||||||
:id="id"
|
:id="id"
|
||||||
|
type="other"
|
||||||
|
:fetchData="props.fetchData"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,18 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from "vue";
|
||||||
|
import http from "@/plugins/http";
|
||||||
|
import config from "@/app.config";
|
||||||
|
import { useQuasar } from "quasar";
|
||||||
|
|
||||||
import type { FileLists } from "@/modules/11_discipline/interface/index/Main";
|
import type { FileLists } from "@/modules/11_discipline/interface/index/Main";
|
||||||
|
|
||||||
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
|
|
||||||
|
const $q = useQuasar();
|
||||||
|
|
||||||
|
const mixin = useCounterMixin();
|
||||||
|
const { showLoader, hideLoader, success, messageError } = mixin;
|
||||||
|
|
||||||
const fileRef = ref<Object | null>(null);
|
const fileRef = ref<Object | null>(null);
|
||||||
const file = ref<any>();
|
const file = ref<any>();
|
||||||
|
|
||||||
|
|
@ -28,32 +39,61 @@ const props = defineProps({
|
||||||
required: true,
|
required: true,
|
||||||
default: "support",
|
default: "support",
|
||||||
},
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
fetchData: {
|
||||||
|
type: Function,
|
||||||
|
default: () => "",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* อัปโหลดหลักฐานสนับสนุนข้อกล่าวหา
|
* อัปโหลดหลักฐานสนับสนุนข้อกล่าวหา
|
||||||
*/
|
*/
|
||||||
function uploadFile() {
|
async function uploadFile() {
|
||||||
console.log("test");
|
console.log("test");
|
||||||
|
|
||||||
// const Data = new FormData();
|
const Data = new FormData();
|
||||||
// Data.append("file", file.value);
|
Data.append("file", file.value);
|
||||||
// showLoader();
|
showLoader();
|
||||||
// http
|
await http
|
||||||
// .put(config.API.complaintFileUpload(props.id), Data)
|
.put(config.API.disciplineDoc(props.type, props.id), Data)
|
||||||
// .then((res) => {
|
.then(() => {
|
||||||
// console.log(res);
|
file.value = null;
|
||||||
// success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
// })
|
props.fetchData();
|
||||||
// .catch((e) => {
|
})
|
||||||
// messageError($q, e);
|
.catch((e) => {
|
||||||
// })
|
messageError($q, e);
|
||||||
// .finally(async () => {
|
})
|
||||||
// hideLoader();
|
.finally(async () => {
|
||||||
// });
|
hideLoader();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
function removeFile(id: string) {
|
async function removeFile(id: string) {
|
||||||
console.log(id);
|
showLoader();
|
||||||
|
await http
|
||||||
|
.delete(config.API.disciplineByIdDoc(props.type, props.id, id))
|
||||||
|
.then(() => {
|
||||||
|
success($q, "ลบข้อมูลสำเร็จ");
|
||||||
|
props.fetchData();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
messageError($q, e);
|
||||||
|
})
|
||||||
|
.finally(async () => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* เปิดลิงค์ไฟล์
|
||||||
|
* @param link รับมาเป็น https ลิงค์
|
||||||
|
*/
|
||||||
|
function downloadFile(link: string) {
|
||||||
|
window.open(link, "_blank");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -122,7 +162,7 @@ function removeFile(id: string) {
|
||||||
size="12px"
|
size="12px"
|
||||||
color="blue"
|
color="blue"
|
||||||
icon="mdi-download-outline"
|
icon="mdi-download-outline"
|
||||||
@href="f.pathName"
|
@click="downloadFile(f.pathName)"
|
||||||
>
|
>
|
||||||
<q-tooltip>ดาวน์โหลดเอกสาร</q-tooltip>
|
<q-tooltip>ดาวน์โหลดเอกสาร</q-tooltip>
|
||||||
</q-btn>
|
</q-btn>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,12 @@ interface DataOption {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
interface DataOptioGroup {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
disable: Boolean;
|
||||||
|
}
|
||||||
|
|
||||||
interface DataNumberOption {
|
interface DataNumberOption {
|
||||||
id: number;
|
id: number;
|
||||||
|
|
@ -71,4 +77,5 @@ export type {
|
||||||
DataNumberOption,
|
DataNumberOption,
|
||||||
responseType,
|
responseType,
|
||||||
FileLists,
|
FileLists,
|
||||||
|
DataOptioGroup,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import type {
|
||||||
DataOption,
|
DataOption,
|
||||||
directorType,
|
directorType,
|
||||||
responseType,
|
responseType,
|
||||||
|
DataOptioGroup,
|
||||||
} from "@/modules/11_discipline/interface/index/Main";
|
} from "@/modules/11_discipline/interface/index/Main";
|
||||||
import { useCounterMixin } from "@/stores/mixin";
|
import { useCounterMixin } from "@/stores/mixin";
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
|
|
@ -23,14 +24,22 @@ export const useInvestigateDisStore = defineStore(
|
||||||
{ id: "1", name: "ร้ายแรง" },
|
{ id: "1", name: "ร้ายแรง" },
|
||||||
{ id: "2", name: "ไม่ร้ายแรง" },
|
{ id: "2", name: "ไม่ร้ายแรง" },
|
||||||
]);
|
]);
|
||||||
const optionsfaultLevel = ref<DataOption[]>([
|
const optionsfaultLevel = ref<DataOptioGroup[]>([
|
||||||
// { id: "0", name: "ไม่ร้ายแรง" },
|
{ id: "0", name: "ไม่ร้ายแรง", disable: true },
|
||||||
// { id: "1", name: "ภาคทัณฑ์" },
|
{ id: "ภาคทัณฑ์", name: "ภาคทัณฑ์", disable: false },
|
||||||
// { id: "2", name: "ตัดเงินเดือน" },
|
{
|
||||||
// { id: "3", name: "ลดขั้นเงินเดือน" },
|
id: "ตัดเงินเดือน",
|
||||||
// { id: "4", name: "ร้ายแรง" },
|
name: "ตัดเงินเดือน",
|
||||||
// { id: "5", name: "ปลดออก" },
|
disable: false,
|
||||||
// { id: "6", name: "ไล่ออก" },
|
},
|
||||||
|
{
|
||||||
|
id: "ลดขั้นเงินเดือน",
|
||||||
|
name: "ลดขั้นเงินเดือน",
|
||||||
|
disable: false,
|
||||||
|
},
|
||||||
|
{ id: "4", name: "ร้ายแรง", disable: true },
|
||||||
|
{ id: "ปลดออก", name: "ปลดออก", disable: false },
|
||||||
|
{ id: "ไล่ออก", name: "ไล่ออก", disable: false },
|
||||||
]);
|
]);
|
||||||
async function fetchList(data: investigateDisDataRowType[]) {
|
async function fetchList(data: investigateDisDataRowType[]) {
|
||||||
let datalist: any[] = data.map((e: any) => ({
|
let datalist: any[] = data.map((e: any) => ({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue