some ui fix and debug input field, separate price field
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<app-input
|
||||
<app-price-input
|
||||
[control]="goldPrice"
|
||||
label="قیمت پیشفرض هر گرم طلا"
|
||||
name="goldBasePrice"
|
||||
type="price"
|
||||
[min]="0"
|
||||
hint="در این بخش میتوانید قیمت پیشفرض هر گرم طلا را وارد کنید." />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { PriceInputComponent } from '@/shared/components/input/price-input.component';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
||||
import { debounce, timer } from 'rxjs';
|
||||
@@ -7,7 +7,7 @@ import { PosConfigGoldPriceService } from './services/main.service';
|
||||
@Component({
|
||||
selector: 'pos-config-gold-price-form',
|
||||
templateUrl: 'form.component.html',
|
||||
imports: [ReactiveFormsModule, InputComponent],
|
||||
imports: [ReactiveFormsModule, PriceInputComponent],
|
||||
})
|
||||
export class PosConfigGoldPriceFormComponent {
|
||||
private readonly service = inject(PosConfigGoldPriceService);
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
</div> -->
|
||||
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
<app-input label="از مبلغ" [control]="form.controls.total_amount_from" name="total_amount_from" type="price" />
|
||||
<app-input label="تا مبلغ" [control]="form.controls.total_amount_to" name="total_amount_to" type="price" />
|
||||
<app-price-input label="از مبلغ" [control]="form.controls.total_amount_from" name="total_amount_from" />
|
||||
<app-price-input label="تا مبلغ" [control]="form.controls.total_amount_to" name="total_amount_to" />
|
||||
</div>
|
||||
</form>
|
||||
<div class="bg-surface-card mt-auto shrink-0 pb-4">
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Maybe } from '@/core';
|
||||
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||
import { TspProviderResponseStatus } from '@/shared/catalog';
|
||||
import { InputComponent } from '@/shared/components';
|
||||
import { PriceInputComponent } from '@/shared/components/input/price-input.component';
|
||||
import { DatepickerComponent } from '@/uikit';
|
||||
import { nowGregorian } from '@/utils';
|
||||
import {
|
||||
@@ -32,6 +33,7 @@ import { IPosSaleInvoicesFilterDto } from '../models';
|
||||
EnumSelectComponent,
|
||||
InputComponent,
|
||||
DatepickerComponent,
|
||||
PriceInputComponent,
|
||||
],
|
||||
})
|
||||
export class PosSaleInvoicesFilterDrawerComponent implements OnChanges {
|
||||
|
||||
@@ -54,4 +54,4 @@
|
||||
[visible]="filterVisible()"
|
||||
[value]="filters()"
|
||||
(visibleChange)="filterVisible.set($event)"
|
||||
(apply)="onFilterApply($event)" />
|
||||
(apply)="changeFilter($event)" />
|
||||
|
||||
@@ -112,6 +112,12 @@ export class PosSaleInvoiceListComponent {
|
||||
this.filterVisible.update((v) => !v);
|
||||
}
|
||||
|
||||
changeFilter(query: IPosSaleInvoicesFilterDto) {
|
||||
const { page, ...rest } = query;
|
||||
this.resetPage();
|
||||
this.onFilterApply(rest);
|
||||
}
|
||||
|
||||
onFilterApply(query: IPosSaleInvoicesFilterDto) {
|
||||
this.filters.set(query);
|
||||
this.syncFiltersToQueryParams();
|
||||
@@ -119,6 +125,7 @@ export class PosSaleInvoiceListComponent {
|
||||
}
|
||||
|
||||
removeFilter(key: keyof IPosSaleInvoicesFilterDto) {
|
||||
this.resetPage();
|
||||
const next = { ...this.filters() };
|
||||
delete next[key];
|
||||
this.filters.set(next);
|
||||
@@ -126,6 +133,10 @@ export class PosSaleInvoiceListComponent {
|
||||
this.getData();
|
||||
}
|
||||
|
||||
resetPage() {
|
||||
this.filters.update((val) => ({ ...val, page: 1 }));
|
||||
}
|
||||
|
||||
toSinglePage(item: IPosSaleInvoicesResponse) {
|
||||
this.router.navigateByUrl(posSaleInvoicesNamedRoutes.saleInvoice.meta.pagePath!(item.id));
|
||||
}
|
||||
@@ -160,7 +171,6 @@ export class PosSaleInvoiceListComponent {
|
||||
}
|
||||
|
||||
private syncFiltersToQueryParams() {
|
||||
this.filters.update((val) => ({ ...val, page: 1 }));
|
||||
const queryParams = Object.entries(this.filters()).reduce<Record<string, string>>(
|
||||
(acc, [key, value]) => {
|
||||
if (value !== undefined && value !== null && value !== '') {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<form [formGroup]="form" (submit)="submit()">
|
||||
<app-input [control]="form.controls.name" name="name" label="نام مشتری" />
|
||||
<app-input [control]="form.controls.national_id" name="national_id" label="شماره ملی" type="nationalId" />
|
||||
<app-form-footer-actions submitLabel="ثبت بدون اطلاعات خریدار و ادامه" (onCancel)="close()" />
|
||||
<app-form-footer-actions submitLabel="ثبت مشتری و ادامه" (onCancel)="close()" />
|
||||
</form>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
(onChange)="changePayByTerminalSteps($event.value)" />
|
||||
</uikit-field>
|
||||
@for (terminalControl of terminalControls; track $index) {
|
||||
<app-input
|
||||
<app-price-input
|
||||
[control]="terminalControl"
|
||||
[name]="'terminal_' + $index"
|
||||
[label]="$index === 0 ? 'پرداخت با پوز' : 'پرداخت با پوز - مرحله ' + ($index + 1)"
|
||||
@@ -53,30 +53,29 @@
|
||||
باقیمانده مبلغ
|
||||
</button>
|
||||
</ng-template>
|
||||
</app-input>
|
||||
</app-price-input>
|
||||
}
|
||||
</div>
|
||||
<form [formGroup]="form" (submit)="submit()">
|
||||
<app-input
|
||||
<app-price-input
|
||||
[control]="form.controls.cash"
|
||||
name="cash"
|
||||
label="نقدی/ کارتخوان دیگر/ کارت به کارت"
|
||||
type="price"
|
||||
[max]="cashMax()">
|
||||
<ng-template #suffixTemp>
|
||||
<button pButton size="small" type="button" [disabled]="!remainedAmount()" (click)="fillRemained('CASH')">
|
||||
باقیمانده مبلغ
|
||||
</button>
|
||||
</ng-template>
|
||||
</app-input>
|
||||
</app-price-input>
|
||||
@if (isGoldGuild()) {
|
||||
<app-input [control]="form.controls.set_off" name="setOff" label="تهاتر" type="price" [max]="setOffMax()">
|
||||
<app-price-input [control]="form.controls.set_off" name="setOff" label="تهاتر" [max]="setOffMax()">
|
||||
<ng-template #suffixTemp>
|
||||
<button pButton size="small" type="button" [disabled]="!remainedAmount()" (click)="fillRemained('SET_OFF')">
|
||||
باقیمانده مبلغ
|
||||
</button>
|
||||
</ng-template>
|
||||
</app-input>
|
||||
</app-price-input>
|
||||
}
|
||||
|
||||
<app-form-footer-actions
|
||||
|
||||
@@ -3,9 +3,10 @@ import { NativeBridgeService } from '@/core/services';
|
||||
import { ToastService } from '@/core/services/toast.service';
|
||||
import { PosInfoStore } from '@/domains/pos/store';
|
||||
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||
import { InputComponent, KeyValueComponent } from '@/shared/components';
|
||||
import { KeyValueComponent } from '@/shared/components';
|
||||
import { SharedLightBottomsheetComponent } from '@/shared/components/dialog/light-bottomsheet.component';
|
||||
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||
import { PriceInputComponent } from '@/shared/components/input/price-input.component';
|
||||
import { UikitFieldComponent, UikitLabelComponent } from '@/uikit';
|
||||
import { Component, computed, inject, signal } from '@angular/core';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
@@ -31,7 +32,6 @@ import { PosLandingStore } from '../../store/main.store';
|
||||
imports: [
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
InputComponent,
|
||||
FormFooterActionsComponent,
|
||||
KeyValueComponent,
|
||||
ButtonDirective,
|
||||
@@ -40,6 +40,7 @@ import { PosLandingStore } from '../../store/main.store';
|
||||
UikitFieldComponent,
|
||||
SelectButton,
|
||||
UikitLabelComponent,
|
||||
PriceInputComponent,
|
||||
],
|
||||
providers: [{ provide: PosPaymentBridgeAbstract, useExisting: PosPaymentBridgeService }],
|
||||
})
|
||||
|
||||
@@ -7,7 +7,12 @@
|
||||
}
|
||||
} @else {
|
||||
@for (good of visibleGoods(); track good.id) {
|
||||
<div class="bg-surface-card border-surface-border flex flex-1 flex-col rounded-lg border p-1">
|
||||
<div class="bg-surface-card border-surface-border relative flex flex-1 flex-col rounded-lg border p-1">
|
||||
@if (!good.is_default_guild_good) {
|
||||
<div class="absolute inset-e-2 top-2">
|
||||
<p-tag severity="contrast" value="شخصی" />
|
||||
</div>
|
||||
}
|
||||
<img
|
||||
[src]="good.image_url || goodPlaceholder"
|
||||
loading="lazy"
|
||||
@@ -16,9 +21,6 @@
|
||||
<div class="mt-2 flex grow flex-col justify-between text-center">
|
||||
<span class="flex w-full grow items-center justify-center text-center text-lg font-bold">
|
||||
{{ good.name }}
|
||||
@if (!good.is_default_guild_good) {
|
||||
<small class="text-muted-color text-xs">*</small>
|
||||
}
|
||||
</span>
|
||||
<div class="my-2 mt-1 flex w-full shrink-0 items-center justify-between gap-1 px-2">
|
||||
<button pButton type="button" label="انتخاب" class="w-full grow" (click)="addProduct(good)"></button>
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { ButtonDirective } from 'primeng/button';
|
||||
import { Skeleton } from 'primeng/skeleton';
|
||||
import { Tag } from 'primeng/tag';
|
||||
import images from 'src/assets/images';
|
||||
import { PosLandingStore } from '../../store/main.store';
|
||||
import { FavoriteCTAComponent } from './favorite-CTA.component';
|
||||
@@ -19,7 +20,7 @@ import { FavoriteCTAComponent } from './favorite-CTA.component';
|
||||
selector: 'pos-good-grid-view',
|
||||
templateUrl: './grid-view.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [ButtonDirective, Skeleton, FavoriteCTAComponent],
|
||||
imports: [ButtonDirective, Skeleton, FavoriteCTAComponent, Tag],
|
||||
})
|
||||
export class PosGoodsGridViewComponent {
|
||||
@Output() onAdd = new EventEmitter<IGoodResponse>();
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
<div class="flex flex-col gap-2">
|
||||
<span class="text-base font-bold">
|
||||
{{ good.name }}
|
||||
@if (!good.is_default_guild_good) {
|
||||
<small class="text-muted-color text-xs">*</small>
|
||||
}
|
||||
<!-- @if (!good.is_default_guild_good) {
|
||||
<p-tag severity="contrast" value="شخصی" />
|
||||
} -->
|
||||
</span>
|
||||
<span class="text-muted-color text-sm">
|
||||
{{ good.sku.code }}
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { ButtonDirective } from 'primeng/button';
|
||||
import { Skeleton } from 'primeng/skeleton';
|
||||
import { Tag } from 'primeng/tag';
|
||||
import images from 'src/assets/images';
|
||||
import { PosLandingStore } from '../../store/main.store';
|
||||
import { FavoriteCTAComponent } from './favorite-CTA.component';
|
||||
@@ -19,7 +20,7 @@ import { FavoriteCTAComponent } from './favorite-CTA.component';
|
||||
selector: 'pos-goods-list-view',
|
||||
templateUrl: './list-view.component.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
imports: [ButtonDirective, Skeleton, FavoriteCTAComponent],
|
||||
imports: [ButtonDirective, Skeleton, FavoriteCTAComponent, Tag],
|
||||
})
|
||||
export class PosGoodsListViewComponent {
|
||||
private readonly store = inject(PosLandingStore);
|
||||
|
||||
Reference in New Issue
Block a user