diff --git a/app/components/Modal.vue b/app/components/Modal.vue index 0cd6b5d..86cf7ab 100644 --- a/app/components/Modal.vue +++ b/app/components/Modal.vue @@ -129,12 +129,14 @@ const doClick = function (e) { }; onMounted(() => { - document.documentElement.classList.add("is-clipped"); - window.addEventListener("keydown", (e) => { - if (e.key === "Escape") closeModal(); - }); - const collection = document.getElementsByClassName("modal-background"); - count = collection.length; + if (Object.values(props).some((x) => isNotNil(x))) { + document.documentElement.classList.add("is-clipped"); + window.addEventListener("keydown", (e) => { + if (e.key === "Escape") closeModal(); + }); + const collection = document.getElementsByClassName("modal-background"); + count = collection.length; + } }); onUnmounted(() => { diff --git a/app/components/accounting/AccountView.vue b/app/components/accounting/AccountView.vue index c73f548..623cbed 100644 --- a/app/components/accounting/AccountView.vue +++ b/app/components/accounting/AccountView.vue @@ -41,7 +41,7 @@
- {{ `${$dayjs(record.create_time).format("DD/MM/YYYY")}` }} + {{ `${$dayjs(record.create_time).format("L")}` }}
diff --git a/app/components/accounting/DebtView.vue b/app/components/accounting/DebtView.vue index 8a19ff2..3cd8385 100644 --- a/app/components/accounting/DebtView.vue +++ b/app/components/accounting/DebtView.vue @@ -407,7 +407,7 @@ async function loadData() { remainingTTTHNV = Math.max(0, remainingTTTHNV); return { - to_date: sch.to_date ? $dayjs(sch.to_date).format("DD/MM/YYYY") : "—", + to_date: sch.to_date ? $dayjs(sch.to_date).format("L") : "—", amount: scheduleAmount, luy_ke_sang_dot: luyKeSangDot, thuc_thanh_toan: thucThanhToan, @@ -433,7 +433,7 @@ async function loadData() { customer_code: txn.customer__code || "", customer_name: txn.customer__fullname || "", trade_code: txn.product__trade_code || txn.code || "", - contract_date: txn.date ? $dayjs(txn.date).format("DD/MM/YYYY") : "—", + contract_date: txn.date ? $dayjs(txn.date).format("L") : "—", contract_date_raw: txn.date, sale_price: salePriceNum, ttthnv_paid: ttthnvPaid, diff --git a/app/components/accounting/InternalEntry.vue b/app/components/accounting/InternalEntry.vue index 8f80747..d1faccd 100644 --- a/app/components/accounting/InternalEntry.vue +++ b/app/components/accounting/InternalEntry.vue @@ -37,7 +37,7 @@
- {{ $dayjs(record.date).format("DD/MM/YYYY") }} + {{ $dayjs(record.date).format("L") }}
@@ -102,7 +102,7 @@
- {{ `${$dayjs(record.create_time).format("DD/MM/YYYY")}` }} + {{ `${$dayjs(record.create_time).format("L")}` }}
@@ -209,7 +209,7 @@ > - {{ $dayjs(item.date).format("DD/MM/YYYY HH:mm:ss") }} + {{ $dayjs(item.date).format("L HH:mm:ss") }} diff --git a/app/components/application/ContractPaymentUpload.vue b/app/components/application/ContractPaymentUpload.vue index a69063e..ee081fe 100644 --- a/app/components/application/ContractPaymentUpload.vue +++ b/app/components/application/ContractPaymentUpload.vue @@ -77,7 +77,7 @@

{{ $formatFileSize(file.file__size) }} • - {{ $dayjs(file.create_time).format("DD/MM/YYYY HH:mm") }} + {{ $dayjs(file.create_time).format("L HH:mm") }}

diff --git a/app/components/application/PaymentSchedule.vue b/app/components/application/PaymentSchedule.vue index 6dd7d83..51bbe12 100644 --- a/app/components/application/PaymentSchedule.vue +++ b/app/components/application/PaymentSchedule.vue @@ -853,8 +853,8 @@ export default { originalCalculatedAmount: originalAmount, discountAmount: earlyDetail.discountAmount, netAmount: earlyDetail.netAmount, - actualDueDate: this.calculationStartDate.format("DD/MM/YYYY"), - dueDate: plan.days > 0 ? this.calculationStartDate.add(plan.days, "day").format("DD/MM/YYYY") : null, + actualDueDate: this.calculationStartDate.format("L"), + dueDate: plan.days > 0 ? this.calculationStartDate.add(plan.days, "day").format("L") : null, displayValue: plan.type === 1 ? `${plan.value}%` : this.$numtoString(plan.value), }; } else { @@ -865,7 +865,7 @@ export default { discountAmount: 0, netAmount: originalAmount, actualDueDate: null, - dueDate: plan.days > 0 ? this.calculationStartDate.add(plan.days, "day").format("DD/MM/YYYY") : null, + dueDate: plan.days > 0 ? this.calculationStartDate.add(plan.days, "day").format("L") : null, displayValue: plan.type === 1 ? `${plan.value}%` : this.$numtoString(plan.value), }; } @@ -891,7 +891,7 @@ export default { const daysDiff = plan.days || 0; if (daysDiff > 0) { const dueDateObj = this.calculationStartDate.add(daysDiff, "day"); - dueDate = dueDateObj.format("DD/MM/YYYY"); + dueDate = dueDateObj.format("L"); } return { @@ -927,7 +927,7 @@ export default { isEarlyPaymentMerged: true, calculatedAmount: this.totalEarlyPayment - (this.selectedPolicy.deposit || 0), days: 0, - dueDate: this.calculationStartDate.format("DD/MM/YYYY"), + dueDate: this.calculationStartDate.format("L"), payment_note: "Thanh toán sớm gộp", displayValue: "-", isFirstPlan: true, @@ -942,7 +942,7 @@ export default { const daysDiff = plan.days || 0; if (daysDiff > 0) { const dueDateObj = this.calculationStartDate.add(daysDiff, "day"); - dueDate = dueDateObj.format("DD/MM/YYYY"); + dueDate = dueDateObj.format("L"); } displayPlans.push({ @@ -963,9 +963,7 @@ export default { calculatedPlans() { if (this.isPrecalculated && this.paymentPlans && this.paymentPlans.length > 0) { return this.paymentPlans.map((plan, index) => { - const dueDate = plan.due_days - ? this.calculationStartDate.add(plan.due_days, "day").format("DD/MM/YYYY") - : null; + const dueDate = plan.due_days ? this.calculationStartDate.add(plan.due_days, "day").format("L") : null; return { ...plan, displayCycle: plan.cycle || index + 1, @@ -1039,7 +1037,7 @@ export default { return this.enableEarlyPayment; }, formatDate(date) { - return dayjs(date).format("DD/MM/YYYY"); + return dayjs(date).format("L"); }, handleEarlyPaymentToggle() { diff --git a/app/components/application/PaymentSchedulePresentation.vue b/app/components/application/PaymentSchedulePresentation.vue index bf046a3..4c3fd89 100644 --- a/app/components/application/PaymentSchedulePresentation.vue +++ b/app/components/application/PaymentSchedulePresentation.vue @@ -721,7 +721,7 @@ const totalPaid = computed(() => { const formatDate = (date) => { if (!date) return "-"; - return dayjs(date).format("DD/MM/YYYY"); + return dayjs(date).format("L"); }; diff --git a/app/components/application/PhaseAdvance.vue b/app/components/application/PhaseAdvance.vue index 0f0dd1b..50ce9a0 100644 --- a/app/components/application/PhaseAdvance.vue +++ b/app/components/application/PhaseAdvance.vue @@ -1195,7 +1195,7 @@ function handleContractUpdated(eventData) { function formatDate(dateString) { if (!dateString) return "-"; - return dayjs(dateString).format("DD/MM/YYYY"); + return dayjs(dateString).format("L"); } function showCustomerDetails() { diff --git a/app/components/customer/CustomerView.vue b/app/components/customer/CustomerView.vue index 619be86..ed74802 100644 --- a/app/components/customer/CustomerView.vue +++ b/app/components/customer/CustomerView.vue @@ -69,7 +69,7 @@
- {{ record.issued_date ? $dayjs(record.issued_date).format("DD/MM/YYYY") : "/" }} + {{ record.issued_date ? $dayjs(record.issued_date).format("L") : "/" }}
@@ -129,10 +129,7 @@
- {{ $dayjs(record.create_time).format("DD/MM/YYYY") }} - {{ $dayjs(record.create_time).format("HH:mm") }} + {{ $dayjs(record.create_time).format("L") }} {{ $dayjs(record.create_time).format("HH:mm") }}
@@ -153,7 +150,7 @@
- {{ record.update_time ? $dayjs(record.update_time).format("DD/MM/YYYY HH:mm") : "/" }} + {{ record.update_time ? $dayjs(record.update_time).format("L HH:mm") : "/" }}
diff --git a/app/components/datatable/PivotDataView.vue b/app/components/datatable/PivotDataView.vue index 6f2dbd5..13a20aa 100644 --- a/app/components/datatable/PivotDataView.vue +++ b/app/components/datatable/PivotDataView.vue @@ -529,7 +529,7 @@ const formatCellValue = (value, field) => { } if (field.format === "date") { - return $dayjs(value).format("DD/MM/YYYY"); + return $dayjs(value).format("L"); } return value; diff --git a/app/components/datatable/format/FormatDate.vue b/app/components/datatable/format/FormatDate.vue index 53822ef..3110b69 100644 --- a/app/components/datatable/format/FormatDate.vue +++ b/app/components/datatable/format/FormatDate.vue @@ -1,5 +1,5 @@ diff --git a/app/components/datepicker/EventSummary.vue b/app/components/datepicker/EventSummary.vue index 996b8ca..42f2ba8 100644 --- a/app/components/datepicker/EventSummary.vue +++ b/app/components/datepicker/EventSummary.vue @@ -86,7 +86,7 @@ {{ $dayjs(today).format("DD/MM/YYYY") }}{{ $dayjs(today).format("L") }} diff --git a/app/components/datepicker/PickDay.vue b/app/components/datepicker/PickDay.vue index 403bcda..9659e61 100644 --- a/app/components/datepicker/PickDay.vue +++ b/app/components/datepicker/PickDay.vue @@ -56,26 +56,26 @@
{{ m.dayPrint }}
+ /> + />
diff --git a/app/components/datepicker/PickYear.vue b/app/components/datepicker/PickYear.vue index e9d4a74..b51fa84 100644 --- a/app/components/datepicker/PickYear.vue +++ b/app/components/datepicker/PickYear.vue @@ -1,65 +1,53 @@ - diff --git a/app/components/debt/Due.vue b/app/components/debt/Due.vue index fbc652a..d227efa 100644 --- a/app/components/debt/Due.vue +++ b/app/components/debt/Due.vue @@ -279,7 +279,7 @@ async function sendEmails() { { ref: paymentScheduleData[i].txn_detail__transaction__product, user: $store.login.id, - detail: `Đã gửi email thông báo nhắc nợ cho sản phẩm ${paymentScheduleData[i].txn_detail__transaction__product__trade_code} vào lúc ${$dayjs().format("HH:mm ngày DD/MM/YYYY")}.`, + detail: `Đã gửi email thông báo nhắc nợ cho sản phẩm ${paymentScheduleData[i].txn_detail__transaction__product__trade_code} vào lúc ${$dayjs().format("HH:mm ngày L")}.`, }, undefined, false, diff --git a/app/components/debt/Overdue.vue b/app/components/debt/Overdue.vue index 76a52e1..f5c5be9 100644 --- a/app/components/debt/Overdue.vue +++ b/app/components/debt/Overdue.vue @@ -278,7 +278,7 @@ async function sendEmails() { { ref: paymentScheduleData[i].txn_detail__transaction__product, user: $store.login.id, - detail: `Đã gửi email thông báo quá hạn cho sản phẩm ${paymentScheduleData[i].txn_detail__transaction__product__trade_code} vào lúc ${$dayjs().format("HH:mm ngày DD/MM/YYYY")}.`, + detail: `Đã gửi email thông báo quá hạn cho sản phẩm ${paymentScheduleData[i].txn_detail__transaction__product__trade_code} vào lúc ${$dayjs().format("HH:mm ngày L")}.`, }, undefined, false, diff --git a/app/components/dialog/Error.vue b/app/components/dialog/Error.vue index 3b81d05..d7b0edc 100644 --- a/app/components/dialog/Error.vue +++ b/app/components/dialog/Error.vue @@ -2,43 +2,48 @@
- +
-

+
+ />
diff --git a/app/components/dialog/Info.vue b/app/components/dialog/Info.vue index 55f32fe..114d15e 100644 --- a/app/components/dialog/Info.vue +++ b/app/components/dialog/Info.vue @@ -1,35 +1,37 @@ - diff --git a/app/components/dialog/Success.vue b/app/components/dialog/Success.vue index 14962de..333406c 100644 --- a/app/components/dialog/Success.vue +++ b/app/components/dialog/Success.vue @@ -2,14 +2,18 @@
- +
-

+
+ />
- diff --git a/app/components/media/FileUpload.vue b/app/components/media/FileUpload.vue index 4d515e5..4a8381b 100644 --- a/app/components/media/FileUpload.vue +++ b/app/components/media/FileUpload.vue @@ -1,3 +1,4 @@ + - diff --git a/app/components/modal/EditDueDateModal.vue b/app/components/modal/EditDueDateModal.vue index 7ad28f3..34d1518 100644 --- a/app/components/modal/EditDueDateModal.vue +++ b/app/components/modal/EditDueDateModal.vue @@ -269,7 +269,7 @@ const isUpdateValid = computed(() => { const formatDate = (dateString) => { if (!dateString) return "-"; - return dayjs(dateString).format("DD/MM/YYYY"); + return dayjs(dateString).format("L"); }; const fetchPaymentScheduleData = async () => { diff --git a/app/components/modal/InternalEntry.vue b/app/components/modal/InternalEntry.vue index 9000047..8f5e8d7 100644 --- a/app/components/modal/InternalEntry.vue +++ b/app/components/modal/InternalEntry.vue @@ -42,7 +42,7 @@
- {{ entry.date ? $dayjs(entry.date).format("DD/MM/YYYY") : "/" }} + {{ entry.date ? $dayjs(entry.date).format("L") : "/" }}
@@ -207,7 +207,7 @@
- {{ entry.create_time ? $dayjs(entry.create_time).format("DD/MM/YYYY HH:mm") : "/" }} + {{ entry.create_time ? $dayjs(entry.create_time).format("L HH:mm") : "/" }}
diff --git a/app/components/modal/PaymentScheduleConfirmModal.vue b/app/components/modal/PaymentScheduleConfirmModal.vue index b69eb71..1c2025b 100644 --- a/app/components/modal/PaymentScheduleConfirmModal.vue +++ b/app/components/modal/PaymentScheduleConfirmModal.vue @@ -367,7 +367,7 @@ const isInvoiceAllowed = computed(() => paymentScheduleData.value?.status === 2) const formatDate = (dateString) => { if (!dateString) return "-"; - return dayjs(dateString).format("DD/MM/YYYY"); + return dayjs(dateString).format("L"); }; const getEntryTypeLabel = (type) => { @@ -430,8 +430,8 @@ const processedEntries = computed(() => { rate: Number(entry.DAILY_PENALTY_RATE || 0) * 100, totalDebt: Number(entry.amount_remain_after_allocation || 0) + penaltyThisPeriod, penaltyDetail: { - from: lastEventDate.format("DD/MM/YYYY"), - to: entryDate.format("DD/MM/YYYY"), + from: lastEventDate.format("L"), + to: entryDate.format("L"), days, }, }); diff --git a/app/components/people/PeopleView.vue b/app/components/people/PeopleView.vue index abf9052..d7c9997 100644 --- a/app/components/people/PeopleView.vue +++ b/app/components/people/PeopleView.vue @@ -80,7 +80,7 @@
- {{ record.dob ? $dayjs(record.dob).format("DD/MM/YYYY") : "/" }} + {{ record.dob ? $dayjs(record.dob).format("L") : "/" }}
@@ -112,7 +112,7 @@
- {{ record.issued_date ? $dayjs(record.issued_date).format("DD/MM/YYYY") : "/" }} + {{ record.issued_date ? $dayjs(record.issued_date).format("L") : "/" }}
diff --git a/app/components/transaction/TransactionConfirmModal.vue b/app/components/transaction/TransactionConfirmModal.vue index 4df4dbf..1cfa588 100644 --- a/app/components/transaction/TransactionConfirmModal.vue +++ b/app/components/transaction/TransactionConfirmModal.vue @@ -412,7 +412,7 @@ export default { this.coOwner = selectedPerson || null; }, formatDate(date) { - return date ? dayjs(date).format("DD/MM/YYYY") : "-"; + return date ? dayjs(date).format("L") : "-"; }, updateDueDate(newDate) { this.editableDueDate = newDate; diff --git a/app/components/transaction/TransactionDetail.vue b/app/components/transaction/TransactionDetail.vue index d234966..2c7eba3 100644 --- a/app/components/transaction/TransactionDetail.vue +++ b/app/components/transaction/TransactionDetail.vue @@ -212,15 +212,13 @@ async function handleFileUpload(uploadedFiles) { >

Từ ngày: - {{ - txndetail.date ? $dayjs(txndetail.date).format("DD/MM/YYYY") : "" - }} + {{ txndetail.date ? $dayjs(txndetail.date).format("L") : "" }}

Đến ngày: {{ - txndetail.due_date ? $dayjs(txndetail.due_date).format("DD/MM/YYYY") : "" + txndetail.due_date ? $dayjs(txndetail.due_date).format("L") : "" }}

diff --git a/app/components/transaction/TransactionView.vue b/app/components/transaction/TransactionView.vue index cd77bca..4f6ae18 100644 --- a/app/components/transaction/TransactionView.vue +++ b/app/components/transaction/TransactionView.vue @@ -315,7 +315,7 @@

- {{ record.issued_date ? $dayjs(record.issued_date).format("DD/MM/YYYY") : "/" }} + {{ record.issued_date ? $dayjs(record.issued_date).format("L") : "/" }}
@@ -395,7 +395,7 @@
- {{ $dayjs(transaction.create_time).format("DD/MM/YYYY HH:mm") }} + {{ $dayjs(transaction.create_time).format("L HH:mm") }}
@@ -1201,7 +1201,7 @@ export default { const postProductNotePayload = { ref: this.product.id, user: id, - detail: `${username} ${this.isVietnamese ? "khóa sản phẩm trong" : "locked product for"} ${this.lockDurationMinutes} ${this.isVietnamese ? "phút đến lúc" : "minutes until"} ${this.$dayjs(lockedUntilValue).format("HH:mm:ss - DD/MM/YYYY")}`, + detail: `${username} ${this.isVietnamese ? "khóa sản phẩm trong" : "locked product for"} ${this.lockDurationMinutes} ${this.isVietnamese ? "phút đến lúc" : "minutes until"} ${this.$dayjs(lockedUntilValue).format("HH:mm:ss - L")}`, }; try { diff --git a/app/components/user/UserInfo.vue b/app/components/user/UserInfo.vue index 6bcd8a2..4c454e0 100644 --- a/app/components/user/UserInfo.vue +++ b/app/components/user/UserInfo.vue @@ -40,7 +40,7 @@ >{{ isVietnamese ? "Thời gian tạo" : "Create time" }}*
- {{ $dayjs(record.create_time).format("DD/MM/YYYY") }} + {{ $dayjs(record.create_time).format("L") }}