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