Compare commits
4
Commits
6ccdbc06f0
...
5a30024548
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a30024548 | ||
|
|
c1b3e90b9b | ||
|
|
0a2466ca0c | ||
|
|
28b0a4be38 |
@@ -125,3 +125,94 @@ body #app .ant-menu-item-selected {
|
|||||||
.content-area__content > .ant-card {
|
.content-area__content > .ant-card {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Phone page chrome ────────────────────────────────────────────────
|
||||||
|
// Opt-in per page (class="page-card" on the page's root card) as each page is
|
||||||
|
// made responsive. Base-form modals get the same treatment for their body.
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.page-card,
|
||||||
|
.base-form-modal .ant-modal-body {
|
||||||
|
.ant-card-head {
|
||||||
|
min-height: 44px;
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
.ant-card-head-title {
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
.ant-card-extra {
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
.ant-card-body {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
.mb-base {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.ant-form-item {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.grid-2,
|
||||||
|
.grid-3,
|
||||||
|
.grid-4 {
|
||||||
|
row-gap: 0;
|
||||||
|
column-gap: 12px;
|
||||||
|
}
|
||||||
|
.ant-tabs-nav {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.form-submit {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// date-range filter rows on report pages: the two dates side by side, the
|
||||||
|
// action buttons on their own row without the blank spacer label
|
||||||
|
.filter-grid {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
.ant-form-item:last-child {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
.ant-form-item-label {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// a nested section card inside the page card: drop the double frame
|
||||||
|
.page-card .ant-card .ant-card,
|
||||||
|
.page-card > .ant-card-body .ant-card {
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
// a horizontally scrollable plain <a-table> (class="table-scroll" on it or
|
||||||
|
// on any ancestor)
|
||||||
|
.table-scroll .ant-table-content,
|
||||||
|
.detail-modal .ant-table-content {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
.table-scroll .ant-table-content > table,
|
||||||
|
.detail-modal .ant-table-content > table {
|
||||||
|
min-width: max-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
// View/status modals (wrap-class-name="detail-modal"): near full width on
|
||||||
|
// phones instead of a percentage of an already narrow screen.
|
||||||
|
.detail-modal .ant-modal {
|
||||||
|
width: calc(100vw - 16px) !important;
|
||||||
|
max-width: none;
|
||||||
|
top: 8px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
.detail-modal .ant-modal-content {
|
||||||
|
padding: 14px 12px;
|
||||||
|
}
|
||||||
|
.detail-modal .ant-card-head {
|
||||||
|
min-height: 40px;
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
.detail-modal .ant-card-body {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
.detail-modal .ant-descriptions-item {
|
||||||
|
padding-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
:ok-text="okText"
|
:ok-text="okText"
|
||||||
cancel-text="انصراف"
|
cancel-text="انصراف"
|
||||||
:mask-closable="false"
|
:mask-closable="false"
|
||||||
|
wrap-class-name="base-form-modal"
|
||||||
@update:open="onUpdateOpen"
|
@update:open="onUpdateOpen"
|
||||||
@ok="$emit('submit')"
|
@ok="$emit('submit')"
|
||||||
@cancel="onCancel"
|
@cancel="onCancel"
|
||||||
@@ -74,3 +75,44 @@ function onCancel() {
|
|||||||
emit('cancel');
|
emit('cancel');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!-- Unscoped: <a-modal> teleports to <body>; contained by wrap-class-name. -->
|
||||||
|
<style>
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.base-form-modal .ant-modal {
|
||||||
|
/* ant sets the width inline from :width */
|
||||||
|
width: 100vw !important;
|
||||||
|
max-width: 100vw;
|
||||||
|
top: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
.base-form-modal .ant-modal-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
min-height: calc(var(--vh, 1vh) * 100);
|
||||||
|
border-radius: 0;
|
||||||
|
padding: 14px 16px 0;
|
||||||
|
}
|
||||||
|
.base-form-modal .ant-modal-header {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.base-form-modal .ant-modal-body {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.base-form-modal .ant-modal-footer {
|
||||||
|
position: sticky;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
margin: 0 -16px;
|
||||||
|
padding: 10px 16px;
|
||||||
|
background: #fff;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
.base-form-modal .ant-modal-footer > .ant-btn {
|
||||||
|
flex: 1;
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -98,4 +98,30 @@ const iconComponent = computed(() => ICONS[props.icon ?? ''] ?? BarChartOutlined
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #888;
|
color: #888;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.stat-card :deep(.ant-card-body) {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
.stat-row {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.stat-icon {
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
.stat-value {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 1.4;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
.stat-title {
|
||||||
|
display: block;
|
||||||
|
font-size: 11px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,15 +11,15 @@
|
|||||||
backend does not implement. The buttons are omitted rather than left as
|
backend does not implement. The buttons are omitted rather than left as
|
||||||
dead controls that silently fail.
|
dead controls that silently fail.
|
||||||
-->
|
-->
|
||||||
<div class="x-table">
|
<div class="x-table" :class="{ 'x-table--cards': cardMode }">
|
||||||
<div class="x-table__toolbar">
|
<div class="x-table__toolbar">
|
||||||
<div class="x-table__search-group">
|
<div class="x-table__search-group">
|
||||||
<a-input-search
|
<a-input-search
|
||||||
v-if="!model._hideSearch"
|
v-if="!model._hideSearch"
|
||||||
v-model:value="query.search"
|
v-model:value="query.search"
|
||||||
|
class="x-table__search"
|
||||||
placeholder="جستجو"
|
placeholder="جستجو"
|
||||||
allow-clear
|
allow-clear
|
||||||
style="max-width: 260px"
|
|
||||||
@search="onSearch"
|
@search="onSearch"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -57,6 +57,18 @@
|
|||||||
<template #icon><ReloadOutlined /></template>
|
<template #icon><ReloadOutlined /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
|
|
||||||
|
<!-- card view has no column headers to click, so sorting moves here -->
|
||||||
|
<a-select
|
||||||
|
v-if="cardMode && sortOptions.length"
|
||||||
|
:value="sortValue"
|
||||||
|
class="x-table__sort"
|
||||||
|
size="small"
|
||||||
|
placeholder="مرتبسازی"
|
||||||
|
allow-clear
|
||||||
|
:options="sortOptions"
|
||||||
|
@change="onSortSelect"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -109,7 +121,74 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="cardMode" class="x-table__cards">
|
||||||
|
<a-spin :spinning="loading">
|
||||||
|
<a-empty v-if="!data.length && !loading" :description="locale.emptyText" />
|
||||||
|
<a-checkbox
|
||||||
|
v-if="hasSelection && data.length"
|
||||||
|
class="x-table__select-all"
|
||||||
|
:checked="allOnPageSelected"
|
||||||
|
:indeterminate="someOnPageSelected && !allOnPageSelected"
|
||||||
|
@change="(e: any) => selectPage(e.target.checked)"
|
||||||
|
>
|
||||||
|
انتخاب همه در این صفحه
|
||||||
|
</a-checkbox>
|
||||||
|
<div
|
||||||
|
v-for="record in data"
|
||||||
|
:key="String(record.id)"
|
||||||
|
class="x-card"
|
||||||
|
:class="{ 'x-card--selected': hasSelection && isSelected(record) }"
|
||||||
|
>
|
||||||
|
<div class="x-card__head">
|
||||||
|
<div class="x-card__title">
|
||||||
|
<a-checkbox
|
||||||
|
v-if="hasSelection"
|
||||||
|
:checked="isSelected(record)"
|
||||||
|
@change="(e: any) => toggleRow(record, e.target.checked)"
|
||||||
|
/>
|
||||||
|
<span v-if="cardMediaCol" class="x-card__media">
|
||||||
|
<slot :name="cardMediaCol.slot" :text="cellValue(record, cardMediaCol)" :record="record" />
|
||||||
|
</span>
|
||||||
|
<span v-if="cardIdCol" class="x-card__id">#{{ cellValue(record, cardIdCol) }}</span>
|
||||||
|
<span class="x-card__name">
|
||||||
|
<template v-for="col in cardTitleCols" :key="col.key">
|
||||||
|
<slot v-if="col.slot" :name="col.slot" :text="cellValue(record, col)" :record="record" />
|
||||||
|
<template v-else>{{ displayValue(record, col) }} </template>
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div v-if="cardActionCol" class="x-card__actions">
|
||||||
|
<slot :name="cardActionCol.slot" :text="cellValue(record, cardActionCol)" :record="record" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<dl v-if="cardBodyCols.length" class="x-card__body">
|
||||||
|
<div v-for="col in cardBodyCols" :key="col.key" class="x-card__row">
|
||||||
|
<dt>{{ col.title }}</dt>
|
||||||
|
<dd>
|
||||||
|
<slot v-if="col.slot" :name="col.slot" :text="cellValue(record, col)" :record="record" />
|
||||||
|
<template v-else>{{ displayValue(record, col) }}</template>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
</div>
|
||||||
|
</a-spin>
|
||||||
|
|
||||||
|
<div v-if="!model._hidePagination && query.total > 0" class="x-table__card-pager">
|
||||||
|
<span class="x-table__card-total">{{ query.total }} مورد</span>
|
||||||
|
<a-pagination
|
||||||
|
size="small"
|
||||||
|
show-less-items
|
||||||
|
:current="query.page"
|
||||||
|
:page-size="query.limit"
|
||||||
|
:total="query.total"
|
||||||
|
:show-size-changer="false"
|
||||||
|
@change="onCardPage"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<a-table
|
<a-table
|
||||||
|
v-else
|
||||||
:columns="antColumns"
|
:columns="antColumns"
|
||||||
:data-source="data"
|
:data-source="data"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
@@ -117,7 +196,8 @@
|
|||||||
:locale="locale"
|
:locale="locale"
|
||||||
:row-selection="rowSelection"
|
:row-selection="rowSelection"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
size="middle"
|
:size="layout.isMobile ? 'small' : 'middle'"
|
||||||
|
:scroll="layout.isSmallScreen ? { x: 'max-content' } : undefined"
|
||||||
bordered
|
bordered
|
||||||
@change="onTableChange"
|
@change="onTableChange"
|
||||||
>
|
>
|
||||||
@@ -140,8 +220,9 @@
|
|||||||
import { computed, onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import { FilterOutlined, PrinterOutlined, ReloadOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
import { FilterOutlined, PrinterOutlined, ReloadOutlined, SettingOutlined } from '@ant-design/icons-vue';
|
||||||
import api from '../../api/client';
|
import api from '../../api/client';
|
||||||
import type { XTbl } from './model';
|
import type { XTbl, Xtc } from './model';
|
||||||
import { gridDate } from '../../utils/filters';
|
import { gridDate } from '../../utils/filters';
|
||||||
|
import { useLayoutStore } from '../../stores/layout';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -150,10 +231,15 @@ const props = withDefaults(
|
|||||||
hasSelection?: boolean;
|
hasSelection?: boolean;
|
||||||
/** legacy used v-model for the selected rows */
|
/** legacy used v-model for the selected rows */
|
||||||
modelValue?: Record<string, unknown>[];
|
modelValue?: Record<string, unknown>[];
|
||||||
|
/** On phones, render each row as a card instead of a wide table. Opt-in per page. */
|
||||||
|
mobileCards?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{ hasSelection: false, modelValue: () => [] },
|
{ hasSelection: false, modelValue: () => [], mobileCards: false },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const layout = useLayoutStore();
|
||||||
|
const cardMode = computed(() => props.mobileCards && layout.isMobile);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'query', q: unknown): void;
|
(e: 'query', q: unknown): void;
|
||||||
(e: 'update:modelValue', rows: Record<string, unknown>[]): void;
|
(e: 'update:modelValue', rows: Record<string, unknown>[]): void;
|
||||||
@@ -234,6 +320,107 @@ function slotNameFor(column: { __slot?: string }) {
|
|||||||
return column.__slot;
|
return column.__slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── phone card view ──────────────────────────────────────────────────
|
||||||
|
interface CardCol {
|
||||||
|
key: string;
|
||||||
|
title: string;
|
||||||
|
path: string[];
|
||||||
|
slot?: string;
|
||||||
|
date: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
const ACTION_KEYS = ['opt', 'op', 'action'];
|
||||||
|
|
||||||
|
const cardCols = computed<CardCol[]>(() =>
|
||||||
|
visibleCols.value.map((c: Xtc) => ({
|
||||||
|
key: c.key,
|
||||||
|
title: c.title,
|
||||||
|
path: c.dataIndex.split('.'),
|
||||||
|
slot: c.scopedSlots?.customRender,
|
||||||
|
date: c.filterType === 'date',
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
const cardActionCol = computed(() => cardCols.value.find((c) => ACTION_KEYS.includes(c.key) && c.slot));
|
||||||
|
const cardIdCol = computed(() => cardCols.value.find((c) => c.key === 'id'));
|
||||||
|
const cardMediaCol = computed(() => cardCols.value.find((c) => c.slot === 'image'));
|
||||||
|
const cardTitleCols = computed<CardCol[]>(() => {
|
||||||
|
const rest = cardCols.value.filter(
|
||||||
|
(c) => c !== cardActionCol.value && c !== cardIdCol.value && c !== cardMediaCol.value,
|
||||||
|
);
|
||||||
|
const named = rest.find((c) => c.key === 'name' || c.key === 'title');
|
||||||
|
if (named) return [named];
|
||||||
|
const fname = rest.find((c) => c.key === 'fname');
|
||||||
|
if (fname) return [fname, ...rest.filter((c) => c.key === 'lname')];
|
||||||
|
return rest.slice(0, 1);
|
||||||
|
});
|
||||||
|
const cardBodyCols = computed(() =>
|
||||||
|
cardCols.value.filter(
|
||||||
|
(c) =>
|
||||||
|
c !== cardActionCol.value &&
|
||||||
|
c !== cardIdCol.value &&
|
||||||
|
c !== cardMediaCol.value &&
|
||||||
|
!cardTitleCols.value.includes(c),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
// card-mode selection, same v-model contract as the table's rowSelection
|
||||||
|
function isSelected(record: Record<string, unknown>) {
|
||||||
|
return props.modelValue.some((r) => r.id === record.id);
|
||||||
|
}
|
||||||
|
function toggleRow(record: Record<string, unknown>, checked: boolean) {
|
||||||
|
const rest = props.modelValue.filter((r) => r.id !== record.id);
|
||||||
|
emit('update:modelValue', checked ? [...rest, record] : rest);
|
||||||
|
}
|
||||||
|
const allOnPageSelected = computed(() => data.value.length > 0 && data.value.every(isSelected));
|
||||||
|
const someOnPageSelected = computed(() => data.value.some(isSelected));
|
||||||
|
function selectPage(checked: boolean) {
|
||||||
|
const pageIds = new Set(data.value.map((r) => r.id));
|
||||||
|
const rest = props.modelValue.filter((r) => !pageIds.has(r.id));
|
||||||
|
emit('update:modelValue', checked ? [...rest, ...data.value] : rest);
|
||||||
|
}
|
||||||
|
|
||||||
|
function cellValue(record: Record<string, unknown>, col: CardCol): unknown {
|
||||||
|
return col.path.reduce<unknown>(
|
||||||
|
(v, k) => (v && typeof v === 'object' ? (v as Record<string, unknown>)[k] : undefined),
|
||||||
|
record,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayValue(record: Record<string, unknown>, col: CardCol) {
|
||||||
|
const v = cellValue(record, col);
|
||||||
|
if (v === null || v === undefined || v === '') return '-';
|
||||||
|
return col.date ? gridDate(v) : v;
|
||||||
|
}
|
||||||
|
|
||||||
|
const sortOptions = computed(() =>
|
||||||
|
visibleCols.value
|
||||||
|
.filter((c) => c.__sorter)
|
||||||
|
.flatMap((c) => [
|
||||||
|
{ value: `${c.key}|asc`, label: `${c.title} ↑` },
|
||||||
|
{ value: `${c.key}|desc`, label: `${c.title} ↓` },
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
const sortValue = computed(() => (sort.value ? `${sort.value}|${sortDirection.value}` : undefined));
|
||||||
|
|
||||||
|
function onSortSelect(value?: string) {
|
||||||
|
if (value) {
|
||||||
|
const [key, dir] = value.split('|');
|
||||||
|
sort.value = key;
|
||||||
|
sortDirection.value = dir as 'asc' | 'desc';
|
||||||
|
} else {
|
||||||
|
sort.value = undefined;
|
||||||
|
}
|
||||||
|
query.page = 1;
|
||||||
|
fetch();
|
||||||
|
}
|
||||||
|
|
||||||
|
function onCardPage(page: number, pageSize: number) {
|
||||||
|
query.page = page;
|
||||||
|
query.limit = pageSize;
|
||||||
|
fetch();
|
||||||
|
document.getElementById('content-area')?.scrollTo({ top: 0, behavior: 'smooth' });
|
||||||
|
}
|
||||||
|
|
||||||
/** Resolves a filter row's column back to its Xtc definition. */
|
/** Resolves a filter row's column back to its Xtc definition. */
|
||||||
function colForField(field?: string) {
|
function colForField(field?: string) {
|
||||||
if (!field) return undefined;
|
if (!field) return undefined;
|
||||||
@@ -401,4 +588,167 @@ defineExpose({ fetch });
|
|||||||
.refresh-btn {
|
.refresh-btn {
|
||||||
transition: all 0.15s ease;
|
transition: all 0.15s ease;
|
||||||
}
|
}
|
||||||
|
.x-table__search {
|
||||||
|
max-width: 260px;
|
||||||
|
}
|
||||||
|
.x-table__sort {
|
||||||
|
width: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── phone card view ── */
|
||||||
|
.x-table__cards {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.x-table__cards :deep(.ant-spin-container) {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
min-height: 80px;
|
||||||
|
}
|
||||||
|
.x-card {
|
||||||
|
border: 1px solid #eef0f3;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.x-card__head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 10px 12px;
|
||||||
|
background: #fafbfc;
|
||||||
|
border-bottom: 1px solid #eef0f3;
|
||||||
|
}
|
||||||
|
.x-card__title {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.x-card__id {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: 11px;
|
||||||
|
color: #8a909c;
|
||||||
|
background: #eef0f3;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 1px 6px;
|
||||||
|
direction: ltr;
|
||||||
|
}
|
||||||
|
.x-card__name {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1c2d56;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.x-card__actions {
|
||||||
|
flex-shrink: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
.x-card--selected {
|
||||||
|
border-color: #91caff;
|
||||||
|
}
|
||||||
|
.x-card--selected .x-card__head {
|
||||||
|
background: #f0f7ff;
|
||||||
|
}
|
||||||
|
.x-card__media {
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
.x-card__media :deep(img) {
|
||||||
|
width: 44px !important;
|
||||||
|
height: 44px !important;
|
||||||
|
object-fit: cover !important;
|
||||||
|
border-radius: 6px;
|
||||||
|
}
|
||||||
|
.x-table__select-all {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a909c;
|
||||||
|
}
|
||||||
|
.x-card__body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 4px 12px;
|
||||||
|
}
|
||||||
|
.x-card__row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
padding: 7px 0;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.x-card__row + .x-card__row {
|
||||||
|
border-top: 1px dashed #f0f0f0;
|
||||||
|
}
|
||||||
|
.x-card__row dt {
|
||||||
|
color: #8a909c;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.x-card__row dd {
|
||||||
|
margin: 0;
|
||||||
|
color: #333;
|
||||||
|
text-align: left;
|
||||||
|
min-width: 0;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
.x-card__row dd :deep(.ant-tag) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.x-table__card-pager {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.x-table__card-total {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #8a909c;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.x-table__toolbar {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
/* flatten so search takes row one and actions + add share row two */
|
||||||
|
.x-table__search-group {
|
||||||
|
display: contents;
|
||||||
|
}
|
||||||
|
.x-table__search {
|
||||||
|
max-width: none;
|
||||||
|
flex: 1 1 100%;
|
||||||
|
}
|
||||||
|
.x-table__actions {
|
||||||
|
gap: 2px;
|
||||||
|
}
|
||||||
|
.x-table__sort {
|
||||||
|
width: 130px;
|
||||||
|
}
|
||||||
|
.x-table__add {
|
||||||
|
margin-inline-start: auto;
|
||||||
|
}
|
||||||
|
.x-table__filters {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.x-table__filter-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
padding-bottom: 8px;
|
||||||
|
border-bottom: 1px dashed #e8e8e8;
|
||||||
|
}
|
||||||
|
/* the filter inputs carry fixed inline widths for desktop */
|
||||||
|
.x-table__filter-row > * {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
.x-table__filter-row > :nth-child(n + 3) {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
.x-table__filter-actions > * {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -126,9 +126,19 @@ async function onLogout() {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
.nav-left {
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.nav-right {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
.page-title {
|
.page-title {
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
color: #1c2d56;
|
color: #1c2d56;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
.breadcrumb {
|
.breadcrumb {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@@ -139,6 +149,29 @@ async function onLogout() {
|
|||||||
gap: 8px;
|
gap: 8px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 991px) {
|
||||||
|
.the-navbar {
|
||||||
|
height: 56px;
|
||||||
|
line-height: 56px;
|
||||||
|
padding: 0 8px 0 16px;
|
||||||
|
}
|
||||||
|
.nav-left {
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.breadcrumb {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.page-title {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.user-name {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -12,10 +12,25 @@
|
|||||||
sidebar/navbar that used to scroll away with it.
|
sidebar/navbar that used to scroll away with it.
|
||||||
-->
|
-->
|
||||||
<a-layout class="layout--main" :class="{ 'no-scroll': isAppPage }">
|
<a-layout class="layout--main" :class="{ 'no-scroll': isAppPage }">
|
||||||
<VerticalNavMenu :collapsed="collapsed" />
|
<VerticalNavMenu v-if="!layout.isSmallScreen" :collapsed="collapsed" />
|
||||||
|
|
||||||
|
<a-drawer
|
||||||
|
v-else
|
||||||
|
:open="layout.mobileNavOpen"
|
||||||
|
placement="right"
|
||||||
|
:width="260"
|
||||||
|
:closable="false"
|
||||||
|
root-class-name="mobile-nav-drawer"
|
||||||
|
@close="layout.setMobileNavOpen(false)"
|
||||||
|
>
|
||||||
|
<VerticalNavMenu />
|
||||||
|
</a-drawer>
|
||||||
|
|
||||||
<a-layout>
|
<a-layout>
|
||||||
<TheNavbar :collapsed="collapsed" @toggle-sidebar="layout.setSidebarCollapsed(!collapsed)" />
|
<TheNavbar
|
||||||
|
:collapsed="layout.isSmallScreen ? !layout.mobileNavOpen : collapsed"
|
||||||
|
@toggle-sidebar="onToggleSidebar"
|
||||||
|
/>
|
||||||
|
|
||||||
<a-layout-content id="content-area">
|
<a-layout-content id="content-area">
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
@@ -41,6 +56,11 @@ const layout = useLayoutStore();
|
|||||||
// collapsed/expanded across reloads instead of resetting every time.
|
// collapsed/expanded across reloads instead of resetting every time.
|
||||||
const collapsed = computed(() => layout.sidebarCollapsed);
|
const collapsed = computed(() => layout.sidebarCollapsed);
|
||||||
|
|
||||||
|
function onToggleSidebar() {
|
||||||
|
if (layout.isSmallScreen) layout.setMobileNavOpen(!layout.mobileNavOpen);
|
||||||
|
else layout.setSidebarCollapsed(!collapsed.value);
|
||||||
|
}
|
||||||
|
|
||||||
// legacy meta.no_scroll -> the 'no-scroll' body class
|
// legacy meta.no_scroll -> the 'no-scroll' body class
|
||||||
const isAppPage = computed(() => Boolean(route.meta?.no_scroll));
|
const isAppPage = computed(() => Boolean(route.meta?.no_scroll));
|
||||||
|
|
||||||
@@ -58,13 +78,23 @@ watch(
|
|||||||
() => route.path,
|
() => route.path,
|
||||||
() => {
|
() => {
|
||||||
overriddenTitle.value = undefined;
|
overriddenTitle.value = undefined;
|
||||||
|
layout.setMobileNavOpen(false);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => layout.isSmallScreen,
|
||||||
|
(small) => {
|
||||||
|
if (!small) layout.setMobileNavOpen(false);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.layout--main {
|
.layout--main {
|
||||||
height: 100vh;
|
/* --vh is set from window.innerHeight in App.vue, so mobile browser chrome
|
||||||
|
(address bar) is excluded from the height */
|
||||||
|
height: calc(var(--vh, 1vh) * 100);
|
||||||
overflow: hidden; /* the sidebar and navbar are pinned; only #content-area scrolls */
|
overflow: hidden; /* the sidebar and navbar are pinned; only #content-area scrolls */
|
||||||
}
|
}
|
||||||
.layout--main > :deep(.ant-layout) {
|
.layout--main > :deep(.ant-layout) {
|
||||||
@@ -78,8 +108,14 @@ watch(
|
|||||||
gap underneath on short lists. This is also the ONLY element that
|
gap underneath on short lists. This is also the ONLY element that
|
||||||
scrolls — the navbar above it and the sidebar beside it stay fixed. */
|
scrolls — the navbar above it and the sidebar beside it stay fixed. */
|
||||||
display: flex;
|
display: flex;
|
||||||
height: calc(100vh - 61px); /* 61px matches TheNavbar's fixed height */
|
height: calc(var(--vh, 1vh) * 100 - 61px); /* 61px matches TheNavbar's fixed height */
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
@media (max-width: 991px) {
|
||||||
|
#content-area {
|
||||||
|
height: calc(var(--vh, 1vh) * 100 - 56px); /* TheNavbar is 56px below 992 */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.content-wrapper,
|
.content-wrapper,
|
||||||
.content-area__content {
|
.content-area__content {
|
||||||
@@ -87,5 +123,17 @@ watch(
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!-- Unscoped: <a-drawer> teleports to <body>; contained by root-class-name. -->
|
||||||
|
<style>
|
||||||
|
.mobile-nav-drawer .ant-drawer-body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.mobile-nav-drawer .vertical-nav-menu {
|
||||||
|
height: 100%;
|
||||||
|
border-left: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -27,10 +27,13 @@ export const useLayoutStore = defineStore('layout', {
|
|||||||
// legacy state.js: sidebar visibility for the vertical nav menu
|
// legacy state.js: sidebar visibility for the vertical nav menu
|
||||||
isSidebarActive: true,
|
isSidebarActive: true,
|
||||||
sidebarCollapsed: readPersistedCollapsed(),
|
sidebarCollapsed: readPersistedCollapsed(),
|
||||||
|
// below the 992 breakpoint the sidebar is an off-canvas drawer; never persisted
|
||||||
|
mobileNavOpen: false,
|
||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
// legacy used breakpoints of 1200 (theme tour) and 992 (nav menu collapse)
|
// legacy used breakpoints of 1200 (theme tour) and 992 (nav menu collapse)
|
||||||
isSmallScreen: (s) => s.windowWidth < 992,
|
isSmallScreen: (s) => s.windowWidth < 992,
|
||||||
|
isMobile: (s) => s.windowWidth < 576,
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
// legacy mutation: UPDATE_WINDOW_WIDTH
|
// legacy mutation: UPDATE_WINDOW_WIDTH
|
||||||
@@ -41,6 +44,9 @@ export const useLayoutStore = defineStore('layout', {
|
|||||||
updateWindowScrollY(y: number) {
|
updateWindowScrollY(y: number) {
|
||||||
this.scrollY = y;
|
this.scrollY = y;
|
||||||
},
|
},
|
||||||
|
setMobileNavOpen(value: boolean) {
|
||||||
|
this.mobileNavOpen = value;
|
||||||
|
},
|
||||||
toggleSidebar(value?: boolean) {
|
toggleSidebar(value?: boolean) {
|
||||||
this.isSidebarActive = value ?? !this.isSidebarActive;
|
this.isSidebarActive = value ?? !this.isSidebarActive;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -9,132 +9,162 @@
|
|||||||
payloads unchanged plus the new chart aggregates used below.
|
payloads unchanged plus the new chart aggregates used below.
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<!-- ── KPI row: every stat the two legacy dashboards showed, preserved ── -->
|
<div class="dashboard">
|
||||||
<div class="grid-4">
|
<!-- ── KPI row: every stat the two legacy dashboards showed, preserved ── -->
|
||||||
<StatisticsCardLine
|
<div class="kpi-grid kpi-grid--4">
|
||||||
icon="UsersIcon"
|
<StatisticsCardLine
|
||||||
color="warning"
|
icon="UsersIcon"
|
||||||
:statistic="`${data.customerCount ?? 0} نفر`"
|
color="warning"
|
||||||
statistic-title="مشتریان جدید (۳۰ روز گذشته)"
|
:statistic="`${data.customerCount ?? 0} نفر`"
|
||||||
/>
|
statistic-title="مشتریان جدید (۳۰ روز گذشته)"
|
||||||
<StatisticsCardLine
|
|
||||||
icon="ShoppingBagIcon"
|
|
||||||
color="primary"
|
|
||||||
:statistic="`${data.allgram ?? 0} گرم`"
|
|
||||||
statistic-title="طلای فروش رفته (۳۰ روز گذشته)"
|
|
||||||
/>
|
|
||||||
<StatisticsCardLine
|
|
||||||
icon="ShoppingBagIcon"
|
|
||||||
color="success"
|
|
||||||
:statistic="`${data.ordercount ?? 0} سفارش`"
|
|
||||||
statistic-title="تعداد سفارشات (۳۰ روز گذشته)"
|
|
||||||
/>
|
|
||||||
<StatisticsCardLine
|
|
||||||
icon="DollarSignIcon"
|
|
||||||
color="danger"
|
|
||||||
:statistic="goldPriceLabel"
|
|
||||||
statistic-title="نرخ هر گرم طلای ۱۸ عیار"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid-2 mt-4">
|
|
||||||
<StatisticsCardLine
|
|
||||||
icon="BarChartIcon"
|
|
||||||
color="primary"
|
|
||||||
:statistic="`${data.sumLastOrder ?? 0} سفارش`"
|
|
||||||
statistic-title="تعداد سفارشات تحویلشده (۳۰ روز گذشته)"
|
|
||||||
/>
|
|
||||||
<StatisticsCardLine
|
|
||||||
icon="CreditCardIcon"
|
|
||||||
color="warning"
|
|
||||||
:statistic="`${totalDebtLabel} گرم`"
|
|
||||||
statistic-title="مجموع بدهی طلای مشتریان"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ── روند سفارشها: 30-day line chart, تک vs عمده ── -->
|
|
||||||
<a-card title="روند سفارشها (۳۰ روز گذشته)" class="mt-4">
|
|
||||||
<apexchart
|
|
||||||
type="area"
|
|
||||||
height="300"
|
|
||||||
:options="trendChartOptions"
|
|
||||||
:series="trendSeries"
|
|
||||||
/>
|
|
||||||
</a-card>
|
|
||||||
|
|
||||||
<div class="grid-2 mt-4">
|
|
||||||
<a-card title="وضعیت سفارشات (۳۰ روز گذشته)">
|
|
||||||
<apexchart type="donut" height="300" :options="statusChartOptions" :series="statusSeries" />
|
|
||||||
</a-card>
|
|
||||||
|
|
||||||
<a-card title="تفکیک عمده / تک (۳۰ روز گذشته)">
|
|
||||||
<apexchart type="donut" height="300" :options="channelChartOptions" :series="channelSeries" />
|
|
||||||
</a-card>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="grid-2 mt-4">
|
|
||||||
<a-card title="عملکرد کارشناسان فروش">
|
|
||||||
<apexchart
|
|
||||||
v-if="agentChartSeries[0]?.data.length"
|
|
||||||
type="bar"
|
|
||||||
height="280"
|
|
||||||
:options="agentChartOptions"
|
|
||||||
:series="agentChartSeries"
|
|
||||||
/>
|
/>
|
||||||
<a-table
|
<StatisticsCardLine
|
||||||
class="mt-3"
|
icon="ShoppingBagIcon"
|
||||||
size="small"
|
color="primary"
|
||||||
:data-source="data.reagent"
|
:statistic="`${data.allgram ?? 0} گرم`"
|
||||||
:columns="agentColumns"
|
statistic-title="طلای فروش رفته (۳۰ روز گذشته)"
|
||||||
:pagination="false"
|
/>
|
||||||
|
<StatisticsCardLine
|
||||||
|
icon="ShoppingBagIcon"
|
||||||
|
color="success"
|
||||||
|
:statistic="`${data.ordercount ?? 0} سفارش`"
|
||||||
|
statistic-title="تعداد سفارشات (۳۰ روز گذشته)"
|
||||||
|
/>
|
||||||
|
<StatisticsCardLine
|
||||||
|
icon="DollarSignIcon"
|
||||||
|
color="danger"
|
||||||
|
:statistic="goldPriceLabel"
|
||||||
|
statistic-title="نرخ هر گرم طلای ۱۸ عیار"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="kpi-grid kpi-grid--2">
|
||||||
|
<StatisticsCardLine
|
||||||
|
icon="BarChartIcon"
|
||||||
|
color="primary"
|
||||||
|
:statistic="`${data.sumLastOrder ?? 0} سفارش`"
|
||||||
|
statistic-title="تعداد سفارشات تحویلشده (۳۰ روز گذشته)"
|
||||||
|
/>
|
||||||
|
<StatisticsCardLine
|
||||||
|
icon="CreditCardIcon"
|
||||||
|
color="warning"
|
||||||
|
:statistic="`${totalDebtLabel} گرم`"
|
||||||
|
statistic-title="مجموع بدهی طلای مشتریان"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- ── روند سفارشها: 30-day line chart, تک vs عمده ── -->
|
||||||
|
<a-card title="روند سفارشها (۳۰ روز گذشته)" class="dash-card">
|
||||||
|
<apexchart
|
||||||
|
type="area"
|
||||||
|
:height="chartHeight"
|
||||||
|
:options="trendChartOptions"
|
||||||
|
:series="trendSeries"
|
||||||
|
/>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<div class="card-grid">
|
||||||
|
<a-card title="وضعیت سفارشات (۳۰ روز گذشته)" class="dash-card">
|
||||||
|
<apexchart type="donut" :height="chartHeight" :options="statusChartOptions" :series="statusSeries" />
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<a-card title="تفکیک عمده / تک (۳۰ روز گذشته)" class="dash-card">
|
||||||
|
<apexchart type="donut" :height="chartHeight" :options="channelChartOptions" :series="channelSeries" />
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-grid">
|
||||||
|
<a-card title="عملکرد کارشناسان فروش" class="dash-card">
|
||||||
|
<apexchart
|
||||||
|
v-if="agentChartSeries[0]?.data.length"
|
||||||
|
type="bar"
|
||||||
|
:height="barChartHeight"
|
||||||
|
:options="agentChartOptions"
|
||||||
|
:series="agentChartSeries"
|
||||||
|
/>
|
||||||
|
<a-table
|
||||||
|
class="dash-table"
|
||||||
|
size="small"
|
||||||
|
:data-source="data.reagent"
|
||||||
|
:columns="agentColumns"
|
||||||
|
:pagination="false"
|
||||||
|
:scroll="{ x: 'max-content' }"
|
||||||
|
row-key="id"
|
||||||
|
/>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<a-card title="محصولات پرفروش (۳۰ روز گذشته)" class="dash-card">
|
||||||
|
<apexchart
|
||||||
|
v-if="productChartSeries[0]?.data.length"
|
||||||
|
type="bar"
|
||||||
|
:height="barChartHeight"
|
||||||
|
:options="productChartOptions"
|
||||||
|
:series="productChartSeries"
|
||||||
|
/>
|
||||||
|
<a-empty v-else description="دادهای برای نمایش وجود ندارد" />
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<a-card title="میزان فروش" class="dash-card">
|
||||||
|
<div class="sales-summary">
|
||||||
|
<div class="sales-summary__item">
|
||||||
|
<span class="sales-summary__label">تعداد سفارش (۳۰ روز)</span>
|
||||||
|
<span class="sales-summary__value">{{ data.sumLastOrder ?? 0 }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="sales-summary__item">
|
||||||
|
<span class="sales-summary__label">مجموع وزن (۳۰ روز)</span>
|
||||||
|
<span class="sales-summary__value">{{ data.sumLastOrderMonth ?? 0 }} گرم</span>
|
||||||
|
</div>
|
||||||
|
<div class="sales-summary__item">
|
||||||
|
<span class="sales-summary__label">میانگین هر سفارش</span>
|
||||||
|
<span class="sales-summary__value">{{ avgWeightPerOrder }} گرم</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
<a-card title="سفارشات هفته جاری" class="dash-card">
|
||||||
|
<a-list
|
||||||
|
v-if="layout.isMobile"
|
||||||
|
class="order-list"
|
||||||
|
:data-source="data.lastOrder"
|
||||||
|
:pagination="data.lastOrder?.length > 10 ? { pageSize: 10, size: 'small', align: 'center' } : false"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
/>
|
>
|
||||||
</a-card>
|
<template #renderItem="{ item }">
|
||||||
|
<a-list-item class="order-item">
|
||||||
|
<div class="order-item__head">
|
||||||
|
<span class="order-item__name">{{ item.name }}</span>
|
||||||
|
<a-tag :color="tagColor(item.statusColor)" class="order-item__tag">{{ item.sts_str }}</a-tag>
|
||||||
|
</div>
|
||||||
|
<div class="order-item__customer">{{ item.customer }}</div>
|
||||||
|
<div class="order-item__meta">
|
||||||
|
<span>{{ item.w }} گرم</span>
|
||||||
|
<span>{{ jdate(item.caj) }}</span>
|
||||||
|
</div>
|
||||||
|
</a-list-item>
|
||||||
|
</template>
|
||||||
|
</a-list>
|
||||||
|
|
||||||
<a-card title="محصولات پرفروش (۳۰ روز گذشته)">
|
<a-table
|
||||||
<apexchart
|
v-else
|
||||||
v-if="productChartSeries[0]?.data.length"
|
size="small"
|
||||||
type="bar"
|
:data-source="data.lastOrder"
|
||||||
height="280"
|
:columns="orderColumns"
|
||||||
:options="productChartOptions"
|
:pagination="{ pageSize: 10 }"
|
||||||
:series="productChartSeries"
|
:scroll="{ x: 'max-content' }"
|
||||||
/>
|
row-key="id"
|
||||||
<a-empty v-else description="دادهای برای نمایش وجود ندارد" />
|
>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.dataIndex === 'sts_str'">
|
||||||
|
<a-tag :color="tagColor(record.statusColor)">{{ record.sts_str }}</a-tag>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.dataIndex === 'caj'">
|
||||||
|
{{ jdate(record.caj) }}
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-card title="میزان فروش" class="mt-4">
|
|
||||||
<a-descriptions bordered size="small" :column="3">
|
|
||||||
<a-descriptions-item label="تعداد سفارش (۳۰ روز)">
|
|
||||||
{{ data.sumLastOrder ?? 0 }}
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="مجموع وزن (۳۰ روز)">
|
|
||||||
{{ data.sumLastOrderMonth ?? 0 }} گرم
|
|
||||||
</a-descriptions-item>
|
|
||||||
<a-descriptions-item label="میانگین هر سفارش">
|
|
||||||
{{ avgWeightPerOrder }} گرم
|
|
||||||
</a-descriptions-item>
|
|
||||||
</a-descriptions>
|
|
||||||
</a-card>
|
|
||||||
|
|
||||||
<a-card title="سفارشات هفته جاری" class="mt-4">
|
|
||||||
<a-table
|
|
||||||
size="small"
|
|
||||||
:data-source="data.lastOrder"
|
|
||||||
:columns="orderColumns"
|
|
||||||
:pagination="{ pageSize: 10 }"
|
|
||||||
row-key="id"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="column.dataIndex === 'sts_str'">
|
|
||||||
<a-tag :color="tagColor(record.statusColor)">{{ record.sts_str }}</a-tag>
|
|
||||||
</template>
|
|
||||||
<template v-else-if="column.dataIndex === 'caj'">
|
|
||||||
{{ jdate(record.caj) }}
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</a-table>
|
|
||||||
</a-card>
|
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -142,9 +172,14 @@
|
|||||||
import { computed, onMounted, reactive, ref } from 'vue';
|
import { computed, onMounted, reactive, ref } from 'vue';
|
||||||
import StatisticsCardLine from '../components/statistics-cards/StatisticsCardLine.vue';
|
import StatisticsCardLine from '../components/statistics-cards/StatisticsCardLine.vue';
|
||||||
import { jdate, price } from '../utils/filters';
|
import { jdate, price } from '../utils/filters';
|
||||||
|
import { useLayoutStore } from '../stores/layout';
|
||||||
import api from '../api/client';
|
import api from '../api/client';
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
const layout = useLayoutStore();
|
||||||
|
|
||||||
|
const chartHeight = computed(() => (layout.isMobile ? 240 : 300));
|
||||||
|
const barChartHeight = computed(() => (layout.isMobile ? 240 : 280));
|
||||||
|
|
||||||
interface OrdersTrendPoint {
|
interface OrdersTrendPoint {
|
||||||
date: string;
|
date: string;
|
||||||
@@ -231,43 +266,57 @@ const trendSeries = computed(() => {
|
|||||||
];
|
];
|
||||||
});
|
});
|
||||||
const trendChartOptions = computed(() => ({
|
const trendChartOptions = computed(() => ({
|
||||||
chart: { toolbar: { show: false }, fontFamily: 'inherit' },
|
chart: { toolbar: { show: false }, fontFamily: 'inherit', parentHeightOffset: 0 },
|
||||||
colors: [COLOR_PRIMARY, COLOR_SUCCESS],
|
colors: [COLOR_PRIMARY, COLOR_SUCCESS],
|
||||||
dataLabels: { enabled: false },
|
dataLabels: { enabled: false },
|
||||||
stroke: { curve: 'smooth', width: 2 },
|
stroke: { curve: 'smooth', width: 2 },
|
||||||
fill: { type: 'gradient', gradient: { opacityFrom: 0.35, opacityTo: 0.05 } },
|
fill: { type: 'gradient', gradient: { opacityFrom: 0.35, opacityTo: 0.05 } },
|
||||||
legend: { position: 'top', horizontalAlign: 'right' },
|
legend: { position: 'top', horizontalAlign: 'right', fontSize: layout.isMobile ? '12px' : '14px' },
|
||||||
|
grid: { padding: layout.isMobile ? { left: 4, right: 4 } : {} },
|
||||||
xaxis: {
|
xaxis: {
|
||||||
categories: (data.ordersTrend ?? []).map((d: OrdersTrendPoint) => jdate(d.date)),
|
// phones drop the year (1405/07/04 -> 07/04) so the edge labels aren't
|
||||||
|
// clipped; the tooltip below still shows the full date
|
||||||
|
categories: (data.ordersTrend ?? []).map((d: OrdersTrendPoint) => {
|
||||||
|
const label = String(jdate(d.date) ?? '');
|
||||||
|
return layout.isMobile ? label.slice(5) : label;
|
||||||
|
}),
|
||||||
// 30 daily labels overlap at rotate: 0 (see screenshot); angle them so
|
// 30 daily labels overlap at rotate: 0 (see screenshot); angle them so
|
||||||
// each date stays legible instead of running into its neighbours.
|
// each date stays legible instead of running into its neighbours.
|
||||||
|
tickAmount: layout.isMobile ? 6 : undefined,
|
||||||
labels: {
|
labels: {
|
||||||
rotate: -45,
|
rotate: -45,
|
||||||
rotateAlways: true,
|
rotateAlways: true,
|
||||||
hideOverlappingLabels: true,
|
hideOverlappingLabels: true,
|
||||||
style: { fontSize: '12px', fontWeight: 500 },
|
style: { fontSize: layout.isMobile ? '10px' : '12px', fontWeight: 500 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yaxis: { labels: { style: { fontSize: layout.isMobile ? '10px' : '12px' } } },
|
||||||
|
tooltip: {
|
||||||
|
shared: true,
|
||||||
|
x: {
|
||||||
|
formatter: (_v: unknown, opts: { dataPointIndex: number }) =>
|
||||||
|
jdate((data.ordersTrend ?? [])[opts?.dataPointIndex]?.date),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
tooltip: { shared: true },
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// ── وضعیت سفارشات: donut ────────────────────────────────────────────────
|
// ── وضعیت سفارشات: donut ────────────────────────────────────────────────
|
||||||
const statusSeries = computed(() => (data.statusBreakdown ?? []).map((s: StatusBreakdownRow) => s.count));
|
const statusSeries = computed(() => (data.statusBreakdown ?? []).map((s: StatusBreakdownRow) => s.count));
|
||||||
const statusChartOptions = computed(() => ({
|
const statusChartOptions = computed(() => ({
|
||||||
chart: { fontFamily: 'inherit' },
|
chart: { fontFamily: 'inherit', parentHeightOffset: 0 },
|
||||||
labels: (data.statusBreakdown ?? []).map((s: StatusBreakdownRow) => s.label),
|
labels: (data.statusBreakdown ?? []).map((s: StatusBreakdownRow) => s.label),
|
||||||
colors: [COLOR_WARNING, COLOR_PRIMARY, COLOR_PRIMARY, COLOR_WARNING, COLOR_WARNING, COLOR_SUCCESS, COLOR_SUCCESS, COLOR_DANGER],
|
colors: [COLOR_WARNING, COLOR_PRIMARY, COLOR_PRIMARY, COLOR_WARNING, COLOR_WARNING, COLOR_SUCCESS, COLOR_SUCCESS, COLOR_DANGER],
|
||||||
legend: { position: 'bottom' },
|
legend: { position: 'bottom', fontSize: layout.isMobile ? '11px' : '14px' },
|
||||||
dataLabels: { enabled: true },
|
dataLabels: { enabled: true },
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// ── تفکیک عمده/تک: donut ────────────────────────────────────────────────
|
// ── تفکیک عمده/تک: donut ────────────────────────────────────────────────
|
||||||
const channelSeries = computed(() => (data.channelBreakdown ?? []).map((c: ChannelBreakdownRow) => c.count));
|
const channelSeries = computed(() => (data.channelBreakdown ?? []).map((c: ChannelBreakdownRow) => c.count));
|
||||||
const channelChartOptions = computed(() => ({
|
const channelChartOptions = computed(() => ({
|
||||||
chart: { fontFamily: 'inherit' },
|
chart: { fontFamily: 'inherit', parentHeightOffset: 0 },
|
||||||
labels: (data.channelBreakdown ?? []).map((c: ChannelBreakdownRow) => c.label),
|
labels: (data.channelBreakdown ?? []).map((c: ChannelBreakdownRow) => c.label),
|
||||||
colors: [COLOR_PRIMARY, COLOR_SUCCESS],
|
colors: [COLOR_PRIMARY, COLOR_SUCCESS],
|
||||||
legend: { position: 'bottom' },
|
legend: { position: 'bottom', fontSize: layout.isMobile ? '11px' : '14px' },
|
||||||
dataLabels: { enabled: true },
|
dataLabels: { enabled: true },
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -276,23 +325,35 @@ const agentChartSeries = computed(() => [
|
|||||||
{ name: 'گرم فروختهشده', data: (data.reagent ?? []).map((r: any) => Number(r.grams_sell ?? 0)) },
|
{ name: 'گرم فروختهشده', data: (data.reagent ?? []).map((r: any) => Number(r.grams_sell ?? 0)) },
|
||||||
]);
|
]);
|
||||||
const agentChartOptions = computed(() => ({
|
const agentChartOptions = computed(() => ({
|
||||||
chart: { toolbar: { show: false }, fontFamily: 'inherit' },
|
chart: { toolbar: { show: false }, fontFamily: 'inherit', parentHeightOffset: 0 },
|
||||||
plotOptions: { bar: { horizontal: true, borderRadius: 4 } },
|
plotOptions: { bar: { horizontal: true, borderRadius: 4 } },
|
||||||
colors: [COLOR_PRIMARY],
|
colors: [COLOR_PRIMARY],
|
||||||
dataLabels: { enabled: true },
|
dataLabels: { enabled: true },
|
||||||
xaxis: { categories: (data.reagent ?? []).map((r: any) => r.name) },
|
xaxis: {
|
||||||
|
categories: (data.reagent ?? []).map((r: any) => r.name),
|
||||||
|
labels: { style: { fontSize: layout.isMobile ? '10px' : '12px' } },
|
||||||
|
},
|
||||||
|
yaxis: { labels: { maxWidth: layout.isMobile ? 120 : 160, style: { fontSize: layout.isMobile ? '11px' : '12px' } } },
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// ── محصولات پرفروش: bar ─────────────────────────────────────────────────
|
// ── محصولات پرفروش: bar (horizontal on phones, so long titles stay readable)
|
||||||
const productChartSeries = computed(() => [
|
const productChartSeries = computed(() => [
|
||||||
{ name: 'وزن فروختهشده (گرم)', data: (data.topProducts ?? []).map((p: TopProductRow) => Number(p.weight ?? 0)) },
|
{ name: 'وزن فروختهشده (گرم)', data: (data.topProducts ?? []).map((p: TopProductRow) => Number(p.weight ?? 0)) },
|
||||||
]);
|
]);
|
||||||
const productChartOptions = computed(() => ({
|
const productChartOptions = computed(() => ({
|
||||||
chart: { toolbar: { show: false }, fontFamily: 'inherit' },
|
chart: { toolbar: { show: false }, fontFamily: 'inherit', parentHeightOffset: 0 },
|
||||||
plotOptions: { bar: { borderRadius: 4, columnWidth: '55%' } },
|
plotOptions: {
|
||||||
|
bar: layout.isMobile
|
||||||
|
? { horizontal: true, borderRadius: 4, barHeight: '60%' }
|
||||||
|
: { borderRadius: 4, columnWidth: '55%' },
|
||||||
|
},
|
||||||
colors: [COLOR_SUCCESS],
|
colors: [COLOR_SUCCESS],
|
||||||
dataLabels: { enabled: false },
|
dataLabels: { enabled: false },
|
||||||
xaxis: { categories: (data.topProducts ?? []).map((p: TopProductRow) => p.title) },
|
xaxis: {
|
||||||
|
categories: (data.topProducts ?? []).map((p: TopProductRow) => p.title),
|
||||||
|
labels: { style: { fontSize: layout.isMobile ? '10px' : '12px' } },
|
||||||
|
},
|
||||||
|
yaxis: { labels: { maxWidth: layout.isMobile ? 120 : 160, style: { fontSize: layout.isMobile ? '11px' : '12px' } } },
|
||||||
}));
|
}));
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
@@ -316,11 +377,143 @@ onMounted(async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* .grid-2/.grid-3/.grid-4 come from the global utilities.less (dedup) */
|
.dashboard {
|
||||||
.mt-4 {
|
display: flex;
|
||||||
margin-top: 1rem;
|
flex-direction: column;
|
||||||
|
gap: 16px;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
.mt-3 {
|
|
||||||
margin-top: 0.75rem;
|
.kpi-grid {
|
||||||
|
display: grid;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.kpi-grid--4 {
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
|
||||||
|
}
|
||||||
|
.kpi-grid--2,
|
||||||
|
.card-grid {
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||||
|
}
|
||||||
|
.card-grid {
|
||||||
|
display: grid;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.card-grid > *,
|
||||||
|
.kpi-grid > * {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dash-table {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── میزان فروش ── */
|
||||||
|
.sales-summary {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
border: 1px solid #f0f0f0;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.sales-summary__item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
}
|
||||||
|
.sales-summary__item + .sales-summary__item {
|
||||||
|
border-right: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
.sales-summary__label {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
.sales-summary__value {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1c2d56;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── سفارشات هفته جاری (phone list) ── */
|
||||||
|
.order-list :deep(.ant-list-pagination) {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.order-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
.order-item__head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.order-item__name {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #1c2d56;
|
||||||
|
}
|
||||||
|
.order-item__tag {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.order-item__customer {
|
||||||
|
font-size: 13px;
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
.order-item__meta {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-size: 12px;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 991px) {
|
||||||
|
.dashboard,
|
||||||
|
.kpi-grid,
|
||||||
|
.card-grid {
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.kpi-grid--4,
|
||||||
|
.kpi-grid--2 {
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
}
|
||||||
|
.card-grid {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dash-card :deep(.ant-card-head) {
|
||||||
|
min-height: 44px;
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
.dash-card :deep(.ant-card-head-title) {
|
||||||
|
font-size: 14px;
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
.dash-card :deep(.ant-card-body) {
|
||||||
|
padding: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sales-summary {
|
||||||
|
grid-template-columns: minmax(0, 1fr);
|
||||||
|
}
|
||||||
|
.sales-summary__item {
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 10px 12px;
|
||||||
|
}
|
||||||
|
.sales-summary__item + .sales-summary__item {
|
||||||
|
border-right: none;
|
||||||
|
border-top: 1px solid #f0f0f0;
|
||||||
|
}
|
||||||
|
.sales-summary__value {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
<!-- route-based fallback for direct links to /category/add/:id? -->
|
<!-- route-based fallback for direct links to /category/add/:id? -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card :title="`دسته بندی ${typeSuffix}`" class="mb-base">
|
<a-card :title="`دسته بندی ${typeSuffix}`" class="mb-base page-card">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="نوع نمایش"
|
label="نوع نمایش"
|
||||||
:validate-status="err.type ? 'error' : ''"
|
:validate-status="err.type ? 'error' : ''"
|
||||||
@@ -129,7 +129,7 @@
|
|||||||
<a-textarea v-model:value="form.body_html" :auto-size="{ minRows: 3, maxRows: 8 }" />
|
<a-textarea v-model:value="form.body_html" :auto-size="{ minRows: 3, maxRows: 8 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
slot in legacy stays absent.
|
slot in legacy stays absent.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست دسته بندی ها">
|
<a-card title="لیست دسته بندی ها" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #add>
|
<template #add>
|
||||||
<ListPageHeader rid="collection.create" add-label="افزودن دسته" @add="openAdd" />
|
<ListPageHeader rid="collection.create" add-label="افزودن دسته" @add="openAdd" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
-->
|
-->
|
||||||
<div id="page-user-view">
|
<div id="page-user-view">
|
||||||
<div id="user-data">
|
<div id="user-data">
|
||||||
<a-card class="mb-base">
|
<a-card class="mb-base page-card">
|
||||||
<a-tabs v-if="hasPermission('persons.create')">
|
<a-tabs v-if="hasPermission('persons.create')">
|
||||||
<a-tab-pane v-if="hasPermission('persons.create.client')" key="omde" tab="مشتری عمده">
|
<a-tab-pane v-if="hasPermission('persons.create.client')" key="omde" tab="مشتری عمده">
|
||||||
<BulkCustomer />
|
<BulkCustomer />
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
a 19-line wrapper whose entire template is <Customer /> (bulkCustomer).
|
a 19-line wrapper whose entire template is <Customer /> (bulkCustomer).
|
||||||
bulkCustomer reads the :id route param to switch between create and edit.
|
bulkCustomer reads the :id route param to switch between create and edit.
|
||||||
-->
|
-->
|
||||||
<BulkCustomer />
|
<BulkCustomer class="page-card" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Ported from legacy henza_admin/src/views/apps/customer/EditReagent.vue — a
|
Ported from legacy henza_admin/src/views/apps/customer/EditReagent.vue — a
|
||||||
19-line wrapper over <ReagentCustomer />, which reads the :id route param.
|
19-line wrapper over <ReagentCustomer />, which reads the :id route param.
|
||||||
-->
|
-->
|
||||||
<ReagentCustomer />
|
<ReagentCustomer class="page-card" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
— a 16-line wrapper over <Customer /> (singleCustomer), which reads the :id
|
— a 16-line wrapper over <Customer /> (singleCustomer), which reads the :id
|
||||||
route param to switch between create and edit.
|
route param to switch between create and edit.
|
||||||
-->
|
-->
|
||||||
<SingleCustomerForm />
|
<SingleCustomerForm class="page-card" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
@@ -295,4 +295,10 @@ onMounted(async () => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
/* single-column grid on phones: a 2-row span would only leave a gap */
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.avatar-cell {
|
||||||
|
grid-row: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -247,7 +247,7 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary" class="mr-4" @click="handleSubmitOmde">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="mr-4 form-submit" @click="handleSubmitOmde">ثبت اطلاعات</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
column on ProductImage and is dropped, same as the other schema-less fields
|
column on ProductImage and is dropped, same as the other schema-less fields
|
||||||
noted above.
|
noted above.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-view">
|
<div id="page-user-view" class="page-card">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="تصاویر محصول" class="mb-base">
|
<a-card title="تصاویر محصول" class="mb-base">
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- تنوع ها -->
|
<!-- تنوع ها -->
|
||||||
<a-card v-if="hasPermission('product.list.variants')" class="mb-8 overflow-auto">
|
<a-card v-if="hasPermission('product.list.variants')" class="mb-8 overflow-auto table-scroll">
|
||||||
<template #title>
|
<template #title>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<div class="flex-1">تنوع ها</div>
|
<div class="flex-1">تنوع ها</div>
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a-button type="primary" class="mr-4" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="mr-4 form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-form>
|
</a-form>
|
||||||
@@ -583,4 +583,10 @@ onMounted(async () => {
|
|||||||
.overflow-auto {
|
.overflow-auto {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mb-8 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
wage percentage to all of them. Farsi copy preserved.
|
wage percentage to all of them. Farsi copy preserved.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="تغییر درصد محصولات">
|
<a-card title="تغییر درصد محصولات" class="page-card">
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<a-form-item label="دسته بندی">
|
<a-form-item label="دسته بندی">
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
cancel-text="خیر"
|
cancel-text="خیر"
|
||||||
@confirm="applyChange"
|
@confirm="applyChange"
|
||||||
>
|
>
|
||||||
<a-button type="primary" :loading="changeLoading">اعمال تغییرات</a-button>
|
<a-button type="primary" class="form-submit" :loading="changeLoading">اعمال تغییرات</a-button>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|||||||
@@ -5,18 +5,19 @@
|
|||||||
preserved. The commented-out "تنوع ها" action stays absent, as in legacy.
|
preserved. The commented-out "تنوع ها" action stays absent, as in legacy.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست محصولات">
|
<a-card title="لیست محصولات" class="page-card">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<!-- D27 §12: کارساخته و موجودی از حسابداری -->
|
<!-- D27 §12: کارساخته و موجودی از حسابداری -->
|
||||||
<AccountingSyncButton v-if="hasPermission('product.list')" endpoint="admin/products/accounting-sync" @done="tblProducts?.fetch()" />
|
<AccountingSyncButton v-if="hasPermission('product.list')" endpoint="admin/products/accounting-sync" @done="tblProducts?.fetch()" />
|
||||||
</template>
|
</template>
|
||||||
<h6>تعداد {{ selectedRows.length }} محصول انتخاب شده است.</h6>
|
<h6 class="selected-count">تعداد {{ selectedRows.length }} محصول انتخاب شده است.</h6>
|
||||||
|
|
||||||
<XTable
|
<XTable
|
||||||
ref="tblProducts"
|
ref="tblProducts"
|
||||||
v-model="selectedRows"
|
v-model="selectedRows"
|
||||||
:model="model"
|
:model="model"
|
||||||
:has-selection="true"
|
:has-selection="true"
|
||||||
|
mobile-cards
|
||||||
>
|
>
|
||||||
<template #image="{ record }">
|
<template #image="{ record }">
|
||||||
<img
|
<img
|
||||||
@@ -72,9 +73,9 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<!-- اطلاعات جامع -->
|
<!-- اطلاعات جامع -->
|
||||||
<a-modal v-model:open="visibleProduct" title="اطلاعات جامع محصول" width="70%">
|
<a-modal v-model:open="visibleProduct" title="اطلاعات جامع محصول" width="70%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions bordered size="small" :column="2">
|
<a-descriptions bordered size="small" :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
|
||||||
<a-descriptions-item label="نام محصول">{{ tempRow.title }}</a-descriptions-item>
|
<a-descriptions-item label="نام محصول">{{ tempRow.title }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="کد محصول">{{ tempRow.product_code || '-' }}</a-descriptions-item>
|
<a-descriptions-item label="کد محصول">{{ tempRow.product_code || '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="برند">{{ tempRow.brand?.title || '-' }}</a-descriptions-item>
|
<a-descriptions-item label="برند">{{ tempRow.brand?.title || '-' }}</a-descriptions-item>
|
||||||
@@ -182,4 +183,15 @@ function toEdit(id: string) {
|
|||||||
object-fit: cover;
|
object-fit: cover;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
/* the actions sit in the card header on phones; a fixed 12rem would crowd the title */
|
||||||
|
.w-48 {
|
||||||
|
width: auto;
|
||||||
|
}
|
||||||
|
.selected-count {
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
<!-- route-based fallback for direct links to /branch/add and /branch/edit/:id -->
|
<!-- route-based fallback for direct links to /branch/add and /branch/edit/:id -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card :title="id ? 'ویرایش شعبه' : 'افزودن شعبه'" class="mb-base">
|
<a-card :title="id ? 'ویرایش شعبه' : 'افزودن شعبه'" class="mb-base page-card">
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<a-form-item label="نام شعبه" :validate-status="err.name ? 'error' : ''" :help="err.name">
|
<a-form-item label="نام شعبه" :validate-status="err.name ? 'error' : ''" :help="err.name">
|
||||||
<a-input v-model:value="form.name" />
|
<a-input v-model:value="form.name" />
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
<a-textarea v-model:value="form.address" :auto-size="{ minRows: 2, maxRows: 5 }" />
|
<a-textarea v-model:value="form.address" :auto-size="{ minRows: 2, maxRows: 5 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
workshop use different forms), so this component stays generic instead of
|
workshop use different forms), so this component stays generic instead of
|
||||||
growing a v-if per caller.
|
growing a v-if per caller.
|
||||||
-->
|
-->
|
||||||
<a-card :title="title">
|
<a-card :title="title" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template v-if="addRid" #add>
|
<template v-if="addRid" #add>
|
||||||
<ListPageHeader :rid="addRid" :add-label="addLabel" @add="openAdd()" />
|
<ListPageHeader :rid="addRid" :add-label="addLabel" @add="openAdd()" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Ported from legacy henza_admin/src/views/branch/addCustomer.vue — a 19-line
|
Ported from legacy henza_admin/src/views/branch/addCustomer.vue — a 19-line
|
||||||
wrapper whose entire template is <singleCustomer />. Kept as a wrapper.
|
wrapper whose entire template is <singleCustomer />. Kept as a wrapper.
|
||||||
-->
|
-->
|
||||||
<div>
|
<div class="page-card">
|
||||||
<SingleCustomerForm />
|
<SingleCustomerForm />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
only their own without the view having to filter.
|
only their own without the view having to filter.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="فاکتور خرید">
|
<a-card title="فاکتور خرید" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #opt="{ record }">
|
<template #opt="{ record }">
|
||||||
<a-tooltip title="مشاهده">
|
<a-tooltip title="مشاهده">
|
||||||
<EyeOutlined class="cursor-pointer mx-1 text-primary" @click="view(record)" />
|
<EyeOutlined class="cursor-pointer mx-1 text-primary" @click="view(record)" />
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<a-modal v-model:open="visible" title="مشاهده فاکتور" width="70%">
|
<a-modal v-model:open="visible" title="مشاهده فاکتور" width="70%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions bordered size="small" :column="2">
|
<a-descriptions bordered size="small" :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
|
||||||
<a-descriptions-item label="شعبه">{{ tempRow.name }}</a-descriptions-item>
|
<a-descriptions-item label="شعبه">{{ tempRow.name }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="ثبت کننده">
|
<a-descriptions-item label="ثبت کننده">
|
||||||
{{ tempRow.allocator_user?.name ?? '-' }}
|
{{ tempRow.allocator_user?.name ?? '-' }}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
endpoints here, because a dashboard showing placeholder rows is worse than
|
endpoints here, because a dashboard showing placeholder rows is worse than
|
||||||
one showing nothing. Recorded in docs/ADMIN-PORT-PLAN.md.
|
one showing nothing. Recorded in docs/ADMIN-PORT-PLAN.md.
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading" class="page-card table-scroll">
|
||||||
<a-card title="سفارشات هفته جاری">
|
<a-card title="سفارشات هفته جاری">
|
||||||
<a-table
|
<a-table
|
||||||
size="small"
|
size="small"
|
||||||
@@ -89,4 +89,10 @@ onMounted(async () => {
|
|||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
branch mode gates the whole route instead. Preserved.
|
branch mode gates the whole route instead. Preserved.
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="ثبت سفارش">
|
<a-card title="ثبت سفارش" class="page-card">
|
||||||
<span>جهت ثبت سفارش مشتری را انتخاب نمایید</span>
|
<span>جهت ثبت سفارش مشتری را انتخاب نمایید</span>
|
||||||
|
|
||||||
<a-form layout="vertical" class="mt-4" @submit.prevent="submitOrder">
|
<a-form layout="vertical" class="mt-4" @submit.prevent="submitOrder">
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
<div v-if="form.customer_id != null">
|
<div v-if="form.customer_id != null">
|
||||||
<h6>تعداد {{ items.length }} محصول انتخاب شده است.</h6>
|
<h6>تعداد {{ items.length }} محصول انتخاب شده است.</h6>
|
||||||
|
|
||||||
<XTable ref="tblProducts" :model="cols">
|
<XTable ref="tblProducts" :model="cols" mobile-cards>
|
||||||
<template #image="{ record }">
|
<template #image="{ record }">
|
||||||
<img
|
<img
|
||||||
width="90px"
|
width="90px"
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<a-card v-if="items.length > 0" title="سبد سفارش" class="mt-4">
|
<a-card v-if="items.length > 0" title="سبد سفارش" class="mt-4 table-scroll">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="items"
|
:data-source="items"
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
<a-textarea v-model:value="form.note" :auto-size="{ minRows: 2, maxRows: 4 }" />
|
<a-textarea v-model:value="form.note" :auto-size="{ minRows: 2, maxRows: 4 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" :disabled="items.length < 1" @click="submitOrder">
|
<a-button type="primary" class="form-submit" :disabled="items.length < 1" @click="submitOrder">
|
||||||
ثبت سفارش
|
ثبت سفارش
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
@@ -249,4 +249,20 @@ onMounted(async () => {
|
|||||||
.totals {
|
.totals {
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.customer-field {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.totals {
|
||||||
|
margin: 12px 0;
|
||||||
|
}
|
||||||
|
h6 {
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
city has none — so saving silently copied the parent's onto the child.
|
city has none — so saving silently copied the parent's onto the child.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست شهر ها">
|
<a-card title="لیست شهر ها" class="page-card">
|
||||||
<XTable ref="citiesTable" :model="model">
|
<XTable ref="citiesTable" :model="model" mobile-cards>
|
||||||
<template #add>
|
<template #add>
|
||||||
<ListPageHeader rid="cities.create" add-label="افزودن شهر" @add="addOpen = true" />
|
<ListPageHeader rid="cities.create" add-label="افزودن شهر" @add="addOpen = true" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<!-- route-based fallback for direct links to /city/create -->
|
<!-- route-based fallback for direct links to /city/create -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card title="افزودن شهر">
|
<a-card title="افزودن شهر" class="page-card">
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<a-form-item label="نام شهر" :validate-status="err.title ? 'error' : ''" :help="err.title">
|
<a-form-item label="نام شهر" :validate-status="err.title ? 'error' : ''" :help="err.title">
|
||||||
<a-input v-model:value="form.title" />
|
<a-input v-model:value="form.title" />
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
<a-input-number v-model:value="form.percent_aux" class="w-full" :min="0" :max="100" :step="0.1" />
|
<a-input-number v-model:value="form.percent_aux" class="w-full" :min="0" :max="100" :step="0.1" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
longer exists) becomes the bundled logo.
|
longer exists) becomes the bundled logo.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست دیدگاه ها">
|
<a-card title="لیست دیدگاه ها" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #customer="{ text }">
|
<template #customer="{ text }">
|
||||||
{{ text && text.fname && text.lname ? `${text.fname} ${text.lname}` : 'بدون نام' }}
|
{{ text && text.fname && text.lname ? `${text.fname} ${text.lname}` : 'بدون نام' }}
|
||||||
</template>
|
</template>
|
||||||
@@ -92,7 +92,7 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<!-- مشاهده دیدگاه -->
|
<!-- مشاهده دیدگاه -->
|
||||||
<a-modal v-model:open="visibleComment" title="مشاهده دیدگاه" width="80%">
|
<a-modal v-model:open="visibleComment" title="مشاهده دیدگاه" width="80%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow" class="comments-list">
|
<div v-if="tempRow" class="comments-list">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="comment-item">
|
<li class="comment-item">
|
||||||
@@ -270,4 +270,20 @@ async function submitChanges(row: Record<string, any>) {
|
|||||||
border: 1px solid grey;
|
border: 1px solid grey;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.comment-item {
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.comment-item .img {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.comment-body {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
- the retail screen adds a wallet panel (legacy single/wallet/{id})
|
- the retail screen adds a wallet panel (legacy single/wallet/{id})
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card :title="title">
|
<a-card :title="title" class="page-card">
|
||||||
<a-descriptions bordered size="small" :column="3">
|
<a-descriptions bordered size="small" :column="{ xxl: 3, xl: 3, lg: 3, md: 2, sm: 2, xs: 1 }">
|
||||||
<a-descriptions-item label="نام">{{ customer?.name ?? '-' }}</a-descriptions-item>
|
<a-descriptions-item label="نام">{{ customer?.name ?? '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="موبایل">{{ customer?.mobile ?? '-' }}</a-descriptions-item>
|
<a-descriptions-item label="موبایل">{{ customer?.mobile ?? '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="کد ملی">
|
<a-descriptions-item label="کد ملی">
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<!-- D27 — link and balance in the accounting software. -->
|
<!-- D27 — link and balance in the accounting software. -->
|
||||||
<CustomerAccountingCard :customer-id="id" />
|
<CustomerAccountingCard :customer-id="id" />
|
||||||
|
|
||||||
<a-tabs class="mt-4" :default-active-key="defaultTab">
|
<a-tabs class="mt-4 detail-tabs" :default-active-key="defaultTab">
|
||||||
<a-tab-pane key="orders" tab="سفارش ها">
|
<a-tab-pane key="orders" tab="سفارش ها">
|
||||||
<a-table
|
<a-table
|
||||||
size="small"
|
size="small"
|
||||||
@@ -208,9 +208,28 @@ onMounted(async () => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.stats {
|
.stats {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.stats :deep(.ant-tag) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.detail-tabs :deep(.ant-tabs-nav) {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.detail-tabs :deep(.ant-table-content) {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
.detail-tabs :deep(.ant-table-content > table) {
|
||||||
|
min-width: max-content;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -12,16 +12,16 @@
|
|||||||
the implementation lives once, parameterised by props.
|
the implementation lives once, parameterised by props.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card :title="title">
|
<a-card :title="title" class="page-card">
|
||||||
<template v-if="accountingSync" #extra>
|
<template v-if="accountingSync" #extra>
|
||||||
<AccountingSyncButton endpoint="admin/customers-omde/accounting-sync" @done="tbl?.fetch()" />
|
<AccountingSyncButton endpoint="admin/customers-omde/accounting-sync" @done="tbl?.fetch()" />
|
||||||
</template>
|
</template>
|
||||||
<div v-if="query && query.count && query.total">
|
<div v-if="query && query.count && query.total" class="list-count">
|
||||||
{{ query.total }} رکورد یافت شد -
|
{{ query.total }} رکورد یافت شد -
|
||||||
<span class="text-danger">{{ query.count }} رکورد غیر فعال</span>
|
<span class="text-danger">{{ query.count }} رکورد غیر فعال</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<XTable ref="tbl" :model="model" @query="setCount">
|
<XTable ref="tbl" :model="model" mobile-cards @query="setCount">
|
||||||
<template v-if="showAddButton" #add>
|
<template v-if="showAddButton" #add>
|
||||||
<ListPageHeader rid="persons.create.client" add-label="افزودن مشتری عمده" @add="openAdd" />
|
<ListPageHeader rid="persons.create.client" add-label="افزودن مشتری عمده" @add="openAdd" />
|
||||||
</template>
|
</template>
|
||||||
@@ -503,3 +503,12 @@ function viewCash(record: Record<string, any>) {
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.list-count {
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
those customers' orders instead.
|
those customers' orders instead.
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="مشاهده اطلاعات کارشناس فروش">
|
<a-card title="مشاهده اطلاعات کارشناس فروش" class="page-card">
|
||||||
<a-descriptions bordered size="small" :column="3">
|
<a-descriptions bordered size="small" :column="{ xxl: 3, xl: 3, lg: 3, md: 2, sm: 2, xs: 1 }">
|
||||||
<a-descriptions-item label="نام">{{ agent?.name ?? '-' }}</a-descriptions-item>
|
<a-descriptions-item label="نام">{{ agent?.name ?? '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="موبایل">{{ agent?.mobile ?? '-' }}</a-descriptions-item>
|
<a-descriptions-item label="موبایل">{{ agent?.mobile ?? '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="شعبه">{{ agent?.branch?.name ?? '-' }}</a-descriptions-item>
|
<a-descriptions-item label="شعبه">{{ agent?.branch?.name ?? '-' }}</a-descriptions-item>
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-tabs class="mt-4" default-active-key="referred">
|
<a-tabs class="mt-4 detail-tabs" default-active-key="referred">
|
||||||
<a-tab-pane key="referred" tab="مشتریان معرفیشده">
|
<a-tab-pane key="referred" tab="مشتریان معرفیشده">
|
||||||
<a-table
|
<a-table
|
||||||
size="small"
|
size="small"
|
||||||
@@ -118,9 +118,28 @@ onMounted(async () => {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
.stats {
|
.stats {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.stats :deep(.ant-tag) {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.detail-tabs :deep(.ant-tabs-nav) {
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
.detail-tabs :deep(.ant-table-content) {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
.detail-tabs :deep(.ant-table-content > table) {
|
||||||
|
min-width: max-content;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -16,8 +16,8 @@
|
|||||||
endpoints it used to hit (which would 404/target the wrong row entirely).
|
endpoints it used to hit (which would 404/target the wrong row entirely).
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست کارشناسان فروش">
|
<a-card title="لیست کارشناسان فروش" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #add>
|
<template #add>
|
||||||
<ListPageHeader
|
<ListPageHeader
|
||||||
v-if="hasPermission('persons.create.seller')"
|
v-if="hasPermission('persons.create.seller')"
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
including legacy's quirk that the "مشاهده اطلاعات" icon is gated on the
|
including legacy's quirk that the "مشاهده اطلاعات" icon is gated on the
|
||||||
`wallet.charge` rid rather than a view rid.
|
`wallet.charge` rid rather than a view rid.
|
||||||
-->
|
-->
|
||||||
<a-card :title="is_branch ? 'لیست مشتریان' : 'لیست مشتریان تک فروشی'">
|
<a-card :title="is_branch ? 'لیست مشتریان' : 'لیست مشتریان تک فروشی'" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #op="{ record }">
|
<template #op="{ record }">
|
||||||
<a-tooltip title="ویرایش">
|
<a-tooltip title="ویرایش">
|
||||||
<EditOutlined class="cursor-pointer mx-1 text-primary" @click="toEdit(record.id)" />
|
<EditOutlined class="cursor-pointer mx-1 text-primary" @click="toEdit(record.id)" />
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
<!-- route-based fallback for direct links to /add/findoc and /edit/findoc/:id -->
|
<!-- route-based fallback for direct links to /add/findoc and /edit/findoc/:id -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card title="ثبت سند مالی" class="mb-base">
|
<a-card title="ثبت سند مالی" class="mb-base page-card">
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<a-form-item label="نوع سند">
|
<a-form-item label="نوع سند">
|
||||||
<a-select v-model:value="form.type">
|
<a-select v-model:value="form.type">
|
||||||
@@ -213,7 +213,7 @@
|
|||||||
<a-textarea v-model:value="form.note" :auto-size="{ minRows: 3, maxRows: 5 }" />
|
<a-textarea v-model:value="form.note" :auto-size="{ minRows: 3, maxRows: 5 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="لیست اسناد مالی">
|
<a-card title="لیست اسناد مالی" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #add>
|
<template #add>
|
||||||
<ListPageHeader rid="document.create" add-label="ثبت سند مالی" @add="openAdd" />
|
<ListPageHeader rid="document.create" add-label="ثبت سند مالی" @add="openAdd" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
@submit="handleSubmit"
|
@submit="handleSubmit"
|
||||||
>
|
>
|
||||||
<a-card title="لیست محصولات">
|
<a-card title="لیست محصولات">
|
||||||
<XTable ref="tblProducts" :model="productCols">
|
<XTable ref="tblProducts" :model="productCols" mobile-cards>
|
||||||
<template #image="{ record }">
|
<template #image="{ record }">
|
||||||
<img
|
<img
|
||||||
width="90px"
|
width="90px"
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5">
|
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5 table-scroll">
|
||||||
<a-table :columns="columns" :data-source="items" bordered :pagination="false" row-key="pid">
|
<a-table :columns="columns" :data-source="items" bordered :pagination="false" row-key="pid">
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.dataIndex === 'delete'">
|
<template v-if="column.dataIndex === 'delete'">
|
||||||
@@ -87,8 +87,8 @@
|
|||||||
|
|
||||||
<!-- route-based fallback for direct links to /invoice/add and /invoice/edit/:id -->
|
<!-- route-based fallback for direct links to /invoice/add and /invoice/edit/:id -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-card title="لیست محصولات">
|
<a-card title="لیست محصولات" class="page-card">
|
||||||
<XTable ref="tblProducts" :model="productCols">
|
<XTable ref="tblProducts" :model="productCols" mobile-cards>
|
||||||
<template #image="{ record }">
|
<template #image="{ record }">
|
||||||
<img
|
<img
|
||||||
width="90px"
|
width="90px"
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5">
|
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5 table-scroll">
|
||||||
<a-table
|
<a-table
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data-source="items"
|
:data-source="items"
|
||||||
@@ -151,7 +151,7 @@
|
|||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a-button type="primary" :disabled="items.length < 1" @click="handleSubmit">
|
<a-button type="primary" class="form-submit" :disabled="items.length < 1" @click="handleSubmit">
|
||||||
ثبت تغییرات
|
ثبت تغییرات
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
branch-allocation grid.
|
branch-allocation grid.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست فاکتورها">
|
<a-card title="لیست فاکتورها" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #add>
|
<template #add>
|
||||||
<ListPageHeader rid="invoice.create" add-label="افزودن فاکتور" @add="openAdd" />
|
<ListPageHeader rid="invoice.create" add-label="افزودن فاکتور" @add="openAdd" />
|
||||||
</template>
|
</template>
|
||||||
@@ -39,9 +39,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<a-modal v-model:open="visible" title="مشاهده فاکتور" width="70%">
|
<a-modal v-model:open="visible" title="مشاهده فاکتور" width="70%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions bordered size="small" :column="2">
|
<a-descriptions bordered size="small" :column="{ xxl: 2, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
|
||||||
<a-descriptions-item label="شعبه">{{ tempRow.name }}</a-descriptions-item>
|
<a-descriptions-item label="شعبه">{{ tempRow.name }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="ثبت کننده">
|
<a-descriptions-item label="ثبت کننده">
|
||||||
{{ tempRow.allocator_user?.name ?? '-' }}
|
{{ tempRow.allocator_user?.name ?? '-' }}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
one here too — each slide uses the shared ImageUploadInput, which posts to the
|
one here too — each slide uses the shared ImageUploadInput, which posts to the
|
||||||
ported `file/create` endpoint and stores the returned URL.
|
ported `file/create` endpoint and stores the returned URL.
|
||||||
-->
|
-->
|
||||||
<a-card v-if="hasPermission('config.statics')" title="مدیریت ثابت ها">
|
<a-card v-if="hasPermission('config.statics')" title="مدیریت ثابت ها" class="page-card table-scroll">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-tabs>
|
<a-tabs>
|
||||||
<!-- برندها -->
|
<!-- برندها -->
|
||||||
@@ -380,4 +380,21 @@ onMounted(async () => {
|
|||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
/* the add-row input fills what the button leaves instead of a fixed 260px */
|
||||||
|
.row > .ant-input {
|
||||||
|
flex: 1 1 140px;
|
||||||
|
max-width: none !important;
|
||||||
|
}
|
||||||
|
.slide {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
.slide .row > * {
|
||||||
|
flex: 1 1 100%;
|
||||||
|
}
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
the server only ever says whether one is set, never what it is.
|
the server only ever says whether one is set, never what it is.
|
||||||
-->
|
-->
|
||||||
<div>
|
<div>
|
||||||
<a-card v-if="hasPermission('config.accounting')" title="اتصال به نرمافزار حسابداری">
|
<a-card v-if="hasPermission('config.accounting')" title="اتصال به نرمافزار حسابداری" class="page-card table-scroll">
|
||||||
<template #extra>
|
<template #extra>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-tag v-if="overview?.busy" color="processing">همگامسازی در حال اجرا</a-tag>
|
<a-tag v-if="overview?.busy" color="processing">همگامسازی در حال اجرا</a-tag>
|
||||||
@@ -766,4 +766,32 @@ pre {
|
|||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mb-4 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
/* toolbars above the log/links/movement tables: wrap instead of overflowing */
|
||||||
|
:deep(.ant-space) {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
:deep(.ant-tabs-tabpane > .ant-space .ant-select),
|
||||||
|
:deep(.ant-tabs-tabpane > .ant-space .ant-input-search),
|
||||||
|
:deep(.ant-tabs-tabpane > .ant-space .ant-input) {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
:deep(.ant-tabs-tabpane > .ant-space > .ant-space-item) {
|
||||||
|
flex: 1 1 140px;
|
||||||
|
}
|
||||||
|
:deep(.ant-alert) {
|
||||||
|
padding: 10px 12px;
|
||||||
|
}
|
||||||
|
:deep(.ant-alert-with-description .ant-alert-icon) {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-inline-end: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Ported from legacy henza_admin/src/views/manage/report.vue — a shortcut board
|
Ported from legacy henza_admin/src/views/manage/report.vue — a shortcut board
|
||||||
of report links, read from the `dashboard.links` setting.
|
of report links, read from the `dashboard.links` setting.
|
||||||
-->
|
-->
|
||||||
<a-card title="مدیریت گزارشات">
|
<a-card title="مدیریت گزارشات" class="page-card">
|
||||||
<a-empty v-if="links.length === 0" description="هنوز لینکی تعریف نشده است" />
|
<a-empty v-if="links.length === 0" description="هنوز لینکی تعریف نشده است" />
|
||||||
<div v-else class="links">
|
<div v-else class="links">
|
||||||
<a v-for="(l, i) in links" :key="i" :href="l.url" target="_blank" class="link-card">
|
<a v-for="(l, i) in links" :key="i" :href="l.url" target="_blank" class="link-card">
|
||||||
@@ -39,4 +39,16 @@ onMounted(async () => {
|
|||||||
color: #1c2d56;
|
color: #1c2d56;
|
||||||
}
|
}
|
||||||
.link-card:hover { border-color: #1c2d56; }
|
.link-card:hover { border-color: #1c2d56; }
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.links {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.link-card {
|
||||||
|
padding: 12px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
draft side by side → the admin confirms the sample is right → «تأیید و
|
draft side by side → the admin confirms the sample is right → «تأیید و
|
||||||
ثبت». The approved sample is kept with the formula as its reference.
|
ثبت». The approved sample is kept with the formula as its reference.
|
||||||
-->
|
-->
|
||||||
<div v-if="hasPermission('config.wage')" class="wage">
|
<div v-if="hasPermission('config.wage')" class="wage page-card">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<!-- ── status ─────────────────────────────────────────── -->
|
<!-- ── status ─────────────────────────────────────────── -->
|
||||||
<a-card class="mb-4" :bordered="false">
|
<a-card class="mb-4" :bordered="false">
|
||||||
@@ -498,4 +498,18 @@ onMounted(async () => {
|
|||||||
|
|
||||||
.hist { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
|
.hist { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
|
||||||
.hist__meta { font-size: 12px; color: #888; }
|
.hist__meta { font-size: 12px; color: #888; }
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mb-4 { margin-bottom: 12px; }
|
||||||
|
.mt-4 { margin-top: 12px; }
|
||||||
|
.wage :deep(.ant-row) { row-gap: 12px !important; }
|
||||||
|
.status__title { font-size: 14px; }
|
||||||
|
.formula { padding: 10px 12px; font-size: 13px; line-height: 2; }
|
||||||
|
.chip { padding: 0 8px; line-height: 24px; }
|
||||||
|
.num { width: 100%; flex: 1 1 140px; }
|
||||||
|
.limit .num { width: auto; flex: 1 1 140px; }
|
||||||
|
.sample { grid-template-columns: 1fr 1fr; gap: 10px; }
|
||||||
|
.cmp { font-size: 12px; }
|
||||||
|
.cmp th, .cmp td { padding: 6px; }
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
active tab — so the visually-second tab opens first.
|
active tab — so the visually-second tab opens first.
|
||||||
-->
|
-->
|
||||||
<div>
|
<div>
|
||||||
<a-card v-if="hasPermission('config.wallet')" title="مدیریت کیف پول">
|
<a-card v-if="hasPermission('config.wallet')" title="مدیریت کیف پول" class="page-card">
|
||||||
<a-tabs default-active-key="1">
|
<a-tabs default-active-key="1">
|
||||||
<a-tab-pane key="2" tab="تاریخ تولد" force-render>
|
<a-tab-pane key="2" tab="تاریخ تولد" force-render>
|
||||||
<a-spin :spinning="loading" tip="لطفا کمی تامل کنید">
|
<a-spin :spinning="loading" tip="لطفا کمی تامل کنید">
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
<a-input-number v-model:value="form2.birthday_credit" class="w-full" :min="0" />
|
<a-input-number v-model:value="form2.birthday_credit" class="w-full" :min="0" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<a-button type="primary" class="mb-4 mt-4 mr-4" @click="setWallet2">ارسال</a-button>
|
<a-button type="primary" class="mb-4 mt-4 mr-4 form-submit" @click="setWallet2">ارسال</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</div>
|
</div>
|
||||||
<a-button type="primary" class="mb-4 mt-4 mr-4" @click="setWallet1">ارسال</a-button>
|
<a-button type="primary" class="mb-4 mt-4 mr-4 form-submit" @click="setWallet1">ارسال</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
Ported from legacy henza_admin/src/views/newsletters/newsletters.vue.
|
Ported from legacy henza_admin/src/views/newsletters/newsletters.vue.
|
||||||
The delete action is COMMENTED OUT in legacy and stays absent.
|
The delete action is COMMENTED OUT in legacy and stays absent.
|
||||||
-->
|
-->
|
||||||
<a-card title="لیست خبرنامه">
|
<a-card title="لیست خبرنامه" class="page-card">
|
||||||
<XTable ref="newsletter" :model="model">
|
<XTable ref="newsletter" :model="model" mobile-cards>
|
||||||
<template #actions="{ record }">
|
<template #actions="{ record }">
|
||||||
<span class="muted">{{ record.email ?? '-' }}</span>
|
<span class="muted">{{ record.email ?? '-' }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- Ported from legacy henza_admin/src/views/notify/create.vue. -->
|
<!-- Ported from legacy henza_admin/src/views/notify/create.vue. -->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="ارسال نوتیفیکیشن">
|
<a-card title="ارسال نوتیفیکیشن" class="page-card">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<a-form-item label="عنوان" :validate-status="err.title ? 'error' : ''" :help="err.title">
|
<a-form-item label="عنوان" :validate-status="err.title ? 'error' : ''" :help="err.title">
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<a-textarea v-model:value="form.text" :auto-size="{ minRows: 4, maxRows: 8 }" />
|
<a-textarea v-model:value="form.text" :auto-size="{ minRows: 4, maxRows: 8 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ارسال</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ارسال</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
Ported from legacy henza_admin/src/views/notify/user.vue — the received
|
Ported from legacy henza_admin/src/views/notify/user.vue — the received
|
||||||
notifications list, with a read-state modal.
|
notifications list, with a read-state modal.
|
||||||
-->
|
-->
|
||||||
<a-card title="لیست نوتیفیکیشن های دریافتی">
|
<a-card title="لیست نوتیفیکیشن های دریافتی" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #opt="{ record }">
|
<template #opt="{ record }">
|
||||||
<a-tooltip title="مشاهده">
|
<a-tooltip title="مشاهده">
|
||||||
<EyeOutlined class="cursor-pointer mx-1 text-primary" @click="view(record)" />
|
<EyeOutlined class="cursor-pointer mx-1 text-primary" @click="view(record)" />
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<a-modal v-model:open="visible" title="مشاهده نوتیفیکیشن" width="60%">
|
<a-modal v-model:open="visible" title="مشاهده نوتیفیکیشن" width="60%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions bordered size="small" :column="1">
|
<a-descriptions bordered size="small" :column="1">
|
||||||
<a-descriptions-item label="عنوان">{{ tempRow.title }}</a-descriptions-item>
|
<a-descriptions-item label="عنوان">{{ tempRow.title }}</a-descriptions-item>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
The card title in legacy is "تعریف تخفیف" (the same string the promotion form
|
The card title in legacy is "تعریف تخفیف" (the same string the promotion form
|
||||||
uses) even though this screen defines EXCLUSIONS — preserved, not corrected.
|
uses) even though this screen defines EXCLUSIONS — preserved, not corrected.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-view">
|
<div id="page-user-view" class="page-card">
|
||||||
<div id="user-data">
|
<div id="user-data">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
<template v-if="type === 1">
|
<template v-if="type === 1">
|
||||||
<h6>تعداد {{ selectedRow.length }} محصول انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} محصول انتخاب شده است</h6>
|
||||||
<XTable ref="tblProducts" v-model="selectedRow" :model="productCols" :has-selection="true">
|
<XTable ref="tblProducts" v-model="selectedRow" :model="productCols" :has-selection="true" mobile-cards>
|
||||||
<template #image="{ record }">
|
<template #image="{ record }">
|
||||||
<img
|
<img
|
||||||
width="90px"
|
width="90px"
|
||||||
@@ -42,24 +42,24 @@
|
|||||||
|
|
||||||
<template v-if="type === 2">
|
<template v-if="type === 2">
|
||||||
<h6>تعداد {{ selectedRow.length }} دسته بندی انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} دسته بندی انتخاب شده است</h6>
|
||||||
<XTable ref="tblCategory" v-model="selectedRow" :model="categoryCols" :has-selection="true" />
|
<XTable ref="tblCategory" v-model="selectedRow" :model="categoryCols" :has-selection="true" mobile-cards />
|
||||||
<h6>تعداد {{ selectedRow.length }} دسته بندی انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} دسته بندی انتخاب شده است</h6>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="type === 3">
|
<template v-if="type === 3">
|
||||||
<h6>تعداد {{ selectedRow.length }} مشتری انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} مشتری انتخاب شده است</h6>
|
||||||
<XTable ref="tblCustomer" v-model="selectedRow" :model="customerCols" :has-selection="true" />
|
<XTable ref="tblCustomer" v-model="selectedRow" :model="customerCols" :has-selection="true" mobile-cards />
|
||||||
<h6>تعداد {{ selectedRow.length }} مشتری انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} مشتری انتخاب شده است</h6>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="type === 4">
|
<template v-if="type === 4">
|
||||||
<h6>تعداد {{ selectedRow.length }} برند انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} برند انتخاب شده است</h6>
|
||||||
<XTable ref="tblBrand" v-model="selectedRow" :model="brandCols" :has-selection="true" />
|
<XTable ref="tblBrand" v-model="selectedRow" :model="brandCols" :has-selection="true" mobile-cards />
|
||||||
<h6>تعداد {{ selectedRow.length }} برند انتخاب شده است</h6>
|
<h6>تعداد {{ selectedRow.length }} برند انتخاب شده است</h6>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="mt-5">
|
<div class="mt-5">
|
||||||
<a-button type="primary" class="mr-4" @click="handleSubmit">ثبت</a-button>
|
<a-button type="primary" class="mr-4 form-submit" @click="handleSubmit">ثبت</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
@@ -221,4 +221,17 @@ onMounted(getData);
|
|||||||
.mt-5 {
|
.mt-5 {
|
||||||
margin-top: 1.25rem;
|
margin-top: 1.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mb-10 {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
.mt-5 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
h6 {
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
syntax becomes Vue 3 named slots.
|
syntax becomes Vue 3 named slots.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card :title="is_branch ? 'لیست سفارش' : 'لیست سفارش های تک فروشی'">
|
<a-card :title="is_branch ? 'لیست سفارش' : 'لیست سفارش های تک فروشی'" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #opt="{ record }">
|
<template #opt="{ record }">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<TooltipBtn
|
<TooltipBtn
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<!-- وضعیت سفارش -->
|
<!-- وضعیت سفارش -->
|
||||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش">
|
<a-modal v-model:open="visibleSts" title="وضعیت سفارش" wrap-class-name="detail-modal">
|
||||||
<a-timeline v-if="tempRow">
|
<a-timeline v-if="tempRow">
|
||||||
<a-timeline-item
|
<a-timeline-item
|
||||||
v-for="(item, index) in tempRow.activity"
|
v-for="(item, index) in tempRow.activity"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<!-- مشاهده سفارش -->
|
<!-- مشاهده سفارش -->
|
||||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%">
|
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions>
|
<a-descriptions>
|
||||||
<a-descriptions-item label="مشتری">
|
<a-descriptions-item label="مشتری">
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
delete action and the report link are COMMENTED OUT in legacy and stay absent.
|
delete action and the report link are COMMENTED OUT in legacy and stay absent.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="سفارش های ساختنی">
|
<a-card title="سفارش های ساختنی" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #name="{ record }">
|
<template #name="{ record }">
|
||||||
{{ record.customer?.name }}
|
{{ record.customer?.name }}
|
||||||
</template>
|
</template>
|
||||||
@@ -41,6 +41,7 @@
|
|||||||
v-model:open="visibleList"
|
v-model:open="visibleList"
|
||||||
title="مشاهده سفارش"
|
title="مشاهده سفارش"
|
||||||
width="80%"
|
width="80%"
|
||||||
|
wrap-class-name="detail-modal"
|
||||||
@cancel="onCloseDetail"
|
@cancel="onCloseDetail"
|
||||||
>
|
>
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
@@ -69,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<div class="flex gap-8">
|
<div class="flex gap-8 make-detail">
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img
|
||||||
v-if="tempRow.designImageUrl"
|
v-if="tempRow.designImageUrl"
|
||||||
@@ -220,4 +221,14 @@ function onCloseDetail() {
|
|||||||
.mr-3 {
|
.mr-3 {
|
||||||
margin-left: 0.75rem;
|
margin-left: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.make-detail {
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.make-detail > .flex {
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
report endpoint directly) but now points at the new API.
|
report endpoint directly) but now points at the new API.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست سفارش های عمده">
|
<a-card title="لیست سفارش های عمده" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #city="{ text }">
|
<template #city="{ text }">
|
||||||
<div v-if="text">{{ getCity(text) }}</div>
|
<div v-if="text">{{ getCity(text) }}</div>
|
||||||
<div v-else>-</div>
|
<div v-else>-</div>
|
||||||
@@ -55,7 +55,7 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<!-- وضعیت سفارش -->
|
<!-- وضعیت سفارش -->
|
||||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش">
|
<a-modal v-model:open="visibleSts" title="وضعیت سفارش" wrap-class-name="detail-modal">
|
||||||
<a-timeline v-if="tempRow">
|
<a-timeline v-if="tempRow">
|
||||||
<a-timeline-item
|
<a-timeline-item
|
||||||
v-for="(item, index) in tempRow.activity"
|
v-for="(item, index) in tempRow.activity"
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<!-- مشاهده سفارش -->
|
<!-- مشاهده سفارش -->
|
||||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%">
|
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions>
|
<a-descriptions>
|
||||||
<a-descriptions-item label="مشتری">
|
<a-descriptions-item label="مشتری">
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
the legacy markup but is COMMENTED OUT — preserved as absent, not re-added.
|
the legacy markup but is COMMENTED OUT — preserved as absent, not re-added.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست سفارش های عمده">
|
<a-card title="لیست سفارش های عمده" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #opt="{ record }">
|
<template #opt="{ record }">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<TooltipBtn
|
<TooltipBtn
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<!-- وضعیت سفارش -->
|
<!-- وضعیت سفارش -->
|
||||||
<a-modal v-model:open="visibleSts" title="وضعیت سفارش">
|
<a-modal v-model:open="visibleSts" title="وضعیت سفارش" wrap-class-name="detail-modal">
|
||||||
<a-timeline v-if="tempRow">
|
<a-timeline v-if="tempRow">
|
||||||
<a-timeline-item
|
<a-timeline-item
|
||||||
v-for="(item, index) in tempRow.activity"
|
v-for="(item, index) in tempRow.activity"
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
</a-modal>
|
</a-modal>
|
||||||
|
|
||||||
<!-- مشاهده سفارش -->
|
<!-- مشاهده سفارش -->
|
||||||
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%">
|
<a-modal v-model:open="visibleList" title="مشاهده سفارش" width="80%" wrap-class-name="detail-modal">
|
||||||
<div v-if="tempRow">
|
<div v-if="tempRow">
|
||||||
<a-descriptions>
|
<a-descriptions>
|
||||||
<a-descriptions-item label="مشتری">
|
<a-descriptions-item label="مشتری">
|
||||||
|
|||||||
@@ -13,8 +13,8 @@
|
|||||||
inventing a Rial figure — see docs/ADMIN-PORT-PLAN.md.
|
inventing a Rial figure — see docs/ADMIN-PORT-PLAN.md.
|
||||||
-->
|
-->
|
||||||
<a-spin v-if="hasPermission('order.create')" :spinning="loading">
|
<a-spin v-if="hasPermission('order.create')" :spinning="loading">
|
||||||
<a-card title="لیست محصولات">
|
<a-card title="لیست محصولات" class="page-card">
|
||||||
<XTable ref="tblProducts" :model="cols">
|
<XTable ref="tblProducts" :model="cols" mobile-cards>
|
||||||
<template #image="{ record }">
|
<template #image="{ record }">
|
||||||
<img
|
<img
|
||||||
width="90px"
|
width="90px"
|
||||||
@@ -42,7 +42,15 @@
|
|||||||
</XTable>
|
</XTable>
|
||||||
|
|
||||||
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5">
|
<a-card v-if="items.length > 0" title="ثبت سفارش" class="mt-5">
|
||||||
<a-table :columns="columns" :data-source="items" bordered :pagination="false" row-key="vid">
|
<a-table
|
||||||
|
:columns="columns"
|
||||||
|
:data-source="items"
|
||||||
|
bordered
|
||||||
|
:pagination="false"
|
||||||
|
row-key="vid"
|
||||||
|
:size="layout.isMobile ? 'small' : 'middle'"
|
||||||
|
:scroll="layout.isSmallScreen ? { x: 'max-content' } : undefined"
|
||||||
|
>
|
||||||
<template #bodyCell="{ column, record, index }">
|
<template #bodyCell="{ column, record, index }">
|
||||||
<template v-if="column.dataIndex === 'delete'">
|
<template v-if="column.dataIndex === 'delete'">
|
||||||
<CloseOutlined class="cursor-pointer" @click="cart.remove(record)" />
|
<CloseOutlined class="cursor-pointer" @click="cart.remove(record)" />
|
||||||
@@ -170,7 +178,7 @@
|
|||||||
|
|
||||||
<a-button
|
<a-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="mt-4"
|
class="mt-4 form-submit"
|
||||||
:disabled="!items || items.length < 1"
|
:disabled="!items || items.length < 1"
|
||||||
@click="submitOrder"
|
@click="submitOrder"
|
||||||
>
|
>
|
||||||
@@ -197,9 +205,11 @@ import { buildProductListModel } from '../apps/product/productListModel';
|
|||||||
import { useCartStore, type CartItem, type CartVariant } from '../../stores/cart';
|
import { useCartStore, type CartItem, type CartVariant } from '../../stores/cart';
|
||||||
import { useUsersStore } from '../../stores/users';
|
import { useUsersStore } from '../../stores/users';
|
||||||
import { useAuthStore } from '../../stores/auth';
|
import { useAuthStore } from '../../stores/auth';
|
||||||
|
import { useLayoutStore } from '../../stores/layout';
|
||||||
import api from '../../api/client';
|
import api from '../../api/client';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const layout = useLayoutStore();
|
||||||
const users = useUsersStore();
|
const users = useUsersStore();
|
||||||
const auth = useAuthStore();
|
const auth = useAuthStore();
|
||||||
const cart = useCartStore();
|
const cart = useCartStore();
|
||||||
@@ -421,4 +431,24 @@ onMounted(async () => {
|
|||||||
.totals {
|
.totals {
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.grid-5 {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
column-gap: 12px;
|
||||||
|
row-gap: 0;
|
||||||
|
}
|
||||||
|
.grid-5 > :first-child {
|
||||||
|
grid-column: 1 / -1;
|
||||||
|
}
|
||||||
|
.mt-5 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
.totals {
|
||||||
|
margin: 0 0 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
<!-- route-based fallback for direct links to /major/promotion/(tak/)add and .../edit/:id -->
|
<!-- route-based fallback for direct links to /major/promotion/(tak/)add and .../edit/:id -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card :title="title" class="mb-base">
|
<a-card :title="title" class="mb-base page-card">
|
||||||
<div class="grid-4 grid-4--tight">
|
<div class="grid-4 grid-4--tight">
|
||||||
<a-form-item label="نوع تخفیف">
|
<a-form-item label="نوع تخفیف">
|
||||||
<!-- legacy disables the type selector while editing -->
|
<!-- legacy disables the type selector while editing -->
|
||||||
@@ -242,7 +242,7 @@
|
|||||||
<a-textarea v-model:value="form.description" :auto-size="{ minRows: 3, maxRows: 6 }" />
|
<a-textarea v-model:value="form.description" :auto-size="{ minRows: 3, maxRows: 6 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Ported from legacy henza_admin/src/views/promotion/autopromotion.vue —
|
Ported from legacy henza_admin/src/views/promotion/autopromotion.vue —
|
||||||
the one-shot welcome discount for new customers. State toggle + percentage.
|
the one-shot welcome discount for new customers. State toggle + percentage.
|
||||||
-->
|
-->
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" class="page-card" @submit.prevent="handleSubmit">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="تخفیف اتوماتیک یکبار مصرف ویژه مشتریان جدید" class="mb-base">
|
<a-card title="تخفیف اتوماتیک یکبار مصرف ویژه مشتریان جدید" class="mb-base">
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|
||||||
<a-button type="primary" class="mr-4" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="mr-4 form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
commented-out `sts` and `confirmed` slots which stay absent.
|
commented-out `sts` and `confirmed` slots which stay absent.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست تخفیف ها">
|
<a-card title="لیست تخفیف ها" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #add>
|
<template #add>
|
||||||
<div class="list-page-header-row">
|
<div class="list-page-header-row">
|
||||||
<ListPageHeader rid="offers.create" add-label="افزودن تخفیف عمده" @add="openAdd('omde')" />
|
<ListPageHeader rid="offers.create" add-label="افزودن تخفیف عمده" @add="openAdd('omde')" />
|
||||||
@@ -140,5 +140,12 @@ async function deletePromotion(record: Record<string, any>) {
|
|||||||
display: flex;
|
display: flex;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.list-page-header-row {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,9 @@
|
|||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="گزارش تجمیعی سفارشات و اسناد مالی">
|
<a-card title="گزارش تجمیعی سفارشات و اسناد مالی" class="page-card table-scroll">
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<div class="grid-4">
|
<div class="grid-4 filter-grid">
|
||||||
<DateInput v-model="filters.start_date" label="از تاریخ" />
|
<DateInput v-model="filters.start_date" label="از تاریخ" />
|
||||||
<DateInput v-model="filters.end_date" label="تا تاریخ" />
|
<DateInput v-model="filters.end_date" label="تا تاریخ" />
|
||||||
<a-form-item label=" ">
|
<a-form-item label=" ">
|
||||||
@@ -122,4 +122,15 @@ onMounted(load);
|
|||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.summary {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
row-gap: 6px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="گزارش محصولات">
|
<a-card title="گزارش محصولات" class="page-card table-scroll">
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<div class="grid-4">
|
<div class="grid-4 filter-grid">
|
||||||
<DateInput v-model="filters.start_date" label="از تاریخ" />
|
<DateInput v-model="filters.start_date" label="از تاریخ" />
|
||||||
<DateInput v-model="filters.end_date" label="تا تاریخ" />
|
<DateInput v-model="filters.end_date" label="تا تاریخ" />
|
||||||
<a-form-item label=" ">
|
<a-form-item label=" ">
|
||||||
@@ -80,4 +80,15 @@ onMounted(load);
|
|||||||
.mt-4 {
|
.mt-4 {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.summary {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
row-gap: 6px;
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
.mt-4 {
|
||||||
|
margin-top: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
NOTE the "تک فروشی" audience has a rid (sms.create.tak) but NO option in the
|
NOTE the "تک فروشی" audience has a rid (sms.create.tak) but NO option in the
|
||||||
legacy markup, so it is unreachable. Preserved as absent.
|
legacy markup, so it is unreachable. Preserved as absent.
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading" class="page-card">
|
||||||
<a-card title="ارسال پیامک">
|
<a-card title="ارسال پیامک">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
@@ -51,12 +51,12 @@
|
|||||||
<a-textarea v-model:value="text" :auto-size="{ minRows: 4, maxRows: 8 }" />
|
<a-textarea v-model:value="text" :auto-size="{ minRows: 4, maxRows: 8 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ارسال</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ارسال</a-button>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<a-card v-if="hasPermission('sms.list')" title="لیست پیامک ها" class="mt-4">
|
<a-card v-if="hasPermission('sms.list')" title="لیست پیامک ها" class="mt-4">
|
||||||
<XTable ref="tbl" :model="model" />
|
<XTable ref="tbl" :model="model" mobile-cards />
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
@@ -111,4 +111,8 @@ async function handleSubmit() {
|
|||||||
<style scoped>
|
<style scoped>
|
||||||
/* .grid-2 now comes from the global utilities.less (dedup) */
|
/* .grid-2 now comes from the global utilities.less (dedup) */
|
||||||
.mt-4 { margin-top: 1rem; }
|
.mt-4 { margin-top: 1rem; }
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
.mt-4 { margin-top: 12px; }
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
activity log ("آمار"). Pick a customer, see their recent actions.
|
activity log ("آمار"). Pick a customer, see their recent actions.
|
||||||
-->
|
-->
|
||||||
<a-spin :spinning="loading">
|
<a-spin :spinning="loading">
|
||||||
<a-card title="آمار">
|
<a-card title="آمار" class="page-card table-scroll">
|
||||||
<a-form layout="vertical">
|
<a-form layout="vertical">
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<a-form-item label="مشتری">
|
<a-form-item label="مشتری">
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
user-type list, as legacy did.
|
user-type list, as legacy did.
|
||||||
-->
|
-->
|
||||||
<div id="page-user-list">
|
<div id="page-user-list">
|
||||||
<a-card title="لیست مدیران">
|
<a-card title="لیست مدیران" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<!-- legacy ListUser.vue:4 — the add-user button, gated on the same rid. -->
|
<!-- legacy ListUser.vue:4 — the add-user button, gated on the same rid. -->
|
||||||
<template #add>
|
<template #add>
|
||||||
<ListPageHeader rid="user.list.create" add-label="افزودن کاربر" @add="openAdd" />
|
<ListPageHeader rid="user.list.create" add-label="افزودن کاربر" @add="openAdd" />
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
is drawn with a rotated border that lands wrong under [dir=rtl].
|
is drawn with a rotated border that lands wrong under [dir=rtl].
|
||||||
-->
|
-->
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card id="rid" title="دسترسی ها">
|
<a-card id="rid" title="دسترسی ها" class="page-card">
|
||||||
<div class="grid-2">
|
<div class="grid-2">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="سطح کاربر"
|
label="سطح کاربر"
|
||||||
@@ -52,6 +52,7 @@
|
|||||||
<a-button
|
<a-button
|
||||||
v-if="!newUT && hasPermission('user.permission.edit')"
|
v-if="!newUT && hasPermission('user.permission.edit')"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
class="form-submit"
|
||||||
html-type="submit"
|
html-type="submit"
|
||||||
>
|
>
|
||||||
ثبت تغییرات
|
ثبت تغییرات
|
||||||
@@ -60,6 +61,7 @@
|
|||||||
<a-button
|
<a-button
|
||||||
v-if="newUT && hasPermission('user.permission.create')"
|
v-if="newUT && hasPermission('user.permission.create')"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
class="form-submit"
|
||||||
html-type="submit"
|
html-type="submit"
|
||||||
>
|
>
|
||||||
افزودن
|
افزودن
|
||||||
@@ -211,4 +213,14 @@ onMounted(async () => {
|
|||||||
.tree-item {
|
.tree-item {
|
||||||
grid-column: 1 / -1;
|
grid-column: 1 / -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 575px) {
|
||||||
|
/* the permission tree nests deep; a smaller indent keeps titles readable */
|
||||||
|
.tree-item :deep(.ant-tree-indent-unit) {
|
||||||
|
width: 14px;
|
||||||
|
}
|
||||||
|
.tree-item :deep(.ant-tree-node-content-wrapper) {
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
<!-- route-based fallback for direct links to /user/create and /user/edit/:id -->
|
<!-- route-based fallback for direct links to /user/create and /user/edit/:id -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card :title="id ? 'ویرایش مدیر' : 'افزودن مدیر'" class="mb-base">
|
<a-card :title="id ? 'ویرایش مدیر' : 'افزودن مدیر'" class="mb-base page-card">
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<a-form-item label="نام" :validate-status="err.fname ? 'error' : ''" :help="err.fname">
|
<a-form-item label="نام" :validate-status="err.fname ? 'error' : ''" :help="err.fname">
|
||||||
<a-input v-model:value="form.fname" />
|
<a-input v-model:value="form.fname" />
|
||||||
@@ -139,7 +139,7 @@
|
|||||||
|
|
||||||
<p v-if="id" class="hint">برای تغییر ندادن رمز عبور، هر دو فیلد رمز را خالی بگذارید.</p>
|
<p v-if="id" class="hint">برای تغییر ندادن رمز عبور، هر دو فیلد رمز را خالی بگذارید.</p>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
real title is shown when present, with the same fallback — the fallback is
|
real title is shown when present, with the same fallback — the fallback is
|
||||||
what legacy actually displayed.
|
what legacy actually displayed.
|
||||||
-->
|
-->
|
||||||
<a-card title="اطلاعات کاربری">
|
<a-card title="اطلاعات کاربری" class="page-card">
|
||||||
<a-descriptions>
|
<a-descriptions :column="{ xxl: 3, xl: 3, lg: 3, md: 2, sm: 2, xs: 1 }">
|
||||||
<a-descriptions-item label="نام">{{ user?.fname || '-' }}</a-descriptions-item>
|
<a-descriptions-item label="نام">{{ user?.fname || '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="نام خانوادگی">{{ user?.lname || '-' }}</a-descriptions-item>
|
<a-descriptions-item label="نام خانوادگی">{{ user?.lname || '-' }}</a-descriptions-item>
|
||||||
<a-descriptions-item label="شماره تلفن">{{ user?.mobile || '-' }}</a-descriptions-item>
|
<a-descriptions-item label="شماره تلفن">{{ user?.mobile || '-' }}</a-descriptions-item>
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
mismatch, preserved.
|
mismatch, preserved.
|
||||||
-->
|
-->
|
||||||
<div>
|
<div>
|
||||||
<a-card v-if="hasPermission('wallet.percent')" title="لیست کیف پول های شارژ شده">
|
<a-card v-if="hasPermission('wallet.percent')" title="لیست کیف پول های شارژ شده" class="page-card">
|
||||||
<XTable ref="tbl" :model="model">
|
<XTable ref="tbl" :model="model" mobile-cards>
|
||||||
<template #time="{ text }">
|
<template #time="{ text }">
|
||||||
{{ text ? jdateTime(text) : '' }}
|
{{ text ? jdateTime(text) : '' }}
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
<!-- route-based fallback for direct links to /workshop/add and /workshop/edit/:id -->
|
<!-- route-based fallback for direct links to /workshop/add and /workshop/edit/:id -->
|
||||||
<a-spin v-else :spinning="loading">
|
<a-spin v-else :spinning="loading">
|
||||||
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
<a-form layout="vertical" @submit.prevent="handleSubmit">
|
||||||
<a-card :title="id ? 'ویرایش کارگاه' : 'افزودن کارگاه'" class="mb-base">
|
<a-card :title="id ? 'ویرایش کارگاه' : 'افزودن کارگاه'" class="mb-base page-card">
|
||||||
<div class="grid-3">
|
<div class="grid-3">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="نام کارگاه"
|
label="نام کارگاه"
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
<a-textarea v-model:value="form.workshop_address" :auto-size="{ minRows: 2, maxRows: 5 }" />
|
<a-textarea v-model:value="form.workshop_address" :auto-size="{ minRows: 2, maxRows: 5 }" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-button type="primary" @click="handleSubmit">ثبت اطلاعات</a-button>
|
<a-button type="primary" class="form-submit" @click="handleSubmit">ثبت اطلاعات</a-button>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
|
|||||||
Reference in New Issue
Block a user