2023-09-01 11:51:12 +07:00
|
|
|
<script setup lang="ts">
|
2024-05-21 15:29:31 +07:00
|
|
|
import { ref, onMounted, reactive } from "vue";
|
2023-09-01 11:51:12 +07:00
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
|
import { useCounterMixin } from "@/stores/mixin";
|
|
|
|
|
import DialogHeader from "@/modules/04_registry/components/DialogHeader.vue";
|
|
|
|
|
import type { QInput, QForm } from "quasar";
|
|
|
|
|
import type { treeTab } from "@/modules/05_placement/interface/index/Main";
|
|
|
|
|
import http from "@/plugins/http";
|
|
|
|
|
import config from "@/app.config";
|
|
|
|
|
import type { QTableProps } from "quasar";
|
2023-09-19 17:42:17 +07:00
|
|
|
import type {
|
|
|
|
|
requestSendNoti,
|
|
|
|
|
DataCopyOrder,
|
2024-05-21 15:29:31 +07:00
|
|
|
FormActive,
|
2023-09-19 17:42:17 +07:00
|
|
|
ResponseOrganiz,
|
2024-05-21 15:29:31 +07:00
|
|
|
OrgTree,
|
|
|
|
|
TreeMain,
|
2023-09-19 17:42:17 +07:00
|
|
|
} from "@/modules/06_retirement/interface/response/Deceased";
|
2023-09-01 11:51:12 +07:00
|
|
|
import { useRouter, useRoute } from "vue-router";
|
2023-11-17 14:21:53 +07:00
|
|
|
|
2024-05-21 15:29:31 +07:00
|
|
|
import DialogOrgSelectOneStep from "@/components/Dialogs/DialogOrgSelectOneStep.vue";
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/** Use */
|
2023-09-01 11:51:12 +07:00
|
|
|
const router = useRouter();
|
|
|
|
|
const route = useRoute();
|
2023-11-17 14:21:53 +07:00
|
|
|
const $q = useQuasar();
|
|
|
|
|
const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง
|
|
|
|
|
const {
|
|
|
|
|
dialogRemove,
|
|
|
|
|
messageError,
|
|
|
|
|
showLoader,
|
|
|
|
|
hideLoader,
|
|
|
|
|
success,
|
|
|
|
|
dialogConfirm,
|
|
|
|
|
} = mixin;
|
|
|
|
|
|
|
|
|
|
/** props*/
|
2023-09-01 11:51:12 +07:00
|
|
|
const props = defineProps({
|
|
|
|
|
next: {
|
|
|
|
|
type: Function,
|
|
|
|
|
default: () => console.log("not function"),
|
|
|
|
|
},
|
|
|
|
|
previous: {
|
|
|
|
|
type: Function,
|
|
|
|
|
default: () => console.log("not function"),
|
|
|
|
|
},
|
|
|
|
|
});
|
2024-05-21 15:29:31 +07:00
|
|
|
const itemTaps = ref<string[]>();
|
2023-09-01 11:51:12 +07:00
|
|
|
const profileId = ref<string>(route.params.id.toString());
|
|
|
|
|
const next = () => props.next();
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**ตัวแปร */
|
2023-09-01 11:51:12 +07:00
|
|
|
const myForm = ref<QForm | null>(null);
|
|
|
|
|
const filterRef = ref<QInput>();
|
|
|
|
|
const filter = ref<string>("");
|
2024-05-21 15:29:31 +07:00
|
|
|
const modalSelectOrg = ref<boolean>(false);
|
|
|
|
|
|
|
|
|
|
const nodes = ref<Array<OrgTree>>([]);
|
|
|
|
|
const selectedModal = ref<any[]>([]);
|
2023-11-17 14:21:53 +07:00
|
|
|
const rows = ref<DataCopyOrder[]>([]);
|
|
|
|
|
const editRows = ref<DataCopyOrder[]>([]);
|
|
|
|
|
|
2024-05-21 15:29:31 +07:00
|
|
|
/** active form */
|
|
|
|
|
const formActive = reactive<FormActive>({
|
|
|
|
|
activeId: "",
|
|
|
|
|
activeName: "",
|
|
|
|
|
draftId: "",
|
|
|
|
|
draftName: "",
|
|
|
|
|
orgPublishDate: null,
|
|
|
|
|
isPublic: false,
|
|
|
|
|
});
|
2023-11-17 14:21:53 +07:00
|
|
|
|
|
|
|
|
/** คอลัมน์Modal */
|
|
|
|
|
const rowsModal = ref<ResponseOrganiz[]>([]);
|
2023-09-01 11:51:12 +07:00
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/** selcet OPtion */
|
2023-09-01 11:51:12 +07:00
|
|
|
const optionSelect = ref<any>([
|
|
|
|
|
{ id: 1, name: "อีเมล" },
|
|
|
|
|
{ id: 2, name: "กล่องข้อความ" },
|
|
|
|
|
]);
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/** คอลัมน์ที่แสดง */
|
2023-09-01 11:51:12 +07:00
|
|
|
const visibleColumns = ref<String[]>([
|
|
|
|
|
"no",
|
|
|
|
|
"idCard",
|
|
|
|
|
"name",
|
|
|
|
|
"position",
|
|
|
|
|
"unit",
|
|
|
|
|
"send",
|
|
|
|
|
]);
|
2023-11-17 14:21:53 +07:00
|
|
|
|
|
|
|
|
/** คอลัมน์ */
|
2023-09-01 11:51:12 +07:00
|
|
|
const columns = ref<QTableProps["columns"]>([
|
|
|
|
|
{ name: "no", align: "left", label: "ลำดับ", field: "no", sortable: true },
|
|
|
|
|
{
|
|
|
|
|
name: "idCard",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "เลขประจำตัวประชาชน",
|
|
|
|
|
field: "idCard",
|
|
|
|
|
sortable: true,
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "name",
|
|
|
|
|
align: "left",
|
2024-01-10 17:15:15 +07:00
|
|
|
label: "ชื่อ-นามสกุล",
|
2023-09-01 11:51:12 +07:00
|
|
|
field: "name",
|
|
|
|
|
sortable: true,
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "position",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ตำแหน่ง",
|
|
|
|
|
field: "position",
|
|
|
|
|
sortable: true,
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "unit",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "หน่วยงาน",
|
|
|
|
|
field: "unit",
|
|
|
|
|
sortable: true,
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "send",
|
|
|
|
|
align: "left",
|
|
|
|
|
label: "ช่องทางการส่งสำเนา",
|
|
|
|
|
field: "send",
|
|
|
|
|
sortable: true,
|
|
|
|
|
sort: (a: string, b: string) =>
|
|
|
|
|
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/** Hook */
|
2023-09-01 11:51:12 +07:00
|
|
|
onMounted(async () => {
|
2023-09-01 17:51:21 +07:00
|
|
|
await getData();
|
2023-09-01 11:51:12 +07:00
|
|
|
});
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/** เรียกข้อมูลจาก api */
|
2023-09-01 17:51:21 +07:00
|
|
|
const getData = async () => {
|
2023-09-01 11:51:12 +07:00
|
|
|
showLoader();
|
|
|
|
|
await http
|
2023-09-01 17:51:21 +07:00
|
|
|
.get(config.API.detailByidDeceased(profileId.value))
|
2023-09-01 11:51:12 +07:00
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
let list: DataCopyOrder[] = [];
|
2023-09-01 17:51:21 +07:00
|
|
|
data.map((r: any) => {
|
2023-09-01 11:51:12 +07:00
|
|
|
let selectCopyOrder = [];
|
2023-09-01 17:51:21 +07:00
|
|
|
if (r.isSendMail) {
|
2023-09-01 11:51:12 +07:00
|
|
|
selectCopyOrder.push(1);
|
|
|
|
|
}
|
2023-09-01 17:51:21 +07:00
|
|
|
if (r.isSendInbox) {
|
2023-09-01 11:51:12 +07:00
|
|
|
selectCopyOrder.push(2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
list.push({
|
2023-09-19 17:42:17 +07:00
|
|
|
id: r.id,
|
2023-09-01 17:51:21 +07:00
|
|
|
personalId: r.profileId ?? "",
|
2023-09-19 17:42:17 +07:00
|
|
|
name: `${r.prefix}${r.firstName} ${r.lastName}`,
|
2023-09-01 17:51:21 +07:00
|
|
|
idCard: r.citizenId ?? "",
|
|
|
|
|
position: r.positionName ?? "",
|
|
|
|
|
unit: r.organizationName ?? "-",
|
2023-09-01 11:51:12 +07:00
|
|
|
send: "",
|
|
|
|
|
mutiselect: selectCopyOrder,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
if (editRows.value.length > 0) {
|
|
|
|
|
list.map((r: DataCopyOrder) => {
|
|
|
|
|
editRows.value.map((e: DataCopyOrder) => {
|
|
|
|
|
if (r.personalId == e.personalId) {
|
|
|
|
|
r.mutiselect = e.mutiselect;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
rows.value = list;
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**
|
|
|
|
|
*ฟังก์ชั่น Save
|
|
|
|
|
*/
|
2024-05-21 15:29:31 +07:00
|
|
|
async function saveData() {
|
2023-09-19 17:42:17 +07:00
|
|
|
showLoader();
|
|
|
|
|
const persons = selectedModal.value.map((item) => ({
|
|
|
|
|
profileId: item.profileId,
|
|
|
|
|
}));
|
|
|
|
|
const dataToSend = { Persons: persons };
|
|
|
|
|
await http
|
|
|
|
|
.put(config.API.detailByidDeceased(profileId.value), dataToSend)
|
2024-05-21 15:29:31 +07:00
|
|
|
.then((res) => {
|
|
|
|
|
getData();
|
|
|
|
|
})
|
2023-09-19 17:42:17 +07:00
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
2024-05-21 15:29:31 +07:00
|
|
|
}
|
2023-09-01 11:51:12 +07:00
|
|
|
|
|
|
|
|
const resetFilter = () => {
|
|
|
|
|
// reset ค่าที่ค้นหาเมื่อกดปุ่ม X ในกล่องค้นหา
|
|
|
|
|
filter.value = "";
|
|
|
|
|
filterRef.value!.focus();
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**
|
|
|
|
|
* class จัดรูปแบบแสดงระหว่างข้อมูลที่แก้ไขหรือแสดงเฉยๆ
|
|
|
|
|
* @param val ข้อมูล input สำหรับแก้ไขหรือไม่
|
|
|
|
|
*/
|
2023-09-01 11:51:12 +07:00
|
|
|
const getClass = (val: boolean) => {
|
|
|
|
|
return {
|
|
|
|
|
"full-width inputgreen cursor-pointer": val,
|
|
|
|
|
"full-width cursor-pointer": !val,
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**
|
|
|
|
|
* กดปุ่มเพิ่มด้านบน table
|
|
|
|
|
*/
|
2024-05-21 15:29:31 +07:00
|
|
|
function clickAdd() {
|
|
|
|
|
modalSelectOrg.value = true;
|
2023-09-01 11:51:12 +07:00
|
|
|
if (myForm.value !== null) {
|
|
|
|
|
myForm.value.reset();
|
|
|
|
|
}
|
2024-05-21 15:29:31 +07:00
|
|
|
}
|
2023-09-01 11:51:12 +07:00
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**
|
|
|
|
|
* ลบข้อมูล
|
|
|
|
|
*/
|
2023-09-01 11:51:12 +07:00
|
|
|
const clickDelete = (id: string) => {
|
2023-09-19 17:42:17 +07:00
|
|
|
dialogRemove($q, () => deleteData(id));
|
2023-09-01 11:51:12 +07:00
|
|
|
};
|
|
|
|
|
|
2024-05-21 15:29:31 +07:00
|
|
|
/** ดึงข้อมูล active */
|
|
|
|
|
async function getActive() {
|
2023-09-01 11:51:12 +07:00
|
|
|
showLoader();
|
|
|
|
|
await http
|
2024-05-21 15:29:31 +07:00
|
|
|
.get(config.API.activeOrganization)
|
|
|
|
|
.then((res) => {
|
2023-09-01 11:51:12 +07:00
|
|
|
const data = res.data.result;
|
2024-05-21 15:29:31 +07:00
|
|
|
|
|
|
|
|
formActive.activeId = data.activeId;
|
|
|
|
|
formActive.activeName = data.activeName;
|
|
|
|
|
formActive.draftId = data.draftId;
|
|
|
|
|
formActive.draftName = data.draftName;
|
|
|
|
|
formActive.orgPublishDate = data.orgPublishDate;
|
|
|
|
|
formActive.isPublic = data.isPublic;
|
|
|
|
|
|
|
|
|
|
getTreeData(data.activeId);
|
2023-09-01 11:51:12 +07:00
|
|
|
})
|
2024-05-21 15:29:31 +07:00
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
2023-09-01 11:51:12 +07:00
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
2024-05-21 15:29:31 +07:00
|
|
|
}
|
2023-09-01 11:51:12 +07:00
|
|
|
|
2024-05-21 15:29:31 +07:00
|
|
|
/** ดึงข้อมูล หน่วยงาน */
|
|
|
|
|
async function getTreeData(id: string) {
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
|
|
|
|
.get(config.API.orgByid(id))
|
|
|
|
|
.then((res) => {
|
|
|
|
|
const data = res.data.result;
|
|
|
|
|
nodes.value = data;
|
|
|
|
|
filterItemsTaps(data);
|
|
|
|
|
})
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
messageError($q, err);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function filterItemsTaps(data: TreeMain[]) {
|
|
|
|
|
let orgTreeIds: string[] = [];
|
|
|
|
|
for (const child of data) {
|
|
|
|
|
orgTreeIds.push(child.orgTreeId);
|
|
|
|
|
if (child.children) {
|
|
|
|
|
orgTreeIds = orgTreeIds.concat(filterItemsTaps(child.children));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
itemTaps.value = orgTreeIds;
|
|
|
|
|
return orgTreeIds;
|
|
|
|
|
}
|
2023-09-01 11:51:12 +07:00
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**ลบข้อมูล */
|
2023-09-01 11:51:12 +07:00
|
|
|
const deleteData = async (id: string) => {
|
|
|
|
|
await http
|
2023-09-01 17:51:21 +07:00
|
|
|
.delete(config.API.detailByidDeceased(id))
|
2023-09-01 11:51:12 +07:00
|
|
|
.then((res) => {
|
|
|
|
|
success($q, "ลบข้อมูลสำเร็จ");
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(async () => {
|
2023-09-01 17:51:21 +07:00
|
|
|
await getData();
|
2023-09-01 11:51:12 +07:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-17 14:21:53 +07:00
|
|
|
/**
|
|
|
|
|
* Save ข้อมูล
|
|
|
|
|
*/
|
2023-09-01 11:51:12 +07:00
|
|
|
const saveDataCopyOrder = async () => {
|
|
|
|
|
if (myForm.value !== null) {
|
|
|
|
|
myForm.value.validate().then(async (result: boolean) => {
|
|
|
|
|
if (result) {
|
2023-11-17 14:21:53 +07:00
|
|
|
dialogConfirm(
|
|
|
|
|
$q,
|
|
|
|
|
() => fetchSaveCopyOrder(),
|
|
|
|
|
"ยืนยันการส่งหนังสือเวียน",
|
|
|
|
|
"ต้องการยืนยันการส่งหนังสือเวียนหรือไม่"
|
|
|
|
|
);
|
2023-09-01 11:51:12 +07:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
2023-11-17 14:21:53 +07:00
|
|
|
//อัพเดทข้อมูลหลัง Save
|
2023-09-01 11:51:12 +07:00
|
|
|
const fetchSaveCopyOrder = async () => {
|
2023-09-01 17:51:21 +07:00
|
|
|
let list: requestSendNoti[] = [];
|
2023-09-01 11:51:12 +07:00
|
|
|
rows.value.map((r: DataCopyOrder) => {
|
|
|
|
|
list.push({
|
2023-09-01 17:51:21 +07:00
|
|
|
profileId: r.personalId,
|
|
|
|
|
isSendMail: r.mutiselect.includes(1),
|
|
|
|
|
isSendInbox: r.mutiselect.includes(2),
|
|
|
|
|
isSendNotification: true,
|
2023-09-01 11:51:12 +07:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
showLoader();
|
|
|
|
|
await http
|
2023-09-19 17:42:17 +07:00
|
|
|
.put(config.API.notiDeceased(profileId.value), { Persons: list })
|
2023-09-01 11:51:12 +07:00
|
|
|
.then((res: any) => {
|
|
|
|
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
|
|
|
|
next();
|
|
|
|
|
})
|
|
|
|
|
.catch((e) => {
|
|
|
|
|
messageError($q, e);
|
|
|
|
|
})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
hideLoader();
|
2023-09-19 17:42:17 +07:00
|
|
|
getData();
|
2023-09-01 11:51:12 +07:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
const updateData = (row: DataCopyOrder) => {
|
|
|
|
|
editRows.value.push(row);
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2023-09-19 17:42:17 +07:00
|
|
|
<div class="toptitle text-dark col-12 row items-center">
|
2023-09-01 11:51:12 +07:00
|
|
|
<q-btn
|
|
|
|
|
icon="mdi-arrow-left"
|
|
|
|
|
unelevated
|
|
|
|
|
round
|
|
|
|
|
dense
|
|
|
|
|
flat
|
|
|
|
|
color="primary"
|
|
|
|
|
class="q-mr-sm"
|
|
|
|
|
@click="router.push(`/deceased/${profileId}`)"
|
|
|
|
|
/>
|
|
|
|
|
ส่งหนังสือเวียน
|
|
|
|
|
</div>
|
|
|
|
|
<div class="bg-white">
|
|
|
|
|
<div class="q-py-md q-pl-md" style="height: 68vh; overflow-y: scroll">
|
|
|
|
|
<div class="col-12 row q-py-sm items-center">
|
|
|
|
|
<q-btn flat round color="primary" @click="clickAdd" icon="mdi-plus">
|
|
|
|
|
<q-tooltip>เพิ่มข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
<q-space />
|
|
|
|
|
<div class="items-center" style="display: flex">
|
|
|
|
|
<!-- ค้นหาข้อความใน table -->
|
|
|
|
|
<q-input
|
|
|
|
|
standout
|
|
|
|
|
dense
|
|
|
|
|
v-model="filter"
|
|
|
|
|
ref="filterRef"
|
|
|
|
|
outlined
|
|
|
|
|
debounce="300"
|
|
|
|
|
placeholder="ค้นหา"
|
|
|
|
|
style="max-width: 200px"
|
|
|
|
|
class="q-ml-sm"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:append>
|
|
|
|
|
<q-icon v-if="filter == ''" name="search" />
|
|
|
|
|
<q-icon
|
|
|
|
|
v-if="filter !== ''"
|
|
|
|
|
name="clear"
|
|
|
|
|
class="cursor-pointer"
|
|
|
|
|
@click="resetFilter"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</q-input>
|
|
|
|
|
<!-- แสดงคอลัมน์ใน table -->
|
|
|
|
|
<q-select
|
|
|
|
|
v-model="visibleColumns"
|
|
|
|
|
:display-value="$q.lang.table.columns"
|
|
|
|
|
multiple
|
|
|
|
|
outlined
|
|
|
|
|
dense
|
|
|
|
|
:options="columns"
|
|
|
|
|
options-dense
|
|
|
|
|
option-value="name"
|
|
|
|
|
map-options
|
|
|
|
|
emit-value
|
|
|
|
|
style="min-width: 150px"
|
|
|
|
|
class="gt-xs q-ml-sm"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<q-form ref="myForm">
|
|
|
|
|
<d-table
|
|
|
|
|
:rows="rows"
|
|
|
|
|
:columns="columns"
|
|
|
|
|
:visible-columns="visibleColumns"
|
|
|
|
|
:filter="filter"
|
|
|
|
|
row-key="idCard"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:header="props">
|
|
|
|
|
<q-tr :props="props">
|
|
|
|
|
<q-th v-for="col in props.cols" :key="col.name" :props="props">
|
|
|
|
|
<span class="text-weight-medium">{{ col.label }}</span>
|
|
|
|
|
</q-th>
|
|
|
|
|
<q-th auto-width />
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-slot:body="props">
|
|
|
|
|
<q-tr :props="props" class="cursor-pointer">
|
|
|
|
|
<q-td key="no" :props="props">
|
|
|
|
|
{{ props.rowIndex + 1 }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="idCard" :props="props">
|
|
|
|
|
{{ props.row.idCard }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="name" :props="props">
|
|
|
|
|
{{ props.row.name }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="position" :props="props">
|
|
|
|
|
{{ props.row.position }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="unit" :props="props">
|
|
|
|
|
{{ props.row.unit }}
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td key="send" :props="props">
|
|
|
|
|
<q-select
|
|
|
|
|
:class="getClass(true)"
|
|
|
|
|
hide-bottom-space
|
|
|
|
|
multiple
|
|
|
|
|
:outlined="true"
|
|
|
|
|
dense
|
|
|
|
|
lazy-rules
|
|
|
|
|
v-model="props.row.mutiselect"
|
|
|
|
|
:rules="[(val:any) => !!val || `${'กรุณาเลือกช่องทางการส่งสำเนา'}`,(val:any) => val.length > 0 || `${'กรุณาเลือกช่องทางการส่งสำเนา'}`]"
|
|
|
|
|
:label="`${'เลือกช่องทางการส่งสำเนา'}`"
|
|
|
|
|
emit-value
|
|
|
|
|
map-options
|
|
|
|
|
option-label="name"
|
|
|
|
|
:options="optionSelect"
|
|
|
|
|
option-value="id"
|
|
|
|
|
input-debounce="0"
|
|
|
|
|
color="primary"
|
|
|
|
|
@update:model-value="() => updateData(props.row)"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:no-option>
|
|
|
|
|
<q-item>
|
|
|
|
|
<q-item-section class="text-black">
|
|
|
|
|
ไม่พบข้อมูลที่ค้นหา
|
|
|
|
|
</q-item-section>
|
|
|
|
|
</q-item>
|
|
|
|
|
</template>
|
|
|
|
|
</q-select>
|
|
|
|
|
</q-td>
|
|
|
|
|
<q-td auto-width>
|
|
|
|
|
<q-btn
|
|
|
|
|
dense
|
|
|
|
|
size="12px"
|
|
|
|
|
flat
|
|
|
|
|
round
|
|
|
|
|
color="red"
|
2023-09-01 17:51:21 +07:00
|
|
|
@click="clickDelete(props.row.id)"
|
2023-09-01 11:51:12 +07:00
|
|
|
icon="mdi-delete"
|
|
|
|
|
>
|
|
|
|
|
<q-tooltip>ลบข้อมูล</q-tooltip>
|
|
|
|
|
</q-btn>
|
|
|
|
|
</q-td>
|
|
|
|
|
</q-tr>
|
|
|
|
|
</template>
|
|
|
|
|
</d-table>
|
|
|
|
|
</q-form>
|
|
|
|
|
</div>
|
|
|
|
|
<q-separator />
|
|
|
|
|
<div class="flex justify-end q-pa-sm q-gutter-sm">
|
|
|
|
|
<q-btn
|
|
|
|
|
dense
|
|
|
|
|
unelevated
|
2023-10-06 10:10:50 +07:00
|
|
|
label="ส่งหนังสือเวียน"
|
2023-09-01 11:51:12 +07:00
|
|
|
color="public"
|
|
|
|
|
@click="saveDataCopyOrder"
|
|
|
|
|
class="q-px-md"
|
2023-09-19 17:42:17 +07:00
|
|
|
>
|
2023-09-01 11:51:12 +07:00
|
|
|
</q-btn>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2024-05-21 15:29:31 +07:00
|
|
|
<DialogOrgSelectOneStep
|
|
|
|
|
v-model:modal="modalSelectOrg"
|
|
|
|
|
:title="'เลือกรายชื่อตามหน่วยงาน'"
|
|
|
|
|
v-model:selectedModal="selectedModal"
|
|
|
|
|
:saveData="saveData"
|
|
|
|
|
/>
|
2023-09-01 11:51:12 +07:00
|
|
|
</template>
|