no message
This commit is contained in:
parent
30b420ae6c
commit
5acca0efa6
6 changed files with 90 additions and 43 deletions
|
|
@ -43,6 +43,7 @@ const visibleColumns = ref<string[]>([
|
|||
"no",
|
||||
"idcard",
|
||||
"fullName",
|
||||
"positionNo",
|
||||
"position",
|
||||
"positionLevel",
|
||||
"salary",
|
||||
|
|
@ -78,6 +79,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "positionNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -205,6 +215,7 @@ onMounted(() => {
|
|||
prefix: "นาง",
|
||||
firstName: "ศิรินภา",
|
||||
lastName: "คงน้อย",
|
||||
positionNo: "สกก.1",
|
||||
position: "ตำเเหน่ง1",
|
||||
positionLevel: "level1",
|
||||
salary: "100",
|
||||
|
|
@ -217,6 +228,7 @@ onMounted(() => {
|
|||
prefix: "นาย",
|
||||
firstName: "แก้ว",
|
||||
lastName: "คำ",
|
||||
positionNo: "สกก.1",
|
||||
position: "ตำแหน่ง2",
|
||||
positionLevel: "level2",
|
||||
salary: "100",
|
||||
|
|
@ -229,6 +241,7 @@ onMounted(() => {
|
|||
prefix: "นาย",
|
||||
firstName: "ภัทรานุย",
|
||||
lastName: "คงนอย",
|
||||
positionNo: "สกก.1",
|
||||
position: "ตำแหน่ง2",
|
||||
positionLevel: "level3",
|
||||
salary: "100",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ const id = ref<string>(route.params.id as string);
|
|||
const personOj = reactive<ArrayPerson>({
|
||||
idcard: "",
|
||||
name: "",
|
||||
positionNo: "",
|
||||
position: "",
|
||||
positionLevel: "",
|
||||
salary: "",
|
||||
|
|
@ -76,6 +77,7 @@ const fetchData = async () => {
|
|||
{
|
||||
idcard: "1529900022223",
|
||||
name: "นางศิรินภา คงน้อย",
|
||||
positionNo: "สกก.1",
|
||||
position: "ธุรการ",
|
||||
positionLevel: "ต้น",
|
||||
salary: "10000",
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import type {
|
|||
MyObjectComplaintsRef,
|
||||
DataAddRequest,
|
||||
ArrayPerson,
|
||||
ArrayFileList
|
||||
ArrayFileList,
|
||||
} from "@/modules/11_discipline/interface/request/complaint";
|
||||
|
||||
/** importStroe*/
|
||||
|
|
@ -26,7 +26,7 @@ const fileDocDataUpload = ref<File[]>([]);
|
|||
/** เรียกใช้ store */
|
||||
const mixin = useCounterMixin();
|
||||
const complainstStore = useComplainstDataStore();
|
||||
const { date2Thai, dialogConfirm,dialogRemove,success } = mixin;
|
||||
const { date2Thai, dialogConfirm, dialogRemove, success } = mixin;
|
||||
const { selectComplainantTpye, filterSelector } = complainstStore; // function จาก store complainstStore
|
||||
|
||||
/** validateForm */
|
||||
|
|
@ -60,6 +60,7 @@ const props = defineProps({
|
|||
const personOj = reactive<ArrayPerson>({
|
||||
idcard: "",
|
||||
name: "",
|
||||
positionNo: "",
|
||||
position: "",
|
||||
positionLevel: "",
|
||||
salary: "",
|
||||
|
|
@ -67,10 +68,10 @@ const personOj = reactive<ArrayPerson>({
|
|||
});
|
||||
|
||||
const fileListOj = reactive<ArrayFileList>({
|
||||
id:"",
|
||||
file:"",
|
||||
fileName:"",
|
||||
fileType:""
|
||||
id: "",
|
||||
file: "",
|
||||
fileName: "",
|
||||
fileType: "",
|
||||
});
|
||||
|
||||
const formData = reactive<FormData>({
|
||||
|
|
@ -92,7 +93,7 @@ const formData = reactive<FormData>({
|
|||
personId: [],
|
||||
organizationId: null,
|
||||
respondentId: [],
|
||||
fileList:[fileListOj]
|
||||
fileList: [fileListOj],
|
||||
});
|
||||
|
||||
/** maping ref เข้าตัวแปรเพื่อเตรียมตรวจสอบ */
|
||||
|
|
@ -161,6 +162,15 @@ const columns = ref<QTableProps["columns"]>([
|
|||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "positionNo",
|
||||
align: "left",
|
||||
label: "ตำแหน่งเลขที่",
|
||||
sortable: true,
|
||||
field: "positionNo",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
{
|
||||
name: "position",
|
||||
align: "left",
|
||||
|
|
@ -204,6 +214,7 @@ const visibleColumns = ref<string[]>([
|
|||
"no",
|
||||
"idcard",
|
||||
"name",
|
||||
'positionNo',
|
||||
"position",
|
||||
"positionLevel",
|
||||
"salary",
|
||||
|
|
@ -320,6 +331,7 @@ async function addPerson() {
|
|||
id: "001",
|
||||
idcard: "0000000000001",
|
||||
name: "นางศิรินภา คงน้อย",
|
||||
positionNo: "สกก.1",
|
||||
position: "ตำเเหน่ง1",
|
||||
positionLevel: "level1",
|
||||
salary: "10000",
|
||||
|
|
@ -329,6 +341,7 @@ async function addPerson() {
|
|||
id: "002",
|
||||
idcard: "0000000000002",
|
||||
name: "นายแก้ว คำ",
|
||||
positionNo: "สกก.1",
|
||||
position: "ตำแหน่ง2",
|
||||
positionLevel: "level2",
|
||||
salary: "1000",
|
||||
|
|
@ -338,6 +351,7 @@ async function addPerson() {
|
|||
id: "003",
|
||||
idcard: "0000000000003",
|
||||
name: "นายภัทรานุย คงนอย",
|
||||
positionNo: "สกก.1",
|
||||
position: "ตำแหน่ง2",
|
||||
positionLevel: "level3",
|
||||
salary: "100",
|
||||
|
|
@ -350,19 +364,28 @@ async function addPerson() {
|
|||
|
||||
/**
|
||||
* เปิดลิงค์ไฟล์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
* @param link รับมาเป็น https ลิงค์
|
||||
*/
|
||||
function downloadFile(link:string){
|
||||
window.open(link, '_blank');
|
||||
function downloadFile(link: string) {
|
||||
window.open(link, "_blank");
|
||||
}
|
||||
|
||||
function deleteFile(id:string){
|
||||
dialogRemove($q,() => confirmDelete(id))
|
||||
/**
|
||||
* ลบไฟล์
|
||||
* @param id id file
|
||||
*/
|
||||
function deleteFile(id: string) {
|
||||
dialogRemove($q, () => confirmDelete(id));
|
||||
}
|
||||
|
||||
function confirmDelete(id:string){
|
||||
/**
|
||||
* ยืนยัน ลบ ไฟล์
|
||||
* @param id id file
|
||||
*/
|
||||
function confirmDelete(id: string) {
|
||||
success($q, `ลบไฟล์สำเร็จ #id:${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* เช็คข้อมูลจาก props
|
||||
* เมื่อมีข้อมูล
|
||||
|
|
@ -943,36 +966,40 @@ onMounted(() => {
|
|||
</div>
|
||||
|
||||
<div class="q-pa-md">
|
||||
<q-list bordered separator v-for="data in formData.fileList" :key="data.id">
|
||||
<q-item clickable v-ripple class="items-center">
|
||||
<q-item-section>{{ data.fileName }}</q-item-section>
|
||||
<q-space/>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="blue"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.file)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="red"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deleteFile(data.id)"
|
||||
><q-tooltip>ลบไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</q-item>
|
||||
|
||||
</q-list>
|
||||
</div>
|
||||
<q-list
|
||||
bordered
|
||||
separator
|
||||
v-for="data in formData.fileList"
|
||||
:key="data.id"
|
||||
>
|
||||
<q-item clickable v-ripple class="items-center">
|
||||
<q-item-section>{{ data.fileName }}</q-item-section>
|
||||
<q-space />
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="blue"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-download"
|
||||
@click="downloadFile(data.file)"
|
||||
><q-tooltip>ดาวน์โหลดไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
<q-btn
|
||||
size="12px"
|
||||
flat
|
||||
round
|
||||
dense
|
||||
color="red"
|
||||
class="q-ml-sm"
|
||||
icon="mdi-delete-outline"
|
||||
@click="deleteFile(data.id)"
|
||||
><q-tooltip>ลบไฟล์</q-tooltip></q-btn
|
||||
>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</div>
|
||||
</q-card>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ interface FormData {
|
|||
interface ArrayPerson {
|
||||
idcard: string,
|
||||
name: string,
|
||||
positionNo: string,
|
||||
position: string,
|
||||
positionLevel: string,
|
||||
salary: string,
|
||||
|
|
@ -54,6 +55,7 @@ interface DataAddRequest {
|
|||
id: string
|
||||
idcard: string
|
||||
name: string
|
||||
positionNo: string
|
||||
position: string
|
||||
positionLevel: string
|
||||
salary: string
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ interface DataAdd {
|
|||
id:string
|
||||
idcard:string
|
||||
name:string
|
||||
positionNo:string
|
||||
position:string
|
||||
positionLevel:string
|
||||
salary:string
|
||||
|
|
@ -22,6 +23,7 @@ interface DataAddResponse {
|
|||
id:string
|
||||
idcard:string
|
||||
name:string
|
||||
positionNo:string
|
||||
position:string
|
||||
positionLevel:string
|
||||
salary:string
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export const useComplainstDataStore = defineStore("DisciplineComplainst", () =>
|
|||
id: e.id,
|
||||
idcard: e.idcard,
|
||||
name: e.name,
|
||||
positionNo: e.positionNo,
|
||||
position: e.position,
|
||||
positionLevel: e.positionLevel,
|
||||
salary: addCommas(e.salary),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue