feat: add refresh functionality to various components
- Implemented refresh event emission in multiple list components across partner and superAdmin modules. - Updated consumers and customers list components to handle refresh actions. - Enhanced dashboard component to fetch partner info on initialization. - Introduced new API method in PartnerService to retrieve current partner data. - Modified PartnerStore to utilize the new API method for fetching partner information. - Updated UI elements to reflect changes in partner and license management, including new fields for license renewals. - Added a new POS display component for better presentation of POS terminal information. - Updated layout service and top bar to reflect new titles and improve user experience. - Refactored existing components to ensure consistency and maintainability.
This commit is contained in:
@@ -1,21 +1,21 @@
|
|||||||
{
|
{
|
||||||
"name": "مدیریت کسبوکار",
|
"background_color": "#ffffff",
|
||||||
"short_name": "مدیریت کسبوکار",
|
"display": "standalone",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "/web-app-manifest-192x192.png",
|
"purpose": "maskable",
|
||||||
"sizes": "192x192",
|
"sizes": "192x192",
|
||||||
"type": "image/png",
|
"src": "/web-app-manifest-192x192.png",
|
||||||
"purpose": "maskable"
|
"type": "image/png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "/web-app-manifest-512x512.png",
|
"purpose": "maskable",
|
||||||
"sizes": "512x512",
|
"sizes": "512x512",
|
||||||
"type": "image/png",
|
"src": "/web-app-manifest-512x512.png",
|
||||||
"purpose": "maskable"
|
"type": "image/png"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"theme_color": "#ffffff",
|
"name": "مدیریت صورتحسابهای مالیاتی",
|
||||||
"background_color": "#ffffff",
|
"short_name": "مدیریت صورتحسابهای مالیاتی",
|
||||||
"display": "standalone"
|
"theme_color": "#ffffff"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './pos-display';
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
# POS Display Component
|
||||||
|
|
||||||
|
A reusable component for displaying Point-of-Sale (POS) terminal information with configurable variants.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
The `PosDisplayComponent` displays POS entity information in a card-based layout with support for different visibility variants ('consumer', 'partner', 'full').
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- **Variant Support**: Choose from 'consumer', 'partner', or 'full' display modes
|
||||||
|
- **Conditional Field Visibility**: Fields are dynamically shown/hidden based on variant
|
||||||
|
- **Edit Mode**: Toggle between view and edit modes
|
||||||
|
- **Responsive Grid**: Displays up to 3 columns with gap-4 spacing
|
||||||
|
- **More Actions**: Optional button for additional actions
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### Basic Usage
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { PosDisplayComponent, IPosEntity } from '@/app/components';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-my-component',
|
||||||
|
template: `
|
||||||
|
<app-pos-display
|
||||||
|
variant="consumer"
|
||||||
|
[pos]="posData"
|
||||||
|
[editMode]="isEditing"
|
||||||
|
(onMoreAction)="handleMoreAction()"
|
||||||
|
(editModeChange)="editModeChange($event)"
|
||||||
|
/>
|
||||||
|
`,
|
||||||
|
standalone: true,
|
||||||
|
imports: [PosDisplayComponent],
|
||||||
|
})
|
||||||
|
export class MyComponent {
|
||||||
|
posData = signal<IPosEntity>({
|
||||||
|
id: '123',
|
||||||
|
name: 'Terminal 1',
|
||||||
|
pos_type: 'PSP',
|
||||||
|
serial_number: 'SN123',
|
||||||
|
model: 'Model X',
|
||||||
|
status: 'active',
|
||||||
|
complex: { id: 'c1', name: 'Complex 1' },
|
||||||
|
device: { id: 'd1', name: 'Device A' },
|
||||||
|
provider: { id: 'p1', name: 'Provider A' },
|
||||||
|
});
|
||||||
|
|
||||||
|
isEditing = signal(false);
|
||||||
|
|
||||||
|
handleMoreAction(): void {
|
||||||
|
console.log('More action clicked');
|
||||||
|
}
|
||||||
|
|
||||||
|
editModeChange(editing: boolean): void {
|
||||||
|
this.isEditing.set(editing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Variants
|
||||||
|
|
||||||
|
### Consumer Variant
|
||||||
|
Displays: name, pos_type, serial_number, device, model, provider (6 fields)
|
||||||
|
|
||||||
|
### Partner Variant
|
||||||
|
Displays: name, pos_type, serial_number (3 fields)
|
||||||
|
|
||||||
|
### Full Variant
|
||||||
|
Displays: name, pos_type, serial_number, device, model, provider (6 fields - same as consumer)
|
||||||
|
|
||||||
|
## Inputs
|
||||||
|
|
||||||
|
| Input | Type | Default | Description |
|
||||||
|
|-------|------|---------|-------------|
|
||||||
|
| `variant` | 'consumer' \| 'partner' \| 'full' | 'full' | Display variant mode |
|
||||||
|
| `pos` | Signal<IPosEntity \| undefined> | undefined | POS entity data |
|
||||||
|
| `editMode` | Signal<boolean> | false | Edit mode state |
|
||||||
|
| `cardTitle` | string | 'اطلاعات پایانهی فروش' | Card header title |
|
||||||
|
| `showMoreActions` | boolean | true | Show more actions button |
|
||||||
|
|
||||||
|
## Outputs
|
||||||
|
|
||||||
|
| Output | Payload | Description |
|
||||||
|
|--------|---------|-------------|
|
||||||
|
| `editModeChange` | boolean | Emitted when edit mode toggled |
|
||||||
|
| `onMoreAction` | void | Emitted when more actions button clicked |
|
||||||
|
| `onSubmit` | void | Emitted on form submission |
|
||||||
|
|
||||||
|
## Model (IPosEntity)
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
interface IPosEntity {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
serial_number: string;
|
||||||
|
model?: string;
|
||||||
|
status: string;
|
||||||
|
pos_type: string;
|
||||||
|
complex: ISummary;
|
||||||
|
device?: ISummary;
|
||||||
|
provider?: ISummary;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Integration in Existing Component
|
||||||
|
|
||||||
|
To replace the inline display in your POS single view:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Before: Manual field rendering
|
||||||
|
<app-key-value label="عنوان" [value]="pos()?.name" />
|
||||||
|
<app-key-value label="نوع پایانه" [value]="pos()?.pos_type" />
|
||||||
|
// ... more fields
|
||||||
|
|
||||||
|
// After: Use the component
|
||||||
|
<app-pos-display
|
||||||
|
variant="full"
|
||||||
|
[pos]="pos"
|
||||||
|
[editMode]="editMode"
|
||||||
|
(onMoreAction)="toPosLanding()"
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
- `pos-display.component.ts` - Component logic
|
||||||
|
- `pos-display.component.html` - Template
|
||||||
|
- `pos-display.component.scss` - Styles
|
||||||
|
- `models/posEntity.model.ts` - TypeScript interfaces and types
|
||||||
|
- `index.ts` - Barrel export
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './models/posEntity.model';
|
||||||
|
export * from './pos-display.component';
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import ISummary from '@/core/models/summary';
|
||||||
|
|
||||||
|
export type PosVariant = 'consumer' | 'partner' | 'full';
|
||||||
|
|
||||||
|
export interface IPosEntity {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
serial_number: string;
|
||||||
|
model?: string;
|
||||||
|
status: string;
|
||||||
|
pos_type: string;
|
||||||
|
complex: ISummary;
|
||||||
|
device?: ISummary;
|
||||||
|
provider?: ISummary;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IPosDisplayConfig {
|
||||||
|
variant: PosVariant;
|
||||||
|
editable?: boolean;
|
||||||
|
showMoreActions?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const POS_VARIANT_FIELDS: Record<PosVariant, Array<keyof IPosEntity>> = {
|
||||||
|
consumer: ['name', 'pos_type', 'serial_number', 'device', 'model', 'provider'],
|
||||||
|
partner: ['name', 'pos_type', 'serial_number'],
|
||||||
|
full: ['name', 'pos_type', 'serial_number', 'device', 'model', 'provider'],
|
||||||
|
};
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<app-card-data [cardTitle]="cardTitle" [editable]="true" [editMode]="isEditing()" (editModeChange)="toggleEditMode()">
|
||||||
|
<ng-template #moreActions>
|
||||||
|
@if (showMoreActions) {
|
||||||
|
<p-button type="button" variant="outlined" (onClick)="handleMoreAction()"> ورود به پایانه </p-button>
|
||||||
|
}
|
||||||
|
</ng-template>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-4">
|
||||||
|
<div class="grid grid-cols-3 gap-4 items-center">
|
||||||
|
@for (field of visibleFields(); track field) {
|
||||||
|
@if (isFieldVisible(field)) {
|
||||||
|
<app-key-value [label]="fieldLabels[field]" [value]="getFieldValue(field)" />
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</app-card-data>
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { Component, effect, EventEmitter, Input, Output, signal } from '@angular/core';
|
||||||
|
import { Button } from 'primeng/button';
|
||||||
|
import { IPosEntity, POS_VARIANT_FIELDS, PosVariant } from './models/posEntity.model';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-pos-entity-display',
|
||||||
|
standalone: true,
|
||||||
|
imports: [CommonModule, AppCardComponent, Button, KeyValueComponent],
|
||||||
|
templateUrl: './pos-display.component.html',
|
||||||
|
})
|
||||||
|
export class PosDisplayComponent {
|
||||||
|
@Input() variant: PosVariant = 'full';
|
||||||
|
@Input() pos = signal<IPosEntity | undefined>(undefined);
|
||||||
|
@Input() editMode = signal<boolean>(false);
|
||||||
|
@Input() cardTitle = 'اطلاعات پایانهی فروش';
|
||||||
|
@Input() showMoreActions = true;
|
||||||
|
|
||||||
|
@Output() editModeChange = new EventEmitter<boolean>();
|
||||||
|
@Output() onMoreAction = new EventEmitter<void>();
|
||||||
|
@Output() onSubmit = new EventEmitter<void>();
|
||||||
|
|
||||||
|
visibleFields = signal<Array<keyof IPosEntity>>([]);
|
||||||
|
isEditing = signal<boolean>(false);
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
effect(() => {
|
||||||
|
this.visibleFields.set(POS_VARIANT_FIELDS[this.variant] || POS_VARIANT_FIELDS.full);
|
||||||
|
});
|
||||||
|
|
||||||
|
effect(() => {
|
||||||
|
this.isEditing.set(this.editMode());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
get fieldLabels(): Record<string, string> {
|
||||||
|
return {
|
||||||
|
name: 'عنوان',
|
||||||
|
pos_type: 'نوع پایانه',
|
||||||
|
serial_number: 'شماره سریال',
|
||||||
|
device: 'نوع دستگاه',
|
||||||
|
model: 'مدل دستگاه',
|
||||||
|
provider: 'ارایهدهنده',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
isFieldVisible(field: keyof IPosEntity): boolean {
|
||||||
|
return this.visibleFields().includes(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
getFieldValue(field: keyof IPosEntity): any {
|
||||||
|
const posData = this.pos();
|
||||||
|
if (!posData) return null;
|
||||||
|
|
||||||
|
if (field === 'device' && posData.device) {
|
||||||
|
return posData.device.name;
|
||||||
|
}
|
||||||
|
if (field === 'provider' && posData.provider) {
|
||||||
|
return posData.provider.name;
|
||||||
|
}
|
||||||
|
return posData[field];
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleEditMode(): void {
|
||||||
|
const newMode = !this.isEditing();
|
||||||
|
this.isEditing.set(newMode);
|
||||||
|
this.editModeChange.emit(newMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleMoreAction(): void {
|
||||||
|
this.onMoreAction.emit();
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSubmit(): void {
|
||||||
|
this.onSubmit.emit();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -58,6 +58,7 @@
|
|||||||
[items]="invoice()?.items"
|
[items]="invoice()?.items"
|
||||||
[loading]="loading"
|
[loading]="loading"
|
||||||
pageTitle=""
|
pageTitle=""
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
</app-card-data>
|
</app-card-data>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
PageDataListComponent,
|
PageDataListComponent,
|
||||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
import { getGoodUnitTypeProperties } from '@/utils';
|
import { getGoodUnitTypeProperties } from '@/utils';
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { Badge } from 'primeng/badge';
|
import { Badge } from 'primeng/badge';
|
||||||
import { ButtonDirective } from 'primeng/button';
|
import { ButtonDirective } from 'primeng/button';
|
||||||
import { Divider } from 'primeng/divider';
|
import { Divider } from 'primeng/divider';
|
||||||
@@ -30,6 +30,8 @@ export class ConsumerSaleInvoiceSharedComponent {
|
|||||||
@Input({ required: true }) invoice!: any;
|
@Input({ required: true }) invoice!: any;
|
||||||
@Input() variant: TConsumerSaleInvoice = 'full';
|
@Input() variant: TConsumerSaleInvoice = 'full';
|
||||||
|
|
||||||
|
@Output() onRefresh = new EventEmitter<void>();
|
||||||
|
|
||||||
printInvoice = () => {
|
printInvoice = () => {
|
||||||
window.print();
|
window.print();
|
||||||
};
|
};
|
||||||
@@ -86,4 +88,8 @@ export class ConsumerSaleInvoiceSharedComponent {
|
|||||||
];
|
];
|
||||||
|
|
||||||
expandedRows: { [key: string]: boolean } = {};
|
expandedRows: { [key: string]: boolean } = {};
|
||||||
|
|
||||||
|
refresh() {
|
||||||
|
this.onRefresh.emit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
emptyPlaceholderTitle="حساب کاربریای یافت نشد"
|
emptyPlaceholderTitle="حساب کاربریای یافت نشد"
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@if (selectedItemForEdit()) {
|
@if (selectedItemForEdit()) {
|
||||||
|
|||||||
+1
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<consumer-complex-form
|
<consumer-complex-form
|
||||||
|
|||||||
+1
@@ -12,6 +12,7 @@
|
|||||||
[fullHeight]="fullHeight"
|
[fullHeight]="fullHeight"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<consumer-complex-good-form
|
<consumer-complex-good-form
|
||||||
[businessId]="businessId"
|
[businessId]="businessId"
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<consumer-businessActivity-form
|
<consumer-businessActivity-form
|
||||||
|
|||||||
+6
-6
@@ -11,6 +11,12 @@
|
|||||||
|
|
||||||
<app-enum-select [control]="form.controls.pos_type" type="posType" name="pos_type" />
|
<app-enum-select [control]="form.controls.pos_type" type="posType" name="pos_type" />
|
||||||
|
|
||||||
|
@if (form.controls.pos_type.value === "PSP") {
|
||||||
|
<app-input label="سریال دستگاه" [control]="form.controls.serial_number" name="serial_number" />
|
||||||
|
<catalog-device-select [control]="form.controls.device_id" />
|
||||||
|
<catalog-provider-select [control]="form.controls.provider_id" />
|
||||||
|
}
|
||||||
|
|
||||||
@if (!editMode) {
|
@if (!editMode) {
|
||||||
<p-divider align="center"> اطلاعات ورود </p-divider>
|
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||||
@@ -51,12 +57,6 @@
|
|||||||
</uikit-field>
|
</uikit-field>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (form.controls.pos_type.value === "PSP") {
|
|
||||||
<app-input label="سریال دستگاه" [control]="form.controls.serial_number" name="serial_number" />
|
|
||||||
<catalog-device-select [control]="form.controls.device_id" />
|
|
||||||
<catalog-provider-select [control]="form.controls.provider_id" />
|
|
||||||
}
|
|
||||||
|
|
||||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||||
</form>
|
</form>
|
||||||
</p-dialog>
|
</p-dialog>
|
||||||
|
|||||||
+1
@@ -12,6 +12,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<consumer-pos-form
|
<consumer-pos-form
|
||||||
|
|||||||
+1
@@ -4,5 +4,6 @@
|
|||||||
emptyPlaceholderTitle="تا به حال فاکتور فروشی توسط این پایانه ایجاد نشده است."
|
emptyPlaceholderTitle="تا به حال فاکتور فروشی توسط این پایانه ایجاد نشده است."
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@if (selectedItemForEdit()) {
|
@if (selectedItemForEdit()) {
|
||||||
|
|||||||
@@ -6,4 +6,5 @@
|
|||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|||||||
+1
@@ -6,6 +6,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
<ng-template #moreActions>
|
<ng-template #moreActions>
|
||||||
<a routerLink pButton [routerLink]="invoicesPageRoute" outlined>تمامی فاکتورها</a>
|
<a routerLink pButton [routerLink]="invoicesPageRoute" outlined>تمامی فاکتورها</a>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
[showEdit]="true"
|
[showEdit]="true"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
<ng-template #toPosLandingAction let-item>
|
<ng-template #toPosLandingAction let-item>
|
||||||
<p-button type="button" variant="outlined" (onClick)="toPosLanding(item.id)"> ورود به پایانه </p-button>
|
<p-button type="button" variant="outlined" (onClick)="toPosLanding(item.id)"> ورود به پایانه </p-button>
|
||||||
|
|||||||
@@ -6,4 +6,5 @@
|
|||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export class ConsumerStore extends EntityStore<IConsumerInfoResponse, ConsumerSt
|
|||||||
)
|
)
|
||||||
.subscribe((entity) => {
|
.subscribe((entity) => {
|
||||||
this.layoutService.setPanelInfo({
|
this.layoutService.setPanelInfo({
|
||||||
title: 'پنل مدیریت کسب و کار',
|
title: 'پنل مدیریت صورتحسابهای مالیاتی',
|
||||||
});
|
});
|
||||||
this.patchState({ entity });
|
this.patchState({ entity });
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
const baseUrl = '/api/v1/partner';
|
const baseUrl = '/api/v1/partner';
|
||||||
|
|
||||||
export const PARTNER_API_ROUTES = {
|
export const PARTNER_API_ROUTES = {
|
||||||
info: () => `${baseUrl}`,
|
me: () => `${baseUrl}`,
|
||||||
|
info: () => `${baseUrl}/info`,
|
||||||
};
|
};
|
||||||
|
|||||||
+11
-2
@@ -1,5 +1,14 @@
|
|||||||
export interface IPartnerInfoRawResponse {
|
import ISummary from '@/core/models/summary';
|
||||||
|
|
||||||
|
export interface IPartnerRawResponse {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
role: string;
|
||||||
|
partner: ISummary;
|
||||||
|
account: {
|
||||||
|
username: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
export interface IPartnerResponse extends IPartnerRawResponse {}
|
||||||
|
|
||||||
|
export interface IPartnerInfoRawResponse extends ISummary {}
|
||||||
export interface IPartnerInfoResponse extends IPartnerInfoRawResponse {}
|
export interface IPartnerInfoResponse extends IPartnerInfoRawResponse {}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@if (selectedItemForEdit()) {
|
@if (selectedItemForEdit()) {
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
<app-page-data-list
|
<app-page-data-list
|
||||||
pageTitle="مدیریت حسابهای کاربری"
|
pageTitle="حسابهای کاربری"
|
||||||
[addNewCtaLabel]="'افزودن حساب کاربری جدید'"
|
|
||||||
[columns]="columns"
|
[columns]="columns"
|
||||||
[showAdd]="true"
|
|
||||||
emptyPlaceholderTitle="حساب کاربریای یافت نشد."
|
emptyPlaceholderTitle="حساب کاربریای یافت نشد."
|
||||||
emptyPlaceholderDescription="برای افزودن حساب کاربری جدید، روی دکمهٔ بالا کلیک کنید."
|
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
[showDetails]="true"
|
(onRefresh)="refresh()"
|
||||||
[showAdd]="true"
|
|
||||||
(onAdd)="openAddForm()"
|
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<partner-consumer-account-form
|
<partner-consumer-account-form
|
||||||
|
|||||||
+11
@@ -10,6 +10,17 @@
|
|||||||
<app-input label="عنوان" [control]="form.controls.name" name="name" />
|
<app-input label="عنوان" [control]="form.controls.name" name="name" />
|
||||||
<app-input label="کد اقتصادی" [control]="form.controls.economic_code" name="economic_code" />
|
<app-input label="کد اقتصادی" [control]="form.controls.economic_code" name="economic_code" />
|
||||||
<catalog-guild-select label="صنف" [control]="form.controls.guild_id" name="guild_id" />
|
<catalog-guild-select label="صنف" [control]="form.controls.guild_id" name="guild_id" />
|
||||||
|
|
||||||
|
@if (!editMode) {
|
||||||
|
<p-divider align="center"> اطلاعات لایسنس </p-divider>
|
||||||
|
<uikit-datepicker
|
||||||
|
label="تاریخ شروع لایسنس"
|
||||||
|
[control]="form.controls.license_starts_at"
|
||||||
|
name="license_starts_at"
|
||||||
|
hint="مدت زمان لایسنسها ۱ ساله هستند."
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||||
</form>
|
</form>
|
||||||
</p-dialog>
|
</p-dialog>
|
||||||
|
|||||||
+27
-4
@@ -1,11 +1,14 @@
|
|||||||
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||||
|
import { MustMatch } from '@/core/validators';
|
||||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||||
import { CatalogGuildSelectComponent } from '@/shared/catalog/guild/components/select.component';
|
import { CatalogGuildSelectComponent } from '@/shared/catalog/guild/components/select.component';
|
||||||
import { InputComponent } from '@/shared/components';
|
import { InputComponent } from '@/shared/components';
|
||||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||||
|
import { UikitFlatpickrJalaliComponent } from '@/uikit';
|
||||||
import { Component, inject, Input } from '@angular/core';
|
import { Component, inject, Input } from '@angular/core';
|
||||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { Dialog } from 'primeng/dialog';
|
import { Dialog } from 'primeng/dialog';
|
||||||
|
import { Divider } from 'primeng/divider';
|
||||||
import { IBusinessActivityRequest, IBusinessActivityResponse } from '../../models';
|
import { IBusinessActivityRequest, IBusinessActivityResponse } from '../../models';
|
||||||
import { PartnerConsumerBusinessActivitiesService } from '../../services/businessActivities.service';
|
import { PartnerConsumerBusinessActivitiesService } from '../../services/businessActivities.service';
|
||||||
|
|
||||||
@@ -18,6 +21,8 @@ import { PartnerConsumerBusinessActivitiesService } from '../../services/busines
|
|||||||
InputComponent,
|
InputComponent,
|
||||||
FormFooterActionsComponent,
|
FormFooterActionsComponent,
|
||||||
CatalogGuildSelectComponent,
|
CatalogGuildSelectComponent,
|
||||||
|
Divider,
|
||||||
|
UikitFlatpickrJalaliComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class ConsumerBusinessActivitiesFormComponent extends AbstractFormDialog<
|
export class ConsumerBusinessActivitiesFormComponent extends AbstractFormDialog<
|
||||||
@@ -30,11 +35,28 @@ export class ConsumerBusinessActivitiesFormComponent extends AbstractFormDialog<
|
|||||||
@Input() businessActivityId!: string;
|
@Input() businessActivityId!: string;
|
||||||
|
|
||||||
initForm = () => {
|
initForm = () => {
|
||||||
return this.fb.group({
|
const form = this.fb.group({
|
||||||
name: [this.initialValues?.name || '', [Validators.required]],
|
name: [this.initialValues?.name || '', [Validators.required]],
|
||||||
economic_code: [this.initialValues?.economic_code || '', [Validators.required]],
|
economic_code: [this.initialValues?.economic_code || '', [Validators.required]],
|
||||||
guild_id: [this.initialValues?.guild?.id || '', [Validators.required]],
|
guild_id: [this.initialValues?.guild?.id || '', [Validators.required]],
|
||||||
|
license_starts_at: [''],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (this.editMode) {
|
||||||
|
// @ts-ignore
|
||||||
|
form.removeControl('license_starts_at');
|
||||||
|
} else {
|
||||||
|
form.addControl(
|
||||||
|
'license_starts_at',
|
||||||
|
this.fb.control<string>('', {
|
||||||
|
nonNullable: true,
|
||||||
|
validators: [Validators.required],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
form.addValidators([MustMatch('password', 'confirmPassword')]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return form;
|
||||||
};
|
};
|
||||||
|
|
||||||
form = this.initForm();
|
form = this.initForm();
|
||||||
@@ -48,10 +70,11 @@ export class ConsumerBusinessActivitiesFormComponent extends AbstractFormDialog<
|
|||||||
}
|
}
|
||||||
|
|
||||||
submitForm() {
|
submitForm() {
|
||||||
const formValue = this.form.value as IBusinessActivityRequest;
|
const formValue = this.form.value as IBusinessActivityRequest & { confirmPassword?: string };
|
||||||
|
const { confirmPassword, ...rest } = formValue;
|
||||||
if (this.editMode) {
|
if (this.editMode) {
|
||||||
return this.service.update(this.consumerId, this.businessActivityId, formValue);
|
return this.service.update(this.consumerId, this.businessActivityId, rest);
|
||||||
}
|
}
|
||||||
return this.service.create(this.consumerId, formValue);
|
return this.service.create(this.consumerId, rest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<partner-consumer-businessActivities-form
|
<partner-consumer-businessActivities-form
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<partner-consumer-complex-form
|
<partner-consumer-complex-form
|
||||||
|
|||||||
@@ -10,7 +10,14 @@
|
|||||||
<app-input label="عنوان" [control]="form.controls.name" name="name" />
|
<app-input label="عنوان" [control]="form.controls.name" name="name" />
|
||||||
<app-enum-select [control]="form.controls.pos_type" type="posType" name="pos_type" />
|
<app-enum-select [control]="form.controls.pos_type" type="posType" name="pos_type" />
|
||||||
|
|
||||||
|
@if (form.controls.pos_type.value === "PSP") {
|
||||||
|
<app-input label="سریال دستگاه" [control]="form.controls.serial_number" name="serial_number" />
|
||||||
|
<catalog-device-select [control]="form.controls.device_id" />
|
||||||
|
<catalog-provider-select [control]="form.controls.provider_id" />
|
||||||
|
}
|
||||||
|
|
||||||
@if (!editMode) {
|
@if (!editMode) {
|
||||||
|
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||||
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||||
<uikit-field label="رمز عبور" [control]="form.controls.password">
|
<uikit-field label="رمز عبور" [control]="form.controls.password">
|
||||||
<p-password
|
<p-password
|
||||||
@@ -18,7 +25,7 @@
|
|||||||
name="password"
|
name="password"
|
||||||
formControlName="password"
|
formControlName="password"
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
styleClass="w-full"
|
inputStyleClass="w-full"
|
||||||
[toggleMask]="true"
|
[toggleMask]="true"
|
||||||
[feedback]="false"
|
[feedback]="false"
|
||||||
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||||
@@ -31,7 +38,7 @@
|
|||||||
name="confirmPassword"
|
name="confirmPassword"
|
||||||
formControlName="confirmPassword"
|
formControlName="confirmPassword"
|
||||||
autocomplete="new-password"
|
autocomplete="new-password"
|
||||||
styleClass="w-full"
|
inputStyleClass="w-full"
|
||||||
[toggleMask]="true"
|
[toggleMask]="true"
|
||||||
[feedback]="false"
|
[feedback]="false"
|
||||||
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||||
@@ -39,11 +46,6 @@
|
|||||||
</uikit-field>
|
</uikit-field>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (form.controls.pos_type.value === "PSP") {
|
|
||||||
<app-input label="سریال دستگاه" [control]="form.controls.serial_number" name="serial_number" />
|
|
||||||
<catalog-device-select [control]="form.controls.device_id" />
|
|
||||||
<catalog-provider-select [control]="form.controls.provider_id" />
|
|
||||||
}
|
|
||||||
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||||
</form>
|
</form>
|
||||||
</p-dialog>
|
</p-dialog>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { UikitFieldComponent } from '@/uikit';
|
|||||||
import { Component, inject, Input } from '@angular/core';
|
import { Component, inject, Input } from '@angular/core';
|
||||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { Dialog } from 'primeng/dialog';
|
import { Dialog } from 'primeng/dialog';
|
||||||
|
import { Divider } from 'primeng/divider';
|
||||||
import { Password } from 'primeng/password';
|
import { Password } from 'primeng/password';
|
||||||
import { IPosRequest, IPosResponse } from '../../models';
|
import { IPosRequest, IPosResponse } from '../../models';
|
||||||
import { PartnerPosesService } from '../../services/poses.service';
|
import { PartnerPosesService } from '../../services/poses.service';
|
||||||
@@ -27,6 +28,7 @@ import { PartnerPosesService } from '../../services/poses.service';
|
|||||||
EnumSelectComponent,
|
EnumSelectComponent,
|
||||||
UikitFieldComponent,
|
UikitFieldComponent,
|
||||||
Password,
|
Password,
|
||||||
|
Divider,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class ConsumerPosFormComponent extends AbstractFormDialog<IPosRequest, IPosResponse> {
|
export class ConsumerPosFormComponent extends AbstractFormDialog<IPosRequest, IPosResponse> {
|
||||||
|
|||||||
@@ -2,17 +2,16 @@
|
|||||||
pageTitle="مدیریت پایانههای فروش"
|
pageTitle="مدیریت پایانههای فروش"
|
||||||
[addNewCtaLabel]="'افزودن پایانهی فروش جدید'"
|
[addNewCtaLabel]="'افزودن پایانهی فروش جدید'"
|
||||||
[columns]="columns"
|
[columns]="columns"
|
||||||
[showAdd]="true"
|
|
||||||
emptyPlaceholderTitle="پایانهی فروشی یافت نشد."
|
emptyPlaceholderTitle="پایانهی فروشی یافت نشد."
|
||||||
emptyPlaceholderDescription="برای افزودن پایانهی فروش جدید، روی دکمهٔ بالا کلیک کنید."
|
emptyPlaceholderDescription="برای افزودن پایانهی فروش جدید، روی دکمهٔ بالا کلیک کنید."
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
[showDetails]="true"
|
|
||||||
[showAdd]="true"
|
[showAdd]="true"
|
||||||
[showEdit]="true"
|
[showEdit]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<partner-consumer-pos-form
|
<partner-consumer-pos-form
|
||||||
|
|||||||
@@ -24,21 +24,27 @@ export class ConsumerPosesComponent extends AbstractList<IPosResponse> {
|
|||||||
@Input() header: IColumn[] = [
|
@Input() header: IColumn[] = [
|
||||||
{ field: 'id', header: 'شناسه', type: 'id' },
|
{ field: 'id', header: 'شناسه', type: 'id' },
|
||||||
{ field: 'name', header: 'عنوان' },
|
{ field: 'name', header: 'عنوان' },
|
||||||
{ field: 'serial_number', header: 'شماره سریال' },
|
// { field: 'serial_number', header: 'شماره سریال' },
|
||||||
{ field: 'device', header: 'دستگاه', type: 'nested', nestedOption: { path: 'device.name' } },
|
// { field: 'device', header: 'دستگاه', type: 'nested', nestedOption: { path: 'device.name' } },
|
||||||
{ field: 'pos_type', header: 'نوع دستگاه' },
|
{ field: 'pos_type', header: 'نوع پایانه' },
|
||||||
{
|
{
|
||||||
field: 'provider',
|
field: 'account',
|
||||||
header: 'ارایهدهنده',
|
header: 'کاربر',
|
||||||
type: 'nested',
|
type: 'nested',
|
||||||
nestedOption: { path: 'provider.name' },
|
nestedOption: { path: 'account.username' },
|
||||||
},
|
|
||||||
{ field: 'status', header: 'وضعیت' },
|
|
||||||
{
|
|
||||||
field: 'created_at',
|
|
||||||
header: 'تاریخ ایجاد',
|
|
||||||
type: 'date',
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// field: 'provider',
|
||||||
|
// header: 'ارایهدهنده',
|
||||||
|
// type: 'nested',
|
||||||
|
// nestedOption: { path: 'provider.name' },
|
||||||
|
// },
|
||||||
|
// { field: 'status', header: 'وضعیت' },
|
||||||
|
// {
|
||||||
|
// field: 'created_at',
|
||||||
|
// header: 'تاریخ ایجاد',
|
||||||
|
// type: 'date',
|
||||||
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
private readonly service = inject(PartnerPosesService);
|
private readonly service = inject(PartnerPosesService);
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ export interface IBusinessActivityRequest {
|
|||||||
name: string;
|
name: string;
|
||||||
economic_code: string;
|
economic_code: string;
|
||||||
guild_id: string;
|
guild_id: string;
|
||||||
|
username?: string;
|
||||||
|
password?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LicenseInfo {
|
interface LicenseInfo {
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ export interface IPosRawResponse {
|
|||||||
complex: ISummary;
|
complex: ISummary;
|
||||||
device?: ISummary;
|
device?: ISummary;
|
||||||
provider?: ISummary;
|
provider?: ISummary;
|
||||||
|
account: {
|
||||||
|
username: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
export interface IPosResponse extends IPosRawResponse {}
|
export interface IPosResponse extends IPosRawResponse {}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<partner-consumer-form
|
<partner-consumer-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||||
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
||||||
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
|
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
import { formatJalali } from '@/utils';
|
|
||||||
import { Component, inject } from '@angular/core';
|
import { Component, inject } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { ConsumerUserFormComponent } from '../components/form.component';
|
import { ConsumerUserFormComponent } from '../components/form.component';
|
||||||
@@ -23,17 +22,18 @@ export class ConsumersComponent extends AbstractList<IConsumerResponse> {
|
|||||||
{ field: 'id', header: 'شناسه', type: 'id' },
|
{ field: 'id', header: 'شناسه', type: 'id' },
|
||||||
{ field: 'fullname', header: 'نام' },
|
{ field: 'fullname', header: 'نام' },
|
||||||
{ field: 'mobile_number', header: 'شماره موبایل' },
|
{ field: 'mobile_number', header: 'شماره موبایل' },
|
||||||
{ field: 'status', header: 'وضعیت' },
|
{ field: 'national_code', header: 'کد ملی' },
|
||||||
{
|
// { field: 'status', header: 'وضعیت' },
|
||||||
field: 'license_expires_at',
|
// {
|
||||||
header: 'تاریخ انقضای لایسنس',
|
// field: 'license_expires_at',
|
||||||
customDataModel(item) {
|
// header: 'تاریخ انقضای لایسنس',
|
||||||
if (item.license_info) {
|
// customDataModel(item) {
|
||||||
return formatJalali(item.license_info.expires_at);
|
// if (item.license_info) {
|
||||||
}
|
// return formatJalali(item.license_info.expires_at);
|
||||||
return 'بدون لایسنس';
|
// }
|
||||||
},
|
// return 'بدون لایسنس';
|
||||||
},
|
// },
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
field: 'created_at',
|
field: 'created_at',
|
||||||
header: 'تاریخ ایجاد',
|
header: 'تاریخ ایجاد',
|
||||||
|
|||||||
@@ -8,4 +8,5 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { defaultBaseStateData, EntityState, EntityStore } from '@/core/state';
|
||||||
|
import { IPartnerInfoResponse } from '@/domains/partner/models';
|
||||||
|
import { PartnerService } from '@/domains/partner/services/main.service';
|
||||||
|
import { LayoutService } from '@/layout/service/layout.service';
|
||||||
|
import { inject, Injectable } from '@angular/core';
|
||||||
|
import { catchError, finalize } from 'rxjs';
|
||||||
|
|
||||||
|
interface PartnerInfoState extends EntityState<IPartnerInfoResponse> {}
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class PartnerInfoStore extends EntityStore<IPartnerInfoResponse, PartnerInfoState> {
|
||||||
|
private readonly service = inject(PartnerService);
|
||||||
|
private readonly layoutService = inject(LayoutService);
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(defaultBaseStateData);
|
||||||
|
}
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
this.patchState({ loading: true });
|
||||||
|
this.service
|
||||||
|
.getInfo()
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
this.patchState({ loading: false });
|
||||||
|
}),
|
||||||
|
catchError((error) => {
|
||||||
|
this.setError(error);
|
||||||
|
throw error;
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe((entity) => {
|
||||||
|
this.setEntity(entity);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
override reset(): void {
|
||||||
|
this.setState({ ...defaultBaseStateData });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,18 @@
|
|||||||
import { Component } from '@angular/core';
|
import { Component, computed, inject } from '@angular/core';
|
||||||
|
import { PartnerInfoStore } from '../store/main.store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'partner-dashboard',
|
selector: 'partner-dashboard',
|
||||||
templateUrl: './index.component.html',
|
templateUrl: './index.component.html',
|
||||||
})
|
})
|
||||||
export class DashboardComponent {}
|
export class DashboardComponent {
|
||||||
|
private readonly store = inject(PartnerInfoStore);
|
||||||
|
|
||||||
|
readonly loading = computed(() => this.store.loading());
|
||||||
|
readonly entity = computed(() => this.store.entity());
|
||||||
|
readonly error = computed(() => this.store.error());
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.store.getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,12 @@ import { HttpClient } from '@angular/common/http';
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { PARTNER_API_ROUTES } from '../constants';
|
import { PARTNER_API_ROUTES } from '../constants';
|
||||||
import { IPartnerInfoRawResponse, IPartnerInfoResponse } from '../models';
|
import {
|
||||||
|
IPartnerInfoRawResponse,
|
||||||
|
IPartnerInfoResponse,
|
||||||
|
IPartnerRawResponse,
|
||||||
|
IPartnerResponse,
|
||||||
|
} from '../models';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class PartnerService {
|
export class PartnerService {
|
||||||
@@ -10,6 +15,10 @@ export class PartnerService {
|
|||||||
|
|
||||||
private apiRoutes = PARTNER_API_ROUTES;
|
private apiRoutes = PARTNER_API_ROUTES;
|
||||||
|
|
||||||
|
getMe(): Observable<IPartnerResponse> {
|
||||||
|
return this.http.get<IPartnerRawResponse>(this.apiRoutes.me());
|
||||||
|
}
|
||||||
|
|
||||||
getInfo(): Observable<IPartnerInfoResponse> {
|
getInfo(): Observable<IPartnerInfoResponse> {
|
||||||
return this.http.get<IPartnerInfoRawResponse>(this.apiRoutes.info());
|
return this.http.get<IPartnerInfoRawResponse>(this.apiRoutes.info());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ import { EntityState, EntityStore } from '@/core/state';
|
|||||||
import { LayoutService } from '@/layout/service/layout.service';
|
import { LayoutService } from '@/layout/service/layout.service';
|
||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { catchError, finalize } from 'rxjs';
|
import { catchError, finalize } from 'rxjs';
|
||||||
import { IPartnerInfoResponse } from '../models';
|
import { IPartnerResponse } from '../models';
|
||||||
import { PartnerService } from '../services/main.service';
|
import { PartnerService } from '../services/main.service';
|
||||||
|
|
||||||
interface PartnerState extends EntityState<IPartnerInfoResponse> {}
|
interface PartnerState extends EntityState<IPartnerResponse> {}
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class PartnerStore extends EntityStore<IPartnerInfoResponse, PartnerState> {
|
export class PartnerStore extends EntityStore<IPartnerResponse, PartnerState> {
|
||||||
private readonly service = inject(PartnerService);
|
private readonly service = inject(PartnerService);
|
||||||
private readonly layoutService = inject(LayoutService);
|
private readonly layoutService = inject(LayoutService);
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ export class PartnerStore extends EntityStore<IPartnerInfoResponse, PartnerState
|
|||||||
getData() {
|
getData() {
|
||||||
this.patchState({ loading: true });
|
this.patchState({ loading: true });
|
||||||
this.service
|
this.service
|
||||||
.getInfo()
|
.getMe()
|
||||||
.pipe(
|
.pipe(
|
||||||
finalize(() => {
|
finalize(() => {
|
||||||
this.patchState({ loading: false });
|
this.patchState({ loading: false });
|
||||||
@@ -39,7 +39,7 @@ export class PartnerStore extends EntityStore<IPartnerInfoResponse, PartnerState
|
|||||||
)
|
)
|
||||||
.subscribe((entity) => {
|
.subscribe((entity) => {
|
||||||
this.layoutService.setPanelInfo({
|
this.layoutService.setPanelInfo({
|
||||||
title: `پنل مدیریتی ${entity.name}`,
|
title: `پنل مدیریتی ${entity.partner.name}`,
|
||||||
});
|
});
|
||||||
this.setEntity(entity);
|
this.setEntity(entity);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
[showAdd]="true"
|
[showAdd]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-consumer-account-form
|
<superAdmin-consumer-account-form
|
||||||
|
|||||||
+1
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-consumer-businessActivities-form
|
<superAdmin-consumer-businessActivities-form
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-consumer-complex-form
|
<superAdmin-consumer-complex-form
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-consumer-pos-form
|
<superAdmin-consumer-pos-form
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<superAdmin-consumer-form
|
<superAdmin-consumer-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
[showEdit]="true"
|
[showEdit]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<deviceBrand-form
|
<deviceBrand-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
[showEdit]="true"
|
[showEdit]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<superAdmin-device-form
|
<superAdmin-device-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
[fullHeight]="fullHeight"
|
[fullHeight]="fullHeight"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<admin-guild-good-categories-form
|
<admin-guild-good-categories-form
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
[fullHeight]="fullHeight"
|
[fullHeight]="fullHeight"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<admin-guild-good-form
|
<admin-guild-good-form
|
||||||
[guildId]="guildId"
|
[guildId]="guildId"
|
||||||
|
|||||||
@@ -11,5 +11,6 @@
|
|||||||
[showAdd]="true"
|
[showAdd]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<admin-guild-form [(visible)]="visibleForm" (onSubmit)="refresh()" />
|
<admin-guild-form [(visible)]="visibleForm" (onSubmit)="refresh()" />
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
emptyPlaceholderTitle="لایسنسی یافت نشد"
|
emptyPlaceholderTitle="لایسنسی یافت نشد"
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
<!-- <ng-template #role let-data>
|
<!-- <ng-template #role let-data>
|
||||||
<catalog-role-tag [role]="data.role" />
|
<catalog-role-tag [role]="data.role" />
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
pageTitle="مدیریت حسابهای کاربری"
|
pageTitle="مدیریت حسابهای کاربری"
|
||||||
[addNewCtaLabel]="'افزودن حساب کاربری جدید'"
|
[addNewCtaLabel]="'افزودن حساب کاربری جدید'"
|
||||||
[columns]="columns"
|
[columns]="columns"
|
||||||
[showAdd]="true"
|
|
||||||
emptyPlaceholderTitle="حساب کاربریای یافت نشد."
|
emptyPlaceholderTitle="حساب کاربریای یافت نشد."
|
||||||
emptyPlaceholderDescription="برای افزودن حساب کاربری جدید، روی دکمهٔ بالا کلیک کنید."
|
emptyPlaceholderDescription="برای افزودن حساب کاربری جدید، روی دکمهٔ بالا کلیک کنید."
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
[showDetails]="true"
|
|
||||||
[showAdd]="true"
|
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-partner-account-form
|
<superAdmin-partner-account-form
|
||||||
|
|||||||
+1
@@ -4,5 +4,6 @@
|
|||||||
emptyPlaceholderTitle="تا به حال شارژ کاربری انجام نشده است"
|
emptyPlaceholderTitle="تا به حال شارژ کاربری انجام نشده است"
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
|
|||||||
+1
@@ -4,6 +4,7 @@
|
|||||||
emptyPlaceholderTitle="تا به حال شارژ لایسنسی انجام نشده است"
|
emptyPlaceholderTitle="تا به حال شارژ لایسنسی انجام نشده است"
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
<!-- <ng-template #role let-data>
|
<!-- <ng-template #role let-data>
|
||||||
<catalog-role-tag [role]="data.role" />
|
<catalog-role-tag [role]="data.role" />
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
<app-page-data-list
|
<app-page-data-list
|
||||||
pageTitle="لیست لایسنسهای فروخته شده"
|
pageTitle="لیست لایسنسهای فروخته شده"
|
||||||
[columns]="columns"
|
[columns]="columns"
|
||||||
emptyPlaceholderTitle="تا به حال توسط این شریک تجاری لایسنسی فروخته نشده است"
|
emptyPlaceholderTitle="تا به حال لایسنسی فروخته نشده است"
|
||||||
[items]="items()"
|
[items]="items()"
|
||||||
[loading]="loading()"
|
[loading]="loading()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
<!-- <ng-template #role let-data>
|
<!-- <ng-template #role let-data>
|
||||||
<catalog-role-tag [role]="data.role" />
|
<catalog-role-tag [role]="data.role" />
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
||||||
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
|
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
import { Component, inject, Input } from '@angular/core';
|
import { Component, inject, Input } from '@angular/core';
|
||||||
|
import { ButtonDirective } from 'primeng/button';
|
||||||
import { IPartnerActivatedLicenseResponse } from '../../models';
|
import { IPartnerActivatedLicenseResponse } from '../../models';
|
||||||
import { AdminPartnerActivatedLicensesService } from '../../services/licenses.service';
|
import { AdminPartnerActivatedLicensesService } from '../../services/licenses.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'admin-partner-licenses',
|
selector: 'admin-partner-licenses',
|
||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
imports: [PageDataListComponent],
|
imports: [PageDataListComponent, ButtonDirective],
|
||||||
})
|
})
|
||||||
export class AdminPartnerLicensesComponent extends AbstractList<IPartnerActivatedLicenseResponse> {
|
export class AdminPartnerLicensesComponent extends AbstractList<IPartnerActivatedLicenseResponse> {
|
||||||
@Input({ required: true }) partnerId!: string;
|
@Input({ required: true }) partnerId!: string;
|
||||||
@@ -25,6 +26,12 @@ export class AdminPartnerLicensesComponent extends AbstractList<IPartnerActivate
|
|||||||
return `${item.business_activity.consumer.first_name} ${item.business_activity.consumer.last_name} (${item.business_activity.name})`;
|
return `${item.business_activity.consumer.first_name} ${item.business_activity.consumer.last_name} (${item.business_activity.name})`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'license',
|
||||||
|
header: 'تعداد کاربر قابل تعریف',
|
||||||
|
type: 'nested',
|
||||||
|
nestedOption: { path: 'license.accounts_limit' },
|
||||||
|
},
|
||||||
{ field: 'expires_at', header: 'تاریخ انقضا', type: 'date' },
|
{ field: 'expires_at', header: 'تاریخ انقضا', type: 'date' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,11 @@ export interface IPartnerRawResponse {
|
|||||||
used: number;
|
used: number;
|
||||||
expired: number;
|
expired: number;
|
||||||
};
|
};
|
||||||
|
license_renew_status: {
|
||||||
|
total: number;
|
||||||
|
used: number;
|
||||||
|
expired: number;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
export interface IPartnerResponse extends IPartnerRawResponse {}
|
export interface IPartnerResponse extends IPartnerRawResponse {}
|
||||||
|
|
||||||
|
|||||||
@@ -13,15 +13,24 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
<ng-template #licensesStatus let-item>
|
<ng-template #licensesStatus let-item>
|
||||||
<span class="font-bold">
|
<span class="font-bold">
|
||||||
{{ item.licenses_status.total }}
|
{{ item.licenses_status.total }}
|
||||||
@if (item.licenses_status.used) {
|
|
||||||
<small class="small text-muted-color font-normal"> ({{ item.licenses_status.used }} عدد استفاده شده) </small>
|
<small class="small text-muted-color font-normal"> ({{ item.licenses_status.used }} عدد استفاده شده) </small>
|
||||||
} @else {
|
</span>
|
||||||
<small class="small text-muted-color font-normal"> (تمامی لایسنسها فعال میباشند) </small>
|
</ng-template>
|
||||||
}
|
<ng-template #accountQuotaStatus let-item>
|
||||||
|
<span class="font-bold">
|
||||||
|
{{ item.account_quota_status.total }}
|
||||||
|
<small class="small text-muted-color font-normal"> ({{ item.account_quota_status.used }} عدد استفاده شده) </small>
|
||||||
|
</span>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template #licensesRenewStatus let-item>
|
||||||
|
<span class="font-bold">
|
||||||
|
{{ item.license_renew_status.total }}
|
||||||
|
<small class="small text-muted-color font-normal"> ({{ item.license_renew_status.used }} عدد استفاده شده) </small>
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
|
|||||||
@@ -18,18 +18,25 @@ export class PartnersComponent extends AbstractList<IPartnerResponse> {
|
|||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
|
|
||||||
@ViewChild('licensesStatus', { static: true }) licensesStatus!: TemplateRef<any>;
|
@ViewChild('licensesStatus', { static: true }) licensesStatus!: TemplateRef<any>;
|
||||||
|
@ViewChild('accountQuotaStatus', { static: true }) accountQuotaStatus!: TemplateRef<any>;
|
||||||
|
@ViewChild('licensesRenewStatus', { static: true }) licensesRenewStatus!: TemplateRef<any>;
|
||||||
|
|
||||||
override setColumns(): void {
|
override setColumns(): void {
|
||||||
this.columns = [
|
this.columns = [
|
||||||
{ field: 'name', header: 'نام' },
|
{ field: 'name', header: 'نام' },
|
||||||
{ field: 'code', header: 'کد' },
|
{ field: 'code', header: 'کد' },
|
||||||
{ field: 'licenses', header: 'وضعیت لایسنسها', customDataModel: this.licensesStatus },
|
{ field: 'licenses', header: 'تعداد لایسنسها', customDataModel: this.licensesStatus },
|
||||||
{ field: 'status', header: 'وضعیت' },
|
|
||||||
{
|
{
|
||||||
field: 'created_at',
|
field: 'account_quota',
|
||||||
header: 'تاریخ ایجاد',
|
header: 'تعداد کاربرهای خریداری شده',
|
||||||
type: 'date',
|
customDataModel: this.accountQuotaStatus,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'license_renew',
|
||||||
|
header: 'تعداد لایسنسهای تمدیدی',
|
||||||
|
customDataModel: this.licensesRenewStatus,
|
||||||
|
},
|
||||||
|
{ field: 'status', header: 'وضعیت' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,18 @@
|
|||||||
(partner()?.account_quota_status?.expired || 0)
|
(partner()?.account_quota_status?.expired || 0)
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
<p-divider align="center" class="col-span-3">اطلاعات تمدید لایسنسها</p-divider>
|
||||||
|
<app-key-value label="تعداد کاربران خریداری شده" [value]="partner()?.license_renew_status?.total" />
|
||||||
|
<app-key-value label="تعداد کاربران منقضی شده" [value]="partner()?.license_renew_status?.expired" />
|
||||||
|
<app-key-value label="تعداد کاربران فروخته شده" [value]="partner()?.license_renew_status?.used" />
|
||||||
|
<app-key-value
|
||||||
|
label="تعداد کاربران باقیمانده"
|
||||||
|
[value]="
|
||||||
|
(partner()?.license_renew_status?.total || 0) -
|
||||||
|
(partner()?.license_renew_status?.used || 0) -
|
||||||
|
(partner()?.license_renew_status?.expired || 0)
|
||||||
|
"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</app-card-data>
|
</app-card-data>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
[showAdd]="true"
|
[showAdd]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<provider-form
|
<provider-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
[showDetails]="true"
|
[showDetails]="true"
|
||||||
[showAdd]="true"
|
[showAdd]="true"
|
||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-user-account-form
|
<superAdmin-user-account-form
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
(onAdd)="openAddForm()"
|
(onAdd)="openAddForm()"
|
||||||
(onEdit)="onEditClick($event)"
|
(onEdit)="onEditClick($event)"
|
||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onRefresh)="refresh()"
|
||||||
/>
|
/>
|
||||||
<superAdmin-user-form
|
<superAdmin-user-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
|
|||||||
@@ -28,7 +28,9 @@ export class AppTopbar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
username = computed(() => this.authService.currentAccount()?.username || 'کاربر ناشناس');
|
username = computed(() => this.authService.currentAccount()?.username || 'کاربر ناشناس');
|
||||||
panelTitle = computed(() => this.layoutService.panelInfo()?.title || 'پنل مدیریت کسبوکار');
|
panelTitle = computed(
|
||||||
|
() => this.layoutService.panelInfo()?.title || 'پنل مدیریت صورتحسابهای مالیاتی',
|
||||||
|
);
|
||||||
|
|
||||||
logout = () => {
|
logout = () => {
|
||||||
this.authService.logout();
|
this.authService.logout();
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export class LayoutService {
|
|||||||
public menuItems = signal<MenuItem[]>([]);
|
public menuItems = signal<MenuItem[]>([]);
|
||||||
|
|
||||||
public panelInfo = signal<IPanelInfo>({
|
public panelInfo = signal<IPanelInfo>({
|
||||||
title: 'پنل مدیریت کسبوکار',
|
title: 'پنل مدیریت صورتحسابهای مالیاتی',
|
||||||
});
|
});
|
||||||
|
|
||||||
menuSource$ = this.menuSource.asObservable();
|
menuSource$ = this.menuSource.asObservable();
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
class="flex flex-col items-center justify-center px-12 py-10 h-auto bg-surface-card border border-surface-border rounded-lg shadow w-full max-w-md"
|
class="flex flex-col items-center justify-center px-12 py-10 h-auto bg-surface-card border border-surface-border rounded-lg shadow w-full max-w-md"
|
||||||
>
|
>
|
||||||
<div class="flex flex-col gap-4 text-center mb-10 items-center justify-center">
|
<div class="flex flex-col gap-4 text-center mb-10 items-center justify-center">
|
||||||
<img [src]="logo" alt="مدیریت کسبوکار" class="w-20 h-auto" />
|
<img [src]="logo" alt="مدیریت صورتحسابهای مالیاتی" class="w-20 h-auto" />
|
||||||
<span class="text-lg font-bold"> به پنل مدیریت کسبوکار خوش آمدید. </span>
|
<span class="text-lg font-bold"> به پنل مدیریت صورتحسابهای مالیاتی خوش آمدید. </span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- @if (activeStep() === "login") { -->
|
<!-- @if (activeStep() === "login") { -->
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="flex flex-col items-center justify-center">
|
<div class="flex flex-col items-center justify-center">
|
||||||
<div class="mb-10 flex flex-col gap-5 items-center">
|
<div class="mb-10 flex flex-col gap-5 items-center">
|
||||||
<img [src]="logo" width="80" />
|
<img [src]="logo" width="80" />
|
||||||
<span class="text-2xl font-semibold text-surface-900 dark:text-surface-0">مدیریت کسبوکار</span>
|
<span class="text-2xl font-semibold text-surface-900 dark:text-surface-0">مدیریت صورتحسابهای مالیاتی</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
style="
|
style="
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
class="grow flex! flex-col overflow-hidden"
|
class="grow flex! flex-col overflow-hidden"
|
||||||
[tableStyleClass]="!items.length && !loading ? 'h-full' : ''"
|
[tableStyleClass]="!items.length && !loading ? 'h-full' : ''"
|
||||||
>
|
>
|
||||||
@if (pageTitle || showAdd || filter || caption) {
|
@if (pageTitle || showAdd || filter || caption || showRefresh || moreActions) {
|
||||||
<ng-template pTemplate="caption">
|
<ng-template pTemplate="caption">
|
||||||
<ng-container [ngTemplateOutlet]="caption">
|
<ng-container [ngTemplateOutlet]="caption">
|
||||||
<div class="flex justify-between items-center gap-4">
|
<div class="flex justify-between items-center gap-4">
|
||||||
<h5 class="font-bold">{{ pageTitle }}</h5>
|
<h5 class="font-bold">{{ pageTitle }}</h5>
|
||||||
@if (showAdd || filter || moreActions) {
|
@if (showAdd || filter || showRefresh || moreActions) {
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<ng-container [ngTemplateOutlet]="moreActions" />
|
<ng-container [ngTemplateOutlet]="moreActions" />
|
||||||
@if (filter) {
|
@if (filter) {
|
||||||
@@ -31,6 +31,9 @@
|
|||||||
(click)="openFilter()"
|
(click)="openFilter()"
|
||||||
></p-button>
|
></p-button>
|
||||||
}
|
}
|
||||||
|
@if (showRefresh) {
|
||||||
|
<p-button icon="pi pi-refresh" outlined (click)="refresh()"></p-button>
|
||||||
|
}
|
||||||
@if (showAdd) {
|
@if (showAdd) {
|
||||||
<p-button label="{{ addNewCtaLabel }}" icon="pi pi-plus" (click)="openAddForm()"></p-button>
|
<p-button label="{{ addNewCtaLabel }}" icon="pi pi-plus" (click)="openAddForm()"></p-button>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ export class PageDataListComponent<I> {
|
|||||||
@Input() showDelete: boolean = false;
|
@Input() showDelete: boolean = false;
|
||||||
@Input() showDetails: boolean = false;
|
@Input() showDetails: boolean = false;
|
||||||
@Input() showAdd: boolean = false;
|
@Input() showAdd: boolean = false;
|
||||||
|
@Input() showRefresh: boolean = true;
|
||||||
@Input() isFiltered: boolean = false;
|
@Input() isFiltered: boolean = false;
|
||||||
@Input() fullHeight?: boolean = false;
|
@Input() fullHeight?: boolean = false;
|
||||||
@Input() height: string = '';
|
@Input() height: string = '';
|
||||||
@@ -108,6 +109,7 @@ export class PageDataListComponent<I> {
|
|||||||
@Output() onAdd = new EventEmitter<void>();
|
@Output() onAdd = new EventEmitter<void>();
|
||||||
@Output() pageChange = new EventEmitter<any>();
|
@Output() pageChange = new EventEmitter<any>();
|
||||||
@Output() onThumbnailClick = new EventEmitter<I>();
|
@Output() onThumbnailClick = new EventEmitter<I>();
|
||||||
|
@Output() onRefresh = new EventEmitter();
|
||||||
|
|
||||||
filterDrawerVisible = signal<boolean>(false);
|
filterDrawerVisible = signal<boolean>(false);
|
||||||
expandedRows: { [key: string]: boolean } = {};
|
expandedRows: { [key: string]: boolean } = {};
|
||||||
@@ -258,4 +260,8 @@ export class PageDataListComponent<I> {
|
|||||||
if (this.showDetails) totalCount += 1;
|
if (this.showDetails) totalCount += 1;
|
||||||
return totalCount;
|
return totalCount;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
refresh() {
|
||||||
|
this.onRefresh.emit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
<html lang="fa" dir="rtl">
|
<html lang="fa" dir="rtl">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>pos</title>
|
<title>پنل مدیریت صورتحسابهای مالیاتی</title>
|
||||||
<base href="/" />
|
<base href="/" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
||||||
|
|||||||
Reference in New Issue
Block a user