-
-
+
+
-
-
+
+
-
Recipient Information
+
Recipient Information
@@ -78,32 +101,45 @@
-
Attachments
-
-
-
Click to upload or drag and drop
+
Attachments
+
+
+
Click to upload or drag and drop
- -
+
-
{{ file.name }}
-
+
-
+
@@ -118,10 +154,7 @@ const DartaTowserStore = createOverlayStore("darta-towser")();
const { show } = storeToRefs(DartaTowserStore);
const towser = ref({
- title: [
- { name: "Darta", link: "#" },
- { name: "Create" }
- ],
+ title: [{ name: "Darta", link: "#" }, { name: "Create" }],
action: [
{
title: "Close",
@@ -132,23 +165,29 @@ const towser = ref({
emit: "onSave",
},
],
-})
+});
-const departments = ref([{ id: 1, name: 'Administration' }, { id: 2, name: 'HR' }]);
-const documentCategories = ref([{ id: 1, name: 'Confidential' }, { id: 2, name: 'Public' }]);
+const departments = ref([
+ { id: 1, name: "Administration" },
+ { id: 2, name: "HR" },
+]);
+const documentCategories = ref([
+ { id: 1, name: "Confidential" },
+ { id: 2, name: "Public" },
+]);
const formData = reactive({
department: null,
documentCategory: null,
- documentNumber: '',
- subject: '',
- body: '',
- recipientName: '',
- recipientContact: '',
- recipientAddress: '',
- issuedDate: '',
- dispatchDate: '',
- attachments: [] as File[]
+ documentNumber: "",
+ subject: "",
+ body: "",
+ recipientName: "",
+ recipientContact: "",
+ recipientAddress: "",
+ issuedDate: "",
+ dispatchDate: "",
+ attachments: [] as File[],
});
const fileInputRef = ref
(null);
@@ -159,7 +198,7 @@ const onClose = () => {
};
const onSave = () => {
- submitForm();
+ handleSave();
};
const triggerFileInput = () => {
@@ -178,13 +217,32 @@ const removeFile = (index: number) => {
};
const resetForm = () => {
- formData.documentNumber = '';
- formData.subject = '';
+ formData.department = null;
+ formData.documentCategory = null;
+ formData.documentNumber = "";
+ formData.subject = "";
+ formData.body = "";
+ formData.recipientName = "";
+ formData.recipientContact = "";
+ formData.recipientAddress = "";
+ formData.issuedDate = "";
+ formData.dispatchDate = "";
formData.attachments = [];
};
-const submitForm = async () => {
- console.log("Submitting:", formData);
+const handleSave = async () => {
+ if (
+ !formData.department ||
+ !formData.documentCategory ||
+ !formData.documentNumber ||
+ !formData.subject ||
+ !formData.body
+ ) {
+ console.error("Please fill in all required fields");
+ return;
+ }
+
+ console.log("Saving:", formData);
onClose();
};
-
\ No newline at end of file
+
diff --git a/src/views/Darta/Darta.vue b/src/views/Darta/Darta.vue
index 923290d..45850fb 100644
--- a/src/views/Darta/Darta.vue
+++ b/src/views/Darta/Darta.vue
@@ -16,10 +16,9 @@
-
+