fix(crm): mesghal by metal, jalali fit, scoped group filters

This commit is contained in:
2026-10-24 22:25:27 +03:30
parent f8128ebe3a
commit 48815852fc
8 changed files with 202 additions and 27 deletions
+32 -8
View File
@@ -318,16 +318,32 @@ function place() {
const panel = panelRef.value;
if (!trigger) return;
const rect = trigger.getBoundingClientRect();
const width = panel?.offsetWidth || (props.mode === 'time' ? (isMobile.value ? 340 : 280) : 320);
const height = panel?.offsetHeight || (props.mode === 'time' ? (isMobile.value ? 460 : 320) : 360);
const width =
panel?.offsetWidth ||
(props.mode === 'time' ? (isMobile.value ? 340 : 280) : 328);
const height =
panel?.offsetHeight ||
(props.mode === 'time' ? (isMobile.value ? 460 : 320) : 340);
const margin = 8;
let nextLeft = rect.left;
if (getComputedStyle(document.documentElement).direction === 'rtl') {
nextLeft = rect.right - width;
}
nextLeft = Math.min(Math.max(8, nextLeft), window.innerWidth - width - 8);
let nextTop = rect.bottom + 8;
if (nextTop + height > window.innerHeight - 8) {
nextTop = Math.max(8, rect.top - height - 8);
nextLeft = Math.min(
Math.max(margin, nextLeft),
Math.max(margin, window.innerWidth - width - margin),
);
const spaceBelow = window.innerHeight - rect.bottom - margin * 2;
const spaceAbove = rect.top - margin * 2;
let nextTop: number;
if (height <= spaceBelow) {
nextTop = rect.bottom + margin;
} else if (height <= spaceAbove) {
nextTop = rect.top - height - margin;
} else if (spaceBelow >= spaceAbove) {
nextTop = Math.max(margin, window.innerHeight - height - margin);
} else {
nextTop = margin;
}
left.value = nextLeft;
top.value = nextTop;
@@ -852,8 +868,9 @@ onBeforeUnmount(() => {
position: fixed;
z-index: 120;
width: min(20.5rem, calc(100vw - 16px));
max-height: calc(100vh - 16px);
overflow: auto;
/* تقویم باید یکجا دیده شود؛ اسکرول داخل پنل گیج‌کننده است */
max-height: none;
overflow: visible;
background: #fff;
border-radius: var(--radius);
box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
@@ -861,6 +878,13 @@ onBeforeUnmount(() => {
font-family: IRANSans, Tahoma, sans-serif;
}
@media (max-height: 420px) {
.panel {
max-height: calc(100vh - 16px);
overflow: auto;
}
}
.panel-time {
width: min(22.5rem, calc(100vw - 16px));
}
@@ -13,6 +13,7 @@ import {
printTahesabInvoicePdf,
rowInvoiceDesc,
formatInvoiceWeightBalance,
invoiceMesghalLabels,
sumInvoiceMali,
tabdilVaznColumnLabel,
type TahesabInvoiceGroup,
@@ -71,6 +72,10 @@ const company = computed(
const generatedAtLabel = computed(() =>
props.open ? formatJalaliDateTime(new Date()) : '',
);
const mesghalLabels = computed(() =>
invoiceMesghalLabels(sourceRows.value),
);
function printPdf() {
if (!props.group) return;
const ok = printTahesabInvoicePdf({
@@ -243,8 +248,14 @@ function printPdf() {
<div class="account-row">
<div class="mesghal-box">
<span class="ib-k">قیمت یک مثقال نقره خام:</span>
<span class="mesghal-blank" aria-hidden="true" />
<div
v-for="label in mesghalLabels"
:key="label"
class="mesghal-line"
>
<span class="ib-k">{{ label }}</span>
<span class="mesghal-blank" aria-hidden="true" />
</div>
</div>
<div class="account-box">
<div class="acc-line">
@@ -612,11 +623,17 @@ th {
border-radius: 10px;
background: transparent;
padding: 8px 12px;
display: flex;
flex-direction: column;
justify-content: center;
gap: 8px;
min-height: 2.5rem;
}
.mesghal-line {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
min-height: 2.5rem;
}
.mesghal-blank {
flex: 1;